|
|
|
|
@ -7,7 +7,6 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.biutag.supervisiondata.mapper.dwd.ModelClueDataMapper; |
|
|
|
|
import com.biutag.supervisiondata.mapper.mine.AlarmNotificationMapper; |
|
|
|
|
@ -119,6 +118,10 @@ public class ModelClueServiceImpl implements ModelClueService {
|
|
|
|
|
} |
|
|
|
|
List<AlarmNotification> list = new ArrayList<>(); |
|
|
|
|
for (ModelClue item : modelClues) { |
|
|
|
|
// 已存在则跳过
|
|
|
|
|
if (alarmNotificationMapper.exists(new LambdaQueryWrapper<AlarmNotification>().eq(AlarmNotification::getAlarmContent, item.getThingDesc()))) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
AlarmNotification notification = new AlarmNotification(); |
|
|
|
|
notification.setAlarmTime(LocalDateTime.now()); |
|
|
|
|
notification.setAlarmTypeId(3L); |
|
|
|
|
@ -271,10 +274,10 @@ public class ModelClueServiceImpl implements ModelClueService {
|
|
|
|
|
// 无需更新状态的模型
|
|
|
|
|
if (modelId != 19 && modelId != 26 && modelId != 27 && modelId != 28 && modelId != 30 && modelId != 100 ) { |
|
|
|
|
oldUniqueKeys = modelClueRepository.listObjs(new LambdaQueryWrapper<ModelClue>().select(ModelClue::getUniqueKey).ne(ModelClue::getDistributionState, "2").eq(ModelClue::getModelId, modelId), String::valueOf); |
|
|
|
|
List<String> changeStatusIds = oldUniqueKeys.stream().filter(item -> !uniqueKeys.contains(item)).toList(); |
|
|
|
|
if (!changeStatusIds.isEmpty()) { |
|
|
|
|
// List<String> changeStatusIds = oldUniqueKeys.stream().filter(item -> !uniqueKeys.contains(item)).toList();
|
|
|
|
|
// if (!changeStatusIds.isEmpty()) {
|
|
|
|
|
// modelClueMapper.update(null, new LambdaUpdateWrapper<ModelClue>().in(ModelClue::getUniqueKey, changeStatusIds).set(ModelClue::getDistributionState, "2"));
|
|
|
|
|
} |
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
List<String> needsInsertIds = new ArrayList<>(); |
|
|
|
|
for (String uniqueKey : uniqueKeys) { |
|
|
|
|
@ -364,6 +367,11 @@ public class ModelClueServiceImpl implements ModelClueService {
|
|
|
|
|
involvePoliceEmpNo = Optional.ofNullable(map.get(modelGeneration.getInvolvePoliceEmpNo())) |
|
|
|
|
.map(Object::toString).orElse(""); |
|
|
|
|
} |
|
|
|
|
Object uniqueKey = map.get(model.getClueUniqueFieldName()); |
|
|
|
|
// 如果 uniqueKey 为空,则跳过
|
|
|
|
|
if (Objects.isNull(uniqueKey)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
modelClues.add(new ModelClue() |
|
|
|
|
.setModelId(modelId) |
|
|
|
|
.setInvolveDepartName(involveDepartName) |
|
|
|
|
@ -373,8 +381,8 @@ public class ModelClueServiceImpl implements ModelClueService {
|
|
|
|
|
.setThingDesc(thingDescGeneration) |
|
|
|
|
.setData(JSONObject.toJSONString(map)) |
|
|
|
|
.setDistributionState("0") |
|
|
|
|
.setUniqueKey(map.get(model.getClueUniqueFieldName()).toString()) |
|
|
|
|
.setNegativeIdEx(map.get(model.getClueUniqueFieldName()).toString()) |
|
|
|
|
.setUniqueKey(uniqueKey.toString()) |
|
|
|
|
.setNegativeIdEx(uniqueKey.toString()) |
|
|
|
|
.setCreateTime(LocalDateTime.now()).setUpdateTime(LocalDateTime.now())); |
|
|
|
|
} |
|
|
|
|
System.out.println("自建模型" + modelId + "的modelClues数量为:" + modelClues.size()); |
|
|
|
|
|