Просмотр исходного кода

协议调度,回显规则时,对规则描述中的内容进行转义

lipf 4 месяцев назад
Родитель
Сommit
156a46f195

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchRulesAttrLink.java

@@ -31,11 +31,18 @@ public class PtlAgreementDispatchRulesAttrLink implements Serializable {
     @Schema(description = "左操作符")
     private String min;
 
+    @Schema(description = "左操作符号转义后的值")
+    @TableField(exist = false)
+    private String minName;
+
     @Schema(description = "操作符")
     private String operator;
 
     @Schema(description = "右操作符")
     private String max;
+    @Schema(description = "右操作符号转义后的值")
+    @TableField(exist = false)
+    private String maxName;
 
     @TableField(exist = false)
     private List<String> minArray = new ArrayList<>();

+ 0 - 2
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchVo.java

@@ -1,6 +1,5 @@
 package com.jzg.commons.entity.agreement.dispatch.vo;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
@@ -9,7 +8,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 
 @Data

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRulesDictLabal.java

@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.jzg.commons.util.StringUtils;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.util.List;
+import java.util.Objects;
 
 @TableName(value = "ptl_agreement_undwrt_rules_dict_labal", autoResultMap = true)
 @Data
@@ -19,6 +21,13 @@ public class PtlAgreementUndwrtRulesDictLabal {
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
+    public String getIdStr(){
+        if(id == null){
+            return StringUtils.EMPTY;
+        }
+        return Objects.toString(this.id);
+    }
+
     @TableField(value = "parent_id")
     private Integer parentId;
 

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchMapper.java

@@ -3,9 +3,16 @@ package com.jzg.organization.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
 
 @Mapper
 public interface PtlAgreementDispatchMapper extends BaseMapper<PtlAgreementDispatch> {
 
+
+    @Select("select * from ptl_agreement_undwrt_rules_dict_labal paurdl where paurdl.is_delete =0")
+    List<PtlAgreementUndwrtRulesDictLabal> queryAllDictLabal();
 }

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -141,6 +141,10 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
             // 获取保司的报价失败之后的动作
             List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchAfterActions = afterActionMapper.getAfterActions(ptlAgreementDispatchQuery.getCompanyId());
             int index = 1;
+            // add by lipf, 对协议配置中的字典序号进行转义 2026年5月20日16:43:34
+            List<PtlAgreementUndwrtRulesDictLabal> ptlAgreementUndwrtRulesDictLabals = baseMapper.queryAllDictLabal();
+            Map<String, String> dictLabalId2Name = ptlAgreementUndwrtRulesDictLabals.stream()
+                    .collect(Collectors.toMap(PtlAgreementUndwrtRulesDictLabal::getIdStr, PtlAgreementUndwrtRulesDictLabal::getName));
             for(PtlAgreementDispatch dispatch : ptlAgreementDispatches){
                 if(dispatch.getDispatchName().isEmpty()){
                     dispatch.setDispatchName("规则" + index);
@@ -168,6 +172,10 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
                     }else{
                         attrlink.setOperatorDesc("未知");
                     }
+                    String minName = dictLabalId2Name.getOrDefault(attrlink.getMin(),attrlink.getMin());
+                    String maxName = dictLabalId2Name.getOrDefault(attrlink.getMax(),attrlink.getMax());
+                    attrlink.setMinName(minName);
+                    attrlink.setMaxName(maxName);
                     PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
                     if(undwrtRuleAttrByAttrCode != null && undwrtRuleAttrByAttrCode.getDictId() != null){
                         attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());

+ 8 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.organization.mapper.PtlAgreementDispatchMapper">
+
+
+</mapper>