|
@@ -2247,37 +2247,37 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
List<ExcelTabVo1> excelTabs = jdbcTemplate.query(sqlForExcel, new BeanPropertyRowMapper<>(ExcelTabVo1.class));
|
|
|
|
|
|
ArrayList<ReportResult> reportResults = new ArrayList<>();
|
|
|
- //中期支付报表封面
|
|
|
+ //中期支付报表封面A1
|
|
|
Optional<ExcelTabVo1> excel = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876698961629186")).findFirst();
|
|
|
//String url = "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240828/3ee50ef54005c95bd724bcabae54058c.XLSX";
|
|
|
String url = excel.get().getFileUrl();
|
|
|
String htmlUrl=excel.get().getHtmlUrl();
|
|
|
- //中间支付审核表
|
|
|
+ //中间支付审核表A1
|
|
|
Optional<ExcelTabVo1> excel1 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876742800494593")).findFirst();
|
|
|
//String url1 = "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20241120/ea6c945827dd2990a9c7b1957fe201c4.XLSX";
|
|
|
String url1 = excel1.get().getFileUrl();
|
|
|
String htmlUrl1=excel1.get().getHtmlUrl();
|
|
|
- //补助款申请支付审核表
|
|
|
+ //补助款申请支付审核表A2
|
|
|
Optional<ExcelTabVo1> excel2 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876780238852097")).findFirst();
|
|
|
//String url2 = "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20241120/970eec0eb3cf3d215263a0e2f24c142e.xlsx";
|
|
|
String url2 = excel2.get().getFileUrl();
|
|
|
String htmlUrl2=excel2.get().getHtmlUrl();
|
|
|
- //中间计量支付证书
|
|
|
+ //中间计量支付证书A1
|
|
|
Optional<ExcelTabVo1> excel3 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876814359515138")).findFirst();
|
|
|
//String url3 = "https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240828/fb1110ae6aab7295759775206e5b44b8.XLSX";
|
|
|
String url3 = excel3.get().getFileUrl();
|
|
|
String htmlUrl3=excel3.get().getHtmlUrl();
|
|
|
- //中间计量支付申请表
|
|
|
+ //中间计量支付申请表A1
|
|
|
Optional<ExcelTabVo1> excel4 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876859939016705")).findFirst();
|
|
|
//String url4="https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240828/bff82dd0a1b7394f5fdab1322a3e6023.XLSX";
|
|
|
String url4=excel4.get().getFileUrl();
|
|
|
String htmlUrl4=excel4.get().getHtmlUrl();
|
|
|
- //工程支付月报
|
|
|
+ //工程支付月报A1
|
|
|
Optional<ExcelTabVo1> excel5 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876896593039362")).findFirst();
|
|
|
//String url5="https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240903/c8a5b424eace6c26b2edf9b9b33f088a.XLSX";
|
|
|
String url5=excel5.get().getFileUrl();
|
|
|
String htmlUrl5=excel5.get().getHtmlUrl();
|
|
|
- //清单支付报表
|
|
|
+ //清单支付报表A1
|
|
|
Optional<ExcelTabVo1> excel6 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876940398350338")).findFirst();
|
|
|
//String url6="https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20241120/e168f024c8055362664a276ad3721cb7.XLSX";
|
|
|
String url6=excel6.get().getFileUrl();
|
|
@@ -2331,9 +2331,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- //顶部项目名称
|
|
|
- Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
- a1.setCellValue(projectName);
|
|
|
+
|
|
|
//期号
|
|
|
String periodNumber = contractMeterPeriodNow.getPeriodNumber();
|
|
|
if(ObjectUtil.isNotEmpty(periodNumber) && periodNumber.contains("第")){
|
|
@@ -2343,6 +2341,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Cell d4 = getCellByAddress(sheet, "D4");
|
|
|
d4.setCellValue(periodNumber);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//日期
|
|
|
Cell c11 = getCellByAddress(sheet, "C11");
|
|
|
c11.setCellValue(endDate.toString());
|
|
@@ -2359,6 +2359,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Cell c10 = getCellByAddress(sheet, "C10");
|
|
|
c10.setCellStyle(cellStyle);
|
|
|
c10.setCellValue(contractInfo.getContractorUnitName());
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
+ a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(cellStyle);
|
|
|
+
|
|
|
}
|
|
|
dianqian(htmlUrl,sheet,workbook);
|
|
|
|
|
@@ -2476,13 +2481,14 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//底部日期
|
|
|
/*Cell f25 = getCellByAddress(sheet, "F25");
|
|
|
f25.setCellValue(endDate.toString());*/
|
|
|
- //顶部项目名称
|
|
|
- Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
- a1.setCellValue(projectName);
|
|
|
|
|
|
//工程名称
|
|
|
Cell c3 = getCellByAddress(sheet, "C3");
|
|
|
c3.setCellValue(projectName);
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
+ a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(c3.getCellStyle());
|
|
|
|
|
|
dianqian(htmlUrl,sheet,workbook);
|
|
|
for (Sheet sheet1 : workbook) {
|
|
@@ -2700,10 +2706,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//填报单位
|
|
|
Cell d4 = getCellByAddress(sheet, "D4");
|
|
|
d4.setCellValue(contractInfo.getContractorUnitName());
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a2 = getCellByAddress(sheet, "A2");
|
|
|
+ a2.setCellValue(projectName);
|
|
|
+ a2.setCellStyle(d4.getCellStyle());
|
|
|
}
|
|
|
- //顶部项目名称
|
|
|
- Cell a2 = getCellByAddress(sheet, "A2");
|
|
|
- a2.setCellValue(projectName);
|
|
|
+
|
|
|
dianqian(htmlUrl,sheet,workbook);
|
|
|
for (Sheet sheet1 : workbook) {
|
|
|
for (Row row : sheet1) {
|
|
@@ -2929,10 +2937,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//施工单位
|
|
|
Cell b3 = getCellByAddress(sheet, "B3");
|
|
|
b3.setCellValue(contractInfo.getConstructionUnitName());
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
+ a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(b3.getCellStyle());
|
|
|
}
|
|
|
- //顶部项目名称
|
|
|
- Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
- a1.setCellValue(projectName);
|
|
|
+
|
|
|
dianqian(htmlUrl,sheet,workbook);
|
|
|
for (Sheet sheet1 : workbook) {
|
|
|
for (Row row : sheet1) {
|
|
@@ -3093,6 +3103,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//顶部项目名称
|
|
|
Cell a1=getCellByAddress(sheet,"A1");
|
|
|
a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(d5.getCellStyle());
|
|
|
//根据坐标获取单元格
|
|
|
Cell c = getCellByAddress(sheet, "E6");
|
|
|
//本期计量
|
|
@@ -3442,13 +3453,16 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if(ObjectUtil.isNotEmpty(contractId)){
|
|
|
ContractInfo contractInfo = getContractInfo(contractId);
|
|
|
String projectName = getProjectName(contractInfo.getPId());
|
|
|
- //顶部项目名称
|
|
|
- Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
- a1.setCellValue(projectName);
|
|
|
+
|
|
|
+
|
|
|
//项目名称
|
|
|
Cell b3 = getCellByAddress(sheet, "B3");
|
|
|
b3.setCellValue(projectName);
|
|
|
CellStyle cellStyle = b3.getCellStyle();
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
+ a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(b3.getCellStyle());
|
|
|
//合同号
|
|
|
Cell b4 = getCellByAddress(sheet, "B4");
|
|
|
b4.setCellValue(contractInfo.getContractNumber());
|
|
@@ -3670,8 +3684,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//到本期末完成金额 首页至本页
|
|
|
BigDecimal totalNowEndMoney=BigDecimal.ZERO;
|
|
|
//编号来划分
|
|
|
- for (int i = 0; i < value.size(); i+=14) {
|
|
|
- int endIndex = Math.min(i + 14, value.size());
|
|
|
+ for (int i = 0; i < value.size(); i+=11) {
|
|
|
+ int endIndex = Math.min(i + 11, value.size());
|
|
|
List<MeterInventoryVO1> subList = value.subList(i, endIndex);
|
|
|
//原合同金额 本页
|
|
|
BigDecimal CurrentMeterMoney = subList.stream().map(MeterInventoryVO1::getCurrentMeterMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
@@ -3703,12 +3717,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
// 起始行号
|
|
|
int startRow =8;
|
|
|
- int endRow = 21;
|
|
|
+ int endRow = 18;
|
|
|
String[] letters = new String[] {
|
|
|
"A", "B", "D", "E", "F", "G", "H",
|
|
|
"I", "J", "K", "L", "M", "N", "P",
|
|
|
"Q", "R", "S"};
|
|
|
- //循环一次 就是8到21的一行
|
|
|
+ //循环一次 就是8到18的一行
|
|
|
for (int ii = 0; ii < subList.size()&& startRow <= endRow; ii++,startRow++) {
|
|
|
MeterInventoryVO1 obj = subList.get(ii);
|
|
|
//循环一次 就是A到S的一列
|
|
@@ -3723,52 +3737,54 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- Cell a22=getCellByAddress(sheet,"A22");
|
|
|
+ Cell a22=getCellByAddress(sheet,"A19");
|
|
|
a22.setCellValue("本页小计");
|
|
|
- Cell g22 = getCellByAddress(sheet,"G22");
|
|
|
+ Cell g22 = getCellByAddress(sheet,"G19");
|
|
|
g22.setCellValue(CurrentMeterMoney.toString());
|
|
|
if(!ChangeMeterMoney.equals(BigDecimal.ZERO)){
|
|
|
- Cell j22=getCellByAddress(sheet,"J22");
|
|
|
+ Cell j22=getCellByAddress(sheet,"J19");
|
|
|
j22.setCellValue(ChangeMeterMoney.toString());
|
|
|
}
|
|
|
- Cell l22=getCellByAddress(sheet,"L22");
|
|
|
+ Cell l22=getCellByAddress(sheet,"L19");
|
|
|
l22.setCellValue(AfterCurrentMeterMoney.toString());
|
|
|
if(!BeforeEndMoney.equals(BigDecimal.ZERO)){
|
|
|
- Cell n22=getCellByAddress(sheet,"N22");
|
|
|
+ Cell n22=getCellByAddress(sheet,"N19");
|
|
|
n22.setCellValue(BeforeEndMoney.toString());
|
|
|
}
|
|
|
- Cell q22=getCellByAddress(sheet,"Q22");
|
|
|
+ Cell q22=getCellByAddress(sheet,"Q19");
|
|
|
q22.setCellValue(NowMoney.toString());
|
|
|
- Cell s22=getCellByAddress(sheet,"S22");
|
|
|
+ Cell s22=getCellByAddress(sheet,"S19");
|
|
|
s22.setCellValue(NowEndMoney.toString());
|
|
|
- Cell a23=getCellByAddress(sheet,"A23");
|
|
|
+ Cell a23=getCellByAddress(sheet,"A20");
|
|
|
a23.setCellValue("从首页至本页合计");
|
|
|
- Cell g23 = getCellByAddress(sheet,"G23");
|
|
|
+ Cell g23 = getCellByAddress(sheet,"G20");
|
|
|
g23.setCellValue(totalCurrentMeterMoney.toString());
|
|
|
if(!totalChangeMeterMoney.equals(BigDecimal.ZERO)){
|
|
|
- Cell j23=getCellByAddress(sheet,"J23");
|
|
|
+ Cell j23=getCellByAddress(sheet,"J20");
|
|
|
j23.setCellValue(totalChangeMeterMoney.toString());
|
|
|
}
|
|
|
- Cell l23=getCellByAddress(sheet,"L23");
|
|
|
+ Cell l23=getCellByAddress(sheet,"L20");
|
|
|
l23.setCellValue(totalAfterCurrentMeterMoney.toString());
|
|
|
if(!totalBeforeEndMoney.equals(BigDecimal.ZERO)){
|
|
|
- Cell n23=getCellByAddress(sheet,"N23");
|
|
|
+ Cell n23=getCellByAddress(sheet,"N20");
|
|
|
n23.setCellValue(totalBeforeEndMoney.toString());
|
|
|
}
|
|
|
- Cell q23=getCellByAddress(sheet,"Q23");
|
|
|
+ Cell q23=getCellByAddress(sheet,"Q20");
|
|
|
q23.setCellValue(totalNowMoney.toString());
|
|
|
- Cell s23=getCellByAddress(sheet,"S23");
|
|
|
+ Cell s23=getCellByAddress(sheet,"S20");
|
|
|
s23.setCellValue(totalNowEndMoney.toString());
|
|
|
if(ObjectUtil.isNotEmpty(contractId)){
|
|
|
ContractInfo contractInfo = getContractInfo(contractId);
|
|
|
String projectName = getProjectName(contractInfo.getPId());
|
|
|
- //顶部项目名称
|
|
|
- Cell a1 =getCellByAddress(sheet,"A1");
|
|
|
- a1.setCellValue(projectName);
|
|
|
+
|
|
|
//项目名称
|
|
|
Cell b3=getCellByAddress(sheet,"B3");
|
|
|
b3.setCellValue(projectName);
|
|
|
CellStyle cellStyle = b3.getCellStyle();
|
|
|
+ //顶部项目名称
|
|
|
+ Cell a1 =getCellByAddress(sheet,"A1");
|
|
|
+ a1.setCellValue(projectName);
|
|
|
+ a1.setCellStyle(cellStyle);
|
|
|
//合同号
|
|
|
Cell b4=getCellByAddress(sheet,"B4");
|
|
|
b4.setCellValue(contractInfo.getContractNumber());
|