|
@@ -75,6 +75,7 @@ import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
@@ -2319,7 +2320,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//获取所有excel报表源数据
|
|
|
String sqlForExcel = "SELECT e.id,p.html_url,e.file_url FROM m_wbs_tree_private as p LEFT JOIN m_excel_tab as e on p.excel_id=e.id where p.wbs_type=3 AND p.is_deleted=0 AND p.type=2"+" and project_id="+projectId;
|
|
|
List<ExcelTabVo1> excelTabs = jdbcTemplate.query(sqlForExcel, new BeanPropertyRowMapper<>(ExcelTabVo1.class));
|
|
|
-
|
|
|
+ for (ExcelTabVo1 excelTab : excelTabs) {
|
|
|
+ System.out.println(excelTab.getFileUrl());
|
|
|
+ }
|
|
|
ArrayList<ReportResult> reportResults = new ArrayList<>();
|
|
|
//中期支付报表封面
|
|
|
Optional<ExcelTabVo1> excel = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876698961629186")).findFirst();
|
|
@@ -2357,20 +2360,26 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
String url6=excel6.get().getFileUrl();
|
|
|
String htmlUrl6=excel6.get().getHtmlUrl();
|
|
|
// 获取中期支付报表封面的pdfurl
|
|
|
- ReportResult CoverOfMidtermPaymentReportPDF = getCoverOfMidtermPaymentReportPDF(url,contractId,periodId,htmlUrl, projectName);
|
|
|
+ ReportResult CoverOfMidtermPaymentReportPDF = getCoverOfMidtermPaymentReportPDF(url,contractId,periodId,htmlUrl, projectName,list);
|
|
|
+ CoverOfMidtermPaymentReportPDF.setPkeyId(1816648920839749640L);
|
|
|
//获取中间支付审核表的pdfurl
|
|
|
ReportResult intermediatePaymentPDF = getIntermediatePaymentPDF(url1,contractId,periodId,list,redisId,htmlUrl1,blReserveFundsRatioNew,projectName,changeMoneyNew);
|
|
|
+ intermediatePaymentPDF.setPkeyId(1816648920839749634L);
|
|
|
//获取补助款申请支付审核表pdfUrl
|
|
|
ReportResult subsidyApplicationPaymentReviewPDF = getSubsidyApplicationPaymentReviewPDF(url2,contractId,periodId,list,htmlUrl2,blReserveFundsRatioNew,projectName,projectId,reportId);
|
|
|
+ subsidyApplicationPaymentReviewPDF.setPkeyId(1816648920839749642L);
|
|
|
//获取中间计量支付证书pdfUrl
|
|
|
ReportResult intermediateMeasurementPaymentCertificatePDF = getIntermediateMeasurementPaymentCertificatePDF(url3,contractId,periodId,list,htmlUrl3,blReserveFundsRatioNew,projectName);
|
|
|
+ intermediateMeasurementPaymentCertificatePDF.setPkeyId(1816648920839749643L);
|
|
|
//获取清单支付报表PDF
|
|
|
ReportResult inventoryPayReportPDF=getInventoryPayReportPDF(url6,contractId,periodId,projectId,list,redisId,htmlUrl6);
|
|
|
+ inventoryPayReportPDF.setPkeyId(1816648920839749646L);
|
|
|
//获取工程支付月报pdfUrl
|
|
|
ReportResult monthlyReportPDF=getMonthlyReportPDF(url5,reportId,contractId,periodId,projectId,list,redisId,htmlUrl5);
|
|
|
+ monthlyReportPDF.setPkeyId(1816648920839749645L);
|
|
|
//获取中间支付申请表pdfUrl
|
|
|
ReportResult intermediateApplyPDF=getIntermediateApplyPDF(url4,periodId,projectId,htmlUrl4,projectName);
|
|
|
-
|
|
|
+ intermediateApplyPDF.setPkeyId(1816648920839749644L);
|
|
|
reportResults.add(CoverOfMidtermPaymentReportPDF);
|
|
|
reportResults.add(intermediatePaymentPDF);
|
|
|
reportResults.add(subsidyApplicationPaymentReviewPDF);
|
|
@@ -2385,7 +2394,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/**
|
|
|
* 中期支付报表封面
|
|
|
*/
|
|
|
- private ReportResult getCoverOfMidtermPaymentReportPDF(String url, Long contractId, Long periodId,String htmlUrl,String projectName) {
|
|
|
+ private ReportResult getCoverOfMidtermPaymentReportPDF(String url, Long contractId, Long periodId,String htmlUrl,String projectName,List<ContractMeterPeriod> list) {
|
|
|
|
|
|
//获取本期计量期
|
|
|
String sqlForMeterPeriodById = "SELECT id,period_number,start_date,end_date FROM s_contract_meter_period WHERE id="+periodId+" and is_deleted = 0 ";
|
|
@@ -2419,8 +2428,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
//日期
|
|
|
Cell c11 = getCellByAddress(sheet, "C11");
|
|
|
- c11.setCellValue(endDate.toString());
|
|
|
-
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ String formattedDate = endDate.format(formatter);
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ c11.setCellValue("2024年10月30日");
|
|
|
+ }else {
|
|
|
+ c11.setCellValue(formattedDate);
|
|
|
+ }
|
|
|
if(ObjectUtil.isNotEmpty(contractId)){
|
|
|
CellStyle cellStyle = c11.getCellStyle();
|
|
|
//获取合同段信息
|
|
@@ -2548,8 +2562,10 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
//***************************************************************所有日期*************************************************************************
|
|
|
//底部日期
|
|
|
- /*Cell f25 = getCellByAddress(sheet, "F25");
|
|
|
- f25.setCellValue(endDate.toString());*/
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ Cell f25 = getCellByAddress(sheet, "F25");
|
|
|
+ f25.setCellValue("2024年10月30日");
|
|
|
+ }
|
|
|
//顶部项目名称
|
|
|
Cell a1 = getCellByAddress(sheet, "A1");
|
|
|
a1.setCellValue(projectName);
|
|
@@ -2615,7 +2631,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Long contractMeterPeriodNowId = contractMeterPeriodNow.getId();
|
|
|
//本期计量开始时间
|
|
|
LocalDate startDate = contractMeterPeriodNow.getStartDate();
|
|
|
- //本期计量开始时间
|
|
|
+ //本期计量截止时间
|
|
|
LocalDate endDate = contractMeterPeriodNow.getEndDate();
|
|
|
InputStream modInput = null;
|
|
|
FileInputStream excelFileInput = null;
|
|
@@ -2808,7 +2824,26 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
//***************************************************************所有日期*************************************************************************
|
|
|
//顶部日期
|
|
|
Cell j4 = getCellByAddress(sheet, "J4");
|
|
|
- j4.setCellValue(endDate.toString());
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ String formattedDate = endDate.format(formatter);
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ j4.setCellValue("2024年10月30日");
|
|
|
+ Cell m12 = getCellByAddress(sheet, "M12");
|
|
|
+ Cell m15 = getCellByAddress(sheet, "M15");
|
|
|
+ Cell m18 = getCellByAddress(sheet, "M18");
|
|
|
+ Cell m21 = getCellByAddress(sheet, "M21");
|
|
|
+ Cell m24 = getCellByAddress(sheet, "M24");
|
|
|
+ Cell m27 = getCellByAddress(sheet, "M27");
|
|
|
+ m12.setCellValue("2024年10月30日");
|
|
|
+ m15.setCellValue("2024年10月30日");
|
|
|
+ m18.setCellValue("2024年10月30日");
|
|
|
+ m21.setCellValue("2024年10月30日");
|
|
|
+ m24.setCellValue("2024年10月30日");
|
|
|
+ m27.setCellValue("2024年10月30日");
|
|
|
+ }else {
|
|
|
+ j4.setCellValue(formattedDate);
|
|
|
+ }
|
|
|
+
|
|
|
/*//交通建设事务中心审核意见日期
|
|
|
Cell m12 = getCellByAddress(sheet, "M12");
|
|
|
m12.setCellValue(endDate.toString());
|
|
@@ -2896,7 +2931,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Long contractMeterPeriodNowId = contractMeterPeriodNow.getId();
|
|
|
//本期计量开始时间
|
|
|
LocalDate startDate = contractMeterPeriodNow.getStartDate();
|
|
|
- //本期计量开始时间
|
|
|
+ //本期计量截止时间
|
|
|
LocalDate endDate = contractMeterPeriodNow.getEndDate();
|
|
|
InputStream modInput = null;
|
|
|
FileInputStream excelFileInput = null;
|
|
@@ -3073,8 +3108,29 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
//------------------------------------------------------------日期------------------------------------------------------------
|
|
|
//顶部日期
|
|
|
- Cell g3 = getCellByAddress(sheet, "G3");
|
|
|
- g3.setCellValue(endDate.toString());
|
|
|
+ Cell g3 = getCellByAddress(sheet, "G3");
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ String formattedDate = endDate.format(formatter);
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ g3.setCellValue("2024年10月30日");
|
|
|
+ Cell j11 = getCellByAddress(sheet, "J11");
|
|
|
+ Cell j13 = getCellByAddress(sheet, "J13");
|
|
|
+ Cell j16 = getCellByAddress(sheet, "J16");
|
|
|
+ Cell j19 = getCellByAddress(sheet, "J19");
|
|
|
+ Cell j22 = getCellByAddress(sheet, "J22");
|
|
|
+ Cell j25 = getCellByAddress(sheet, "J25");
|
|
|
+ j11.setCellValue("2024年10月30日");
|
|
|
+ j13.setCellValue("2024年10月30日");
|
|
|
+ j16.setCellValue("2024年10月30日");
|
|
|
+ j19.setCellValue("2024年10月30日");
|
|
|
+ j22.setCellValue("2024年10月30日");
|
|
|
+ j25.setCellValue("2024年10月30日");
|
|
|
+ }else {
|
|
|
+ g3.setCellValue(formattedDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/*//施工单位申报意见
|
|
|
Cell j11 = getCellByAddress(sheet, "J11");
|
|
|
j11.setCellValue(endDate.toString());
|
|
@@ -3283,6 +3339,10 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
value=(BigDecimal) o;
|
|
|
}
|
|
|
c.setCellValue(value.toString());
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ Cell f22 = getCellByAddress(sheet, "F22");
|
|
|
+ f22.setCellValue("2024年10月30日");
|
|
|
+ }
|
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
|
//String file_path = "C://upload1//";
|
|
|
String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
|
|
@@ -3763,8 +3823,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
g4.setCellValue(contractInfo.getSupervisionUnitName());
|
|
|
//截至时间
|
|
|
Cell m_3 = getCellByAddress(sheet, "M3");
|
|
|
- m_3.setCellValue(endDate.toString());
|
|
|
-
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ String formattedDate = endDate.format(formatter);
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ m_3.setCellValue("2024年10月30日");
|
|
|
+ }else {
|
|
|
+ m_3.setCellValue(formattedDate);
|
|
|
+ }
|
|
|
}
|
|
|
dianqian(htmlUrl,sheet,workbook);
|
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
@@ -4085,9 +4150,23 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
Cell a22=getCellByAddress(sheet,"A19");
|
|
|
a22.setCellValue("本页小计");
|
|
|
- Cell g22 = getCellByAddress(sheet,"G19");
|
|
|
+ Cell s3 = getCellByAddress(sheet, "S3");
|
|
|
+ if(periodId.equals(1867838908899852290L)){
|
|
|
+ s3.setCellValue("2024年10月30日");
|
|
|
+ }else {
|
|
|
+ Optional<ContractMeterPeriod> first = list.stream().filter(l -> l.getId().equals(periodId)).findFirst();
|
|
|
+ if(first.get()!=null){
|
|
|
+ LocalDate endDate = first.get().getEndDate();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+ String formattedDate = endDate.format(formatter);
|
|
|
+ s3.setCellValue(formattedDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Cell g22 = getCellByAddress(sheet,"G19");
|
|
|
g22.setCellValue(CurrentMeterMoney.toString());
|
|
|
if(!ChangeMeterMoney.equals(BigDecimal.ZERO)){
|
|
|
Cell j22=getCellByAddress(sheet,"J19");
|