微调
This commit is contained in:
@@ -37,8 +37,8 @@ import com.njcn.gather.device.service.IPqDevSubService;
|
|||||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||||
import com.njcn.gather.monitor.pojo.vo.PqMonitorExcel;
|
import com.njcn.gather.monitor.pojo.vo.PqMonitorExcel;
|
||||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
import com.njcn.gather.monitor.service.IPqMonitorService;
|
||||||
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
|
||||||
import com.njcn.gather.plan.mapper.AdPlanMapper;
|
import com.njcn.gather.plan.mapper.AdPlanMapper;
|
||||||
|
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
import com.njcn.gather.plan.service.IPqDevCheckHistoryService;
|
import com.njcn.gather.plan.service.IPqDevCheckHistoryService;
|
||||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||||
@@ -505,7 +505,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
LambdaUpdateWrapper<PqDevSub> wrapper = new LambdaUpdateWrapper<PqDevSub>()
|
LambdaUpdateWrapper<PqDevSub> wrapper = new LambdaUpdateWrapper<PqDevSub>()
|
||||||
.set(PqDevSub::getCheckResult, result.get(pqDevVo.getId()))
|
.set(PqDevSub::getCheckResult, result.get(pqDevVo.getId()))
|
||||||
.set(StrUtil.isNotBlank(userId), PqDevSub::getCheckBy, userId)
|
.set(StrUtil.isNotBlank(userId), PqDevSub::getCheckBy, userId)
|
||||||
.set(PqDevSub::getCheckTime, LocalDateTime.now())
|
.set(updateCheckNum, PqDevSub::getCheckTime, LocalDateTime.now())
|
||||||
.eq(PqDevSub::getDevId, pqDevVo.getId());
|
.eq(PqDevSub::getDevId, pqDevVo.getId());
|
||||||
String currrentScene = sysTestConfigService.getCurrrentScene();
|
String currrentScene = sysTestConfigService.getCurrrentScene();
|
||||||
if (SceneEnum.PROVINCE_PLATFORM.getValue().equals(currrentScene)) {
|
if (SceneEnum.PROVINCE_PLATFORM.getValue().equals(currrentScene)) {
|
||||||
@@ -583,13 +583,22 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
|
|
||||||
SysUser user = userService.getById(userId);
|
SysUser user = userService.getById(userId);
|
||||||
|
|
||||||
|
// 查询当前设备的检测时间
|
||||||
|
PqDevSub currentDevSub = pqDevSubService.lambdaQuery()
|
||||||
|
.eq(PqDevSub::getDevId, devId)
|
||||||
|
.one();
|
||||||
|
|
||||||
LambdaUpdateChainWrapper<PqDevSub> w = pqDevSubService.lambdaUpdate()
|
LambdaUpdateChainWrapper<PqDevSub> w = pqDevSubService.lambdaUpdate()
|
||||||
.set(PqDevSub::getCheckState, checkState)
|
.set(PqDevSub::getCheckState, checkState)
|
||||||
.set(PqDevSub::getCheckResult, checkResult)
|
.set(PqDevSub::getCheckResult, checkResult)
|
||||||
.set(PqDevSub::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
.set(PqDevSub::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||||
.set(PqDevSub::getCheckTime, LocalDateTime.now())
|
|
||||||
.eq(PqDevSub::getDevId, devId);
|
.eq(PqDevSub::getDevId, devId);
|
||||||
|
|
||||||
|
// 只有当checkTime为空时,才设置为当前时间
|
||||||
|
if (currentDevSub != null && currentDevSub.getCheckTime() == null) {
|
||||||
|
w.set(PqDevSub::getCheckTime, LocalDateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isNotNull(user)) {
|
if (ObjectUtil.isNotNull(user)) {
|
||||||
w.set(PqDevSub::getCheckBy, user.getName());
|
w.set(PqDevSub::getCheckBy, user.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user