|
|
@@ -67,7 +67,7 @@ public class TDevicePlanServiceImpl extends ServiceImpl<TDevicePlanMapper, TDevi
|
|
|
tDevicePlanLambdaQueryWrapper.orderByDesc(TDevicePlan::getCreateTime);
|
|
|
List<TDevicePlan> list = this.list(tDevicePlanLambdaQueryWrapper);
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
- now = now.plus(3, ChronoUnit.MINUTES);
|
|
|
+// now = now.plus(3, ChronoUnit.MINUTES);
|
|
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
|
DateTimeFormatter allFmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
@@ -158,14 +158,17 @@ public class TDevicePlanServiceImpl extends ServiceImpl<TDevicePlanMapper, TDevi
|
|
|
|
|
|
private boolean checkHasRun(TDevicePlan tDevicePlan,LocalDateTime now) {
|
|
|
LambdaQueryWrapper<TPlanRecord> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.orderByDesc(TPlanRecord::getCheckTime);
|
|
|
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ String todayStr = now.format(fmt);
|
|
|
+ queryWrapper.orderByDesc(TPlanRecord::getCreateTime);
|
|
|
+ queryWrapper.apply("date_format(create_time,'%Y-%m-%d') = '"+todayStr+"'");
|
|
|
queryWrapper.eq(TPlanRecord::getPlanId, tDevicePlan.getId());
|
|
|
queryWrapper.last(" limit 1");
|
|
|
TPlanRecord one = itPlanRecordService.getOne(queryWrapper);
|
|
|
if (one != null) {
|
|
|
LocalDateTime createTime = one.getCreateTime();
|
|
|
- DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- String todayStr = now.format(fmt);
|
|
|
+
|
|
|
+
|
|
|
String runTime = createTime.format(fmt);
|
|
|
if (StringUtils.equals(runTime, todayStr)) {
|
|
|
return true;
|