chenyuesheng 2 роки тому
батько
коміт
7804c00091

+ 37 - 21
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/entity/MaterialReportDetails.java

@@ -62,6 +62,10 @@ public class MaterialReportDetails extends DataEntity<MaterialReportDetails> {
 
     //提报部门
     private String reportDepartment;
+    //备注
+    private String remark;
+    //利库金额
+    private String liKuAmount;
 
     /**
      * 利库数量
@@ -271,79 +275,83 @@ public class MaterialReportDetails extends DataEntity<MaterialReportDetails> {
     public String getReportDepartment() {
         return reportDepartment;
     }
-    @Override
-    public String getRemarks() {
-        return super.getRemarks();
+    @ExcelField(title = "备注", align = 2, sort = 14)
+    public String getRemark() {
+        return remark;
     }
-    @ExcelField(title = "利库数量", align = 2, sort = 14)
+    @ExcelField(title = "利库数量", align = 2, sort = 15)
     public Double getNumberOfNiches() {
         return numberOfNiches;
     }
-    @ExcelField(title = "申请数量", align = 2, sort = 15)
+    @ExcelField(title = "利库金额", align = 2, sort = 16)
+    public String getLiKuAmount() {
+        return liKuAmount;
+    }
+    @ExcelField(title = "申请数量", align = 2, sort = 17)
     public Double getNumberOfApplications() {
         return numberOfApplications;
     }
-    @ExcelField(title = "本地利库批次号", align = 2, sort = 16)
+    @ExcelField(title = "本地利库批次号", align = 2, sort = 18)
     public String getLocalWareBatch() {
         return localWareBatch;
     }
-    @ExcelField(title = "本地利库库存地", align = 2, sort = 17)
+    @ExcelField(title = "本地利库库存地", align = 2, sort = 19)
     public String getLocalWareHouse() {
         return localWareHouse;
     }
-    @ExcelField(title = "本地利库数量", align = 2, sort = 18)
+    @ExcelField(title = "本地利库数量", align = 2, sort = 20)
     public String getNumberOfLocal() {
         return numberOfLocal;
     }
-    @ExcelField(title = "跨区利库批次号", align = 2, sort = 19)
+    @ExcelField(title = "跨区利库批次号", align = 2, sort = 21)
     public String getRegionalBatch() {
         return regionalBatch;
     }
-    @ExcelField(title = "跨区利库库存地", align = 2, sort = 20)
+    @ExcelField(title = "跨区利库库存地", align = 2, sort = 22)
     public String getRegionalHouse() {
         return regionalHouse;
     }
-    @ExcelField(title = "跨区利库数量", align = 2, sort = 21)
+    @ExcelField(title = "跨区利库数量", align = 2, sort = 23)
     public String getNumberOfRegional() {
         return numberOfRegional;
     }
-    @ExcelField(title = "本地替代利库利库扩展编码", align = 2, sort = 22)
+    @ExcelField(title = "本地替代利库利库扩展编码", align = 2, sort = 24)
     public String getLocalReplacementExtendedCoding() {
         return localReplacementExtendedCoding;
     }
-    @ExcelField(title = "本地替代利库利库扩展描述", align = 2, sort = 23)
+    @ExcelField(title = "本地替代利库利库扩展描述", align = 2, sort = 25)
     public String getLocalReplacementExtendedDescription() {
         return localReplacementExtendedDescription;
     }
-    @ExcelField(title = "本地替代利库利库批次号", align = 2, sort = 24)
+    @ExcelField(title = "本地替代利库利库批次号", align = 2, sort = 26)
     public String getLocalReplacementBatch() {
         return localReplacementBatch;
     }
-    @ExcelField(title = "本地替代利库利库库存地", align = 2, sort = 25)
+    @ExcelField(title = "本地替代利库利库库存地", align = 2, sort = 27)
     public String getLocalReplacementHouse() {
         return localReplacementHouse;
     }
-    @ExcelField(title = "本地替代利库利库数量", align = 2, sort = 26)
+    @ExcelField(title = "本地替代利库利库数量", align = 2, sort = 28)
     public String getLocalReplacementNumber() {
         return localReplacementNumber;
     }
-    @ExcelField(title = "跨区替代利库利库扩展编码", align = 2, sort = 27)
+    @ExcelField(title = "跨区替代利库利库扩展编码", align = 2, sort = 29)
     public String getRegionalReplacementExtendedCoding() {
         return regionalReplacementExtendedCoding;
     }
-    @ExcelField(title = "跨区替代利库利库扩展描述", align = 2, sort = 28)
+    @ExcelField(title = "跨区替代利库利库扩展描述", align = 2, sort = 30)
     public String getRegionalReplacementExtendedDescription() {
         return regionalReplacementExtendedDescription;
     }
-    @ExcelField(title = "跨区替代利库利库批次号", align = 2, sort = 29)
+    @ExcelField(title = "跨区替代利库利库批次号", align = 2, sort = 31)
     public String getRegionalReplacementBatch() {
         return regionalReplacementBatch;
     }
-    @ExcelField(title = "跨区替代利库利库库存地", align = 2, sort = 30)
+    @ExcelField(title = "跨区替代利库利库库存地", align = 2, sort = 32)
     public String getRegionalReplacementHouse() {
         return regionalReplacementHouse;
     }
-    @ExcelField(title = "跨区替代利库利库数量", align = 2, sort = 31)
+    @ExcelField(title = "跨区替代利库利库数量", align = 2, sort = 33)
     public String getRegionalReplacementNumber() {
         return regionalReplacementNumber;
     }
@@ -668,4 +676,12 @@ public class MaterialReportDetails extends DataEntity<MaterialReportDetails> {
     public void setAreaCodeFlagEnum(AreaCodeFlagEnum areaCodeFlagEnum) {
         this.areaCodeFlagEnum = areaCodeFlagEnum;
     }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public void setLiKuAmount(String liKuAmount) {
+        this.liKuAmount = liKuAmount;
+    }
 }

+ 11 - 3
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/service/MaterialReportDetailsService.java

@@ -108,6 +108,10 @@ public class MaterialReportDetailsService extends CrudService<MaterialReportDeta
 
         //循环初始化
         liKuPoolList.forEach(liKuResourcePool -> {
+            //如果总量为空
+            if(StringUtils.isBlank(liKuResourcePool.getInventoryAmount())){
+                liKuResourcePool.setInventoryAmount("0");
+            }
             //初始化剩余数量
             liKuResourcePool.setRemaining(liKuResourcePool.getInventoryAmount());
             //初始化利库数量
@@ -131,9 +135,9 @@ public class MaterialReportDetailsService extends CrudService<MaterialReportDeta
             if (liKuResourcePool.getUnitOfMeasurement().equals(MaterialsUnitFlagEnum.M.getUnit()) || liKuResourcePool.getUnitOfMeasurement().equals(MaterialsUnitFlagEnum.KM.getUnit())) {
                 if (liKuResourcePool.getUnitOfMeasurement().equals(MaterialsUnitFlagEnum.KM.getUnit())) {
                     liKuResourcePool.setInventoryAmount(new BigDecimal(liKuResourcePool.getInventoryAmount()).multiply(new BigDecimal(1000)).toString());
-                    liKuResourcePool.setLengthOfCable(liKuResourcePool.getInventoryAmount());
-                    liKuResourcePool.setRemaining(liKuResourcePool.getInventoryAmount());
                 }
+                liKuResourcePool.setLengthOfCable(liKuResourcePool.getInventoryAmount());
+                liKuResourcePool.setRemaining(liKuResourcePool.getInventoryAmount());
                 liKuIsSegmentPoolList.add(liKuResourcePool);
                 /*}*/
             } else {
@@ -152,6 +156,10 @@ public class MaterialReportDetailsService extends CrudService<MaterialReportDeta
         List<MaterialReportDetails> materialIsNotSegmentList = new ArrayList<>();
         //根据 段长非段长区分 初始化
         materialReportDetailsList.forEach(l -> {
+            //如果申请数量为空
+            if(null==l.getTotal()){
+                l.setTotal(0.0);
+            }
             //初始化利库数量
             l.setNumberOfNiches(0.0);
             //初始化申请数量
@@ -172,9 +180,9 @@ public class MaterialReportDetailsService extends CrudService<MaterialReportDeta
             //单位转换为米
             if (l.getUnit().equals(MaterialsUnitFlagEnum.KM.getUnit())) {
                 l.setTotal((BigDecimal.valueOf(l.getTotal()).multiply(new BigDecimal(1000))).doubleValue());
-                l.setNumberOfApplications(l.getTotal());
             }
             if (l.getUnit().equals(MaterialsUnitFlagEnum.M.getUnit()) || l.getUnit().equals(MaterialsUnitFlagEnum.KM.getUnit())) {
+                l.setNumberOfApplications(l.getTotal());
                 materialIsSegmentList.add(l);
             } else {
                 materialIsNotSegmentList.add(l);

+ 40 - 36
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/utils/ExportUtil.java

@@ -115,24 +115,26 @@ public class ExportUtil {
                     Cell cell10 = crateCell(workbook,row,10,color); //甲乙供
                     Cell cell11 = crateCell(workbook,row,11,color);//提报人
                     Cell cell12 = crateCell(workbook,row,12,color);//提报部门
-                    Cell cell13 = crateCell(workbook,row,13,color); //利库数量
-                    Cell cell14 = crateCell(workbook,row,14,color); //申请数量
-                    Cell cell15 = crateCell(workbook,row,15,color); //本地利库批次号
-                    Cell cell16 = crateCell(workbook,row,16,color); //本地利库库存地
-                    Cell cell17 = crateCell(workbook,row,17,color); //本地利库数量
-                    Cell cell18 = crateCell(workbook,row,18,color); //跨区利库批次号
-                    Cell cell19 = crateCell(workbook,row,19,color); //跨区利库库存地
-                    Cell cell20 = crateCell(workbook,row,20,color); //跨区利库数量
-                    Cell cell21 = crateCell(workbook,row,21,color); //本地替代利库利库扩展编码
-                    Cell cell22 = crateCell(workbook,row,22,color); //本地替代利库利库扩展描述
-                    Cell cell23 = crateCell(workbook,row,23,color); //本地替代利库利库批次号
-                    Cell cell24 = crateCell(workbook,row,24,color); //本地替代利库利库库存地
-                    Cell cell25 = crateCell(workbook,row,25,color); //本地替代利库利库数量
-                    Cell cell26 = crateCell(workbook,row,26,color); //跨区替代利库利库扩展编码
-                    Cell cell27 = crateCell(workbook,row,27,color); //跨区替代利库利库扩展描述
-                    Cell cell28 = crateCell(workbook,row,28,color); //跨区替代利库利库批次号
-                    Cell cell29 = crateCell(workbook,row,29,color); //跨区替代利库利库库存地
-                    Cell cell30 = crateCell(workbook,row,30,color); //跨区替代利库利库数量
+                    Cell cell13 = crateCell(workbook,row,13,color); //备注
+                    Cell cell14 = crateCell(workbook,row,14,color); //利库数量
+                    Cell cell15 = crateCell(workbook,row,15,color); //利库金额
+                    Cell cell16 = crateCell(workbook,row,16,color); //申请数量
+                    Cell cell17 = crateCell(workbook,row,17,color); //本地利库批次号
+                    Cell cell18 = crateCell(workbook,row,18,color); //本地利库库存地
+                    Cell cell19 = crateCell(workbook,row,19,color); //本地利库数量
+                    Cell cell20 = crateCell(workbook,row,20,color); //跨区利库批次号
+                    Cell cell21 = crateCell(workbook,row,21,color); //跨区利库库存地
+                    Cell cell22 = crateCell(workbook,row,22,color); //跨区利库数量
+                    Cell cell23 = crateCell(workbook,row,23,color); //本地替代利库利库扩展编码
+                    Cell cell24 = crateCell(workbook,row,24,color); //本地替代利库利库扩展描述
+                    Cell cell25 = crateCell(workbook,row,25,color); //本地替代利库利库批次号
+                    Cell cell26 = crateCell(workbook,row,26,color); //本地替代利库利库库存地
+                    Cell cell27 = crateCell(workbook,row,27,color); //本地替代利库利库数量
+                    Cell cell28 = crateCell(workbook,row,28,color); //跨区替代利库利库扩展编码
+                    Cell cell29 = crateCell(workbook,row,29,color); //跨区替代利库利库扩展描述
+                    Cell cell30 = crateCell(workbook,row,30,color); //跨区替代利库利库批次号
+                    Cell cell31 = crateCell(workbook,row,31,color); //跨区替代利库利库库存地
+                    Cell cell32 = crateCell(workbook,row,32,color); //跨区替代利库利库数量
 
 
                     cell0.setCellValue(getString(report.getReportingArea()));
@@ -148,24 +150,26 @@ public class ExportUtil {
                     cell10.setCellValue(getString(report.getSupplied()));
                     cell11.setCellValue(getString(report.getReportPerson()));//提报人
                     cell12.setCellValue(getString(report.getReportDepartment()));//提报部门
-                    cell13.setCellValue(getDouble(report.getNumberOfNiches()));
-                    cell14.setCellValue(getDouble(report.getNumberOfApplications()));
-                    cell15.setCellValue(getString(report.getLocalWareBatch()));
-                    cell16.setCellValue(getString(report.getLocalWareHouse()));
-                    cell17.setCellValue(getString(report.getNumberOfLocal()));
-                    cell18.setCellValue(getString(report.getRegionalBatch()));
-                    cell19.setCellValue(getString(report.getRegionalHouse()));
-                    cell20.setCellValue(getString(report.getNumberOfRegional()));
-                    cell21.setCellValue(getString(report.getLocalReplacementExtendedCoding()));
-                    cell22.setCellValue(getString(report.getLocalReplacementExtendedDescription()));
-                    cell23.setCellValue(getString(report.getLocalReplacementBatch()));
-                    cell24.setCellValue(getString(report.getLocalReplacementHouse()));
-                    cell25.setCellValue(getString(report.getLocalReplacementNumber()));
-                    cell26.setCellValue(getString(report.getRegionalReplacementExtendedCoding()));
-                    cell27.setCellValue(getString(report.getRegionalReplacementExtendedDescription()));
-                    cell28.setCellValue(getString(report.getRegionalReplacementBatch()));
-                    cell29.setCellValue(getString(report.getRegionalReplacementHouse()));
-                    cell30.setCellValue(getString(report.getRegionalReplacementNumber()));
+                    cell13.setCellValue(getString(report.getRemark()));//备注
+                    cell14.setCellValue(getDouble(report.getNumberOfNiches()));
+                    cell15.setCellValue(getString(report.getLiKuAmount()));//利库金额
+                    cell16.setCellValue(getDouble(report.getNumberOfApplications()));
+                    cell17.setCellValue(getString(report.getLocalWareBatch()));
+                    cell18.setCellValue(getString(report.getLocalWareHouse()));
+                    cell19.setCellValue(getString(report.getNumberOfLocal()));
+                    cell20.setCellValue(getString(report.getRegionalBatch()));
+                    cell21.setCellValue(getString(report.getRegionalHouse()));
+                    cell22.setCellValue(getString(report.getNumberOfRegional()));
+                    cell23.setCellValue(getString(report.getLocalReplacementExtendedCoding()));
+                    cell24.setCellValue(getString(report.getLocalReplacementExtendedDescription()));
+                    cell25.setCellValue(getString(report.getLocalReplacementBatch()));
+                    cell26.setCellValue(getString(report.getLocalReplacementHouse()));
+                    cell27.setCellValue(getString(report.getLocalReplacementNumber()));
+                    cell28.setCellValue(getString(report.getRegionalReplacementExtendedCoding()));
+                    cell29.setCellValue(getString(report.getRegionalReplacementExtendedDescription()));
+                    cell30.setCellValue(getString(report.getRegionalReplacementBatch()));
+                    cell31.setCellValue(getString(report.getRegionalReplacementHouse()));
+                    cell32.setCellValue(getString(report.getRegionalReplacementNumber()));
                 }
             }
             /*if(likuList!=null&&likuList.size()>0){