|
@@ -24,6 +24,7 @@ import org.apache.poi.ss.usermodel.*;
|
|
|
import org.apache.poi.util.IOUtils;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jsoup.Jsoup;
|
|
|
+import org.jsoup.nodes.Element;
|
|
|
import org.jsoup.select.Elements;
|
|
|
import org.springblade.business.entity.FixedFlow;
|
|
|
import org.springblade.business.entity.FixedFlowLink;
|
|
@@ -2234,10 +2235,18 @@ public class TaskController extends BladeController {
|
|
|
reportId = materialS.getId()+"";
|
|
|
}
|
|
|
} else if (task.getMeterTaskType() == 1) { // 1中间
|
|
|
+ // 获取总金额
|
|
|
+ MiddleMeterApply middleMeterApply = new MiddleMeterApply();
|
|
|
+ middleMeterApply.setContractId(Func.toLong(task.getContractId()) );
|
|
|
+ middleMeterApply.setContractPeriodId(Func.toLong(task.getFormDataId()));
|
|
|
+ BigDecimal currentMeterMoney = middleMeterApplyService.getCurrentMeterMoney(middleMeterApply);
|
|
|
+
|
|
|
InterimPayCertificate inData = interimPayCertificateService.getBaseMapper().selectOne(Wrappers.<InterimPayCertificate>lambdaQuery().eq(InterimPayCertificate::getContractId, task.getContractId()).eq(InterimPayCertificate::getContractPeriodId, task.getFormDataId()));
|
|
|
if (inData == null || Func.isNull(inData)) {
|
|
|
InterimPayCertificate inData2 = new InterimPayCertificate();
|
|
|
ContractMeterPeriod me = contractMeterPeriodService.getById(task.getFormDataId());
|
|
|
+ inData2.setStartDate(me.getStartDate());
|
|
|
+ inData2.setEndDate(me.getEndDate());
|
|
|
inData2.setProjectId(me.getProjectId());
|
|
|
inData2.setContractId(me.getContractId());
|
|
|
inData2.setContractPeriodId(Func.toLong(task.getFormDataId()));
|
|
@@ -2245,10 +2254,12 @@ public class TaskController extends BladeController {
|
|
|
inData2.setPeriodNumber(me.getPeriodNumber());
|
|
|
inData2.setPrintDate(me.getFormPrintDate());
|
|
|
inData2.setProjectId(me.getProjectId());
|
|
|
+ inData2.setPayMoney(currentMeterMoney);
|
|
|
interimPayCertificateService.save(inData2);
|
|
|
reportId = inData2.getId()+"";
|
|
|
+ }else{
|
|
|
+ reportId = inData.getId()+"";
|
|
|
}
|
|
|
- reportId = inData.getId()+"";
|
|
|
}
|
|
|
/**计量公式执行 0中间,1材料,2开工*/
|
|
|
/*复制业务数据状态>主任务状态>替换数据*/
|
|
@@ -2769,7 +2780,7 @@ public class TaskController extends BladeController {
|
|
|
/*设置表头*/
|
|
|
setTitle(sheet, tile);
|
|
|
/*添加电签*/
|
|
|
- setDQInfo(sheet,rs.getUrl());
|
|
|
+ setDQInfo(sheet,rs.getUrl(),tile);
|
|
|
//去掉表格虚线
|
|
|
sheet.setPrintGridlines(false);
|
|
|
//设置 整个工作表为一页
|
|
@@ -2839,8 +2850,8 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 添加电签信息数据
|
|
|
- public void setDQInfo(Sheet sheet, String htmlUrl) {
|
|
|
- String file_path = CollectionUtils.getSysLocalFileUrl();
|
|
|
+ public void setDQInfo(Sheet sheet, String htmlUrl,String title) {
|
|
|
+ String file_path = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";//CollectionUtils.getSysLocalFileUrl();
|
|
|
// 添加电签关键字Id
|
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
File file = null;
|
|
@@ -2858,16 +2869,26 @@ public class TaskController extends BladeController {
|
|
|
Elements dqlist = htmldoc.getElementsByAttribute("dqid");
|
|
|
if(dqlist!=null && !dqlist.isEmpty()){
|
|
|
dqlist.forEach(element -> {
|
|
|
- int y1 = Func.toInt(element.attr("y1"));
|
|
|
- int x1 = Func.toInt(element.attr("x1"));
|
|
|
+ System.out.println(element.hasAttr("y1"));
|
|
|
+ int y1=0;
|
|
|
+ int x1=0;
|
|
|
+ if(!element.hasAttr("y1") && !element.hasAttr("x1")){
|
|
|
+ Element element2 = element.children().get(0);
|
|
|
+ y1 = Func.toInt(element2.attr("y1"));
|
|
|
+ x1 = Func.toInt(element2.attr("x1"));
|
|
|
+ }else{
|
|
|
+ y1 = Func.toInt(element.attr("y1"));
|
|
|
+ x1 = Func.toInt(element.attr("x1"));
|
|
|
+ }
|
|
|
|
|
|
Row row = sheet.getRow(y1 - 1);
|
|
|
if (row != null) {
|
|
|
Cell cell = row.getCell(x1 - 1);
|
|
|
if (cell != null) {
|
|
|
-
|
|
|
+ /*if(title.equals("重庆试验项目-中期支付汇总表")){
|
|
|
+ System.out.println(title+"------坐标------"+y1+"__"+x1+"===="+element.attr("dqid"));
|
|
|
+ }*/
|
|
|
cell.setCellValue(element.attr("dqid"));
|
|
|
-
|
|
|
Workbook workbook = cell.getSheet().getWorkbook();
|
|
|
CellStyle cellStyle = workbook.createCellStyle();
|
|
|
cellStyle.cloneStyleFrom(cell.getCellStyle());
|
|
@@ -2876,7 +2897,6 @@ public class TaskController extends BladeController {
|
|
|
newFont.setColor(IndexedColors.WHITE.getIndex());
|
|
|
newFont.setFontHeightInPoints((short) 2);
|
|
|
cellStyle.setFont(newFont);
|
|
|
-
|
|
|
cell.setCellStyle(cellStyle);
|
|
|
}
|
|
|
}
|