diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 0d8d148..f7927c2 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -236,7 +236,10 @@ public class ModelClueService extends ServiceImpl { } else if (modelId == 22) { // 22号模型:执法记录仪使用不规范问题 getModelCluesForModel22(sql, modelClues); return modelClues; - } else { + } else if (modelId == 25) { // 25号模型:重点人员管控人数过多 + getModelCluesForModel25(sql, modelClues); + return modelClues; + }else { System.out.println("模型" + modelId + "开始查询数据库"); modelClues = modelClueDataMapper.selectDataByDynamicSql(sql); System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size()); @@ -780,6 +783,33 @@ public class ModelClueService extends ServiceImpl { } } + private void getModelCluesForModel25(String sql, List modelClues) { + System.out.println("模型25开始查询数据库"); + List> sqlList = modelClueDataMapper.selectByUniqueKeys(sql); + System.out.println("模型25查询数据库完毕"); + if (sqlList.isEmpty()) { + return; + } + for (Map 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().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 modelClues2, List modelClues1 , int no) { for (ModelClue modelClue2 : modelClues2) { Iterator iterator1 = modelClues1.iterator();