Sfoglia il codice sorgente

送经量加入大经编

wukai 3 settimane fa
parent
commit
a646816774

+ 4 - 4
jjt-biz/src/main/java/com/jjt/biz/service/impl/ApiServiceImpl.java

@@ -252,14 +252,14 @@ public class ApiServiceImpl implements IApiService {
                 formulaDetail.add(detail);
                 //处理平方米克重明细数据
                 GramMassDetail gramMassDetail = new GramMassDetail(isSmall, map);
-
                 gramMassDetails.add(gramMassDetail);
+                //处理送经量数据
+                WarpRunIn warpRunIn = new WarpRunIn(isSmall, map);
+                warpList.add(warpRunIn);
+
                 if (isSmall) {
                     TwinFormulaInfo formulaInfo = new TwinFormulaInfo(map);
                     formulaInfos.add(formulaInfo);
-                    //处理送经量数据
-                    WarpRunIn warpRunIn = new WarpRunIn(map);
-                    warpList.add(warpRunIn);
 
 
                     for (int i = 0; i < Tools.ALLOW_ALARM.length; i++) {

+ 43 - 13
jjt-biz/src/main/java/com/jjt/biz/vo/WarpRunIn.java

@@ -23,32 +23,60 @@ public class WarpRunIn {
     @ApiModelProperty("设备信息")
     private String device;
     @ApiModelProperty("L1梳栉送经量")
-    private Integer l1;
+    private String l1;
     @ApiModelProperty("L2梳栉送经量")
-    private Integer l2;
+    private String l2;
     @ApiModelProperty("L3梳栉送经量")
-    private Integer l3;
+    private String l3;
     @ApiModelProperty("L4梳栉送经量")
-    private Integer l4;
+    private String l4;
     @ApiModelProperty("L5梳栉送经量")
-    private Integer l5;
+    private String l5;
     @ApiModelProperty("牵拉密度")
     private Float density;
     @ApiModelProperty("卷曲张力系数")
     private Float coefficient;
 
-    public WarpRunIn(Map<String, Object> map) {
+    public WarpRunIn(boolean isSmall, Map<String, Object> map) {
         TwinDevice twinDevice = (TwinDevice) map.get("device");
         this.device = twinDevice.getDeviceName();
-        this.l1 = (int) map.get("Formula_data_19");
-        this.l2 = (int) map.get("Formula_data_20");
-        this.l3 = (int) map.get("Formula_data_21");
-        this.l4 = (int) map.get("Formula_data_22");
-        this.l5 = (int) map.get("Formula_data_23");
+        if (isSmall) {
+            setSmall(map);
+        } else {
+            setBig(map);
+        }
+
+    }
+
+    private void setSmall(Map<String, Object> map) {
+        this.l1 = (int) map.get("Formula_data_19") + "";
+        this.l2 = (int) map.get("Formula_data_20") + "";
+        this.l3 = (int) map.get("Formula_data_21") + "";
+        this.l4 = (int) map.get("Formula_data_22") + "";
+        this.l5 = (int) map.get("Formula_data_23") + "";
         this.density = (float) map.get("Formula_data_24");
         this.coefficient = (float) map.get("Formula_data_25");
     }
 
+    private void setBig(Map<String, Object> map) {
+        this.l1 = String.format("%d,%d",
+                ((Number) map.get("Formula_data_1")).intValue(),
+                ((Number) map.get("Formula_data_2")).intValue());
+        this.l2 = String.format("%d,%d",
+                ((Number) map.get("Formula_data_3")).intValue(),
+                ((Number) map.get("Formula_data_4")).intValue());
+        this.l3 = String.format("%d,%d",
+                ((Number) map.get("Formula_data_5")).intValue(),
+                ((Number) map.get("Formula_data_6")).intValue());
+        this.l4 = String.format("%d,%d",
+                ((Number) map.get("Formula_data_7")).intValue(),
+                ((Number) map.get("Formula_data_8")).intValue());
+        this.l5 = String.format("%d,%d",
+                ((Number) map.get("Formula_data_9")).intValue(),
+                ((Number) map.get("Formula_data_10")).intValue());
+        this.density = (float) map.get("Capacity_data_112");
+    }
+
     public void setCells(Cell[] cells, CellStyle style) {
         cells[0].setCellValue(device);
         cells[1].setCellValue(l1);
@@ -58,7 +86,9 @@ public class WarpRunIn {
         cells[5].setCellValue(l5);
         cells[6].setCellValue(density);
         cells[6].setCellStyle(style);
-        cells[7].setCellValue(coefficient);
-        cells[7].setCellStyle(style);
+        if (coefficient != null) {
+            cells[7].setCellValue(coefficient);
+            cells[7].setCellStyle(style);
+        }
     }
 }