From 4065d0c08a08446c238366252df59f8f5c8ab84d Mon Sep 17 00:00:00 2001 From: sjh Date: Tue, 12 Nov 2024 17:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E24=E5=8F=B7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=EF=BC=9A=E8=AD=A6=E6=83=85=E6=9C=AA=E5=BD=95=E5=85=A5=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/service/ModelClueService.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 5a60ad9..7f2a52f 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -265,7 +265,7 @@ public class ModelClueService extends ServiceImpl { return new ArrayList<>(); } List needsInsertModelClues = modelClues.stream().filter(item -> needsInsertIds.contains(item.getUniqueKey())).toList(); - String newSql = generateNewSql(sql, needsInsertIds); + String newSql = generateNewSql(sql, needsInsertIds, modelId); List> allData = modelClueDataMapper.selectByUniqueKeys(newSql); String originalFieldName = getKeyFieldName(sql); for (ModelClue modelClue : needsInsertModelClues) { @@ -289,7 +289,8 @@ public class ModelClueService extends ServiceImpl { } private void setPerson(Integer modelId, ModelClue modelClue, Map data) { - if (modelId == 3) { // 执法区域人员表 + // 执法区域人员表 + if (modelId == 3) { String bar1 = (String) data.get("bar1"); String bar2 = (String) data.get("bar2"); String involvePoliceName = (bar1 != null && !bar1.isEmpty() && bar2 != null && !bar2.isEmpty()) @@ -311,7 +312,8 @@ public class ModelClueService extends ServiceImpl { modelClue.setInvolvePoliceEmpNo("无警号数据"); } } - if (modelId == 10 || modelId == 11 || modelId == 12 || modelId == 13 || modelId == 14 || modelId == 15 || modelId == 19) { // 案件基本信息表 + // 案件基本信息表 + if (modelId == 10 || modelId == 11 || modelId == 12 || modelId == 13 || modelId == 14 || modelId == 15 || modelId == 19) { String bar1Id = (String) data.get("BAR1ID"); String bar2Id = (String) data.get("BAR2ID"); Map bar1 = bar1Id != null && !bar1Id.isEmpty() ? modelClueDataMapper.selectBAR(bar1Id) : null; @@ -330,6 +332,18 @@ public class ModelClueService extends ServiceImpl { modelClue.setInvolvePoliceName("无姓名数据"); } } + // 接警单关联反馈单 + if (modelId == 24) { //24号模型:警情未录入反馈人员信息 + String barId = (String) data.get("fkrbh"); + Map bar = barId != null && !barId.isEmpty() ? modelClueDataMapper.selectBAR(barId) : null; + if (bar != null) { + modelClue.setInvolvePoliceEmpNo((String) bar.get("JH")); + modelClue.setInvolvePoliceName((String) bar.get("XM")); + } else { + modelClue.setInvolvePoliceEmpNo("无警号数据"); + modelClue.setInvolvePoliceName("无姓名数据"); + } + } } private static void generateThingDesc(Integer modelId, ModelClue modelClue, Map data) { @@ -1020,7 +1034,7 @@ public class ModelClueService extends ServiceImpl { } } - public static String generateNewSql(String originalSql, List uniqueKeys) { + public static String generateNewSql(String originalSql, List uniqueKeys, Integer modelId) { Pattern tablePattern = Pattern.compile("FROM\\s+(\\w+)", Pattern.CASE_INSENSITIVE); Matcher tableMatcher = tablePattern.matcher(originalSql); String tableName = ""; @@ -1028,6 +1042,9 @@ public class ModelClueService extends ServiceImpl { tableName = tableMatcher.group(1); } String originalFieldName = getKeyFieldName(originalSql); + if (modelId == 24) { //24号模型:警情未录入反馈人员信息 + return "SELECT a.*, b.fkrbh, b.fkrxm FROM " + tableName + " a left join dwd_asj_zhtx_fkd b on a.jjdbh = b.jjdbh " + "WHERE " + originalFieldName + " IN " + "(" + uniqueKeys.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; + } return "SELECT * FROM " + tableName + " " + "WHERE " + originalFieldName + " IN " + "(" + uniqueKeys.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; }