From 6e10e3e8f47f6fef484bf1dde7e72be08badf50e Mon Sep 17 00:00:00 2001 From: sjh Date: Wed, 13 Nov 2024 11:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E27=E3=80=8128=E3=80=8130?= =?UTF-8?q?=E5=8F=B7=E6=A8=A1=E5=9E=8B=EF=BC=9A=E7=9B=97=E7=AA=83=E8=BD=A6?= =?UTF-8?q?=E5=86=85=E8=B4=A2=E7=89=A9=E8=AD=A6=E6=83=85=E7=BB=93=E8=AD=A6?= =?UTF-8?q?=E6=80=A7=E8=B4=A8=E5=8F=98=E5=8A=A8=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E3=80=81=E7=9B=97=E7=AA=83=E8=BD=A6=E5=86=85?= =?UTF-8?q?=E8=B4=A2=E7=89=A9=E8=B6=85=E8=BF=875000=E5=85=83=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E3=80=81=E6=8E=A5=E8=AD=A6=E7=BB=93=E8=AD=A6?= =?UTF-8?q?=E6=80=A7=E8=B4=A8=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/service/ModelClueService.java | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index de86ea7..73c23ae 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -239,7 +239,7 @@ public class ModelClueService extends ServiceImpl { } else if (modelId == 25) { // 25号模型:重点人员管控人数过多 getModelCluesForModel25(sql, modelClues); return modelClues; - }else { + } else { System.out.println("模型" + modelId + "开始查询数据库"); modelClues = modelClueDataMapper.selectDataByDynamicSql(sql); System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size()); @@ -247,7 +247,7 @@ public class ModelClueService extends ServiceImpl { List uniqueKeys = modelClues.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); List oldUniqueKeys = new ArrayList<>(); // 无需更新状态的模型 - if (modelId != 19) { + if (modelId != 19 && modelId != 27 && modelId != 28 && modelId != 30) { oldUniqueKeys = this.listObjs(new LambdaQueryWrapper().select(ModelClue::getUniqueKey).ne(ModelClue::getDistributionState, "2").eq(ModelClue::getModelId, modelId), String::valueOf); List changeStatusIds = oldUniqueKeys.stream().filter(item -> !uniqueKeys.contains(item)).toList(); if (!changeStatusIds.isEmpty()) { @@ -269,7 +269,9 @@ public class ModelClueService extends ServiceImpl { } List needsInsertModelClues = modelClues.stream().filter(item -> needsInsertIds.contains(item.getUniqueKey())).toList(); String newSql = generateNewSql(sql, needsInsertIds, modelId); + System.out.println("开始查询新sql"); List> allData = modelClueDataMapper.selectByUniqueKeys(newSql); + System.out.println("查询新sql完成,结果数量:" + allData.size()); String originalFieldName = getKeyFieldName(sql); for (ModelClue modelClue : needsInsertModelClues) { for (Map data : allData) { @@ -335,7 +337,7 @@ 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; @@ -469,6 +471,21 @@ public class ModelClueService extends ServiceImpl { + "离开,停留时长" + calculateMinutesBetween(data.get("djsj"), data.get("lksj")) + ",存在间隔时间过短的异常。"); } + } else if (modelId == 27) { // 27号模型:盗窃车内财物警情结警性质变动的异常数据 + modelClue.setThingDesc("发现" + modelClue.getInvolveDepartName() + "受理的接警单" + + modelClue.getUniqueKey() + ",报警日期为" + getDateMinuteString(data.get("bjsj")) + + ",接警性质为“" + data.get("ysjqxzmc") + "”,结警性质为“" + data.get("jqxzmc") + + ",存在盗窃车内财物警情结警性质变动的异常情况。"); + } else if (modelId == 28) { // 28号模型:盗窃车内财物超过5000元的数据 + modelClue.setThingDesc("发现" + modelClue.getInvolveDepartName() + "受理的接警单" + + modelClue.getUniqueKey() + ",报警日期为" + getDateMinuteString(data.get("bjsj")) + + ",接警性质为“" + data.get("ysjqxzmc") + "”,金额超过5000元。报警内容为:“" + data.get("bjnr") + + "”。"); + } else if (modelId == 30) { // 30号模型:接警结警性质不一致的异常数据 + modelClue.setThingDesc("发现" + modelClue.getInvolveDepartName() + "受理的接警单" + + modelClue.getUniqueKey() + ",报警日期为" + getDateMinuteString(data.get("bjsj")) + + ",接警性质为“" + data.get("ysjqxzmc") + "”,结警性质为“" + data.get("jqxzmc") + + ",存在接警结警性质不一致的异常数据的异常情况。"); } } @@ -658,7 +675,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel18(String sql, List modelClues) { System.out.println("模型18开始查询数据库"); List> sqlList = modelClueDataMapper.selectByUniqueKeys(sql); - System.out.println("模型18查询数据库完毕"); + System.out.println("模型18查询数据库完毕,结果数量:" + sqlList.size()); if (sqlList.isEmpty()) { return; } @@ -712,7 +729,7 @@ public class ModelClueService extends ServiceImpl { System.out.println("模型20开始查询数据库"); String sql = "select * from dwd_qb_nbgl_lxqtscsygxjl where STR_TO_DATE(tjrq, '%Y-%m-%d') = CURDATE() - INTERVAL " + param + " DAY;"; List> sqlList = modelClueDataMapper.selectByUniqueKeys(sql); - System.out.println("模型20查询数据库完毕"); + System.out.println("模型20查询数据库完毕,结果数量:" + sqlList.size()); if (sqlList.isEmpty()) { return; } @@ -740,7 +757,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel22(String sql, List modelClues) { System.out.println("模型22开始查询数据库"); List> sqlList = modelClueDataDMMapper.selectByUniqueKeys(sql); - System.out.println("模型22查询数据库完毕"); + System.out.println("模型22查询数据库完毕,结果数量:" + sqlList.size()); if (sqlList.isEmpty()) { return; } @@ -796,7 +813,7 @@ 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查询数据库完毕"); + System.out.println("模型25查询数据库完毕,结果数量:" + sqlList.size()); if (sqlList.isEmpty()) { return; } @@ -1114,7 +1131,8 @@ public class ModelClueService extends ServiceImpl { tableName = tableMatcher.group(1); } String originalFieldName = getKeyFieldName(originalSql); - if (modelId == 24) { //24号模型:警情未录入反馈人员信息 + // 接警单关联反馈单警员 + if (modelId == 24 || modelId == 27 || modelId == 28 || modelId == 30) { return "SELECT a.*, b.fkrbh, b.fkrxm FROM " + tableName + " a left join dwd_asj_zhtx_fkd b on a.jjdbh = b.jjdbh " + "WHERE a." + 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(",")) + ");";