Bläddra i källkod

拆旧材料清单导出

[user3] 3 år sedan
förälder
incheckning
73e6e42602

+ 10 - 0
src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/service/RaiseCapitalDesignService.java

@@ -111,6 +111,10 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
 		List<VoltageInfo> lowVoltageList = this.getAerialConductor(uuid + "lowVoltage","lowVoltage");
 		voltageData.setHighVoltageList(highVoltageList);
 		voltageData.setLowVoltageList(lowVoltageList);
+		//获取拆旧材料清单计算表中的数据
+		InventoryData inventoryData=new InventoryData();
+		List<InventoryInfo> inventoryList = this.getInventory(uuid + "inventory");
+		inventoryData.setInventoryList(inventoryList);
 
 
 		//获取电缆分段表数据信息
@@ -207,6 +211,8 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
 		XSSFSheet sheetPickingList = null;
 
 		XSSFSheet sheetVoltageList = null;
+		//拆旧材料清单
+		XSSFSheet sheetInventoryList = null;
 		try {
 			inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
 			workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
@@ -218,6 +224,8 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
 			sheetVoltageList = workbook.getSheetAt(2);//架空导线计算表
 
 			sheetVoltageList = workbook.getSheetAt(3);//电缆分段表
+
+			sheetInventoryList = workbook.getSheetAt(4);//拆旧材料清单计算表
 		} catch (Exception e1) {
 			e1.printStackTrace();
 		}
@@ -231,6 +239,8 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
 			RaiseCapitalDesignExportUtil.getSheetVoltageList(sheetVoltageList,voltageData,newRaise,workbook);//架空导线计算表
 
 			RaiseCapitalDesignExportUtil.getSheetCableList(sheetVoltageList,cableSectionData,newRaise,workbook);//电缆分段表
+
+			RaiseCapitalDesignExportUtil.getSheetInventoryList(sheetInventoryList,inventoryData,newRaise,workbook);//拆旧材料清单计算表
             showListMapper.trunCate(projectName);
 			workbook.write(fos);
 			fos.flush();

+ 176 - 3
src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/utils/RaiseCapitalDesignExportUtil.java

@@ -11,6 +11,8 @@ import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
 import com.jeeplus.modules.sg.raiseCapital.entity.RaiseCapital;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionData;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.InventoryData;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.InventoryInfo;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageData;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
@@ -427,6 +429,150 @@ public class RaiseCapitalDesignExportUtil {
             }
         }
     }
+    //拆旧材料清单计算表
+    public static void getSheetInventoryList(Sheet sheet, InventoryData inventoryData, RaiseCapital raiseCapital, Workbook workbook) {
+        if (sheet != null) {
+            CellStyle style = getCellStyleFont(workbook);
+            CellStyle cellStyle = getCellStyle(workbook);
+
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(0);
+
+            List<InventoryInfo> inventoryList = inventoryData.getInventoryList();
+
+            for (InventoryInfo inventoryInfo : inventoryList) {
+                if (inventoryInfo.getName().equals("10kV电力电缆")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "YJV22-8.7/15-3&times;400":
+                            disposeinventoryRowData(1,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "YJV22-8.7/15-3&times;300":
+                            disposeinventoryRowData(2,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "YJV22-8.7/15-3&times;95":
+                            disposeinventoryRowData(3,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "YJV22-8.7/15-3&times;35":
+                            disposeinventoryRowData(4,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV架空导线")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "JKLYJ-240":
+                            disposeinventoryRowData(5,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "JKLYJ-185":
+                            disposeinventoryRowData(6,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "JKLYJ-150":
+                            disposeinventoryRowData(7,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "LGJ-240":
+                            disposeinventoryRowData(8,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "LGJ-185":
+                            disposeinventoryRowData(9,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "LGJ-150":
+                            disposeinventoryRowData(10,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV电杆")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "钢管杆":
+                            disposeinventoryRowData(11,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "宅基塔":
+                            disposeinventoryRowData(12,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "&Phi;190&times;15":
+                            disposeinventoryRowData(13,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "&Phi;190&times;12":
+                            disposeinventoryRowData(14,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV电缆分支箱")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "1进1出":
+                            disposeinventoryRowData(15,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "1进2出":
+                            disposeinventoryRowData(16,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "1进3出":
+                            disposeinventoryRowData(17,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV电缆环网柜")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "2进2出":
+                            disposeinventoryRowData(18,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "2进3出":
+                            disposeinventoryRowData(19,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV变压器")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "50kVA":
+                            disposeinventoryRowData(20,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "315kVA":
+                            disposeinventoryRowData(21,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("10kV柱上设备")){
+                    switch (inventoryInfo.getSpecifications()){
+                        case "断路器开关":
+                            disposeinventoryRowData(22,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "SF6开关":
+                            disposeinventoryRowData(23,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "熔断器":
+                            disposeinventoryRowData(24,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+                if (inventoryInfo.getName().equals("0.4kV电气设备")){
+                    if (inventoryInfo.getSpecifications().equals("低压综合配电箱")){
+                        switch (inventoryInfo.getCompany()){
+                            case "套":
+                                disposeinventoryRowData(25,sheet,inventoryInfo,cellStyle);
+                                break;
+                            case "面":
+                                disposeinventoryRowData(26,sheet,inventoryInfo,cellStyle);
+                                break;
+                        }
+                    }
+                }
+                if (inventoryInfo.getName().equals("0.4kV电缆")){
+                    disposeinventoryRowData(27,sheet,inventoryInfo,cellStyle);
+                }
+                if (inventoryInfo.getName().equals("铁附件")){
+                    disposeinventoryRowData(28,sheet,inventoryInfo,cellStyle);
+                }
+                if (inventoryInfo.getName().equals("10kV箱变")){
+                    switch (inventoryInfo.getNum()){
+                        case "11":
+                            disposeinventoryRowData(29,sheet,inventoryInfo,cellStyle);
+                            break;
+                        case "12":
+                            disposeinventoryRowData(30,sheet,inventoryInfo,cellStyle);
+                            break;
+                    }
+                }
+
+            }
+        }
+    }
 
     /**
      * 架空导线表数据处理
@@ -453,7 +599,7 @@ public class RaiseCapitalDesignExportUtil {
         } else {
             cell = row.getCell(2);
         }
-        cell.setCellValue(voltageInfo.getDoubleCircuitPath());//双回路路径
+        cell.setCellValue(voltageInfo.getDoubleCircuitPath());//物料名称
 
         //第四列
         if (row.getCell(3) == null) {
@@ -462,11 +608,38 @@ public class RaiseCapitalDesignExportUtil {
             cell = row.getCell(3);
         }
         if(StringUtils.isNotBlank(voltageInfo.getSingleLong())){
-            cell.setCellValue(voltageInfo.getSingleLong());//单线长
+            cell.setCellValue(voltageInfo.getSingleLong());//扩展描述
+        }else{
+            cell.setCellValue("0");//扩展描述
+        }
+
+    }
+
+    private static void disposeinventoryRowData(Integer rowLineNumber, Sheet sheet, InventoryInfo inventoryInfo, CellStyle cellStyle){
+
+        XSSFRow row = (XSSFRow) sheet.getRow(rowLineNumber);
+        XSSFCell cell = row.getCell(1);
+        //第二列
+        if (row.getCell(4) == null) {
+            cell = row.getCell(4);
+        } else {
+            cell = row.getCell(4);
+        }
+        cell.setCellValue(inventoryInfo.getQuantity());//数量
+
+        //第三列
+        if (row.getCell(5) == null) {
+            cell = row.getCell(5);
+        } else {
+            cell = row.getCell(5);
+        }
+        if(StringUtils.isNotBlank(inventoryInfo.getRemarks())){
+            cell.setCellValue(inventoryInfo.getRemarks());//备注
         }else{
-            cell.setCellValue("0");//单线长
+            cell.setCellValue("");//备注
         }
 
+
     }