|
@@ -2171,7 +2171,47 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
return R.data("同步成功");
|
|
|
}
|
|
|
}
|
|
|
+ public void dianqian(String htmlUrl,Sheet sheet, Workbook workbook ) {
|
|
|
+ try {
|
|
|
+ InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(htmlUrl);
|
|
|
+// InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1693464012966068224.html");
|
|
|
+ String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ // 组装电签设置
|
|
|
+ Elements dqids = table.getElementsByAttribute("dqid");
|
|
|
+ for (Element element : dqids) {
|
|
|
+ String dqid = element.attr("dqid");
|
|
|
+ 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;
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
+ if (row != null) {
|
|
|
+ Cell cell = row.getCell(x1 - 1);
|
|
|
+ if (cell != null || Func.isNotEmpty(cell)) {
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
+ Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
+ Font redFont = workbook.createFont();
|
|
|
+ redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
|
|
|
+ redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
|
|
|
+ redFont.setFontName(oldfontAt.getFontName());//设置字体
|
|
|
+ String CellValue = cell.getStringCellValue().trim();
|
|
|
+ CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
|
|
|
+ newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
+ newStyle.setFont(redFont);
|
|
|
+ newStyle.setShrinkToFit(true);
|
|
|
+ cell.setCellStyle(newStyle);
|
|
|
+ cell.setCellValue(dqid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
@Override
|
|
|
public List<ReportResult> execute4(Long reportId,Long contractId, Long periodId, Integer type,Long projectId) throws FileNotFoundException, IllegalAccessException {
|
|
|
Long redisId = SnowFlakeUtil.getId();
|
|
@@ -2180,7 +2220,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
List<ContractMeterPeriod> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractMeterPeriod.class));
|
|
|
|
|
|
//获取所有excel报表源数据
|
|
|
- String sqlForExcel = "SELECT id,file_url from m_excel_tab where parent_id =1780876295486361601 and is_deleted = 0";
|
|
|
+ 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));
|
|
|
|
|
|
ArrayList<ReportResult> reportResults = new ArrayList<>();
|
|
@@ -2261,6 +2301,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);
|
|
|
//期号
|
|
|
String periodNumber = contractMeterPeriodNow.getPeriodNumber();
|
|
|
if(ObjectUtil.isNotEmpty(periodNumber) && periodNumber.contains("第")){
|
|
@@ -2353,6 +2394,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);
|
|
|
//------------------------------------------------------------上期末累计计量金额------------------------------------------------------------
|
|
|
BigDecimal allMoney = new BigDecimal(0);
|
|
|
//顺便计算上期末累计支付
|
|
@@ -2473,6 +2515,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);
|
|
|
//***************************************************************建安费*************************************************************************
|
|
|
Cell a6 = getCellByAddress(sheet, "A6");
|
|
|
a6.setCellValue("建安费");
|
|
@@ -2681,6 +2724,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);
|
|
|
//------------------------------------------------------------签约合同价------------------------------------------------------------
|
|
|
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);
|
|
@@ -3004,6 +3048,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);
|
|
|
Cell c3=getCellByAddress(sheet,"C3");
|
|
|
c3.setCellValue(projectName);
|
|
|
//根据坐标获取单元格
|
|
@@ -3242,7 +3287,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
m13.setBeforeEndMoney(new BigDecimal(s));
|
|
|
}
|
|
|
m13.setNowMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY + redisId)));
|
|
|
- m13.setNowEndMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY_SUM +redisId)));
|
|
|
+ m13.setNowEndMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY_SUM +redisId)));
|
|
|
values.add(m13);
|
|
|
|
|
|
MonthlyReportVo m14 = new MonthlyReportVo();
|
|
@@ -3299,6 +3344,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);
|
|
|
//根据坐标获取单元格
|
|
|
// 起始行号
|
|
|
int startRow =9;
|
|
@@ -3565,6 +3611,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);
|
|
|
// 起始行号
|
|
|
int startRow =8;
|
|
|
int endRow = 21;
|
|
@@ -3585,7 +3632,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
c.setCellValue(attributeValue);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
Cell a22=getCellByAddress(sheet,"A22");
|
|
@@ -3660,6 +3706,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
bladeRedis.set("periodId:"+periodId+"formNumber:"+listEntry.getKey()+"nowEndMoney",totalNowEndMoney);
|
|
|
//本期完成金额 本期ID+章节号
|
|
|
bladeRedis.set("periodId:"+periodId+"formNumber:"+listEntry.getKey()+"nowMoney",totalNowMoney);
|
|
|
+
|
|
|
}
|
|
|
collectionUtilsClient.mergePdfPublicMethods(listUrl, localImgUrl);
|
|
|
//上传oss
|