|
|
@ -240,15 +240,19 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
//更新工作票
|
|
|
|
try { |
|
|
|
workTicket.setId(workTicketInfo.getId()); |
|
|
|
//更新工作票
|
|
|
|
//保存流程描述
|
|
|
|
workTicket.setId(workTicketInfo.getId()); |
|
|
|
workTicketInfo.setCreateDept(workTicketInfo.getCreateDept()); |
|
|
|
//保存流程描述
|
|
|
|
workTicket.setTenantId(workTicketInfo.getTenantId()); |
|
|
|
workTicketInfo.setCreateDept(workTicketInfo.getCreateDept()); |
|
|
|
saveWorkTicket(workTicket, response); |
|
|
|
workTicket.setTenantId(workTicketInfo.getTenantId()); |
|
|
|
//工作流ID
|
|
|
|
saveWorkTicket(workTicket, response); |
|
|
|
workTicket.setProcessInstanceId(response.getProcessInstanceId()); |
|
|
|
//工作流ID
|
|
|
|
workTicketInfoService.updateById(workTicket); |
|
|
|
workTicket.setProcessInstanceId(response.getProcessInstanceId()); |
|
|
|
|
|
|
|
workTicketInfoService.updateById(workTicket); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} |
|
|
|
//更新安全措施
|
|
|
|
//更新安全措施
|
|
|
|
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); |
|
|
|
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); |
|
|
|
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { |
|
|
|
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { |
|
|
@ -287,9 +291,11 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
workTicketDelay.setCreateDept(workTicketInfo.getCreateDept()); |
|
|
|
workTicketDelay.setCreateDept(workTicketInfo.getCreateDept()); |
|
|
|
workTicketDelay.setTicketId(workTicketInfo.getId()); |
|
|
|
workTicketDelay.setTicketId(workTicketInfo.getId()); |
|
|
|
workTicketDelay.setTenantId(workTicketInfo.getTenantId()); |
|
|
|
workTicketDelay.setTenantId(workTicketInfo.getTenantId()); |
|
|
|
if (ObjectUtils.isEmpty(workTicketDelay.getId()) || ObjectUtils.isEmpty(workTicketDelayEntity)) { |
|
|
|
if (ObjectUtils.isEmpty(workTicketDelayEntity)) { |
|
|
|
|
|
|
|
log.info("正在保存工作票延期"); |
|
|
|
workTicketDelayService.save(workTicketDelay); |
|
|
|
workTicketDelayService.save(workTicketDelay); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
log.info("正在更新工作票延期"); |
|
|
|
workTicketDelayService.updateByTicketId(workTicketDelay); |
|
|
|
workTicketDelayService.updateByTicketId(workTicketDelay); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -338,9 +344,11 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
|
|
|
|
|
|
|
|
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId()); |
|
|
|
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId()); |
|
|
|
|
|
|
|
|
|
|
|
if (workTicketPrincipalChange.getId() == null || ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) { |
|
|
|
if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) { |
|
|
|
|
|
|
|
log.info("工作票负责人保存变更"); |
|
|
|
workTicketPrincipalChangeService.save(workTicketPrincipalChange); |
|
|
|
workTicketPrincipalChangeService.save(workTicketPrincipalChange); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
log.info("工作票负责人更新变更"); |
|
|
|
workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange); |
|
|
|
workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange); |
|
|
|
} |
|
|
|
} |
|
|
|
log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName()); |
|
|
|
log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName()); |
|
|
@ -355,11 +363,15 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//工作票危险点分析及控制措施票
|
|
|
|
//工作票危险点分析及控制措施票
|
|
|
|
if (workTicketInfo.getIsHazard()) { |
|
|
|
try { |
|
|
|
List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers(); |
|
|
|
if (workTicketInfo.getIsHazard()) { |
|
|
|
if (CollectionUtils.isNotEmpty(ticketInfoDangers)) { |
|
|
|
List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers(); |
|
|
|
ticketInfoDangerService.saveBatch(ticketInfoDangers); |
|
|
|
if (CollectionUtils.isNotEmpty(ticketInfoDangers)) { |
|
|
|
|
|
|
|
ticketInfoDangerService.saveBatch(ticketInfoDangers); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -380,15 +392,21 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
|
|
|
|
|
|
|
|
if ("0".equals(response.getHandleType())) { |
|
|
|
if ("0".equals(response.getHandleType())) { |
|
|
|
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null); |
|
|
|
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null); |
|
|
|
//下一个审批人
|
|
|
|
if (taskUser != null) { |
|
|
|
User stepUser = UserCache.getUser(taskUser); |
|
|
|
//下一个审批人
|
|
|
|
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(stepUser.getName()).concat("审批"); |
|
|
|
User stepUser = UserCache.getUser(taskUser); |
|
|
|
workTicket.setNextStepOperator(stepUser.getName()); |
|
|
|
if (stepUser != null) { |
|
|
|
|
|
|
|
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(stepUser.getName()).concat("审批"); |
|
|
|
|
|
|
|
workTicket.setNextStepOperator(stepUser.getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ("1".equals(response.getHandleType())) { |
|
|
|
if ("1".equals(response.getHandleType())) { |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("获取角色信息" + response.getNextStepOperator()); |
|
|
|
log.info("获取角色信息" + response.getNextStepOperator()); |
|
|
|
//根据角色别名获取用户信息
|
|
|
|
//根据角色别名获取用户信息
|
|
|
|
try { |
|
|
|
try { |
|
|
|
R<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator()); |
|
|
|
R<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator()); |
|
|
@ -399,6 +417,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("R<List<User>> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())"); |
|
|
|
log.error("R<List<User>> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())"); |
|
|
|
log.error("获取用户信息失败"); |
|
|
|
log.error("获取用户信息失败"); |
|
|
|
|
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -418,6 +437,9 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
if (StringUtils.isEmpty(nextStepOperator)) { |
|
|
|
if (StringUtils.isEmpty(nextStepOperator)) { |
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("workTicket = " + workTicket); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -599,6 +621,10 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName()); |
|
|
|
workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName()); |
|
|
|
//唯一
|
|
|
|
//唯一
|
|
|
|
workTicket.setCreateUser(AuthUtil.getUserId()); |
|
|
|
workTicket.setCreateUser(AuthUtil.getUserId()); |
|
|
|
|
|
|
|
workTicket.setIsSafety(false); |
|
|
|
|
|
|
|
workTicket.setIsHazard(false); |
|
|
|
|
|
|
|
workTicket.setIsRailway(false); |
|
|
|
|
|
|
|
workTicket.setIsLimited(false); |
|
|
|
boolean isSave = firstWorkTicketService.save(workTicket); |
|
|
|
boolean isSave = firstWorkTicketService.save(workTicket); |
|
|
|
if (!isSave) { |
|
|
|
if (!isSave) { |
|
|
|
throw new IllegalArgumentException("保存工作对象错误"); |
|
|
|
throw new IllegalArgumentException("保存工作对象错误"); |
|
|
@ -738,13 +764,13 @@ public class TicketProcessServiceImpl implements TicketProcessService { |
|
|
|
//1. 工作对象
|
|
|
|
//1. 工作对象
|
|
|
|
Map<String, Object> workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, result); |
|
|
|
Map<String, Object> workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, result); |
|
|
|
//安全隔离措施附页 (true,展示附件,false,不展示附件
|
|
|
|
//安全隔离措施附页 (true,展示附件,false,不展示附件
|
|
|
|
getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety")); |
|
|
|
this.getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety")); |
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard")); |
|
|
|
this.getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard")); |
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway")); |
|
|
|
this.getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway")); |
|
|
|
//有限空间监测记录单(true,展示附件,false,不展示附件)
|
|
|
|
//有限空间监测记录单(true,展示附件,false,不展示附件)
|
|
|
|
getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited")); |
|
|
|
this.getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited")); |
|
|
|
result.putAll(workTicketInfoMap); |
|
|
|
result.putAll(workTicketInfoMap); |
|
|
|
//2. 安全措施
|
|
|
|
//2. 安全措施
|
|
|
|
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); |
|
|
|
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); |
|
|
|