From 06ce1c2a72c894d0377af9a2294cf928bfea2983 Mon Sep 17 00:00:00 2001 From: sjh Date: Thu, 21 Nov 2024 19:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B95=E5=8F=B7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=EF=BC=9A=E9=87=8D=E7=82=B9=E4=BA=BA=E5=91=98=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E7=9B=91=E7=9D=A3=E6=A8=A1=E5=9E=8B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/mapper/RiskTestMapper.java | 12 +++++++++ .../supervision/pojo/entity/RiskTest.java | 26 +++++++++++++++++++ .../supervision/service/ModelClueService.java | 23 +++++++++------- src/main/resources/mapper/RiskTestMapper.xml | 5 ++++ 4 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/mapper/RiskTestMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/RiskTest.java create mode 100644 src/main/resources/mapper/RiskTestMapper.xml diff --git a/src/main/java/com/biutag/supervision/mapper/RiskTestMapper.java b/src/main/java/com/biutag/supervision/mapper/RiskTestMapper.java new file mode 100644 index 0000000..aa856f3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RiskTestMapper.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RiskTest; + +/** + * @author kami on 2024-11-13 16:17:36 + * @version 0.0.1 + * @since 1.8 + */ +public interface RiskTestMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RiskTest.java b/src/main/java/com/biutag/supervision/pojo/entity/RiskTest.java new file mode 100644 index 0000000..409a1bd --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RiskTest.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author kami on 2024-11-13 16:18:01 + * @version 0.0.1 + * @since 1.8 + */ +@Data +public class RiskTest implements Serializable { + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @TableField("`name`") + String name; +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index c90dfc7..eb489f2 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -63,6 +63,8 @@ public class ModelClueService extends ServiceImpl { private final RedisTemplate redisTemplate; + private final RiskTestMapper riskTestMapper; + public Page page(ModelClueQueryParam param) { if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { return new Page().setTotal(0).setRecords(new ArrayList<>()); @@ -334,12 +336,15 @@ public class ModelClueService extends ServiceImpl { } private void getModelCluesForModel5(String param, List modelClues) { - List jsonStrings = redisTemplate.opsForList().range("call:point", 0, -1); + +// List jsonStrings = redisTemplate.opsForList().range("call:point", 0, -1); + List jsonStrings = riskTestMapper.selectList(null); if (jsonStrings != null) { System.out.println("获取到的数据条数:" + jsonStrings.size()); try { - for (Object jsonString : jsonStrings) { - JSONObject jsonObject = JSON.parseObject((String) jsonString); + for (RiskTest json : jsonStrings) { + String jsonString = json.getName(); + JSONObject jsonObject = JSON.parseObject(jsonString); String name = (String) jsonObject.get("name"); String mobiles = (String) jsonObject.get("mobiles"); String idCode = (String) jsonObject.get("idCode"); @@ -374,14 +379,14 @@ public class ModelClueService extends ServiceImpl { + mobiles + "”请予以重点关注。"); } else if (callCount >= 5) { newModelClue.setThingDesc( - "发现" + newModelClue.getInvolveDepartName() + "管理的重点人员" + name - + "(身份证号:"+idCode+")于" + dateString + "产生了" + callCount - + "条有效报警,报警电话为“" + mobiles + "”请予以重点关注。"); + "发现" + newModelClue.getInvolveDepartName() + "管理的重点人员" + name + + "(身份证号:" + idCode + ")于" + dateString + "产生了" + callCount + + "条有效报警,报警电话为“" + mobiles + "”请予以重点关注。"); } else if (noUsefulCallCount >= 100) { newModelClue.setThingDesc( - "发现" + newModelClue.getInvolveDepartName() + "管理的重点人员" + name - + "(身份证号:"+idCode+")于" + dateString + "产生了" - + noUsefulCallCount + "条无效报警,报警电话为“" + mobiles + "”请予以重点关注。"); + "发现" + newModelClue.getInvolveDepartName() + "管理的重点人员" + name + + "(身份证号:" + idCode + ")于" + dateString + "产生了" + + noUsefulCallCount + "条无效报警,报警电话为“" + mobiles + "”请予以重点关注。"); } else { System.out.println("数据有误,idCode:" + idCode + "callCount:" + callCount + "noUsefulCallCount:" + noUsefulCallCount); break; diff --git a/src/main/resources/mapper/RiskTestMapper.xml b/src/main/resources/mapper/RiskTestMapper.xml new file mode 100644 index 0000000..6677fd0 --- /dev/null +++ b/src/main/resources/mapper/RiskTestMapper.xml @@ -0,0 +1,5 @@ + + + + +