This commit is contained in:
caozehui
2026-06-15 09:10:37 +08:00
parent 366d1fadfa
commit 55fe1fe05f

View File

@@ -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.vo.PqMonitorExcel;
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.pojo.enums.DataSourceEnum;
import com.njcn.gather.plan.pojo.po.AdPlan;
import com.njcn.gather.plan.service.IPqDevCheckHistoryService;
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>()
.set(PqDevSub::getCheckResult, result.get(pqDevVo.getId()))
.set(StrUtil.isNotBlank(userId), PqDevSub::getCheckBy, userId)
.set(PqDevSub::getCheckTime, LocalDateTime.now())
.set(updateCheckNum, PqDevSub::getCheckTime, LocalDateTime.now())
.eq(PqDevSub::getDevId, pqDevVo.getId());
String currrentScene = sysTestConfigService.getCurrrentScene();
if (SceneEnum.PROVINCE_PLATFORM.getValue().equals(currrentScene)) {
@@ -583,13 +583,22 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
SysUser user = userService.getById(userId);
// 查询当前设备的检测时间
PqDevSub currentDevSub = pqDevSubService.lambdaQuery()
.eq(PqDevSub::getDevId, devId)
.one();
LambdaUpdateChainWrapper<PqDevSub> w = pqDevSubService.lambdaUpdate()
.set(PqDevSub::getCheckState, checkState)
.set(PqDevSub::getCheckResult, checkResult)
.set(PqDevSub::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
.set(PqDevSub::getCheckTime, LocalDateTime.now())
.eq(PqDevSub::getDevId, devId);
// 只有当checkTime为空时才设置为当前时间
if (currentDevSub != null && currentDevSub.getCheckTime() == null) {
w.set(PqDevSub::getCheckTime, LocalDateTime.now());
}
if (ObjectUtil.isNotNull(user)) {
w.set(PqDevSub::getCheckBy, user.getName());
}