From 1a1492997640dc1343a62d2dfe71dc21c3b9a564 Mon Sep 17 00:00:00 2001 From: sjh Date: Thu, 14 Nov 2024 20:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B926=E5=8F=B7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/service/ModelClueService.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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())