diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 63582e0..0a3617e 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -269,7 +269,7 @@ public class ModelClueService extends ServiceImpl { System.out.println("开始查询新sql" + newSql); List> allData = modelClueDataMapper.selectByUniqueKeys(newSql); if (modelId == 26) { - filterDataForModel26(allData); + return filterDataForModel26(allData); } System.out.println("查询新sql完成,结果数量:" + allData.size()); String originalFieldName = getKeyFieldName(sql); @@ -293,7 +293,7 @@ public class ModelClueService extends ServiceImpl { return needsInsertModelClues; } - private static void filterDataForModel26(List> allData) { + private List filterDataForModel26(List> allData) { List> filteredData = allData.stream().filter(map -> map.get("ajbh") != null && map.get("zjhm") != null).toList(); Map>>> groupedData = filteredData.stream() .collect(Collectors.groupingBy( @@ -345,11 +345,27 @@ public class ModelClueService extends ServiceImpl { } } System.out.println("模型26筛选后的alldata数量:" + allData.size()); + System.out.println("查询新sql完成,结果数量:" + allData.size()); + List modelClues = new ArrayList<>(); + for (Map data : allData) { + ModelClue modelClue = new ModelClue(); + modelClue.setData(JSONObject.toJSONString(data)); + modelClue.setDistributionState("0"); + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, data.get("csid")).last("LIMIT 1")); + if (supExternalDepart != null && supExternalDepart.getInternalShortName() != null && !supExternalDepart.getInternalShortName().isEmpty()) { + modelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); + modelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + } + setPerson(26, modelClue, data); + generateThingDesc(26, modelClue, data); + modelClues.add(modelClue); + } + return modelClues; } private void setPerson(Integer modelId, ModelClue modelClue, Map data) { // 执法区域人员表 - if (modelId == 3) { + if (modelId == 3 || modelId == 26) { String bar1 = (String) data.get("bar1"); String bar2 = (String) data.get("bar2"); String involvePoliceName = (bar1 != null && !bar1.isEmpty() && bar2 != null && !bar2.isEmpty())