|
@@ -2185,8 +2185,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Elements x11 = element.getElementsByAttribute("x1");
|
|
|
if (x11 != null && x11.size() >= 1) {
|
|
|
Element element1 = x11.get(x11.size() - 1);
|
|
|
- int x1 = Func.toInt(element1.attr("x1"))-1;
|
|
|
- int y1 = Func.toInt(element1.attr("y1"))-1;
|
|
|
+ int x1 = Func.toInt(element1.attr("x1"));
|
|
|
+ int y1 = Func.toInt(element1.attr("y1"));
|
|
|
Row row = sheet.getRow(y1 - 1);
|
|
|
if (row != null) {
|
|
|
Cell cell = row.getCell(x1 - 1);
|
|
@@ -2220,52 +2220,59 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
List<ContractMeterPeriod> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractMeterPeriod.class));
|
|
|
|
|
|
//获取所有excel报表源数据
|
|
|
- String sqlForExcel = "SELECT id,file_url,html_url from m_excel_tab where parent_id =1780876295486361601 and is_deleted = 0";
|
|
|
- List<ExcelTab> excelTabs = jdbcTemplate.query(sqlForExcel, new BeanPropertyRowMapper<>(ExcelTab.class));
|
|
|
+ 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));
|
|
|
|
|
|
ArrayList<ReportResult> reportResults = new ArrayList<>();
|
|
|
//中期支付报表封面
|
|
|
- Optional<ExcelTab> excel = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876698961629186")).findFirst();
|
|
|
+ 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();
|
|
|
//中间支付审核表
|
|
|
- Optional<ExcelTab> excel1 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876742800494593")).findFirst();
|
|
|
+ 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();
|
|
|
//补助款申请支付审核表
|
|
|
- Optional<ExcelTab> excel2 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876780238852097")).findFirst();
|
|
|
+ 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();
|
|
|
//中间计量支付证书
|
|
|
- Optional<ExcelTab> excel3 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876814359515138")).findFirst();
|
|
|
+ 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();
|
|
|
//中间计量支付申请表
|
|
|
- Optional<ExcelTab> excel4 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876859939016705")).findFirst();
|
|
|
+ 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();
|
|
|
//工程支付月报
|
|
|
- Optional<ExcelTab> excel5 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876896593039362")).findFirst();
|
|
|
+ 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();
|
|
|
//清单支付报表
|
|
|
- Optional<ExcelTab> excel6 = excelTabs.stream().filter(e -> e.getId().toString().equals("1780876940398350338")).findFirst();
|
|
|
+ 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();
|
|
|
+ String htmlUrl6=excel6.get().getHtmlUrl();
|
|
|
// 获取中期支付报表封面的pdfurl
|
|
|
- ReportResult CoverOfMidtermPaymentReportPDF = getCoverOfMidtermPaymentReportPDF(url,contractId,periodId);
|
|
|
+ ReportResult CoverOfMidtermPaymentReportPDF = getCoverOfMidtermPaymentReportPDF(url,contractId,periodId,htmlUrl);
|
|
|
//获取中间支付审核表的pdfurl
|
|
|
- ReportResult intermediatePaymentPDF = getIntermediatePaymentPDF(url1,contractId,periodId,list,redisId);
|
|
|
+ ReportResult intermediatePaymentPDF = getIntermediatePaymentPDF(url1,contractId,periodId,list,redisId,htmlUrl1);
|
|
|
//获取补助款申请支付审核表pdfUrl
|
|
|
- ReportResult subsidyApplicationPaymentReviewPDF = getSubsidyApplicationPaymentReviewPDF(url2,contractId,periodId,list);
|
|
|
+ ReportResult subsidyApplicationPaymentReviewPDF = getSubsidyApplicationPaymentReviewPDF(url2,contractId,periodId,list,htmlUrl2);
|
|
|
//获取中间计量支付证书pdfUrl
|
|
|
- ReportResult intermediateMeasurementPaymentCertificatePDF = getIntermediateMeasurementPaymentCertificatePDF(url3,contractId,periodId,list);
|
|
|
+ ReportResult intermediateMeasurementPaymentCertificatePDF = getIntermediateMeasurementPaymentCertificatePDF(url3,contractId,periodId,list,htmlUrl3);
|
|
|
//获取清单支付报表PDF
|
|
|
- ReportResult inventoryPayReportPDF=getInventoryPayReportPDF(url6,contractId,periodId,projectId,list,redisId);
|
|
|
+ ReportResult inventoryPayReportPDF=getInventoryPayReportPDF(url6,contractId,periodId,projectId,list,redisId,htmlUrl6);
|
|
|
//获取工程支付月报pdfUrl
|
|
|
- ReportResult monthlyReportPDF=getMonthlyReportPDF(url5,reportId,contractId,periodId,projectId,list,redisId);
|
|
|
+ ReportResult monthlyReportPDF=getMonthlyReportPDF(url5,reportId,contractId,periodId,projectId,list,redisId,htmlUrl5);
|
|
|
//获取中间支付申请表pdfUrl
|
|
|
- ReportResult intermediateApplyPDF=getIntermediateApplyPDF(url4,periodId,projectId);
|
|
|
+ ReportResult intermediateApplyPDF=getIntermediateApplyPDF(url4,periodId,projectId,htmlUrl4);
|
|
|
|
|
|
reportResults.add(CoverOfMidtermPaymentReportPDF);
|
|
|
reportResults.add(intermediatePaymentPDF);
|
|
@@ -2281,7 +2288,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/**
|
|
|
* 中期支付报表封面
|
|
|
*/
|
|
|
- private ReportResult getCoverOfMidtermPaymentReportPDF(String url, Long contractId, Long periodId) {
|
|
|
+ private ReportResult getCoverOfMidtermPaymentReportPDF(String url, Long contractId, Long periodId,String htmlUrl) {
|
|
|
|
|
|
//获取本期计量期
|
|
|
String sqlForMeterPeriodById = "SELECT id,period_number,start_date,end_date FROM s_contract_meter_period WHERE id="+periodId+" and is_deleted = 0 ";
|
|
@@ -2301,7 +2308,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
//期号
|
|
|
String periodNumber = contractMeterPeriodNow.getPeriodNumber();
|
|
|
if(ObjectUtil.isNotEmpty(periodNumber) && periodNumber.contains("第")){
|
|
@@ -2369,7 +2376,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/**
|
|
|
*中间计量支付证书获取PDFurl
|
|
|
*/
|
|
|
- private ReportResult getIntermediateMeasurementPaymentCertificatePDF(String url3, Long contractId, Long periodId, List<ContractMeterPeriod> list) {
|
|
|
+ private ReportResult getIntermediateMeasurementPaymentCertificatePDF(String url3, Long contractId, Long periodId, List<ContractMeterPeriod> list,String htmlUrl) {
|
|
|
//判断当前是否是第一期
|
|
|
Boolean isOnePeriod = false;
|
|
|
ContractMeterPeriod contractMeterPeriod = list.get(0);
|
|
@@ -2394,7 +2401,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url3);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url3,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
//------------------------------------------------------------上期末累计计量金额------------------------------------------------------------
|
|
|
BigDecimal allMoney = new BigDecimal(0);
|
|
|
//顺便计算上期末累计支付
|
|
@@ -2490,7 +2497,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/**
|
|
|
*补助款申请支付审核表获取PDFurl
|
|
|
*/
|
|
|
- private ReportResult getSubsidyApplicationPaymentReviewPDF(String url2, Long contractId, Long periodId, List<ContractMeterPeriod> list) {
|
|
|
+ private ReportResult getSubsidyApplicationPaymentReviewPDF(String url2, Long contractId, Long periodId, List<ContractMeterPeriod> list,String htmlUrl) {
|
|
|
//判断当前是否是只有1期计量
|
|
|
Boolean isOnePeriod = false;
|
|
|
ContractMeterPeriod contractMeterPeriod = list.get(0);
|
|
@@ -2515,7 +2522,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url2);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url2,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
//***************************************************************建安费*************************************************************************
|
|
|
Cell a6 = getCellByAddress(sheet, "A6");
|
|
|
a6.setCellValue("建安费");
|
|
@@ -2699,7 +2706,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
/**
|
|
|
* 中间支付审核表获取PDFurl
|
|
|
*/
|
|
|
- public ReportResult getIntermediatePaymentPDF(String url,Long contractId,Long periodId,List<ContractMeterPeriod> list,Long redisId) {
|
|
|
+ public ReportResult getIntermediatePaymentPDF(String url,Long contractId,Long periodId,List<ContractMeterPeriod> list,Long redisId,String htmlUrl) {
|
|
|
//判断当前是否是只有1期计量
|
|
|
Boolean isOnePeriod = false;
|
|
|
ContractMeterPeriod contractMeterPeriod1 = list.get(0);
|
|
@@ -2724,7 +2731,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
//------------------------------------------------------------签约合同价------------------------------------------------------------
|
|
|
String sql1 = "SELECT SUM(contract_money) FROM `s_contract_inventory_form` WHERE contract_id="+contractId+" and is_deleted = 0 ";
|
|
|
BigDecimal totalMoney = jdbcTemplate.queryForObject(sql1, BigDecimal.class);
|
|
@@ -3029,7 +3036,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
* @param url
|
|
|
* @return
|
|
|
*/
|
|
|
- public ReportResult getIntermediateApplyPDF(String url,Long periodId,Long projectId){
|
|
|
+ public ReportResult getIntermediateApplyPDF(String url,Long periodId,Long projectId,String htmlUrl){
|
|
|
String projectName = null;
|
|
|
try {
|
|
|
String sql="Select project_name from m_project_info where id='"+projectId+"'";
|
|
@@ -3048,7 +3055,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
Cell c3=getCellByAddress(sheet,"C3");
|
|
|
c3.setCellValue(projectName);
|
|
|
//根据坐标获取单元格
|
|
@@ -3106,7 +3113,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
* @param url
|
|
|
* @return
|
|
|
*/
|
|
|
- public ReportResult getMonthlyReportPDF(String url, Long reportId,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId) throws IllegalAccessException {
|
|
|
+ public ReportResult getMonthlyReportPDF(String url, Long reportId,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId,String htmlUrl) throws IllegalAccessException {
|
|
|
//获取本期计量期
|
|
|
String sqlForMeterPeriodById = "SELECT id,period_number,start_date,end_date FROM s_contract_meter_period WHERE id="+periodId+" and is_deleted = 0 ";
|
|
|
ContractMeterPeriod contractMeterPeriodNow = jdbcTemplate.queryForObject(sqlForMeterPeriodById, new BeanPropertyRowMapper<>(ContractMeterPeriod.class));
|
|
@@ -3344,7 +3351,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
//根据坐标获取单元格
|
|
|
// 起始行号
|
|
|
int startRow =9;
|
|
@@ -3415,7 +3422,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
- public ReportResult getInventoryPayReportPDF(String url,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId) throws FileNotFoundException, IllegalAccessException {
|
|
|
+ public ReportResult getInventoryPayReportPDF(String url,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId,String htmlUrl) throws FileNotFoundException, IllegalAccessException {
|
|
|
MiddleMeterApply middleMeterApply=new MiddleMeterApply();
|
|
|
middleMeterApply.setContractId(contractId);
|
|
|
middleMeterApply.setContractPeriodId(periodId);
|
|
@@ -3611,7 +3618,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
modInput = CommonUtil.getOSSInputStream(url);
|
|
|
workbook = WorkbookFactory.create(modInput);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
- dianqian(url,sheet,workbook);
|
|
|
+ dianqian(htmlUrl,sheet,workbook);
|
|
|
// 起始行号
|
|
|
int startRow =8;
|
|
|
int endRow = 21;
|