|
@@ -623,7 +623,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
* @throws FileNotFoundException
|
|
|
*/
|
|
|
@Override
|
|
|
- public void batchCompleteApprovalTask(List<TaskApprovalVO> taskApprovalVOS) {
|
|
|
+ public Boolean batchCompleteApprovalTask(List<TaskApprovalVO> taskApprovalVOS) {
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
String nickName = AuthUtil.getNickName();
|
|
|
// 批量审批接口
|
|
@@ -670,7 +670,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- this.taskBatchService.saveBatch(taskList);
|
|
|
+ return this.taskBatchService.saveBatch(taskList);
|
|
|
}else if (taskAppr.getFlag().equals("NO")){ //废除
|
|
|
Set<String> taskIds = taskApprovalVOS.stream().map(TaskApprovalVO::getTaskId).collect(Collectors.toSet());
|
|
|
List<Task> tasks = this.listByIds(taskIds);
|
|
@@ -763,8 +763,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
wbsTreeContractStatisticsClient.updateInformationQueryStatusByTaskId(String.join(",", taskIds));
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2025,15 +2027,33 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
R result = new R();
|
|
|
jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
|
|
|
boolean b = false;
|
|
|
+
|
|
|
+ //是否恢复pdf
|
|
|
+ Boolean isRestorePdf = false;
|
|
|
+ //当前节点的电签pdf
|
|
|
+ String eVisaPdfUrl = "";
|
|
|
+ String pdfUrl = "";
|
|
|
if(type == 1){
|
|
|
+ //当前节点的电签pdf
|
|
|
+ InformationQuery byId = informationQueryService.getById(task.getFormDataId());
|
|
|
+ if(byId != null){
|
|
|
+ eVisaPdfUrl = byId.getEVisaPdfUrl();
|
|
|
+ pdfUrl = byId.getPdfUrl();
|
|
|
+ }
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
.eq(InformationQuery::getId, task.getFormDataId())
|
|
|
.set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
-// .set(InformationQuery::getPdfUrl, null)
|
|
|
+ .set(InformationQuery::getPdfUrl, null)
|
|
|
);
|
|
|
}else {
|
|
|
if(task.getApprovalType()==3){
|
|
|
- b=contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
+ //当前节点的电签pdf
|
|
|
+ ContractLog byId = contractLogService.getById(task.getFormDataId());
|
|
|
+ if(byId != null){
|
|
|
+ eVisaPdfUrl = byId.getEVisaPdfUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+ b=contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
.eq(ContractLog::getId,task.getFormDataId())
|
|
|
.set(ContractLog::getEVisaPdfUrl,null));
|
|
|
if(!b){
|
|
@@ -2041,6 +2061,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
return;
|
|
|
}
|
|
|
}else {
|
|
|
+ //当前节点的电签pdf
|
|
|
+ InformationQuery byId = informationQueryService.getById(task.getFormDataId());
|
|
|
+ if(byId != null){
|
|
|
+ eVisaPdfUrl = byId.getEVisaPdfUrl();
|
|
|
+ }
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
.eq(InformationQuery::getId, task.getFormDataId())
|
|
|
.set(InformationQuery::getEVisaPdfUrl, null));
|
|
@@ -2061,7 +2086,15 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
String sql="select type from u_information_query where id="+task.getFormDataId();
|
|
|
Integer InformationType = jdbcTemplate.queryForObject(sql, new SingleColumnRowMapper<>(Integer.class));
|
|
|
if(InformationType==1){
|
|
|
- result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
|
|
|
+ try {
|
|
|
+ result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
|
|
|
+ //恢复pdf
|
|
|
+ if(result.getCode()!=200){
|
|
|
+ isRestorePdf = true;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ isRestorePdf = true;
|
|
|
+ }
|
|
|
}else {
|
|
|
TrialResignDto dto=new TrialResignDto();
|
|
|
dto.setType(1);
|
|
@@ -2081,14 +2114,23 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
String sql="SELECT * from u_entrust_info where id=(select wbs_id from u_information_query where id="+task.getFormDataId()+")";
|
|
|
EntrustInfo info = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(EntrustInfo.class));
|
|
|
ReSigningEntrustDto dto=new ReSigningEntrustDto(info.getId().toString(),task.getId().toString(),contractId,info.getNodeId(),2,1);
|
|
|
- result=excelTabClient.saveReEntrustTabData(dto,header);
|
|
|
- if(result.getCode()==200){
|
|
|
- if(result.getData()!=null){
|
|
|
- informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
- .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
- .set(InformationQuery::getPdfUrl,result.getData()));
|
|
|
+ try {
|
|
|
+ result=excelTabClient.saveReEntrustTabData(dto,header);
|
|
|
+ if(result.getCode()==200){
|
|
|
+ if(result.getData()!=null){
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getPdfUrl,result.getData()));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //恢复pdf
|
|
|
+ isRestorePdf = true;
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ //恢复pdf
|
|
|
+ isRestorePdf = true;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
long endTime_1 = System.currentTimeMillis();
|
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
@@ -2099,6 +2141,16 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
result.setData("成功");
|
|
|
}
|
|
|
+ //恢复pdf 并且 恢复电签pdf
|
|
|
+ if(isRestorePdf){
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getPdfUrl, pdfUrl)
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, eVisaPdfUrl));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//重新电签
|
|
|
if (result != null && ("成功".equals(result.getData())||200==result.getCode())) {
|
|
|
List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
|
|
@@ -2120,12 +2172,57 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
- this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
+ boolean b1 = this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
+ //如果失败 恢复电签
|
|
|
+ if (!b1) {
|
|
|
+ if (type == 1) {
|
|
|
+ //当前节点的电签pdf
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, eVisaPdfUrl)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (task.getApprovalType() == 3) {
|
|
|
+ contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
+ .eq(ContractLog::getId, task.getFormDataId())
|
|
|
+ .set(ContractLog::getEVisaPdfUrl, eVisaPdfUrl));
|
|
|
+ if (!b) {
|
|
|
+ jdbcTemplate.update("update u_task set is_deleted=1 where id=" + task.getId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, eVisaPdfUrl));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
|
long executionTime_2 = endTime_2 - startTime_2;
|
|
|
log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
|
|
|
} else {
|
|
|
+ if (type == 1) {
|
|
|
+ //当前节点的电签pdf
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, eVisaPdfUrl)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (task.getApprovalType() == 3) {
|
|
|
+ contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
+ .eq(ContractLog::getId, task.getFormDataId())
|
|
|
+ .set(ContractLog::getEVisaPdfUrl, eVisaPdfUrl));
|
|
|
+ if (!b) {
|
|
|
+ jdbcTemplate.update("update u_task set is_deleted=1 where id=" + task.getId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, eVisaPdfUrl));
|
|
|
+ }
|
|
|
+ }
|
|
|
//修改重签状态为保存PDF失败
|
|
|
this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
|
|
|
.set(TaskParallel::getEVisaContent, "重新保存PDF失败")
|