소스 검색

Merge remote-tracking branch 'origin/master'

lixiaolong 2 주 전
부모
커밋
41b314faef

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/po/PtlSchemeInfo.java

@@ -28,6 +28,9 @@ public class PtlSchemeInfo extends BaseModel {
     @Schema(description = "描述")
     private String description;
 
+    @Schema(description = "排序字段")
+    private Integer sort;
+
 }
 
 

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeQueryVo.java

@@ -45,6 +45,7 @@ public class PtlSchemeQueryVo {
     @Schema(description = "回显的方案规则")
     private List<PtlAgreementUndwrtRulesAttr> ruleAttrs = new ArrayList<>();
 
+
     @Data
     public static class Scheme{
         private String id;
@@ -58,6 +59,7 @@ public class PtlSchemeQueryVo {
 
         @Schema(description = "描述")
         private String description;
+        private Integer sort;
 
         @Schema(description = "险种列表")
         private List<PtlSchemeInsuranceVo> schemeInsuranceList = new ArrayList<>();
@@ -84,6 +86,7 @@ public class PtlSchemeQueryVo {
         scheme.setSchemeType(ptlSchemeInfo.getSchemeType());
         scheme.setSchemeName(ptlSchemeInfo.getSchemeName());
         scheme.setDescription(ptlSchemeInfo.getDescription());
+        scheme.setSort(ptlSchemeInfo.getSort());
         this.schemeList.add(scheme);
         //处理商业险
         insurances.stream().filter(insurance-> insurance.getSchemeInfoId().equals(ptlSchemeInfo.getId())).forEach(insurance -> {

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -49,6 +49,7 @@ public class PtlSchemeSaveVo {
     @Schema(description = "回显的方案规则")
     private List<PtlAgreementUndwrtRulesAttr> ruleAttrs = new ArrayList<>();
 
+
     @Data
     public static class Scheme{
         private String id;
@@ -66,6 +67,9 @@ public class PtlSchemeSaveVo {
         @Schema(description = "方案描述")
         private String description;
 
+        @Schema(description = "排序字段")
+        private Integer sort;
+
         @Schema(description = "险种列表")
         private List<PtlSchemeInsuranceVo> schemeInsuranceList = new ArrayList<>();
 
@@ -171,6 +175,7 @@ public class PtlSchemeSaveVo {
             }
             ptlSchemeInfo.setId(scheme.getId());
             ptlSchemeInfo.setSchemeId(this.id);
+            ptlSchemeInfo.setSort(scheme.getSort());
             ptlSchemeInfo.setSchemeType(this.schemeType);
             ptlSchemeInfo.setSchemeName(scheme.getSchemeName());
             ptlSchemeInfo.setDescription(scheme.getDescription());

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/SchemeResultVo.java

@@ -46,6 +46,8 @@ public class SchemeResultVo {
 
         private String productId;
 
+        private Integer sort;
+
         List<Kind> kinds = new ArrayList<>();
 
         List<Driving> drivings = new ArrayList<>();

+ 5 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -918,8 +918,12 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         List<SchemeResultVo.SchemeInfoVo> allInfo = new ArrayList<>();
 
         schemeVo.forEach(scheme -> allInfo.addAll(scheme.getInfos()));
+        // 按sort 方案排序
+        List<SchemeResultVo.SchemeInfoVo> sortedList = allInfo.stream()
+                .sorted(Comparator.comparing(SchemeResultVo.SchemeInfoVo::getSort))
+                .collect(Collectors.toList());
 
-        schemeResultVo.setSchemes(allInfo);
+        schemeResultVo.setSchemes(sortedList);
         //把基础方案的商业险的value 赋值
         schemeResultVo.getSchemes().forEach(schemeInfoVo -> {
             schemeInfoVo.getKinds().forEach(kind -> {

+ 5 - 2
tenant/organization/src/main/resources/mapper/PtlSchemeMapper.xml

@@ -14,6 +14,7 @@
             <result column="scheme_name" property="schemeName"/>
             <result column="scheme_type" property="schemeType"/>
             <result column="description" property="description"/>
+            <result column="sort" property="sort"/>
             <collection property="kinds" ofType="com.jzg.commons.entity.scheme.vo.SchemeResultVo$Kind" javaType="java.util.List">
                 <id column="kind_id" property="id"/>
                 <result column="kind_code" property="kindCode"/>
@@ -75,6 +76,7 @@
         psi.scheme_name,
         psi.description,
         psi.scheme_type,
+        psi.sort,
         ps.rule_desc,
         ps.id AS scheme_id,
         ps.company_id,
@@ -99,8 +101,8 @@
         <if test="param.companyId != null and param.companyId != ''">
             AND ps.company_id = #{param.companyId}
         </if>
-        GROUP BY
-        psi.id
+        GROUP BY psi.id order by psi.sort
+
     </select>
 
     <select id="getCompanyList" resultType="com.jzg.commons.entity.po.EsmInsCompany">
@@ -143,6 +145,7 @@
             psi.scheme_type,
             psi.scheme_name,
             psi.description,
+            psi.sort,
             ibi.id AS kind_id,
             ibi.kind_code,
             ibi.kind_name,