Explorar el Código

feat:产线排序

hmc hace 1 año
padre
commit
a9b24463e5

+ 12 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/domain/ProductionLine.java

@@ -61,7 +61,18 @@ public class ProductionLine extends BaseEntity
     @Excel(name = "任务节点编码")
     private String taskNodeKey;
 
-    public void setId(Long id) 
+    @Excel
+    private  int  sort;
+
+    public int getSort() {
+        return sort;
+    }
+
+    public void setSort(int sort) {
+        this.sort = sort;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 5 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/AmmunitionPlanInformationIntermediateTableServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zkqy.business.service.impl;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -118,10 +119,13 @@ public class AmmunitionPlanInformationIntermediateTableServiceImpl implements IA
             productionLine.setProductionLineWorkshop(ammunitionPlanInformationIntermediateTablVo.getProductionLineWorkshop());
         }
         List<ProductionLine> productionLines = productionLineMapper.selectProductionLineList(productionLine);
+        List<ProductionLine> sortedList = productionLines.stream()
+                .sorted(Comparator.comparing(ProductionLine::getSort))
+                .collect(Collectors.toList());
         //创建产线对象
         List<AmmunitionPlanInformationIntermediateTableRVo> list=new ArrayList<>();
         //循环固定死的产线
-        productionLines.stream().forEach(item -> {
+        sortedList.stream().forEach(item -> {
             //A面待生产
             DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan2=new DetailsOfTheRefuelingPlan();
             detailsOfTheRefuelingPlan2.setMachineId(item.getProductionLineNo());//产线号

+ 6 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanSpinningServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zkqy.business.service.impl;
 
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -64,10 +65,14 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
             productionLine.setProductionLineDepartment(detailsOfTheRefuelingPlanSpinning.getProductionLineDepartment());
         }
         List<ProductionLine> productionLines = productionLineMapper.selectProductionLineList(productionLine);
+        //排序
+        List<ProductionLine> sortedList = productionLines.stream()
+                .sorted(Comparator.comparing(ProductionLine::getSort))
+                .collect(Collectors.toList());
         //存放产线计划的集合
         List<DetailsOfTheRefuelingPlanSpinningRVo> list = new ArrayList<>();
         //循环固定死的产线
-        productionLines.stream().forEach(item -> {
+        sortedList.stream().forEach(item -> {
             //先根据产线号去查询计划信息
             DetailsOfTheRefuelingPlanSpinning spinning = new DetailsOfTheRefuelingPlanSpinning();
             spinning.setMachineId(item.getProductionLineNo());

+ 2 - 1
zkqy-custom-business/src/main/resources/mapper/business/ProductionLineMapper.xml

@@ -22,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="processKey"    column="process_key"    />
         <result property="taskProcessKey"    column="task_process_key"    />
         <result property="taskNodeKey"    column="task_node_key"    />
+        <result property="sort" column="sort"/>
     </resultMap>
 
     <sql id="selectProductionLineVo">
-        select id, production_line_no, production_line_name, production_line_department, production_line_workshop, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, data_approval_status, process_key, task_process_key, task_node_key from {DBNAME}.production_line
+        select id, production_line_no, production_line_name, production_line_department, production_line_workshop, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, data_approval_status, process_key, task_process_key, task_node_key,sort from {DBNAME}.production_line
     </sql>
 
     <select id="selectProductionLineList" parameterType="com.zkqy.business.domain.ProductionLine" resultMap="ProductionLineResult">