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 @@ + + + + +