|
@@ -75,6 +75,7 @@ import java.io.*;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.sql.SQLException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.Month;
|
|
import java.time.Month;
|
|
@@ -186,10 +187,10 @@ public class TaskController extends BladeController {
|
|
/*加锁*/
|
|
/*加锁*/
|
|
String redisValue = bladeRedis.get("meter:report:contractId-" + approvalDTO.getContractId());
|
|
String redisValue = bladeRedis.get("meter:report:contractId-" + approvalDTO.getContractId());
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
- return R.fail(400, "请勿重复提交,10秒后再尝试");
|
|
|
|
|
|
+ return R.fail(400, "请勿重复提交,30秒后再尝试");
|
|
}
|
|
}
|
|
bladeRedis.set("meter:report:contractId-" + approvalDTO.getContractId(), "1");
|
|
bladeRedis.set("meter:report:contractId-" + approvalDTO.getContractId(), "1");
|
|
- bladeRedis.expire("meter:report:contractId-" + approvalDTO.getContractId(), 10);
|
|
|
|
|
|
+ bladeRedis.expire("meter:report:contractId-" + approvalDTO.getContractId(), 30);
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(approvalDTO.getType()) && (approvalDTO.getType().equals(1) || approvalDTO.getType().equals(2) || approvalDTO.getType().equals(3) || approvalDTO.getType().equals(4))) {
|
|
if (ObjectUtil.isNotEmpty(approvalDTO.getType()) && (approvalDTO.getType().equals(1) || approvalDTO.getType().equals(2) || approvalDTO.getType().equals(3) || approvalDTO.getType().equals(4))) {
|
|
if (approvalDTO.getType().equals(1)) {
|
|
if (approvalDTO.getType().equals(1)) {
|
|
@@ -571,7 +572,16 @@ public class TaskController extends BladeController {
|
|
task.setFixedFlowId(ObjectUtil.isNotEmpty(approvalDTO.getFixedFlowId()) ? Long.parseLong(approvalDTO.getFixedFlowId()) : 0L);
|
|
task.setFixedFlowId(ObjectUtil.isNotEmpty(approvalDTO.getFixedFlowId()) ? Long.parseLong(approvalDTO.getFixedFlowId()) : 0L);
|
|
task.setStatus(1); //待审批
|
|
task.setStatus(1); //待审批
|
|
task.setIsDeleted(0);
|
|
task.setIsDeleted(0);
|
|
- taskClient.saveTask(task);
|
|
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ boolean taskBool = taskClient.saveTask(task);
|
|
|
|
+ if (!taskBool) {
|
|
|
|
+ throw new ServiceException("任务创建失败");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ throw new ServiceException("任务创建失败:" + e.getMessage());
|
|
|
|
+ }
|
|
|
|
|
|
/*副任务*/
|
|
/*副任务*/
|
|
/*1.非预设流程*/
|
|
/*1.非预设流程*/
|
|
@@ -737,14 +747,15 @@ public class TaskController extends BladeController {
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperation(value = "任务废除(任务撤销、驳回审批)", notes = "按一期废除,即按整条任务废除(中期计量申请、材料计量单、开工预付款计量单、变更令、任务查看-废除任务)")
|
|
@ApiOperation(value = "任务废除(任务撤销、驳回审批)", notes = "按一期废除,即按整条任务废除(中期计量申请、材料计量单、开工预付款计量单、变更令、任务查看-废除任务)")
|
|
@PushMessage(clientId = ClientIdConstant.METER_CLIENT_ID)
|
|
@PushMessage(clientId = ClientIdConstant.METER_CLIENT_ID)
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public R<Object> repeal(@RequestBody TaskRepealDTO taskRepealDTO) throws JsonProcessingException {
|
|
public R<Object> repeal(@RequestBody TaskRepealDTO taskRepealDTO) throws JsonProcessingException {
|
|
/*加锁*/
|
|
/*加锁*/
|
|
String redisValue = bladeRedis.get("meter:repeal:user:" + SecureUtil.getUserId());
|
|
String redisValue = bladeRedis.get("meter:repeal:user:" + SecureUtil.getUserId());
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
- return R.fail(400, "请勿重复提交,10秒后再尝试");
|
|
|
|
|
|
+ return R.fail(400, "请勿重复提交,30秒后再尝试");
|
|
}
|
|
}
|
|
bladeRedis.set("meter:repeal:user:" + SecureUtil.getUserId(), "1");
|
|
bladeRedis.set("meter:repeal:user:" + SecureUtil.getUserId(), "1");
|
|
- bladeRedis.expire("meter:repeal:user:" + SecureUtil.getUserId(), 10);
|
|
|
|
|
|
+ bladeRedis.expire("meter:repeal:user:" + SecureUtil.getUserId(), 30);
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO) && ObjectUtil.isNotEmpty(taskRepealDTO.getTaskId())) {
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO) && ObjectUtil.isNotEmpty(taskRepealDTO.getTaskId())) {
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO.getMeterTaskRepealDesc()) && taskRepealDTO.getMeterTaskRepealDesc().length() > 1000) {
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO.getMeterTaskRepealDesc()) && taskRepealDTO.getMeterTaskRepealDesc().length() > 1000) {
|
|
@@ -805,9 +816,13 @@ public class TaskController extends BladeController {
|
|
.set(ContractMeterPeriod::getApproveStatus, 0)
|
|
.set(ContractMeterPeriod::getApproveStatus, 0)
|
|
.eq(ContractMeterPeriod::getId, periodId));
|
|
.eq(ContractMeterPeriod::getId, periodId));
|
|
|
|
|
|
- /*删除业务复制数据taskVO*/
|
|
|
|
- jdbcTemplate.execute("DELETE FROM s_middle_meter_apply_task WHERE contract_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
- jdbcTemplate.execute("DELETE FROM s_inventory_form_apply_task WHERE contract_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
|
|
+ try {
|
|
|
|
+ /*删除业务复制数据taskVO*/
|
|
|
|
+ jdbcTemplate.execute("DELETE FROM s_middle_meter_apply_task WHERE contract_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
+ jdbcTemplate.execute("DELETE FROM s_inventory_form_apply_task WHERE contract_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("删除业务复制数据taskVO失败");
|
|
|
|
+ }
|
|
|
|
|
|
/*还原修改过的清单信息*/
|
|
/*还原修改过的清单信息*/
|
|
List<InventoryFormApply> restoreInventoryFormApplyList = new ArrayList<>();
|
|
List<InventoryFormApply> restoreInventoryFormApplyList = new ArrayList<>();
|
|
@@ -866,7 +881,11 @@ public class TaskController extends BladeController {
|
|
.eq(MeterPeriod::getId, periodId));
|
|
.eq(MeterPeriod::getId, periodId));
|
|
|
|
|
|
/*删除业务复制数据taskVO*/
|
|
/*删除业务复制数据taskVO*/
|
|
- jdbcTemplate.execute("DELETE FROM s_material_meter_form_task WHERE meter_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
|
|
+ try {
|
|
|
|
+ jdbcTemplate.execute("DELETE FROM s_material_meter_form_task WHERE meter_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("删除业务复制数据taskVO失败");
|
|
|
|
+ }
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(3)) {
|
|
} else if (task.getMeterTaskType().equals(3)) {
|
|
/*==================== 开工预付款计量单 ====================*/
|
|
/*==================== 开工预付款计量单 ====================*/
|
|
@@ -890,7 +909,11 @@ public class TaskController extends BladeController {
|
|
.eq(MeterPeriod::getId, periodId));
|
|
.eq(MeterPeriod::getId, periodId));
|
|
|
|
|
|
/*删除业务复制数据taskVO*/
|
|
/*删除业务复制数据taskVO*/
|
|
- jdbcTemplate.execute("DELETE FROM s_start_pay_meter_form_task WHERE meter_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
|
|
+ try {
|
|
|
|
+ jdbcTemplate.execute("DELETE FROM s_start_pay_meter_form_task WHERE meter_period_id = '" + periodId + "' AND task_id = " + taskRepealDTO.getTaskId());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("删除业务复制数据taskVO失败");
|
|
|
|
+ }
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(4)) {
|
|
} else if (task.getMeterTaskType().equals(4)) {
|
|
for (String dataId : periodId.split(",")) {
|
|
for (String dataId : periodId.split(",")) {
|
|
@@ -1352,7 +1375,8 @@ public class TaskController extends BladeController {
|
|
@GetMapping("/data/detail")
|
|
@GetMapping("/data/detail")
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperation(value = "任务数据信息详情", notes = "传入任务id,数据dataId")
|
|
@ApiOperation(value = "任务数据信息详情", notes = "传入任务id,数据dataId")
|
|
- public R<TaskDataDetailVO> dataDetail(@RequestParam String id, @RequestParam String dataId) throws JsonProcessingException {
|
|
|
|
|
|
+ public R<TaskDataDetailVO> dataDetail(@RequestParam String id, @RequestParam String dataId) throws
|
|
|
|
+ JsonProcessingException {
|
|
if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(dataId)) {
|
|
if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(dataId)) {
|
|
throw new ServiceException("任务id、数据id不能为空");
|
|
throw new ServiceException("任务id、数据id不能为空");
|
|
}
|
|
}
|
|
@@ -1655,7 +1679,8 @@ public class TaskController extends BladeController {
|
|
@PostMapping("/data/inventoryFormApplyTask/update")
|
|
@PostMapping("/data/inventoryFormApplyTask/update")
|
|
@ApiOperationSupport(order = 8)
|
|
@ApiOperationSupport(order = 8)
|
|
@ApiOperation(value = "清单数据修改", notes = "传入InventoryFormApplyTaskDTO")
|
|
@ApiOperation(value = "清单数据修改", notes = "传入InventoryFormApplyTaskDTO")
|
|
- public R<Object> dataInventoryFormApplyTaskUpdate(@RequestBody InventoryFormApplyTaskDTO dto) throws JsonProcessingException {
|
|
|
|
|
|
+ public R<Object> dataInventoryFormApplyTaskUpdate(@RequestBody InventoryFormApplyTaskDTO dto) throws
|
|
|
|
+ JsonProcessingException {
|
|
if (ObjectUtil.isEmpty(dto.getTaskId())) {
|
|
if (ObjectUtil.isEmpty(dto.getTaskId())) {
|
|
throw new ServiceException("未获取到taskId");
|
|
throw new ServiceException("未获取到taskId");
|
|
}
|
|
}
|
|
@@ -2207,8 +2232,8 @@ public class TaskController extends BladeController {
|
|
/*最终审批轮次*/
|
|
/*最终审批轮次*/
|
|
if (isCurrentUserLastApprove) {
|
|
if (isCurrentUserLastApprove) {
|
|
//TODO 重新生成报表,执行电签(电签失败直接return或抛出异常,不修改下方状态)
|
|
//TODO 重新生成报表,执行电签(电签失败直接return或抛出异常,不修改下方状态)
|
|
- if(task.getMeterTaskType()==3 || task.getMeterTaskType()==2){ //2材料,3开工
|
|
|
|
- MaterialStartStatement materialS = materialStartStatementService.getBaseMapper().selectOne(Wrappers.<MaterialStartStatement>lambdaQuery().eq(MaterialStartStatement::getContractId, task.getContractId()).eq(MaterialStartStatement::getMeterPeriodId, task.getFormDataId()).eq(MaterialStartStatement::getType, task.getMeterTaskType()-1));
|
|
|
|
|
|
+ if (task.getMeterTaskType() == 3 || task.getMeterTaskType() == 2) { //2材料,3开工
|
|
|
|
+ MaterialStartStatement materialS = materialStartStatementService.getBaseMapper().selectOne(Wrappers.<MaterialStartStatement>lambdaQuery().eq(MaterialStartStatement::getContractId, task.getContractId()).eq(MaterialStartStatement::getMeterPeriodId, task.getFormDataId()).eq(MaterialStartStatement::getType, task.getMeterTaskType() - 1));
|
|
if (materialS == null || Func.isNull(materialS)) {
|
|
if (materialS == null || Func.isNull(materialS)) {
|
|
MeterPeriod me = periodService.getById(task.getFormDataId());
|
|
MeterPeriod me = periodService.getById(task.getFormDataId());
|
|
MaterialStartStatement data = new MaterialStartStatement();
|
|
MaterialStartStatement data = new MaterialStartStatement();
|
|
@@ -2218,7 +2243,7 @@ public class TaskController extends BladeController {
|
|
data.setPrintDate(me.getFormPrintDate());
|
|
data.setPrintDate(me.getFormPrintDate());
|
|
data.setPeriodNumber(me.getPeriodNumber());
|
|
data.setPeriodNumber(me.getPeriodNumber());
|
|
data.setProjectId(me.getProjectId());
|
|
data.setProjectId(me.getProjectId());
|
|
- if(task.getMeterTaskType()==2){
|
|
|
|
|
|
+ if (task.getMeterTaskType() == 2) {
|
|
data.setRepaymentCause("材料预付款");
|
|
data.setRepaymentCause("材料预付款");
|
|
data.setStatementName("材料预付款--" + me.getPeriodName());
|
|
data.setStatementName("材料预付款--" + me.getPeriodName());
|
|
data.setType(1);
|
|
data.setType(1);
|
|
@@ -2230,14 +2255,14 @@ public class TaskController extends BladeController {
|
|
data.setType(2);
|
|
data.setType(2);
|
|
}
|
|
}
|
|
materialStartStatementService.saveOrUpdate(data);
|
|
materialStartStatementService.saveOrUpdate(data);
|
|
- reportId = data.getId()+"";
|
|
|
|
|
|
+ reportId = data.getId() + "";
|
|
} else {
|
|
} else {
|
|
- reportId = materialS.getId()+"";
|
|
|
|
|
|
+ reportId = materialS.getId() + "";
|
|
}
|
|
}
|
|
} else if (task.getMeterTaskType() == 1) { // 1中间
|
|
} else if (task.getMeterTaskType() == 1) { // 1中间
|
|
// 获取总金额
|
|
// 获取总金额
|
|
MiddleMeterApply middleMeterApply = new MiddleMeterApply();
|
|
MiddleMeterApply middleMeterApply = new MiddleMeterApply();
|
|
- middleMeterApply.setContractId(Func.toLong(task.getContractId()) );
|
|
|
|
|
|
+ middleMeterApply.setContractId(Func.toLong(task.getContractId()));
|
|
middleMeterApply.setContractPeriodId(Func.toLong(task.getFormDataId()));
|
|
middleMeterApply.setContractPeriodId(Func.toLong(task.getFormDataId()));
|
|
BigDecimal currentMeterMoney = middleMeterApplyService.getCurrentMeterMoney(middleMeterApply);
|
|
BigDecimal currentMeterMoney = middleMeterApplyService.getCurrentMeterMoney(middleMeterApply);
|
|
|
|
|
|
@@ -2256,9 +2281,9 @@ public class TaskController extends BladeController {
|
|
inData2.setProjectId(me.getProjectId());
|
|
inData2.setProjectId(me.getProjectId());
|
|
inData2.setPayMoney(currentMeterMoney);
|
|
inData2.setPayMoney(currentMeterMoney);
|
|
interimPayCertificateService.save(inData2);
|
|
interimPayCertificateService.save(inData2);
|
|
- reportId = inData2.getId()+"";
|
|
|
|
- }else{
|
|
|
|
- reportId = inData.getId()+"";
|
|
|
|
|
|
+ reportId = inData2.getId() + "";
|
|
|
|
+ } else {
|
|
|
|
+ reportId = inData.getId() + "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/**计量公式执行 0中间,1材料,2开工*/
|
|
/**计量公式执行 0中间,1材料,2开工*/
|
|
@@ -2275,8 +2300,8 @@ public class TaskController extends BladeController {
|
|
aopParamsSet.add(param);
|
|
aopParamsSet.add(param);
|
|
}
|
|
}
|
|
//
|
|
//
|
|
- if(reportId!=null && StringUtils.isNotEmpty(reportId) && (task.getMeterTaskType()==3 ||task.getMeterTaskType()==1 || task.getMeterTaskType()==2)){
|
|
|
|
- meterPdfInfo(reportId + "", task.getMeterTaskType()-1);
|
|
|
|
|
|
+ if (reportId != null && StringUtils.isNotEmpty(reportId) && (task.getMeterTaskType() == 3 || task.getMeterTaskType() == 1 || task.getMeterTaskType() == 2)) {
|
|
|
|
+ meterPdfInfo(reportId + "", task.getMeterTaskType() - 1);
|
|
}
|
|
}
|
|
|
|
|
|
return R.data(200, aopParamsSet, "操作成功");
|
|
return R.data(200, aopParamsSet, "操作成功");
|
|
@@ -2692,7 +2717,7 @@ public class TaskController extends BladeController {
|
|
Report report = generateReport(Long.parseLong(reportId), type);
|
|
Report report = generateReport(Long.parseLong(reportId), type);
|
|
return generateReportsPdf(report);
|
|
return generateReportsPdf(report);
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return R.fail("计算失败");
|
|
return R.fail("计算失败");
|
|
@@ -2764,10 +2789,10 @@ public class TaskController extends BladeController {
|
|
if (row != null) {
|
|
if (row != null) {
|
|
Cell cell = row.getCell(x1 - 1);
|
|
Cell cell = row.getCell(x1 - 1);
|
|
if (cell != null) {
|
|
if (cell != null) {
|
|
- String value=dataMap.getOrDefault(keys, StringPool.EMPTY).toString();
|
|
|
|
- if(value.startsWith("http")){
|
|
|
|
|
|
+ String value = dataMap.getOrDefault(keys, StringPool.EMPTY).toString();
|
|
|
|
+ if (value.startsWith("http")) {
|
|
InputStream imageIn = CommonUtil.getOSSInputStream(value);
|
|
InputStream imageIn = CommonUtil.getOSSInputStream(value);
|
|
- if(imageIn!=null) {
|
|
|
|
|
|
+ if (imageIn != null) {
|
|
byte[] bytes = CommonUtil.compressImage(IOUtils.toByteArray(imageIn));
|
|
byte[] bytes = CommonUtil.compressImage(IOUtils.toByteArray(imageIn));
|
|
CreationHelper helper = workbook.getCreationHelper();
|
|
CreationHelper helper = workbook.getCreationHelper();
|
|
ClientAnchor anchor = helper.createClientAnchor();
|
|
ClientAnchor anchor = helper.createClientAnchor();
|
|
@@ -2777,7 +2802,7 @@ public class TaskController extends BladeController {
|
|
pict.resize(1, 1);
|
|
pict.resize(1, 1);
|
|
CollectionUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
|
|
CollectionUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
cell.setCellValue(value);
|
|
cell.setCellValue(value);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -2789,7 +2814,7 @@ public class TaskController extends BladeController {
|
|
/*设置表头*/
|
|
/*设置表头*/
|
|
setTitle(sheet, tile);
|
|
setTitle(sheet, tile);
|
|
/*添加电签*/
|
|
/*添加电签*/
|
|
- setDQInfo(sheet,rs.getUrl(),tile);
|
|
|
|
|
|
+ setDQInfo(sheet, rs.getUrl(), tile);
|
|
//去掉表格虚线
|
|
//去掉表格虚线
|
|
sheet.setPrintGridlines(false);
|
|
sheet.setPrintGridlines(false);
|
|
//设置 整个工作表为一页
|
|
//设置 整个工作表为一页
|
|
@@ -2797,7 +2822,7 @@ public class TaskController extends BladeController {
|
|
sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE);
|
|
sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE);
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
workbook.write(out);
|
|
workbook.write(out);
|
|
- // workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
|
|
|
|
+ // workbook.write(new FileOutputStream(rs.getExcelPath()));
|
|
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(new ByteArrayInputStream(out.toByteArray()));
|
|
com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook(new ByteArrayInputStream(out.toByteArray()));
|
|
out.reset();
|
|
out.reset();
|
|
wb.save(out, SaveFormat.PDF);
|
|
wb.save(out, SaveFormat.PDF);
|
|
@@ -2817,11 +2842,11 @@ public class TaskController extends BladeController {
|
|
if (reader != null) reader.close();
|
|
if (reader != null) reader.close();
|
|
doc.close();
|
|
doc.close();
|
|
rs.setPdfOssPath(CompletableFuture.supplyAsync(() -> {
|
|
rs.setPdfOssPath(CompletableFuture.supplyAsync(() -> {
|
|
- String url="无效链接";
|
|
|
|
|
|
+ String url = "无效链接";
|
|
try {
|
|
try {
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(rs.getName() + SnowFlakeUtil.getId() + ".pdf", rs.getPdfPath());
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(rs.getName() + SnowFlakeUtil.getId() + ".pdf", rs.getPdfPath());
|
|
- url = bladeFile.getLink();
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ url = bladeFile.getLink();
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return url;
|
|
return url;
|
|
@@ -2845,13 +2870,13 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 添加电签任务列表
|
|
// 添加电签任务列表
|
|
- public void addSignTaskBatch(Report report){
|
|
|
|
|
|
+ public void addSignTaskBatch(Report report) {
|
|
try {
|
|
try {
|
|
- String sql=" insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name) "+
|
|
|
|
- " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',4+b.meter_task_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name "+
|
|
|
|
- " from u_task_parallel a,u_task b where a.process_instance_id=b.process_instance_id and b.form_data_id="+report.getPeriodId()+" and b.meter_task_type="+(Func.toInt(report.getType())+1);
|
|
|
|
|
|
+ String sql = " insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name) " +
|
|
|
|
+ " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',4+b.meter_task_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name " +
|
|
|
|
+ " from u_task_parallel a,u_task b where a.process_instance_id=b.process_instance_id and b.form_data_id=" + report.getPeriodId() + " and b.meter_task_type=" + (Func.toInt(report.getType()) + 1);
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2875,7 +2900,7 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 添加电签信息数据
|
|
// 添加电签信息数据
|
|
- public void setDQInfo(Sheet sheet, String htmlUrl,String title) {
|
|
|
|
|
|
+ public void setDQInfo(Sheet sheet, String htmlUrl, String title) {
|
|
String file_path = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";//CollectionUtils.getSysLocalFileUrl();
|
|
String file_path = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";//CollectionUtils.getSysLocalFileUrl();
|
|
// 添加电签关键字Id
|
|
// 添加电签关键字Id
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
@@ -2892,18 +2917,18 @@ public class TaskController extends BladeController {
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
org.jsoup.nodes.Document htmldoc = Jsoup.parse(htmlString);
|
|
org.jsoup.nodes.Document htmldoc = Jsoup.parse(htmlString);
|
|
Elements dqlist = htmldoc.getElementsByAttribute("dqid");
|
|
Elements dqlist = htmldoc.getElementsByAttribute("dqid");
|
|
- if(dqlist!=null && dqlist.size()>0){
|
|
|
|
|
|
+ if (dqlist != null && dqlist.size() > 0) {
|
|
dqlist.forEach(element -> {
|
|
dqlist.forEach(element -> {
|
|
System.out.println(element.hasAttr("y1"));
|
|
System.out.println(element.hasAttr("y1"));
|
|
- int y1=0;
|
|
|
|
- int x1=0;
|
|
|
|
- if(!element.hasAttr("y1") && !element.hasAttr("x1")){
|
|
|
|
|
|
+ int y1 = 0;
|
|
|
|
+ int x1 = 0;
|
|
|
|
+ if (!element.hasAttr("y1") && !element.hasAttr("x1")) {
|
|
Element element2 = element.children().get(0);
|
|
Element element2 = element.children().get(0);
|
|
y1 = Func.toInt(element2.attr("y1"));
|
|
y1 = Func.toInt(element2.attr("y1"));
|
|
x1 = Func.toInt(element2.attr("x1"));
|
|
x1 = Func.toInt(element2.attr("x1"));
|
|
- }else{
|
|
|
|
- y1 = Func.toInt(element.attr("y1"));
|
|
|
|
- x1 = Func.toInt(element.attr("x1"));
|
|
|
|
|
|
+ } else {
|
|
|
|
+ y1 = Func.toInt(element.attr("y1"));
|
|
|
|
+ x1 = Func.toInt(element.attr("x1"));
|
|
}
|
|
}
|
|
|
|
|
|
Row row = sheet.getRow(y1 - 1);
|
|
Row row = sheet.getRow(y1 - 1);
|
|
@@ -2921,19 +2946,19 @@ public class TaskController extends BladeController {
|
|
Font newFont = workbook.createFont();
|
|
Font newFont = workbook.createFont();
|
|
newFont.setFontHeightInPoints(workbook.getFontAt(cell.getCellStyle().getFontIndex()).getFontHeightInPoints());
|
|
newFont.setFontHeightInPoints(workbook.getFontAt(cell.getCellStyle().getFontIndex()).getFontHeightInPoints());
|
|
|
|
|
|
- if (dataInfo==null||StringUtil.isEmpty(dataInfo)){
|
|
|
|
|
|
+ if (dataInfo == null || StringUtil.isEmpty(dataInfo)) {
|
|
cell.setCellValue(dqVal);
|
|
cell.setCellValue(dqVal);
|
|
newFont.setFontHeightInPoints((short) 1);
|
|
newFont.setFontHeightInPoints((short) 1);
|
|
newFont.setColor(IndexedColors.WHITE.getIndex());
|
|
newFont.setColor(IndexedColors.WHITE.getIndex());
|
|
cellStyle.setFont(newFont);
|
|
cellStyle.setFont(newFont);
|
|
- }else{
|
|
|
|
- String lastData = dataInfo+"*"+dqVal;
|
|
|
|
|
|
+ } else {
|
|
|
|
+ String lastData = dataInfo + "*" + dqVal;
|
|
RichTextString richString = new XSSFRichTextString(lastData);
|
|
RichTextString richString = new XSSFRichTextString(lastData);
|
|
richString.clearFormatting();
|
|
richString.clearFormatting();
|
|
- richString.applyFont(0,dataInfo.length(),newFont);
|
|
|
|
|
|
+ richString.applyFont(0, dataInfo.length(), newFont);
|
|
newFont.setFontHeightInPoints((short) 1);
|
|
newFont.setFontHeightInPoints((short) 1);
|
|
newFont.setColor(IndexedColors.WHITE.getIndex());
|
|
newFont.setColor(IndexedColors.WHITE.getIndex());
|
|
- richString.applyFont(dataInfo.length(),lastData.length(),newFont);
|
|
|
|
|
|
+ richString.applyFont(dataInfo.length(), lastData.length(), newFont);
|
|
cell.setCellValue(richString);
|
|
cell.setCellValue(richString);
|
|
}
|
|
}
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|