Browse Source

Merge remote-tracking branch 'origin/master'

main
parent
commit
8f804a10de
  1. 2
      src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java
  2. 5
      src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java
  3. 17
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  4. 8
      src/main/resources/mapper/ModelClueMapper.xml

2
src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java

@ -83,7 +83,7 @@ public class RiskPersonalController {
.eq(RiskScoreRule::getLevel, 2)); .eq(RiskScoreRule::getLevel, 2));
List<Model> models = modelService.list(new LambdaQueryWrapper<Model>().in(Model::getRiskScoreRuleId, rules2.stream().map(RiskScoreRule::getId).toList())); List<Model> models = modelService.list(new LambdaQueryWrapper<Model>().in(Model::getRiskScoreRuleId, rules2.stream().map(RiskScoreRule::getId).toList()));
List<RiskModelTaskClue> records = models.isEmpty() ? new ArrayList<>() : riskModelTaskClueService.page(Page.of(1, 5), new LambdaQueryWrapper<RiskModelTaskClue>() List<RiskModelTaskClue> records = models.isEmpty() ? new ArrayList<>() : riskModelTaskClueService.page(Page.of(1, 100), new LambdaQueryWrapper<RiskModelTaskClue>()
.eq(RiskModelTaskClue::getIdCode, riskPersonal.getIdCode()) .eq(RiskModelTaskClue::getIdCode, riskPersonal.getIdCode())
.in(RiskModelTaskClue::getModelId, models.stream().map(Model::getId).toList()) .in(RiskModelTaskClue::getModelId, models.stream().map(Model::getId).toList())
.eq(RiskModelTaskClue::getDel, "0") .eq(RiskModelTaskClue::getDel, "0")

5
src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java

@ -18,4 +18,9 @@ public interface ModelClueMapper extends BaseMapper<ModelClue> {
@Select("${newSql}") @Select("${newSql}")
List<Map<String, Object>> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql); List<Map<String, Object>> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql);
List<ModelClue> selectByModelId(@Param("modelId") int modelId);
int updateInvolveDepartId(@Param("id") int id, @Param("newDepartId") String newDepartId);
} }

17
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -197,6 +197,22 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} }
public void generate(Integer modelId) { public void generate(Integer modelId) {
if (modelId == 1300) {
List<ModelClue> modelClues = modelClueMapper.selectByModelId(103);
if (modelClues != null && !modelClues.isEmpty()) {
for (ModelClue modelClue : modelClues) {
SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper<SupExternalDepart>().eq(SupExternalDepart::getExternalId, modelClue.getInvolveDepartId()).last("LIMIT 1"));
if (supExternalDepart != null) {
if (supExternalDepart.getInternalId() != null) {
modelClueMapper.updateInvolveDepartId(modelClue.getId(), supExternalDepart.getInternalId());
}
}
}
} else {
System.out.println("No records found for model_id 103.");
}
return;
}
Model model = modelMapper.selectById(modelId); Model model = modelMapper.selectById(modelId);
List<ModelClue> modelClues = new ArrayList<>(); List<ModelClue> modelClues = new ArrayList<>();
if (!Objects.isNull(model) && model.getModelSql() != null) { if (!Objects.isNull(model) && model.getModelSql() != null) {
@ -1041,6 +1057,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
if (statisticsDepart != null && statisticsDepart.getGroupId() != null && statisticsDepart.getGroupId() == 11L) { if (statisticsDepart != null && statisticsDepart.getGroupId() != null && statisticsDepart.getGroupId() == 11L) {
continue; continue;
} }
newModelClue.setInvolveDepartId(supExternalDepart.getInternalId());
} }
} }
newModelClue.setData(JSONObject.toJSONString(newMap)); newModelClue.setData(JSONObject.toJSONString(newMap));

8
src/main/resources/mapper/ModelClueMapper.xml

@ -12,5 +12,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>
<select id="selectByModelId" resultType="com.biutag.supervision.pojo.entity.ModelClue">
SELECT * FROM model_clue WHERE model_id = #{modelId}
</select>
<update id="updateInvolveDepartId">
UPDATE model_clue SET involve_depart_id = #{newDepartId} WHERE id = #{id}
</update>
</mapper> </mapper>
Loading…
Cancel
Save