Selaa lähdekoodia

登记簿检查项排序bug修改

jingyuanchao 1 vuosi sitten
vanhempi
commit
22200ceb0c

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/ResumptionPdf.java

@@ -13,5 +13,6 @@ public class ResumptionPdf implements Serializable {
     private String submitName;
     @ApiModelProperty(value = "执行结果")
     private Integer resValue;
-    private Integer sort;
+    private Integer pointSort;
+    private Integer itemSort;
 }

+ 6 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/gx/vo/ResumptionPlanVo.java

@@ -118,6 +118,11 @@ public class ResumptionPlanVo {
     /**
      * 要点排序值
      */
-    private Integer sort = 0;
+    private Integer pointSort;
+
+    /**
+     * 检查项排序值
+     */
+    private Integer itemSort;
 
 }

+ 12 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -1955,12 +1955,22 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
                 tem.setSubmitName(String.valueOf(submitName));
                 //null:未执行  0:正常 1:异常
                 tem.setResValue(result);
-                tem.setSort(vo.getSort());
+                tem.setPointSort(vo.getPointSort());
+                tem.setItemSort(vo.getItemSort());
                 befs.add(tem);
             }
 
         }
-        befs.sort(Comparator.comparing(ResumptionPdf::getSort));
+        befs.sort(new Comparator<ResumptionPdf>() {
+            @Override
+            public int compare(ResumptionPdf o1, ResumptionPdf o2) {
+                final int compare = o1.getItemSort().compareTo(o2.getItemSort());
+                if (compare != 0) {
+                    return compare;
+                }
+                return o1.getPointSort().compareTo(o2.getPointSort());
+            }
+        });
         return befs;
     }
 

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java

@@ -256,7 +256,8 @@ public class ResumptionRecordServiceImpl extends ServiceImpl<ResumptionRecordMap
             temp.setItemId(x.getItemId());
             temp.setExecuteResult(StringUtils.EMPTY);
             temp.setSubmitName(StringUtils.EMPTY);
-            temp.setSort(x.getSort());
+            temp.setPointSort(x.getPointSort());
+            temp.setItemSort(x.getItemSort());
             result.add(temp);
         });
 

+ 4 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java

@@ -59,7 +59,10 @@ public class AppResumptionDataInfoVo {
 
     private List<ResumptionDataProtectionVo> protections;
 
+    @ApiModelProperty(value = "检查项排序值",notes = "如果没有设置排序,那么放在最后")
+    private Integer itemSort=999;
+
     @ApiModelProperty(value = "要点排序值",notes = "如果没有设置排序,那么放在最后")
-    private Integer sort=999;
+    private Integer pointSort=999;
 
 }

+ 4 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -418,7 +418,8 @@
                q.point_scan,
                q.required,
                q.business_type as pointDataSource,
-               q.sort
+               q.pointSort as pointSort,
+               q.itemSort  as itemSort
         from (select c.id     as item_id,
                      c.`name` as item_name,
                      b.id     as point_id,
@@ -433,7 +434,8 @@
                      a.plan_id,
                      a.point_scan,
                      a.required,
-                     b.sort
+                     ifnull(c.sort,999) as itemSort,
+                     ifnull(b.sort,999) as pointSort
               from core_resumption_plan_to_point a
                        LEFT JOIN core_resumption_rule_point b on a.point_id = b.id
                        LEFT JOIN core_resumption_rule_item c on b.item_id = c.id

+ 3 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -285,9 +285,11 @@
                d.item_id,
                d.res_value,
                d.submit_name,
-               p.sort
+               p.sort as pointSort,
+               ri.sort  as itemSort
         FROM core_resumption_data d
                  INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
+                 INNER JOIN core_resumption_rule_item ri ON ri.id = p.item_id
                  LEFT JOIN sys_area a ON a.id = d.area_id
                  LEFT JOIN sys_area_check ch on ch.id = d.check_id
         WHERE d.resumption_id = #{resumptionId}