|
|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.xunmei.common.core.domain.iot.domain.*;
|
|
|
+import com.xunmei.common.core.utils.IDHelper;
|
|
|
+import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.host.iot.dto.IotDeviceDiagnoseMissionReq;
|
|
|
import com.xunmei.host.iot.dto.IotDeviceDiagnoseThresholdReq;
|
|
|
import com.xunmei.host.iot.mapper.IotDeviceDiagnoseMissionChMapper;
|
|
|
@@ -74,11 +76,14 @@ public class IotCameraMissionRuleServiceImpl implements IotCameraMissionRuleServ
|
|
|
//入库任务
|
|
|
QueryWrapper<IotDeviceDiagnoseMission> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("mission_id", mission.getMissionId());
|
|
|
- wrapper.eq("iot_token", mission.getIotToken());
|
|
|
+ if(StringUtils.isNotEmpty(mission.getIotToken())) {
|
|
|
+ wrapper.eq("iot_token", mission.getIotToken());
|
|
|
+ }
|
|
|
wrapper.last(limitOne);
|
|
|
IotDeviceDiagnoseMission bean = missionMapper.selectOne(wrapper);
|
|
|
if (bean == null) {
|
|
|
missionMapper.insert(mission);
|
|
|
+ }else if(bean.getMissionId().equals("5ed19826-dd47-421e-a632-b00ba9271c45")){//系统默认任务
|
|
|
}else{
|
|
|
missionMapper.updateById(mission);
|
|
|
}
|
|
|
@@ -107,11 +112,17 @@ public class IotCameraMissionRuleServiceImpl implements IotCameraMissionRuleServ
|
|
|
//入库状态app附表
|
|
|
QueryWrapper<IotDeviceDiagnoseThreshold> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("threshold_code", threshold.getThresholdCode());
|
|
|
- wrapper.eq("iot_token", threshold.getIotToken());
|
|
|
+ if(StringUtils.isNotEmpty(threshold.getIotToken())) {
|
|
|
+ wrapper.eq("iot_token", threshold.getIotToken());
|
|
|
+ }
|
|
|
wrapper.last(limitOne);
|
|
|
IotDeviceDiagnoseThreshold bean = thresholdMapper.selectOne(wrapper);
|
|
|
if (bean == null) {
|
|
|
+ //新增时,使用平台生成的id,然后下发到主机统一治理
|
|
|
+ threshold.setThresholdId(IDHelper.id());
|
|
|
+ threshold.setDiagnoseNumber(0);
|
|
|
thresholdMapper.insert(threshold);
|
|
|
+ }else if(bean.getThresholdId()==1){//系统默认阈值
|
|
|
}else{
|
|
|
threshold.setThresholdId(bean.getThresholdId());
|
|
|
thresholdMapper.updateById(threshold);
|