|
@@ -9,6 +9,8 @@ import com.jeeplus.modules.sg.picking.activiti.entity.MdTheClass;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.PickList;
|
|
|
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.VoltageData;
|
|
|
import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
@@ -23,6 +25,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -425,6 +428,13 @@ public class RaiseCapitalDesignExportUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 架空导线表数据处理
|
|
|
+ * @param rowLineNumber
|
|
|
+ * @param sheet
|
|
|
+ * @param voltageInfo
|
|
|
+ * @param cellStyle
|
|
|
+ */
|
|
|
private static void disposeRowData(Integer rowLineNumber, Sheet sheet, VoltageInfo voltageInfo, CellStyle cellStyle){
|
|
|
|
|
|
XSSFRow row = (XSSFRow) sheet.getRow(rowLineNumber);
|
|
@@ -435,7 +445,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
|
} else {
|
|
|
cell = row.getCell(1);
|
|
|
}
|
|
|
- cell.setCellValue(voltageInfo.getSingleCircuitPath());//物料编码
|
|
|
+ cell.setCellValue(voltageInfo.getSingleCircuitPath());//单回路路径
|
|
|
|
|
|
//第三列
|
|
|
if (row.getCell(2) == null) {
|
|
@@ -443,7 +453,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
|
} else {
|
|
|
cell = row.getCell(2);
|
|
|
}
|
|
|
- cell.setCellValue(voltageInfo.getDoubleCircuitPath());//物料名称
|
|
|
+ cell.setCellValue(voltageInfo.getDoubleCircuitPath());//双回路路径
|
|
|
|
|
|
//第四列
|
|
|
if (row.getCell(3) == null) {
|
|
@@ -452,13 +462,174 @@ public class RaiseCapitalDesignExportUtil {
|
|
|
cell = row.getCell(3);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(voltageInfo.getSingleLong())){
|
|
|
- cell.setCellValue(voltageInfo.getSingleLong());//扩展描述
|
|
|
+ cell.setCellValue(voltageInfo.getSingleLong());//单线长
|
|
|
}else{
|
|
|
- cell.setCellValue("0");//扩展描述
|
|
|
+ cell.setCellValue("0");//单线长
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 电缆分段表
|
|
|
+ * @param sheet
|
|
|
+ * @param cableSectionData
|
|
|
+ * @param raiseCapital
|
|
|
+ * @param workbook
|
|
|
+ */
|
|
|
+ public static void getSheetCableList(Sheet sheet, CableSectionData cableSectionData, 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<CableSectionInfo> cableFourHundredList = cableSectionData.getCableFourHundredList(); //YJV22-3×400mm²
|
|
|
+ List<CableSectionInfo> cableThreeHundredList = cableSectionData.getCableThreeHundredList(); //YJV22-3×300mm²
|
|
|
+ List<CableSectionInfo> cableTwoHundredFortyList = cableSectionData.getCableTwoHundredFortyList(); //YJV22-3×240mm²
|
|
|
+ List<CableSectionInfo> cableHundredAndTwentyList = cableSectionData.getCableHundredAndTwentyList(); //YJV22-3×120mm²
|
|
|
+ List<CableSectionInfo> cableSeventyList = cableSectionData.getCableSeventyList(); //YJV22-3×70mm²
|
|
|
+ //将五个list的长度进行排序
|
|
|
+ int[] a=new int[]{cableFourHundredList.size(),cableThreeHundredList.size(),cableTwoHundredFortyList.size(),cableHundredAndTwentyList.size(),cableSeventyList.size()};
|
|
|
+ //将数组按小到大的顺序排列,最后的一个为最大值
|
|
|
+ Arrays.sort(a);
|
|
|
+ //获取最大的一个list长度,作为最终的行号
|
|
|
+ int num=a[a.length-1];
|
|
|
+
|
|
|
+ for (int i = 1; i <= num; i++) {
|
|
|
+ row = (XSSFRow) sheet.createRow((int) i + 1);
|
|
|
+ CableSectionInfo cableFourHundred = null; //3×400mm²
|
|
|
+ if(cableFourHundredList.size()>=i){
|
|
|
+ cableFourHundred = cableFourHundredList.get(i-1);
|
|
|
+ //对数据进行处理
|
|
|
+ disposeCableRowData(row,0,cableFourHundred,cellStyle);
|
|
|
+ }
|
|
|
+ CableSectionInfo cableThreeHundred = null; //3×300mm²
|
|
|
+ if(cableThreeHundredList.size()>=i){
|
|
|
+ cableThreeHundred = cableThreeHundredList.get(i-1);
|
|
|
+ disposeCableRowData(row,8,cableThreeHundred,cellStyle);
|
|
|
+ }
|
|
|
+ CableSectionInfo cableTwoHundredForty = null; //3×240mm²
|
|
|
+ if(cableTwoHundredFortyList.size()>=i){
|
|
|
+ cableTwoHundredForty = cableTwoHundredFortyList.get(i-1);
|
|
|
+ disposeCableRowData(row,16,cableTwoHundredForty,cellStyle);
|
|
|
+ }
|
|
|
+ CableSectionInfo cableHundredAndTwenty = null; //3×120mm²
|
|
|
+ if(cableHundredAndTwentyList.size()>=i){
|
|
|
+ cableHundredAndTwenty = cableHundredAndTwentyList.get(i-1);
|
|
|
+ disposeCableRowData(row,24,cableHundredAndTwenty,cellStyle);
|
|
|
+ }
|
|
|
+ CableSectionInfo cableSeventy = null; //3×70mm²
|
|
|
+ if(cableSeventyList.size()>=i){
|
|
|
+ cableSeventy = cableSeventyList.get(i-1);
|
|
|
+ disposeCableRowData(row,32,cableSeventy,cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 架空导线表数据处理
|
|
|
+ * @param row
|
|
|
+ * @param columnNum
|
|
|
+ * @param cableData
|
|
|
+ * @param cellStyle
|
|
|
+ */
|
|
|
+ private static void disposeCableRowData(XSSFRow row, Integer columnNum, CableSectionInfo cableData, CellStyle cellStyle){
|
|
|
+
|
|
|
+ XSSFCell cell = row.getCell(1);
|
|
|
+ //第一列
|
|
|
+ if (row.getCell(columnNum) == null) {
|
|
|
+ cell = row.createCell(columnNum);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getDestination());//400起讫点
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第二列
|
|
|
+ if (row.getCell(columnNum+1) == null) {
|
|
|
+ cell = row.createCell(columnNum+1);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+1);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getPathLength());//400路径长(m)
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第三列
|
|
|
+ if (row.getCell(columnNum+2) == null) {
|
|
|
+ cell = row.createCell(columnNum+2);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+2);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getUpperRod());//400上杆(m)
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第四列
|
|
|
+ if (row.getCell(columnNum+3) == null) {
|
|
|
+ cell = row.createCell(columnNum+3);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+3);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getArrival());//400进站(m)
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第五列
|
|
|
+ if (row.getCell(columnNum+4) == null) {
|
|
|
+ cell = row.createCell(columnNum+4);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+4);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getIncomingEquipment());//400进设备(m)
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第六列
|
|
|
+ if (row.getCell(columnNum+5) == null) {
|
|
|
+ cell = row.createCell(columnNum+5);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+5);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getCoefficient());//400系数
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第七列
|
|
|
+ if (row.getCell(columnNum+6) == null) {
|
|
|
+ cell = row.createCell(columnNum+6);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+6);
|
|
|
+ }
|
|
|
+ if(cableData != null){
|
|
|
+ cell.setCellValue(cableData.getElectricalChief());//400电气长(m)
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(null != columnNum && 32 != columnNum){
|
|
|
+ //第8列
|
|
|
+ if (row.getCell(columnNum+7) == null) {
|
|
|
+ cell = row.createCell(columnNum+7);
|
|
|
+ } else {
|
|
|
+ cell = row.getCell(columnNum+7);
|
|
|
+ }
|
|
|
+ cell.setCellValue("");//空行
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//设置 字体边框
|
|
|
public static CellStyle getCellStyleFont(Workbook workbook) {
|
|
|
XSSFFont font = (XSSFFont) workbook.createFont();
|