|
@@ -1,5 +1,6 @@
|
|
package com.jeeplus.modules.sg.raiseCapitalDesign.utils;
|
|
package com.jeeplus.modules.sg.raiseCapitalDesign.utils;
|
|
|
|
|
|
|
|
+import com.jeeplus.common.utils.StringUtils;
|
|
import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
|
|
import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
|
|
import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtilCalculate;
|
|
import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtilCalculate;
|
|
import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
|
|
import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
|
|
@@ -8,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.PickList;
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
|
|
import com.jeeplus.modules.sg.raiseCapital.entity.RaiseCapital;
|
|
import com.jeeplus.modules.sg.raiseCapital.entity.RaiseCapital;
|
|
|
|
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageData;
|
|
|
|
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
@@ -288,7 +291,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
for (int i = 0; i < showLists.size(); i++) {
|
|
for (int i = 0; i < showLists.size(); i++) {
|
|
showList = showLists.get(i);
|
|
showList = showLists.get(i);
|
|
row = (XSSFRow) sheet.createRow((int) i + 6);
|
|
row = (XSSFRow) sheet.createRow((int) i + 6);
|
|
- //第一行
|
|
|
|
|
|
+ //第一列
|
|
if (row.getCell(0) == null) {
|
|
if (row.getCell(0) == null) {
|
|
cell = row.createCell(0);
|
|
cell = row.createCell(0);
|
|
} else {
|
|
} else {
|
|
@@ -297,7 +300,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellValue(i + 1);
|
|
cell.setCellValue(i + 1);
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
- //第二行
|
|
|
|
|
|
+ //第二列
|
|
if (row.getCell(1) == null) {
|
|
if (row.getCell(1) == null) {
|
|
cell = row.createCell(1);
|
|
cell = row.createCell(1);
|
|
} else {
|
|
} else {
|
|
@@ -306,7 +309,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellValue(showList.getMaterialCode());//物料编码
|
|
cell.setCellValue(showList.getMaterialCode());//物料编码
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
- //第三行
|
|
|
|
|
|
+ //第三列
|
|
if (row.getCell(2) == null) {
|
|
if (row.getCell(2) == null) {
|
|
cell = row.createCell(2);
|
|
cell = row.createCell(2);
|
|
} else {
|
|
} else {
|
|
@@ -316,7 +319,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
|
|
|
|
- //第四行
|
|
|
|
|
|
+ //第四列
|
|
if (row.getCell(3) == null) {
|
|
if (row.getCell(3) == null) {
|
|
cell = row.createCell(3);
|
|
cell = row.createCell(3);
|
|
} else {
|
|
} else {
|
|
@@ -326,7 +329,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
|
|
|
|
- //第五行
|
|
|
|
|
|
+ //第五列
|
|
if (row.getCell(4) == null) {
|
|
if (row.getCell(4) == null) {
|
|
cell = row.createCell(4);
|
|
cell = row.createCell(4);
|
|
} else {
|
|
} else {
|
|
@@ -335,7 +338,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellValue(showList.getMdUnits());//单位
|
|
cell.setCellValue(showList.getMdUnits());//单位
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
- //第六行
|
|
|
|
|
|
+ //第六列
|
|
if (row.getCell(5) == null) {
|
|
if (row.getCell(5) == null) {
|
|
cell = row.createCell(5);
|
|
cell = row.createCell(5);
|
|
} else {
|
|
} else {
|
|
@@ -344,7 +347,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellValue(showList.getMdTotalAmount());//总量
|
|
cell.setCellValue(showList.getMdTotalAmount());//总量
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
- //第七行
|
|
|
|
|
|
+ //第七列
|
|
if (row.getCell(6) == null) {
|
|
if (row.getCell(6) == null) {
|
|
cell = row.createCell(6);
|
|
cell = row.createCell(6);
|
|
} else {
|
|
} else {
|
|
@@ -353,7 +356,7 @@ public class RaiseCapitalDesignExportUtil {
|
|
cell.setCellValue(showList.getMdSingleWeight());//单重
|
|
cell.setCellValue(showList.getMdSingleWeight());//单重
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
- //第8行
|
|
|
|
|
|
+ //第8列
|
|
if (row.getCell(7) == null) {
|
|
if (row.getCell(7) == null) {
|
|
cell = row.createCell(7);
|
|
cell = row.createCell(7);
|
|
} else {
|
|
} else {
|
|
@@ -366,6 +369,96 @@ public class RaiseCapitalDesignExportUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //架空导线计算表
|
|
|
|
+ public static void getSheetVoltageList(Sheet sheet, VoltageData voltageData, 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<VoltageInfo> highVoltageList = voltageData.getHighVoltageList();
|
|
|
|
+ List<VoltageInfo> lowVoltageList = voltageData.getLowVoltageList();
|
|
|
|
+
|
|
|
|
+ for (VoltageInfo highVoltage : highVoltageList) {
|
|
|
|
+ switch (highVoltage.getVoltageName()){
|
|
|
|
+ case "JKLYJ-10/240":
|
|
|
|
+ disposeRowData(2,sheet,highVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKLYJ-10/150":
|
|
|
|
+ disposeRowData(3,sheet,highVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKLYJ-10/50":
|
|
|
|
+ disposeRowData(4,sheet,highVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (VoltageInfo lowVoltage : lowVoltageList) {
|
|
|
|
+ switch (lowVoltage.getVoltageName()){
|
|
|
|
+ case "JKLYJ-120":
|
|
|
|
+ disposeRowData(6,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKLYJ-70":
|
|
|
|
+ disposeRowData(7,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKLGYJ-120/20":
|
|
|
|
+ disposeRowData(8,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKYJ-120":
|
|
|
|
+ disposeRowData(9,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKYJ-70":
|
|
|
|
+ disposeRowData(10,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKYJ-35":
|
|
|
|
+ disposeRowData(11,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ case "JKYJ-16":
|
|
|
|
+ disposeRowData(12,sheet,lowVoltage,cellStyle);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void disposeRowData(Integer rowLineNumber, Sheet sheet, VoltageInfo voltageInfo, CellStyle cellStyle){
|
|
|
|
+
|
|
|
|
+ XSSFRow row = (XSSFRow) sheet.getRow(rowLineNumber);
|
|
|
|
+ XSSFCell cell = row.getCell(1);
|
|
|
|
+ //第二列
|
|
|
|
+ if (row.getCell(1) == null) {
|
|
|
|
+ cell = row.getCell(1);
|
|
|
|
+ } else {
|
|
|
|
+ cell = row.getCell(1);
|
|
|
|
+ }
|
|
|
|
+ cell.setCellValue(voltageInfo.getSingleCircuitPath());//物料编码
|
|
|
|
+
|
|
|
|
+ //第三列
|
|
|
|
+ if (row.getCell(2) == null) {
|
|
|
|
+ cell = row.getCell(2);
|
|
|
|
+ } else {
|
|
|
|
+ cell = row.getCell(2);
|
|
|
|
+ }
|
|
|
|
+ cell.setCellValue(voltageInfo.getDoubleCircuitPath());//物料名称
|
|
|
|
+
|
|
|
|
+ //第四列
|
|
|
|
+ if (row.getCell(3) == null) {
|
|
|
|
+ cell = row.getCell(3);
|
|
|
|
+ } else {
|
|
|
|
+ cell = row.getCell(3);
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(voltageInfo.getSingleLong())){
|
|
|
|
+ cell.setCellValue(voltageInfo.getSingleLong());//扩展描述
|
|
|
|
+ }else{
|
|
|
|
+ cell.setCellValue("0");//扩展描述
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
//设置 字体边框
|
|
//设置 字体边框
|
|
public static CellStyle getCellStyleFont(Workbook workbook) {
|
|
public static CellStyle getCellStyleFont(Workbook workbook) {
|
|
XSSFFont font = (XSSFFont) workbook.createFont();
|
|
XSSFFont font = (XSSFFont) workbook.createFont();
|