|
@@ -54,11 +54,27 @@ public class ExportUtil {
|
|
XSSFRow row5 = (XSSFRow) sheet.getRow(21);
|
|
XSSFRow row5 = (XSSFRow) sheet.getRow(21);
|
|
XSSFCell cell5 = getViewCell(row5,0);;//财务负责人及编制人
|
|
XSSFCell cell5 = getViewCell(row5,0);;//财务负责人及编制人
|
|
|
|
|
|
|
|
+ int largestYear = 0;
|
|
|
|
+ String largestYearStr = "";
|
|
|
|
+ for(ErpCredit erpCredit:erpCredits){
|
|
|
|
+ if(largestYearStr.equals("")){
|
|
|
|
+ largestYearStr = erpCredit.getItemId().substring(6,8);
|
|
|
|
+ largestYear = Integer.parseInt(largestYearStr);
|
|
|
|
+ }else{
|
|
|
|
+ String tempYearStr = erpCredit.getItemId().substring(6,8);
|
|
|
|
+ int tempYear = Integer.parseInt(largestYearStr);
|
|
|
|
+ if(tempYear > largestYear){
|
|
|
|
+ largestYearStr = tempYearStr;
|
|
|
|
+ largestYear = tempYear;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if("L010010501".equals(profitCenter)){
|
|
if("L010010501".equals(profitCenter)){
|
|
cell1.setCellValue("国网江苏省电力有限公司常州供电分公司");
|
|
cell1.setCellValue("国网江苏省电力有限公司常州供电分公司");
|
|
cell5.setCellValue("财务负责人:贺雪霞 编制人: 王勇");
|
|
cell5.setCellValue("财务负责人:贺雪霞 编制人: 王勇");
|
|
|
|
|
|
- String proName = "20"+projectDefinitionCode.substring(6,8)+"年国网江苏省电力有限公司常州供电分公司配网"
|
|
|
|
|
|
+ String proName = "20"+largestYearStr+"年国网江苏省电力有限公司常州供电分公司配网"
|
|
+erpCredits.size()+"个项目";
|
|
+erpCredits.size()+"个项目";
|
|
cell3.setCellValue(proName);
|
|
cell3.setCellValue(proName);
|
|
}else{
|
|
}else{
|
|
@@ -67,7 +83,7 @@ public class ExportUtil {
|
|
String fileName = "20"+projectDefinitionCode.substring(6,8)+"年配网改造工程项目竣工决算报告";
|
|
String fileName = "20"+projectDefinitionCode.substring(6,8)+"年配网改造工程项目竣工决算报告";
|
|
cell2.setCellValue(fileName);
|
|
cell2.setCellValue(fileName);
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
- String submitDate = "报送日期:"+cal.get(Calendar.YEAR)+"年"+(cal.get(Calendar.MINUTE)+1)+"月";
|
|
|
|
|
|
+ String submitDate = "报送日期:"+cal.get(Calendar.YEAR)+"年"+(cal.get(Calendar.MONTH)+1)+"月";
|
|
cell4.setCellValue(submitDate);
|
|
cell4.setCellValue(submitDate);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -79,7 +95,7 @@ public class ExportUtil {
|
|
* @param erpCredits
|
|
* @param erpCredits
|
|
* @param maintainDataList
|
|
* @param maintainDataList
|
|
*/
|
|
*/
|
|
- public static void getSheetOverView(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
|
|
|
|
|
|
+ public static void getSheetOverView(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList,Schedule schedule){
|
|
if (sheet!=null) {
|
|
if (sheet!=null) {
|
|
GeneralSituation generalSituation = ExportUtilCalculate.getFeneraSituation(erpCredits, maintainDataList);
|
|
GeneralSituation generalSituation = ExportUtilCalculate.getFeneraSituation(erpCredits, maintainDataList);
|
|
XSSFRow row = (XSSFRow) sheet.getRow(6);
|
|
XSSFRow row = (XSSFRow) sheet.getRow(6);
|
|
@@ -99,6 +115,10 @@ public class ExportUtil {
|
|
cell.setCellValue(generalSituation.getDesignUnit());
|
|
cell.setCellValue(generalSituation.getDesignUnit());
|
|
|
|
|
|
row = (XSSFRow) sheet.getRow(5);
|
|
row = (XSSFRow) sheet.getRow(5);
|
|
|
|
+ cell = row.getCell(1);//建设地址
|
|
|
|
+ if("L010010501".equals(erpCredits.get(0).getProfitCenter())){
|
|
|
|
+ cell.setCellValue("国网江苏省电力有限公司常州供电分公司");
|
|
|
|
+ }
|
|
cell = row.getCell(6);//施工单位
|
|
cell = row.getCell(6);//施工单位
|
|
cell.setCellValue(generalSituation.getBuildUnit());
|
|
cell.setCellValue(generalSituation.getBuildUnit());
|
|
|
|
|
|
@@ -127,20 +147,26 @@ public class ExportUtil {
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getInvestmentBudget()));
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getInvestmentBudget()));
|
|
setCellDoubleValue(cell, generalSituation.getInvestmentBudget());
|
|
setCellDoubleValue(cell, generalSituation.getInvestmentBudget());
|
|
|
|
|
|
|
|
+
|
|
|
|
+ String totalSum = schedule.getActualTotalFee();
|
|
|
|
+
|
|
row = (XSSFRow) sheet.getRow(13);
|
|
row = (XSSFRow) sheet.getRow(13);
|
|
cell = row.getCell(7);
|
|
cell = row.getCell(7);
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getActualInvestment()));//实际投资
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getActualInvestment()));//实际投资
|
|
- setCellDoubleValue(cell, generalSituation.getActualInvestment());
|
|
|
|
|
|
+// setCellDoubleValue(cell, generalSituation.getActualInvestment());
|
|
|
|
+ setCellDoubleValue(cell, totalSum);
|
|
|
|
|
|
row = (XSSFRow) sheet.getRow(14);
|
|
row = (XSSFRow) sheet.getRow(14);
|
|
cell = row.getCell(7);
|
|
cell = row.getCell(7);
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getTransferAssets()));
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getTransferAssets()));
|
|
- setCellDoubleValue(cell, generalSituation.getTransferAssets());
|
|
|
|
|
|
+// setCellDoubleValue(cell, generalSituation.getTransferAssets());
|
|
|
|
+ setCellDoubleValue(cell, totalSum);
|
|
|
|
|
|
row = (XSSFRow) sheet.getRow(16);
|
|
row = (XSSFRow) sheet.getRow(16);
|
|
cell = row.getCell(7);
|
|
cell = row.getCell(7);
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getHasItsOwn()));
|
|
// cell.setCellValue(Double.parseDouble(generalSituation.getHasItsOwn()));
|
|
- setCellDoubleValue(cell, generalSituation.getHasItsOwn());
|
|
|
|
|
|
+// setCellDoubleValue(cell, generalSituation.getHasItsOwn());
|
|
|
|
+ setCellDoubleValue(cell,totalSum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -151,7 +177,8 @@ public class ExportUtil {
|
|
* @param maintainDataList
|
|
* @param maintainDataList
|
|
* @param workbook
|
|
* @param workbook
|
|
*/
|
|
*/
|
|
- public static void getSheetView(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList,Workbook workbook){
|
|
|
|
|
|
+ public static Schedule getSheetView(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList,Workbook workbook){
|
|
|
|
+ Schedule lastOne = null;
|
|
if (sheet!=null){
|
|
if (sheet!=null){
|
|
CellStyle cellStyleFont = getCellStyleFont(workbook);
|
|
CellStyle cellStyleFont = getCellStyleFont(workbook);
|
|
CellStyle cellStyle = getCellStyle(workbook);
|
|
CellStyle cellStyle = getCellStyle(workbook);
|
|
@@ -165,6 +192,9 @@ public class ExportUtil {
|
|
for (int i = 0; i <scheduleList.size(); i++) {
|
|
for (int i = 0; i <scheduleList.size(); i++) {
|
|
int total = scheduleList.size()-1;//总数据条数
|
|
int total = scheduleList.size()-1;//总数据条数
|
|
schedule = scheduleList.get(i);
|
|
schedule = scheduleList.get(i);
|
|
|
|
+ if(i == total){
|
|
|
|
+ lastOne = schedule;
|
|
|
|
+ }
|
|
row=(XSSFRow)sheet.createRow(i+6);
|
|
row=(XSSFRow)sheet.createRow(i+6);
|
|
cell = getViewCell(row,0,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,0,i,total,cellStyle,cellStyleFont);
|
|
cell.setCellValue(i+1);//序号
|
|
cell.setCellValue(i+1);//序号
|
|
@@ -204,18 +234,19 @@ public class ExportUtil {
|
|
setCellDoubleValue(cell, schedule.getActualBuildProject());
|
|
setCellDoubleValue(cell, schedule.getActualBuildProject());
|
|
|
|
|
|
cell = getViewCell(row,10,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,10,i,total,cellStyle,cellStyleFont);
|
|
- String actualIntallProject = schedule.getActualIntallProject();
|
|
|
|
- String actualEquipmentValue = schedule.getActualEquipmentValue();
|
|
|
|
- if (null == actualIntallProject || "".equals(actualIntallProject)) {
|
|
|
|
- actualIntallProject = "0.0";
|
|
|
|
- }
|
|
|
|
- if (null == actualEquipmentValue || "".equals(actualEquipmentValue)) {
|
|
|
|
- actualEquipmentValue = "0.0";
|
|
|
|
- }
|
|
|
|
- BigDecimal all = new BigDecimal(actualIntallProject);
|
|
|
|
- BigDecimal mul = new BigDecimal(actualEquipmentValue);
|
|
|
|
- BigDecimal bigDecimal = all.subtract(mul);
|
|
|
|
- cell.setCellValue(bigDecimal.doubleValue());//安装工程实际
|
|
|
|
|
|
+ setCellDoubleValue(cell, schedule.getActualIntallProject());
|
|
|
|
+// String actualIntallProject = schedule.getActualIntallProject();
|
|
|
|
+// String actualEquipmentValue = schedule.getActualEquipmentValue();
|
|
|
|
+// if (null == actualIntallProject || "".equals(actualIntallProject)) {
|
|
|
|
+// actualIntallProject = "0.0";
|
|
|
|
+// }
|
|
|
|
+// if (null == actualEquipmentValue || "".equals(actualEquipmentValue)) {
|
|
|
|
+// actualEquipmentValue = "0.0";
|
|
|
|
+// }
|
|
|
|
+// BigDecimal all = new BigDecimal(actualIntallProject);
|
|
|
|
+// BigDecimal mul = new BigDecimal(actualEquipmentValue);
|
|
|
|
+// BigDecimal bigDecimal = all.subtract(mul);
|
|
|
|
+// cell.setCellValue(bigDecimal.doubleValue());//安装工程实际
|
|
|
|
|
|
cell = getViewCell(row,11,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,11,i,total,cellStyle,cellStyleFont);
|
|
// cell.setCellValue(Double.parseDouble(schedule.getActualEquipmentValue()));//设备价值实际
|
|
// cell.setCellValue(Double.parseDouble(schedule.getActualEquipmentValue()));//设备价值实际
|
|
@@ -226,13 +257,14 @@ public class ExportUtil {
|
|
setCellDoubleValue(cell, schedule.getActualOtherFee());
|
|
setCellDoubleValue(cell, schedule.getActualOtherFee());
|
|
|
|
|
|
cell = getViewCell(row,13,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,13,i,total,cellStyle,cellStyleFont);
|
|
- String actualTotalFee = schedule.getActualTotalFee();
|
|
|
|
- if (null == actualTotalFee || "".equals(actualTotalFee)) {
|
|
|
|
- actualTotalFee = "0.0";
|
|
|
|
- }
|
|
|
|
- BigDecimal actual = new BigDecimal(actualTotalFee);
|
|
|
|
- BigDecimal subtract = actual.subtract(mul);
|
|
|
|
- cell.setCellValue(subtract.doubleValue());//合计实际
|
|
|
|
|
|
+ setCellDoubleValue(cell, schedule.getActualTotalFee());
|
|
|
|
+// String actualTotalFee = schedule.getActualTotalFee();
|
|
|
|
+// if (null == actualTotalFee || "".equals(actualTotalFee)) {
|
|
|
|
+// actualTotalFee = "0.0";
|
|
|
|
+// }
|
|
|
|
+// BigDecimal actual = new BigDecimal(actualTotalFee);
|
|
|
|
+// BigDecimal subtract = actual.subtract(mul);
|
|
|
|
+// cell.setCellValue(subtract.doubleValue());//合计实际
|
|
|
|
|
|
|
|
|
|
cell = getViewCell(row,14,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,14,i,total,cellStyle,cellStyleFont);
|
|
@@ -244,26 +276,28 @@ public class ExportUtil {
|
|
if (null != listDeduction && !"".equals(listDeduction)) {
|
|
if (null != listDeduction && !"".equals(listDeduction)) {
|
|
allDecimal = new BigDecimal(listDeduction);
|
|
allDecimal = new BigDecimal(listDeduction);
|
|
}
|
|
}
|
|
- BigDecimal add = allDecimal.add(subtract);
|
|
|
|
|
|
+ BigDecimal add = allDecimal.add(new BigDecimal(schedule.getActualTotalFee()));
|
|
|
|
|
|
cell = getViewCell(row,15,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,15,i,total,cellStyle,cellStyleFont);
|
|
cell.setCellValue(add.doubleValue());//实际含税投资合计
|
|
cell.setCellValue(add.doubleValue());//实际含税投资合计
|
|
|
|
|
|
|
|
|
|
cell = getViewCell(row,16,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,16,i,total,cellStyle,cellStyleFont);
|
|
- String addSubtractionLines = schedule.getAddSubtractionLines();
|
|
|
|
- if (null == addSubtractionLines || "".equals(addSubtractionLines)) {
|
|
|
|
- addSubtractionLines = "0.0";
|
|
|
|
- }
|
|
|
|
- BigDecimal addSub = new BigDecimal(addSubtractionLines);
|
|
|
|
- BigDecimal decimal = addSub.subtract(mul);
|
|
|
|
- cell.setCellValue(decimal.doubleValue()); //增减额
|
|
|
|
|
|
+ setCellDoubleValue(cell, schedule.getAddSubtractionLines());
|
|
|
|
+// String addSubtractionLines = schedule.getAddSubtractionLines();
|
|
|
|
+// if (null == addSubtractionLines || "".equals(addSubtractionLines)) {
|
|
|
|
+// addSubtractionLines = "0.0";
|
|
|
|
+// }
|
|
|
|
+// BigDecimal addSub = new BigDecimal(addSubtractionLines);
|
|
|
|
+// BigDecimal decimal = addSub.subtract(mul);
|
|
|
|
+// cell.setCellValue(decimal.doubleValue()); //增减额
|
|
|
|
|
|
cell = getViewCell(row,17,i,total,cellStyle,cellStyleFont);
|
|
cell = getViewCell(row,17,i,total,cellStyle,cellStyleFont);
|
|
// cell.setCellValue(Double.parseDouble(schedule.getAddSubtractionRate()));//增减率
|
|
// cell.setCellValue(Double.parseDouble(schedule.getAddSubtractionRate()));//增减率
|
|
setCellDoubleValue(cell, schedule.getAddSubtractionRate());
|
|
setCellDoubleValue(cell, schedule.getAddSubtractionRate());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ return lastOne;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -355,7 +389,7 @@ public class ExportUtil {
|
|
XSSFRow row = (XSSFRow) sheet.createRow(2);
|
|
XSSFRow row = (XSSFRow) sheet.createRow(2);
|
|
XSSFCell cell = getViewCell(row,0);//编制单位
|
|
XSSFCell cell = getViewCell(row,0);//编制单位
|
|
cell.setCellValue(getCompany(erpCredits));
|
|
cell.setCellValue(getCompany(erpCredits));
|
|
- cell = getViewCell(row,10);//编制日期
|
|
|
|
|
|
+ cell = getViewCell(row,7);//编制日期
|
|
cell.setCellValue(getCurrentDate());
|
|
cell.setCellValue(getCurrentDate());
|
|
List<OtherExpenses> otherList = ExportUtilCalculate.getOtherExpenses(erpCredits, maintainDataList);
|
|
List<OtherExpenses> otherList = ExportUtilCalculate.getOtherExpenses(erpCredits, maintainDataList);
|
|
for (int i = 0; i <otherList.size(); i++) {
|
|
for (int i = 0; i <otherList.size(); i++) {
|
|
@@ -1059,7 +1093,7 @@ public class ExportUtil {
|
|
*/
|
|
*/
|
|
public static String getCurrentDate(){
|
|
public static String getCurrentDate(){
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
- return "编制日期:"+calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)
|
|
|
|
|
|
+ return "编制日期:"+calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)
|
|
+"月"+calendar.get(Calendar.DATE)+"日";
|
|
+"月"+calendar.get(Calendar.DATE)+"日";
|
|
}
|
|
}
|
|
|
|
|