|
@@ -134,9 +134,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
private final TrialSelfInspectionRecordMapper trialSelfInspectionRecordMapper;
|
|
|
private final WbsTreeContractStatisticsClientImpl wbsTreeContractStatisticsClient;
|
|
|
//超级管理员的角色id
|
|
|
- private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
|
|
|
+ private final String SUPER_ADMIN_ROLE_ID = "1123598816738675201";
|
|
|
//泓创智诚公司的部门id
|
|
|
- private final Long HONGCHENG_DEPT_ID = 1536982621165592577L;
|
|
|
+ private final Long HONGCHENG_DEPT_ID = 1536982621165592577L;
|
|
|
|
|
|
@Autowired
|
|
|
StringRedisTemplate RedisTemplate;
|
|
@@ -247,7 +247,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//封面
|
|
|
String url = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
String s = getHppsToHttp(url);
|
|
|
- vo.setApprovalFileList(query.getName(), s, query.getWbsId()+"", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
+ vo.setApprovalFileList(query.getName(), s, query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
//不是签章时再查关联资料,因为关联资料都是审批好的pdf,存在关键字,不能再执行签 字/章
|
|
|
if (!isTask) {
|
|
@@ -257,7 +257,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
InformationQueryFile queryFile = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, query.getId()));
|
|
|
if (queryFile != null) {
|
|
|
- vo.setApprovalFileList(queryFile.getName(), getHppsToHttp(queryFile.getPdfUrl()),query.getWbsId()+"", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
+ vo.setApprovalFileList(queryFile.getName(), getHppsToHttp(queryFile.getPdfUrl()), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -280,13 +280,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//资料填报原始pdf
|
|
|
// String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
/** 修改需求,任务查看时,附件不在列表中显示,需要拼接在电签后面。如果此处修改影响其他地方,则到时候再说*/
|
|
|
- if(isTask){
|
|
|
+ if (isTask) {
|
|
|
String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
- vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
- }else{
|
|
|
+ vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
+ } else {
|
|
|
String approvalPdf = StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() : query.getEVisaPdfUrl();
|
|
|
String approvalPdf2 = StringUtils.isNotEmpty(approvalPdf) ? approvalPdf : query.getPdfUrl();
|
|
|
- vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf2), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
+ vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf2), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
|
|
|
//试验关联文件合并pdf
|
|
@@ -296,7 +296,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
query.setPdfTrialUrl(replaceHTTPURL);
|
|
|
}
|
|
|
String trialPdf = StringUtils.isNotEmpty(query.getPdfTrialUrl()) ? query.getPdfTrialUrl() : null;
|
|
|
- vo.setApprovalFileList(query.getName() + "(关联试验文件)", getHppsToHttp(trialPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
+ vo.setApprovalFileList(query.getName() + "(关联试验文件)", getHppsToHttp(trialPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
|
|
|
//试验关联的工程部位信息合并pdf
|
|
@@ -307,7 +307,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
String trailpdf = StringUtils.isNotEmpty(query.getPdfTrialUrlPosition()) ? query.getPdfTrialUrlPosition() : null;
|
|
|
- vo.setApprovalFileList(query.getName() + "(关联试验工程部位信息文件)", getHppsToHttp(trailpdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
+ vo.setApprovalFileList(query.getName() + "(关联试验工程部位信息文件)", getHppsToHttp(trailpdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
}
|
|
|
} else if (new Integer("2").equals(query.getType())) {
|
|
@@ -329,14 +329,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//试验原始pdf
|
|
|
String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
try {
|
|
|
- String sql="Select * from u_trial_self_inspection_record where id="+query.getWbsId();
|
|
|
+ String sql = "Select * from u_trial_self_inspection_record where id=" + query.getWbsId();
|
|
|
TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
|
|
|
- String sql1="select * from u_entrust_info where id="+record.getEntrustId();
|
|
|
+ String sql1 = "select * from u_entrust_info where id=" + record.getEntrustId();
|
|
|
EntrustInfo entrustInfo = jdbcTemplate.queryForObject(sql1, new BeanPropertyRowMapper<>(EntrustInfo.class));
|
|
|
List<String> pdfList = new ArrayList<>();
|
|
|
- if(entrustInfo!=null){
|
|
|
+ if (entrustInfo != null) {
|
|
|
pdfList.add(approvalPdf);
|
|
|
- pdfList.add(entrustInfo.getEntrustEPdf()!=null?entrustInfo.getEntrustEPdf():entrustInfo.getEntrustPdf());
|
|
|
+ pdfList.add(entrustInfo.getEntrustEPdf() != null ? entrustInfo.getEntrustEPdf() : entrustInfo.getEntrustPdf());
|
|
|
if (pdfList.size() > 0) {
|
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
|
Long id = SnowFlakeUtil.getId();
|
|
@@ -353,10 +353,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- vo.setApprovalFileList(query.getName(), getHppsToHttp(approvalPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
+ vo.setApprovalFileList(query.getName(), getHppsToHttp(approvalPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
|
|
|
//试验关联的原材料检测报告合并pdf (wbsId=试验记录id)
|
|
|
String sqlRecord = "select old_pdf_url from u_trial_raw_material_self_record where self_record_id =" + query.getWbsId();
|
|
@@ -369,7 +369,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
String clPdf = StringUtils.isNotEmpty(recordObj.getOldPdfUrl()) ? recordObj.getOldPdfUrl() : null;
|
|
|
- vo.setApprovalFileList(query.getName() + "(原材料检测报告)", getHppsToHttp(clPdf), query.getWbsId()+"", query.getClassify()+"", query.getProjectId()+"", query.getContractId()+"");
|
|
|
+ vo.setApprovalFileList(query.getName() + "(原材料检测报告)", getHppsToHttp(clPdf), query.getWbsId() + "", query.getClassify() + "", query.getProjectId() + "", query.getContractId() + "");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -401,6 +401,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
return url;
|
|
|
}
|
|
|
+
|
|
|
private String getHppsToHttp(String url) {
|
|
|
String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
|
|
|
if (url.contains("https:") && sys_isonline.equals("20")) {
|
|
@@ -627,9 +628,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
String nickName = AuthUtil.getNickName();
|
|
|
// 批量审批接口
|
|
|
- if(taskApprovalVOS!=null && taskApprovalVOS.size()>0){
|
|
|
+ if (taskApprovalVOS != null && taskApprovalVOS.size() > 0) {
|
|
|
TaskApprovalVO taskAppr = taskApprovalVOS.get(0);
|
|
|
- if(taskAppr.getFlag().equals("OK")){ //同意
|
|
|
+ if (taskAppr.getFlag().equals("OK")) { //同意
|
|
|
List<String> taskIds = taskApprovalVOS.stream().map(TaskApprovalVO::getParallelProcessInstanceId).distinct().collect(Collectors.toList());
|
|
|
this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
|
|
|
.set(TaskParallel::getEVisaContent, "当前等待电签的批次较多,请等待几分钟后刷新页面查看........")
|
|
@@ -657,12 +658,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
taskList.add(taskBatch);
|
|
|
//设置委托单的状态
|
|
|
try {
|
|
|
- String sql="SELECT uei.* FROM u_entrust_info uei JOIN u_trial_self_inspection_record utsr ON uei.id = utsr.entrust_id JOIN u_information_query uiq ON utsr.id = uiq.wbs_id WHERE uiq.id = "+taskApprovalVO.getFormDataId()+" and uiq.status !=3 and uiq.is_deleted=0";
|
|
|
+ String sql = "SELECT uei.* FROM u_entrust_info uei JOIN u_trial_self_inspection_record utsr ON uei.id = utsr.entrust_id JOIN u_information_query uiq ON utsr.id = uiq.wbs_id WHERE uiq.id = " + taskApprovalVO.getFormDataId() + " and uiq.status !=3 and uiq.is_deleted=0";
|
|
|
List<EntrustInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(EntrustInfo.class));
|
|
|
- if(!query.isEmpty()){
|
|
|
+ if (!query.isEmpty()) {
|
|
|
EntrustInfo entrustInfo = query.get(0);
|
|
|
- if(entrustInfo.getStatus()==3){
|
|
|
- String update="update u_entrust_info set status = 4 where id="+entrustInfo.getId();
|
|
|
+ if (entrustInfo.getStatus() == 3) {
|
|
|
+ String update = "update u_entrust_info set status = 4 where id=" + entrustInfo.getId();
|
|
|
jdbcTemplate.execute(update);
|
|
|
}
|
|
|
}
|
|
@@ -671,7 +672,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
this.taskBatchService.saveBatch(taskList);
|
|
|
- }else if (taskAppr.getFlag().equals("NO")){ //废除
|
|
|
+ } else if (taskAppr.getFlag().equals("NO")) { //废除
|
|
|
Set<String> taskIds = taskApprovalVOS.stream().map(TaskApprovalVO::getTaskId).collect(Collectors.toSet());
|
|
|
List<Task> tasks = this.listByIds(taskIds);
|
|
|
Map<String, Task> taskMap = tasks.stream().collect(Collectors.toMap(task -> task.getId() + "", task -> task));
|
|
@@ -688,19 +689,19 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
// 废除信息
|
|
|
Integer appType = taskApp.getApprovalType();
|
|
|
//质检系统
|
|
|
- String up_task_par = "update u_task_parallel set status=3 , e_visa_content = '驳回成功,驳回原因:" + taskApp.getComment() + "', initiative=10,update_time=SYSDATE(),update_user="+userId+" where parallel_process_instance_id='"+taskApp.getParallelProcessInstanceId()+"'";
|
|
|
- String up_task = "update u_task set status=3, update_time=SYSDATE(),update_user="+userId+" where id='"+taskApp.getTaskId()+"'";
|
|
|
- this.jdbcTemplate.execute("delete from u_task_batch where JSON_UNQUOTE(JSON_EXTRACT(json_data, '$.taskId'))="+taskApp.getTaskId()+"");
|
|
|
+ String up_task_par = "update u_task_parallel set status=3 , e_visa_content = '驳回成功,驳回原因:" + taskApp.getComment() + "', initiative=10,update_time=SYSDATE(),update_user=" + userId + " where parallel_process_instance_id='" + taskApp.getParallelProcessInstanceId() + "'";
|
|
|
+ String up_task = "update u_task set status=3, update_time=SYSDATE(),update_user=" + userId + " where id='" + taskApp.getTaskId() + "'";
|
|
|
+ this.jdbcTemplate.execute("delete from u_task_batch where JSON_UNQUOTE(JSON_EXTRACT(json_data, '$.taskId'))=" + taskApp.getTaskId() + "");
|
|
|
jdbcTemplate.execute(up_task_par);
|
|
|
jdbcTemplate.execute(up_task);
|
|
|
|
|
|
- if(taskApp.getApprovalType() == 3){
|
|
|
- jdbcTemplate.execute("update u_contract_log set status=3 where id='"+taskApp.getFormDataId()+"'");
|
|
|
- }else if (taskApp.getApprovalType()==8) {
|
|
|
- this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='"+taskApp.getFormDataId()+"')");
|
|
|
- this.jdbcTemplate.execute("update u_information_query set status=3 where id='"+taskApp.getFormDataId()+"'");
|
|
|
- }else {
|
|
|
- jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='"+taskApp.getFormDataId()+"'");
|
|
|
+ if (taskApp.getApprovalType() == 3) {
|
|
|
+ jdbcTemplate.execute("update u_contract_log set status=3 where id='" + taskApp.getFormDataId() + "'");
|
|
|
+ } else if (taskApp.getApprovalType() == 8) {
|
|
|
+ this.jdbcTemplate.execute("update u_entrust_info set status=1 where id=(SELECT wbs_id from u_information_query where id='" + taskApp.getFormDataId() + "')");
|
|
|
+ this.jdbcTemplate.execute("update u_information_query set status=3 where id='" + taskApp.getFormDataId() + "'");
|
|
|
+ } else {
|
|
|
+ jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='" + taskApp.getFormDataId() + "'");
|
|
|
InformationQuery informationQuery = informationQueryService.getById(taskApp.getFormDataId());
|
|
|
Long primaryKeyId = informationQuery.getWbsId();
|
|
|
informationQuery.setStatus(0);
|
|
@@ -768,7 +769,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
|
|
|
- // @Scheduled(cron = "0/20 * * * * ?")
|
|
|
+ // @Scheduled(cron = "0/20 * * * * ?")
|
|
|
/* public void SignInfo() throws InterruptedException {
|
|
|
//执行代码
|
|
|
logger.debug("扫描开始");
|
|
@@ -1119,7 +1120,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
* 质检-日志重签
|
|
|
*/
|
|
|
@Override
|
|
|
- public void logReSigningEVisa( String logids,Long logPkeyId, Long nodePrimaryKeyId, String contractId ,HttpServletRequest request, Integer type) {
|
|
|
+ public void logReSigningEVisa(String logids, Long logPkeyId, Long nodePrimaryKeyId, String contractId, HttpServletRequest request, Integer type) {
|
|
|
List<Task> taskList = jdbcTemplate.query("select * from u_task where is_deleted = 0 and status != 3 and form_data_id in(" + logids + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (taskList.size() > 0) {
|
|
|
//获取任务详情信息Map
|
|
@@ -1141,14 +1142,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
for (Task task : taskList) {
|
|
|
ContractLog contractLog = contractLogMap.get(Long.valueOf(task.getFormDataId()));
|
|
|
R result = new R();
|
|
|
- jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
|
|
|
+ jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
|
|
|
boolean b = false;
|
|
|
- if(type == 1){
|
|
|
- b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
|
|
|
+ if (type == 1) {
|
|
|
+ b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
|
|
|
.set(ContractLog::getEVisaPdfUrl, null)
|
|
|
.set(ContractLog::getPdfUrl, null));
|
|
|
- }else {
|
|
|
- b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
|
|
|
+ } else {
|
|
|
+ b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
|
|
|
.set(ContractLog::getEVisaPdfUrl, null));
|
|
|
}
|
|
|
|
|
@@ -1158,12 +1159,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
long startTime_1 = System.currentTimeMillis();
|
|
|
//获取详细的日志数据
|
|
|
|
|
|
- result = excelTabClient.getTheContractLogBusinessData(logPkeyId.toString(), nodePrimaryKeyId.toString(), contractLog.getRecordTime(), contractId,contractLog.getCreateUser());
|
|
|
+ result = excelTabClient.getTheContractLogBusinessData(logPkeyId.toString(), nodePrimaryKeyId.toString(), contractLog.getRecordTime(), contractId, contractLog.getCreateUser());
|
|
|
long endTime_1 = System.currentTimeMillis();
|
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
- }else{
|
|
|
- if (!b){
|
|
|
+ } else {
|
|
|
+ if (!b) {
|
|
|
throw new ServiceException("清空电签PDF失败");
|
|
|
}
|
|
|
result.setData("成功");
|
|
@@ -1188,7 +1189,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
- if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
+ if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
|
|
|
this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
}
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
@@ -1216,7 +1217,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
}
|
|
|
}
|
|
@@ -1245,13 +1246,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
try {
|
|
|
for (Task task : taskList) {
|
|
|
R result = new R();
|
|
|
- jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
|
|
|
+ jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
|
|
|
boolean b = false;
|
|
|
- if(type == 1){
|
|
|
+ if (type == 1) {
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
.eq(InformationQuery::getId, task.getFormDataId())
|
|
|
.set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
.eq(InformationQuery::getId, task.getFormDataId())
|
|
|
.set(InformationQuery::getEVisaPdfUrl, null));
|
|
@@ -1260,12 +1261,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
if (type == 1) {
|
|
|
//重新保存
|
|
|
long startTime_1 = System.currentTimeMillis();
|
|
|
- result = this.saveTrialSelfNodePdf(dto,queryMap.get(task.getFormDataId()));
|
|
|
+ result = this.saveTrialSelfNodePdf(dto, queryMap.get(task.getFormDataId()));
|
|
|
long endTime_1 = System.currentTimeMillis();
|
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
- }else{
|
|
|
- if (!b){
|
|
|
+ } else {
|
|
|
+ if (!b) {
|
|
|
throw new ServiceException("清空电签PDF失败");
|
|
|
}
|
|
|
result.setData("成功");
|
|
@@ -1276,7 +1277,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
|
|
|
for (TaskParallel taskParallel : taskParallelList) {
|
|
|
//待审批的不进行重签, 存在待审批,但是电签状态是失败的
|
|
|
- if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
|
|
|
+ if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
|
|
|
TaskApprovalVO approvalVO = new TaskApprovalVO();
|
|
|
approvalVO.setTaskId(task.getId().toString());
|
|
|
approvalVO.setFlag("OK");
|
|
@@ -1290,7 +1291,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
- if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
+ if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
|
|
|
this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
}
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
@@ -1316,7 +1317,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
e.printStackTrace();
|
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
}
|
|
|
|
|
@@ -1327,10 +1328,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
public void reSigningEntrust(List<ReSigningEntrustDto> dtos, String header, HttpServletRequest request) {
|
|
|
String taskIds = dtos.stream().map(d -> d.getTaskId()).collect(Collectors.joining(","));
|
|
|
Map<String, ReSigningEntrustDto> map = dtos.stream()
|
|
|
- .filter(dto -> dto.getTaskId() != null) // 确保taskId不为空
|
|
|
- .collect(Collectors.toMap(ReSigningEntrustDto::getTaskId, dto -> dto));
|
|
|
+ .filter(dto -> dto.getTaskId() != null) // 确保taskId不为空
|
|
|
+ .collect(Collectors.toMap(ReSigningEntrustDto::getTaskId, dto -> dto));
|
|
|
Map<Long, ReSigningEntrustDto> longMap = map.values().stream()
|
|
|
- .collect(Collectors.toMap(ReSigningEntrustDto::getTaskIdLong, dto -> dto));
|
|
|
+ .collect(Collectors.toMap(ReSigningEntrustDto::getTaskIdLong, dto -> dto));
|
|
|
//查询任务信息
|
|
|
List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (taskList.size() > 0) {
|
|
@@ -1339,8 +1340,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
|
|
|
if (processInstanceIds.size() > 0) {
|
|
|
String resultIds = processInstanceIds.stream()
|
|
|
- .map(id -> "'" + id + "'")
|
|
|
- .collect(Collectors.joining(","));
|
|
|
+ .map(id -> "'" + id + "'")
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
|
|
|
}
|
|
|
Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
|
|
@@ -1348,20 +1349,20 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
for (int i = 0; i < taskList.size(); i++) {
|
|
|
ReSigningEntrustDto dto = longMap.get(taskList.get(i).getId());
|
|
|
R result = new R();
|
|
|
- jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+taskList.get(i).getId()+"%'");
|
|
|
+ jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + taskList.get(i).getId() + "%'");
|
|
|
boolean b = false;
|
|
|
- if(dto.getType() == 1){
|
|
|
+ if (dto.getType() == 1) {
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
- .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
|
|
|
- .set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
- .set(InformationQuery::getPdfUrl, null));
|
|
|
- String update="update u_entrust_info set entrust_e_pdf=null,entrust_pdf=null where id="+dto.getEntrustId();
|
|
|
+ .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
+ .set(InformationQuery::getPdfUrl, null));
|
|
|
+ String update = "update u_entrust_info set entrust_e_pdf=null,entrust_pdf=null where id=" + dto.getEntrustId();
|
|
|
jdbcTemplate.update(update);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
- .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
|
|
|
- .set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
- String update="update u_entrust_info set entrust_e_pdf=null where id="+dto.getEntrustId();
|
|
|
+ .eq(InformationQuery::getId, taskList.get(i).getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
+ String update = "update u_entrust_info set entrust_e_pdf=null where id=" + dto.getEntrustId();
|
|
|
jdbcTemplate.update(update);
|
|
|
}
|
|
|
|
|
@@ -1369,12 +1370,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
if (dto.getType() == 1) {
|
|
|
//重新保存
|
|
|
long startTime_1 = System.currentTimeMillis();
|
|
|
- result=excelTabClient.saveReEntrustTabData(dto,header);
|
|
|
+ result = excelTabClient.saveReEntrustTabData(dto, header);
|
|
|
long endTime_1 = System.currentTimeMillis();
|
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
- }else{
|
|
|
- if (!b){
|
|
|
+ } else {
|
|
|
+ if (!b) {
|
|
|
throw new ServiceException("清空电签PDF失败");
|
|
|
}
|
|
|
result.setData("成功");
|
|
@@ -1385,7 +1386,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(taskList.get(i).getProcessInstanceId());
|
|
|
for (TaskParallel taskParallel : taskParallelList) {
|
|
|
//待审批的不进行重签, 存在待审批,但是电签状态是失败的
|
|
|
- if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
|
|
|
+ if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
|
|
|
TaskApprovalVO approvalVO = new TaskApprovalVO();
|
|
|
approvalVO.setTaskId(taskList.get(i).getId().toString());
|
|
|
approvalVO.setFlag("OK");
|
|
@@ -1399,11 +1400,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
- if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
+ if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
|
|
|
this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
}
|
|
|
- if(result.getData()!=null){
|
|
|
- String update="update u_entrust_info set entrust_pdf= '"+result.getData()+"' where id="+dto.getEntrustId();
|
|
|
+ if (result.getData() != null) {
|
|
|
+ String update = "update u_entrust_info set entrust_pdf= '" + result.getData() + "' where id=" + dto.getEntrustId();
|
|
|
jdbcTemplate.update(update);
|
|
|
}
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
@@ -1412,8 +1413,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
} else {
|
|
|
//修改重签状态为保存PDF失败
|
|
|
this.taskParallelService.update(Wrappers.<TaskParallel>lambdaUpdate()
|
|
|
- .set(TaskParallel::getEVisaContent, "重新保存PDF失败")
|
|
|
- .eq(TaskParallel::getProcessInstanceId, taskList.get(i).getProcessInstanceId()));
|
|
|
+ .set(TaskParallel::getEVisaContent, "重新保存PDF失败")
|
|
|
+ .eq(TaskParallel::getProcessInstanceId, taskList.get(i).getProcessInstanceId()));
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -1421,14 +1422,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- private R saveTrialSelfNodePdf(TrialResignDto dto,String trialId) {
|
|
|
+ private R saveTrialSelfNodePdf(TrialResignDto dto, String trialId) {
|
|
|
//试验记录id
|
|
|
String trialIds = dto.getTrialIds();
|
|
|
TrialSelfInspectionRecord tRecord = trialSelfInspectionRecordMapper.selectById(trialIds);
|
|
@@ -1551,7 +1551,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
// } else {
|
|
|
// throw new ServiceException("开启并行流程失败");
|
|
|
// }
|
|
|
- taskParallelArray.add(new TaskParallel(vo.getProcessInstanceId(), SnowFlakeUtil.getId() + "", link.getFixedFlowLinkUser().toString(), link.getFixedFlowLinkUserName()));
|
|
|
+ taskParallelArray.add(new TaskParallel(vo.getProcessInstanceId(), SnowFlakeUtil.getId() + "", link.getFixedFlowLinkUser().toString(), link.getFixedFlowLinkUserName()));
|
|
|
}
|
|
|
//设置流程信息
|
|
|
vo.setProcessDefinitionId(taskFlowId);
|
|
@@ -1661,8 +1661,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
try {
|
|
|
System.out.println("----- 电签成功--------");
|
|
|
//添加nodePdf的值
|
|
|
- List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + "+formDataId+")");
|
|
|
- if(Func.isNotEmpty(mapList)&&mapList.size()>=1) {
|
|
|
+ List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + " + formDataId + ")");
|
|
|
+ if (Func.isNotEmpty(mapList) && mapList.size() >= 1) {
|
|
|
String file_path = org.springblade.business.utils.FileUtils.getSysLocalFileUrl();
|
|
|
List<String> datainfo = new ArrayList<>();
|
|
|
datainfo.add(newFileUrl);
|
|
@@ -1685,7 +1685,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
nodePdfUrl = org.springblade.business.utils.FileUtils.getNetUrl(listPdf);
|
|
|
}
|
|
|
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
nodePdfUrl = newFileUrl;
|
|
|
}
|
|
|
|
|
@@ -1744,7 +1744,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//修改试验业务状态(已审批的情况下修改)
|
|
|
if (new Integer(2).equals(queryinfo.getType()) && ObjectUtil.isNotEmpty(queryinfo.getWbsId()) && status != 3) {
|
|
|
jdbcTemplate.execute("update u_trial_self_inspection_record set task_status = '已审批' where id = " + queryinfo.getWbsId());
|
|
|
- jdbcTemplate.execute("update u_entrust_info set status = 4 where id = (select entrust_id from u_trial_self_inspection_record where id = '" + queryinfo.getWbsId()+ "')");
|
|
|
+ jdbcTemplate.execute("update u_entrust_info set status = 4 where id = (select entrust_id from u_trial_self_inspection_record where id = '" + queryinfo.getWbsId() + "')");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1789,7 +1789,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
ArchiveProjectConfig archiveProjectConfig = archiveAutoClient.getByProjectIdOrNew(query.getProjectId());
|
|
|
|
|
|
//测试阶段,必须打开项目配置才能同步wbs节点
|
|
|
- if (archiveProjectConfig != null ) {
|
|
|
+ if (archiveProjectConfig != null) {
|
|
|
//废除
|
|
|
if (status == 0) {
|
|
|
delArchiveFileBusinessData(query.getProjectId(), query.getWbsId());
|
|
@@ -1904,104 +1904,106 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
archiveFileService.deleteLogic(ids);
|
|
|
}
|
|
|
}
|
|
|
-/*
|
|
|
- @Override
|
|
|
- public void reSigningEVisa(String taskIds, String contractId, String projectId,String header,HttpServletRequest request) {
|
|
|
- List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
- if (taskList.size() > 0) {
|
|
|
- List<String> dataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
- List<InformationQuery> informationQueryList = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
- if (informationQueryList.size() > 0) {
|
|
|
- List<Long> nodePKeyIdList = informationQueryList.stream().map(InformationQuery::getWbsId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
- if (nodePKeyIdList.size() > 0) {
|
|
|
- try {
|
|
|
- // 重新保存
|
|
|
- long startTime_1 = System.currentTimeMillis();
|
|
|
- R result = this.saveNodePdf( ,StringUtils.join(nodePKeyIdList, ","), contractId, projectId,header);
|
|
|
- long endTime_1 = System.currentTimeMillis();
|
|
|
- long executionTime_1 = endTime_1 - startTime_1;
|
|
|
- log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
|
|
|
- // 重新电签
|
|
|
- if (result != null && "成功".equals(result.getData())) {
|
|
|
-
|
|
|
- List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
|
|
|
- // 获取任务详情信息Map
|
|
|
- Set<String> processInstanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
|
|
|
- Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
|
|
|
- if (processInstanceIds.size() > 0) {
|
|
|
- String resultIds = processInstanceIds.stream()
|
|
|
- .map(id -> "'" + id + "'")
|
|
|
- .collect(Collectors.joining(","));
|
|
|
- taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
|
|
|
- }
|
|
|
- Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
|
|
|
-
|
|
|
- for (Task task : taskList) {
|
|
|
- List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
|
|
|
- for (TaskParallel taskParallel : taskParallelList) {
|
|
|
- //待审批的不进行重签, 存在待审批,但是电签状态是失败的
|
|
|
- if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
|
|
|
- TaskApprovalVO approvalVO = new TaskApprovalVO();
|
|
|
- approvalVO.setTaskId(task.getId().toString());
|
|
|
- approvalVO.setFlag("OK");
|
|
|
- approvalVO.setComment("重新发起电签");
|
|
|
- approvalVO.setApprovalType(1);
|
|
|
- approvalVO.setFormDataId(task.getFormDataId());
|
|
|
- approvalVO.setParallelProcessInstanceId(taskParallel.getParallelProcessInstanceId());
|
|
|
- approvalVO.setYsNickName(taskParallel.getTaskUserName());
|
|
|
- approvalVO.setUserId(Long.parseLong(taskParallel.getTaskUser()));
|
|
|
- taskApprovalVOS.add(approvalVO);
|
|
|
+ /*
|
|
|
+ @Override
|
|
|
+ public void reSigningEVisa(String taskIds, String contractId, String projectId,String header,HttpServletRequest request) {
|
|
|
+ List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ if (taskList.size() > 0) {
|
|
|
+ List<String> dataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
+ List<InformationQuery> informationQueryList = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
+ if (informationQueryList.size() > 0) {
|
|
|
+ List<Long> nodePKeyIdList = informationQueryList.stream().map(InformationQuery::getWbsId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
+ if (nodePKeyIdList.size() > 0) {
|
|
|
+ try {
|
|
|
+ // 重新保存
|
|
|
+ long startTime_1 = System.currentTimeMillis();
|
|
|
+ R result = this.saveNodePdf( ,StringUtils.join(nodePKeyIdList, ","), contractId, projectId,header);
|
|
|
+ long endTime_1 = System.currentTimeMillis();
|
|
|
+ long executionTime_1 = endTime_1 - startTime_1;
|
|
|
+ log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
+
|
|
|
+ // 重新电签
|
|
|
+ if (result != null && "成功".equals(result.getData())) {
|
|
|
+
|
|
|
+ List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
|
|
|
+ // 获取任务详情信息Map
|
|
|
+ Set<String> processInstanceIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toSet());
|
|
|
+ Map<String, List<TaskParallel>> taskParallelGroupMap = new HashMap<>();
|
|
|
+ if (processInstanceIds.size() > 0) {
|
|
|
+ String resultIds = processInstanceIds.stream()
|
|
|
+ .map(id -> "'" + id + "'")
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ taskParallelGroupMap = jdbcTemplate.query("select parallel_process_instance_id,process_instance_id,e_visa_status,task_user,task_user_name,status from u_task_parallel where process_instance_id in(" + resultIds + ") order by id", new BeanPropertyRowMapper<>(TaskParallel.class)).stream().collect(Collectors.groupingBy(TaskParallel::getProcessInstanceId));
|
|
|
+ }
|
|
|
+ Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
|
|
|
+
|
|
|
+ for (Task task : taskList) {
|
|
|
+ List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
|
|
|
+ for (TaskParallel taskParallel : taskParallelList) {
|
|
|
+ //待审批的不进行重签, 存在待审批,但是电签状态是失败的
|
|
|
+ if (!(new Integer(1)).equals(taskParallel.getStatus()) || (taskParallel.getEVisaStatus() != null && taskParallel.getEVisaStatus() == 99)) {
|
|
|
+ TaskApprovalVO approvalVO = new TaskApprovalVO();
|
|
|
+ approvalVO.setTaskId(task.getId().toString());
|
|
|
+ approvalVO.setFlag("OK");
|
|
|
+ approvalVO.setComment("重新发起电签");
|
|
|
+ approvalVO.setApprovalType(1);
|
|
|
+ approvalVO.setFormDataId(task.getFormDataId());
|
|
|
+ approvalVO.setParallelProcessInstanceId(taskParallel.getParallelProcessInstanceId());
|
|
|
+ approvalVO.setYsNickName(taskParallel.getTaskUserName());
|
|
|
+ approvalVO.setUserId(Long.parseLong(taskParallel.getTaskUser()));
|
|
|
+ taskApprovalVOS.add(approvalVO);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ long startTime_2 = System.currentTimeMillis();
|
|
|
+ this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
+ long endTime_2 = System.currentTimeMillis();
|
|
|
+ long executionTime_2 = endTime_2 - startTime_2;
|
|
|
+ log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("重新保存PDF信息失败");
|
|
|
}
|
|
|
- long startTime_2 = System.currentTimeMillis();
|
|
|
- this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
- long endTime_2 = System.currentTimeMillis();
|
|
|
- long executionTime_2 = endTime_2 - startTime_2;
|
|
|
- log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
|
|
|
- } else {
|
|
|
- throw new ServiceException("重新保存PDF信息失败");
|
|
|
- }
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
+ }*/
|
|
|
+ @Override
|
|
|
+ public R reSigningEVisaStatus0(List<reSigningEVisaStatus> dtos, String header) throws Exception {
|
|
|
+ if (dtos.size() > 0) {
|
|
|
+ Set<Long> newIds = dtos.stream().map(reSigningEVisaStatus::getId).collect(Collectors.toSet());
|
|
|
+ //正在重刷的不允许再次重刷
|
|
|
+ informationQueryService.update(Wrappers.<InformationQuery>update().lambda()
|
|
|
+ .set(InformationQuery::getSaveAgain, 0)
|
|
|
+ .ne(InformationQuery::getSaveAgain, 1)
|
|
|
+ .in(InformationQuery::getId, newIds));
|
|
|
}
|
|
|
- throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
- }*/
|
|
|
- @Override
|
|
|
- public R reSigningEVisaStatus0(List<reSigningEVisaStatus> dtos, String header) throws Exception {
|
|
|
- if(dtos.size()>0){
|
|
|
- Set<Long> newIds = dtos.stream().map(reSigningEVisaStatus::getId).collect(Collectors.toSet());
|
|
|
- //正在重刷的不允许再次重刷
|
|
|
- informationQueryService.update(Wrappers.<InformationQuery>update().lambda()
|
|
|
- .set(InformationQuery::getSaveAgain, 0)
|
|
|
- .ne(InformationQuery::getSaveAgain, 1)
|
|
|
- .in(InformationQuery::getId, newIds));
|
|
|
- }
|
|
|
- return R.success("操作成功");
|
|
|
+ return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void logSaveAgain(LogSaveAgainDto dto) throws Exception {
|
|
|
List<ContractLog> contractLogList = jdbcTemplate.query("select * from u_contract_log where id in (" + dto.getLogIds() + ")", new BeanPropertyRowMapper<>(ContractLog.class));
|
|
|
- if(contractLogList.size()>0){
|
|
|
+ if (contractLogList.size() > 0) {
|
|
|
for (ContractLog contractLog : contractLogList) {
|
|
|
contractLogService.update(new LambdaUpdateWrapper<ContractLog>().eq(ContractLog::getId, contractLog.getId())
|
|
|
- .set(ContractLog::getEVisaPdfUrl, null)
|
|
|
- .set(ContractLog::getPdfUrl, null));
|
|
|
+ .set(ContractLog::getEVisaPdfUrl, null)
|
|
|
+ .set(ContractLog::getPdfUrl, null));
|
|
|
//excelTabClient.getTheContractLogBusinessData(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(), contractLog.getCreateUser());
|
|
|
- excelTabClient.getTheLogPdInfo(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(),contractLog.getCreateUser());
|
|
|
+ excelTabClient.getTheLogPdInfo(dto.getLogPkeyId(), dto.getNodePrimaryKeyId(), contractLog.getRecordTime(), dto.getContractId(), contractLog.getCreateUser());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
- public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header,HttpServletRequest request ) {
|
|
|
+ public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header, HttpServletRequest request) {
|
|
|
//查询任务信息
|
|
|
List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (taskList.size() > 0) {
|
|
@@ -2023,27 +2025,27 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
try {
|
|
|
for (Task task : taskList) {
|
|
|
R result = new R();
|
|
|
- jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
|
|
|
+ jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%" + task.getId() + "%'");
|
|
|
boolean b = false;
|
|
|
- if(type == 1){
|
|
|
- b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
- .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
- .set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
+ if (type == 1) {
|
|
|
+ b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
// .set(InformationQuery::getPdfUrl, null)
|
|
|
- );
|
|
|
- }else {
|
|
|
- if(task.getApprovalType()==3){
|
|
|
- b=contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
- .eq(ContractLog::getId,task.getFormDataId())
|
|
|
- .set(ContractLog::getEVisaPdfUrl,null));
|
|
|
- if(!b){
|
|
|
- jdbcTemplate.update("update u_task set is_deleted=1 where id="+task.getId());
|
|
|
- return;
|
|
|
- }
|
|
|
- }else {
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (task.getApprovalType() == 3) {
|
|
|
+ b = contractLogService.update(new LambdaUpdateWrapper<ContractLog>()
|
|
|
+ .eq(ContractLog::getId, task.getFormDataId())
|
|
|
+ .set(ContractLog::getEVisaPdfUrl, null));
|
|
|
+ if (!b) {
|
|
|
+ jdbcTemplate.update("update u_task set is_deleted=1 where id=" + task.getId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
- .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
- .set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -2057,55 +2059,55 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//重新保存
|
|
|
long startTime_1 = System.currentTimeMillis();
|
|
|
//质检资料
|
|
|
- if(task.getApprovalType()==1 || task.getApprovalType()== 9){
|
|
|
- String sql="select type from u_information_query where id="+task.getFormDataId();
|
|
|
+ if (task.getApprovalType() == 1 || task.getApprovalType() == 9) {
|
|
|
+ String sql = "select type from u_information_query where id=" + task.getFormDataId();
|
|
|
Integer InformationType = jdbcTemplate.queryForObject(sql, new SingleColumnRowMapper<>(Integer.class));
|
|
|
- if(InformationType==1){
|
|
|
+ if (InformationType == 1) {
|
|
|
result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
|
|
|
- }else {
|
|
|
- TrialResignDto dto=new TrialResignDto();
|
|
|
+ } else {
|
|
|
+ TrialResignDto dto = new TrialResignDto();
|
|
|
dto.setType(1);
|
|
|
dto.setProjectId(projectId);
|
|
|
dto.setTrialIds(queryMap.get(task.getFormDataId()));
|
|
|
- result=this.saveTrialSelfNodePdf(dto,queryMap.get(task.getFormDataId()));
|
|
|
+ result = this.saveTrialSelfNodePdf(dto, queryMap.get(task.getFormDataId()));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//日志资料
|
|
|
- if(task.getApprovalType()==3){
|
|
|
+ if (task.getApprovalType() == 3) {
|
|
|
ContractLog contractLog = jdbcTemplate.queryForObject("select * from u_contract_log where id =" + task.getFormDataId(), new BeanPropertyRowMapper<>(ContractLog.class));
|
|
|
- result = excelTabClient.getTheContractLogBusinessData(contractLog.getTableId().toString(), contractLog.getWbsNodeId().toString(), contractLog.getRecordTime(), contractId,contractLog.getCreateUser());
|
|
|
+ result = excelTabClient.getTheContractLogBusinessData(contractLog.getTableId().toString(), contractLog.getWbsNodeId().toString(), contractLog.getRecordTime(), contractId, contractLog.getCreateUser());
|
|
|
}
|
|
|
//委托单重签
|
|
|
- if(task.getApprovalType()==8){
|
|
|
- String sql="SELECT * from u_entrust_info where id=(select wbs_id from u_information_query where id="+task.getFormDataId()+")";
|
|
|
+ if (task.getApprovalType() == 8) {
|
|
|
+ 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){
|
|
|
+ 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()));
|
|
|
+ .eq(InformationQuery::getId, task.getFormDataId())
|
|
|
+ .set(InformationQuery::getPdfUrl, result.getData()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
long endTime_1 = System.currentTimeMillis();
|
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
|
- }else{
|
|
|
- if (!b){
|
|
|
+ } else {
|
|
|
+ if (!b) {
|
|
|
throw new ServiceException("清空电签PDF失败");
|
|
|
}
|
|
|
result.setData("成功");
|
|
|
}
|
|
|
//重新电签
|
|
|
- if (result != null && ("成功".equals(result.getData())||200==result.getCode())) {
|
|
|
+ if (result != null && ("成功".equals(result.getData()) || 200 == result.getCode())) {
|
|
|
List<TaskApprovalVO> taskApprovalVOS = new ArrayList<>();
|
|
|
List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
|
|
|
for (TaskParallel taskParallel : taskParallelList) {
|
|
|
//待审批的不进行重签, 存在待审批,但是电签状态是失败的
|
|
|
- if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent()) ) {
|
|
|
+ if ((new Integer(2)).equals(taskParallel.getStatus()) || Func.isNotEmpty(taskParallel.getEVisaStatus()) || Func.isNotEmpty(taskParallel.getEVisaContent())) {
|
|
|
TaskApprovalVO approvalVO = new TaskApprovalVO();
|
|
|
approvalVO.setTaskId(task.getId().toString());
|
|
|
approvalVO.setFlag("OK");
|
|
@@ -2119,7 +2121,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
- if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
+ if (taskApprovalVOS != null && taskApprovalVOS.size() >= 1) {
|
|
|
this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
}
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
@@ -2136,7 +2138,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
Long userId = AuthUtil.getUserId(request);
|
|
|
String userName = AuthUtil.getNickName(request);
|
|
|
//判断是否是超级管理员并且是泓创智诚下的部门
|
|
|
- if(judgeRoleIdAndDeptId(userId)){
|
|
|
+ if (judgeRoleIdAndDeptId(userId)) {
|
|
|
//满足去除当前填报人的条件 去除当前任务的填报人中当前操作人的信息
|
|
|
removeUserAndName(taskIds, userId, userName);
|
|
|
}
|
|
@@ -2145,7 +2147,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new ServiceException("未获取到任务信息,操作失败!");
|
|
|
}
|
|
|
}
|
|
@@ -2156,32 +2158,31 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 返回true代表满足条件 是超级管理员并且部门是在泓创智诚下面的部门
|
|
|
*/
|
|
|
- public boolean judgeRoleIdAndDeptId(Long userId ){
|
|
|
+ public boolean judgeRoleIdAndDeptId(Long userId) {
|
|
|
try {
|
|
|
- String sqlForUser = "select role_id ,dept_id from blade_user where id = "+userId;
|
|
|
+ String sqlForUser = "select role_id ,dept_id from blade_user where id = " + userId;
|
|
|
User user = jdbcTemplate.queryForObject(sqlForUser, new BeanPropertyRowMapper<>(User.class));
|
|
|
- String sqlforSkipDept = "select id from blade_dept where parent_id = "+HONGCHENG_DEPT_ID + " or id = "+HONGCHENG_DEPT_ID;
|
|
|
+ String sqlforSkipDept = "select id from blade_dept where parent_id = " + HONGCHENG_DEPT_ID + " or id = " + HONGCHENG_DEPT_ID;
|
|
|
List<Dept> depts = jdbcTemplate.query(sqlforSkipDept, new BeanPropertyRowMapper<>(Dept.class));
|
|
|
String roleId = user.getRoleId();
|
|
|
String deptId = user.getDeptId();
|
|
|
- if(roleId==null||deptId==null){
|
|
|
+ if (roleId == null || deptId == null) {
|
|
|
return true;
|
|
|
}
|
|
|
//既是超级管理员同时是泓创下面的部门才允许跳过填报人赋值
|
|
|
- if(roleId!=null&&roleId.contains(SUPER_ADMIN_ROLE_ID)){
|
|
|
+ if (roleId != null && roleId.contains(SUPER_ADMIN_ROLE_ID)) {
|
|
|
Boolean flag = false;
|
|
|
for (Dept dept : depts) {
|
|
|
- if(deptId!=null&&deptId.contains(dept.getId().toString())){
|
|
|
+ if (deptId != null && deptId.contains(dept.getId().toString())) {
|
|
|
flag = true;
|
|
|
return flag;
|
|
|
}
|
|
|
}
|
|
|
return flag;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return false;
|
|
|
}
|
|
|
} catch (DataAccessException e) {
|
|
@@ -2197,26 +2198,26 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
try {
|
|
|
String[] split1 = taskIds.split(",");
|
|
|
for (String taskId : split1) {
|
|
|
- String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" +taskId+ ")";
|
|
|
+ String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" + taskId + ")";
|
|
|
InformationQuery informationQuery = jdbcTemplate.queryForObject(sqlForInformationQuery, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
String fileUserIdAndName = informationQuery.getFileUserIdAndName();
|
|
|
- if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)){
|
|
|
+ if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)) {
|
|
|
String[] split = fileUserIdAndName.split(",");
|
|
|
- if(split != null && split.length > 0){
|
|
|
+ if (split != null && split.length > 0) {
|
|
|
ArrayList<String> list = new ArrayList<>(Arrays.asList(split));
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
- if(list.get(i).contains(userId + "-" + userName)){
|
|
|
+ if (list.get(i).contains(userId + "-" + userName)) {
|
|
|
list.remove(i);
|
|
|
}
|
|
|
}
|
|
|
String fileUserIdAndNameNew = String.join(",", list);
|
|
|
- String sqlForUpdateInformationQuery = "update u_information_query set file_user_id_and_name = '"+fileUserIdAndNameNew+"' where id = (select form_data_id from u_task where id =" +taskId+ ")";
|
|
|
+ String sqlForUpdateInformationQuery = "update u_information_query set file_user_id_and_name = '" + fileUserIdAndNameNew + "' where id = (select form_data_id from u_task where id =" + taskId + ")";
|
|
|
jdbcTemplate.execute(sqlForUpdateInformationQuery);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} catch (DataAccessException e) {
|
|
|
- throw new RuntimeException("去除对应的填报人信息异常");
|
|
|
+ throw new RuntimeException("去除对应的填报人信息异常");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2224,7 +2225,43 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
public Task getTaskByFormDataId(String formDataId) {
|
|
|
return getOne(Wrappers.<Task>lambdaQuery()
|
|
|
.eq(Task::getIsDeleted, 0)
|
|
|
+ .in(Task::getStatus, 0,1, 2)
|
|
|
.eq(Task::getFormDataId, formDataId));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R reSigningEVisaByUserIds(String ids, String userIds) {
|
|
|
+ if (Func.isEmpty(ids) && ids == null) {
|
|
|
+ return R.fail("未获取到taskIds,操作失败!");
|
|
|
+ }
|
|
|
+ String ids2 = "";
|
|
|
+ if (Func.isEmpty(ids) && ids == null) {
|
|
|
+ ids2 = "'"+ids +"'";
|
|
|
+ } else {
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ for (String id : split) {
|
|
|
+ ids2 += "'"+ id + "',";
|
|
|
+ }
|
|
|
+ ids2 = ids2.substring(0, ids2.length() - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ String sqlqu = "update u_information_query set status=2,e_visa_pdf_url='' where id in( " + ids + ") and is_deleted=0 ";
|
|
|
+ String sqlForTask = "update u_task set status=2 where form_data_id in( " + ids2 + ") and status in(1,2) and is_deleted=0 ";
|
|
|
+ String sqlForTaskPall = "UPDATE u_task_parallel a set a.`status`=2 , a.e_visa_status=1 ,a.e_visa_content='电签成功' where a.process_instance_id in(select process_instance_id from u_task b where b.form_data_id in( " + ids2 + ") and b.status in(0,1,2) and b.is_deleted = 0) and a.`status` in(0,1)";
|
|
|
+
|
|
|
+ String taskBtech = "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,sign_format,sign_type) " +
|
|
|
+ " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.approval_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 ,1 as sign_format,1 as sign_type from u_task_parallel a,u_task b where b.`status` in(1,2) and a.`status` in(2) and a.process_instance_id=b.process_instance_id " +
|
|
|
+ " and b.form_data_id in( " + ids2 + ") and a.parallel_process_instance_id not in(SELECT JSON_EXTRACT(c.json_data, '$.parallelProcessInstanceId') from u_task_batch c)";
|
|
|
+
|
|
|
+ if(userIds!=null && userIds.length()>=1){
|
|
|
+ taskBtech += " and b.task_user in("+userIds+")";
|
|
|
+ sqlForTaskPall += " and a.task_user in("+userIds+")";
|
|
|
+ }
|
|
|
+ jdbcTemplate.execute(sqlqu);
|
|
|
+ jdbcTemplate.execute(sqlForTask);
|
|
|
+ jdbcTemplate.execute(sqlForTaskPall);
|
|
|
+ jdbcTemplate.execute(taskBtech);
|
|
|
+
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
}
|