Browse Source

新增25号模型:重点人员管控人数过多

main
sjh 1 year ago
parent
commit
83661211ec
  1. 32
      src/main/java/com/biutag/supervision/service/ModelClueService.java

32
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -236,7 +236,10 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} else if (modelId == 22) { // 22号模型:执法记录仪使用不规范问题 } else if (modelId == 22) { // 22号模型:执法记录仪使用不规范问题
getModelCluesForModel22(sql, modelClues); getModelCluesForModel22(sql, modelClues);
return modelClues; return modelClues;
} else { } else if (modelId == 25) { // 25号模型:重点人员管控人数过多
getModelCluesForModel25(sql, modelClues);
return modelClues;
}else {
System.out.println("模型" + modelId + "开始查询数据库"); System.out.println("模型" + modelId + "开始查询数据库");
modelClues = modelClueDataMapper.selectDataByDynamicSql(sql); modelClues = modelClueDataMapper.selectDataByDynamicSql(sql);
System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size()); System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size());
@ -780,6 +783,33 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} }
} }
private void getModelCluesForModel25(String sql, List<ModelClue> modelClues) {
System.out.println("模型25开始查询数据库");
List<Map<String, Object>> sqlList = modelClueDataMapper.selectByUniqueKeys(sql);
System.out.println("模型25查询数据库完毕");
if (sqlList.isEmpty()) {
return;
}
for (Map<String, Object> map : sqlList) {
ModelClue newModelClue = new ModelClue();
newModelClue.setUniqueKey((String) map.get("xzdpcsdm") + map.get("xzdzzr"));
newModelClue.setNegativeIdEx((String) map.get("xzdpcsdm") + map.get("xzdzzr"));
newModelClue.setInvolveDepartName((String) map.get("xzdpcs"));
SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper<SupExternalDepart>().eq(SupExternalDepart::getInternalId, map.get("xzdpcsdm")).last("LIMIT 1"));
if (supExternalDepart != null) {
if (supExternalDepart.getInternalId() != null) {
newModelClue.setInvolveDepartId(supExternalDepart.getInternalId());
}
}
newModelClue.setData(JSONObject.toJSONString(map));
newModelClue.setDistributionState("0");
newModelClue.setThingDesc(
"灵敏感知系统发现" + newModelClue.getInvolveDepartName() + "民警" + map.get("xzdzzr")
+ "的管控人数为" + map.get("num") + "人。");
modelClues.add(newModelClue);
}
}
private void mergeModelClues(List<ModelClue> modelClues2, List<ModelClue> modelClues1 , int no) { private void mergeModelClues(List<ModelClue> modelClues2, List<ModelClue> modelClues1 , int no) {
for (ModelClue modelClue2 : modelClues2) { for (ModelClue modelClue2 : modelClues2) {
Iterator<ModelClue> iterator1 = modelClues1.iterator(); Iterator<ModelClue> iterator1 = modelClues1.iterator();

Loading…
Cancel
Save