| | |
| | | } |
| | | //判断是否存在保养人 如果存在则启动流程 |
| | | if (StringUtils.isNotBlank(order.getOperator())) { |
| | | //启动流程 TODO |
| | | // flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备二保", |
| | | // order.getId(), "IEamWeekMaintenanceOrderService", "week_maintenance_process", null); |
| | | // Map<String, Object> variables = new HashMap<>(); |
| | | // variables.put("dataId", order.getId()); |
| | | // if (StrUtil.isEmpty(order.getRemark())) { |
| | | // variables.put("organization", "新增周保工单默认启动流程"); |
| | | // variables.put("comment", "新增周保工单默认启动流程"); |
| | | // } else { |
| | | // variables.put("organization", order.getRemark()); |
| | | // variables.put("comment", order.getRemark()); |
| | | // } |
| | | // variables.put("proofreading", true); |
| | | // List<String> usernames = new ArrayList<>(); |
| | | // usernames.add(order.getOperator()); |
| | | // variables.put("NextAssignee", usernames); |
| | | // Result result = flowDefinitionService.startProcessInstanceByKey("week_maintenance_process", variables); |
| | | // if (result != null) { |
| | | // //更新周保状态 |
| | | // order.setMaintenanceStatus(WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name()); |
| | | // order.setActualStartTime(new Date()); |
| | | // eamWeekMaintenanceOrderMapper.updateById(order); |
| | | // //更新设备保养状态 |
| | | // eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name()); |
| | | // return result.isSuccess(); |
| | | // } |
| | | //启动流程 |
| | | flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备三保", |
| | | order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", order.getId()); |
| | | if (StrUtil.isEmpty(order.getRemark())) { |
| | | variables.put("organization", "新增三保工单默认启动流程"); |
| | | variables.put("comment", "新增三保工单默认启动流程"); |
| | | } else { |
| | | variables.put("organization", order.getRemark()); |
| | | variables.put("comment", order.getRemark()); |
| | | } |
| | | variables.put("proofreading", true); |
| | | //并行任务会签 |
| | | variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name()); |
| | | return result.isSuccess(); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | |
| | | } |
| | | //判断是否存在保养人 如果存在则启动流程 |
| | | if (StringUtils.isNotBlank(entity.getOperator())) { |
| | | //启动流程 TODO |
| | | // flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备周保", |
| | | // entity.getId(), "IEamWeekMaintenanceOrderService", "week_maintenance_process", null); |
| | | // Map<String, Object> variables = new HashMap<>(); |
| | | // variables.put("dataId", entity.getId()); |
| | | // if (StrUtil.isEmpty(entity.getRemark())) { |
| | | // variables.put("organization", "新增周保工单默认启动流程"); |
| | | // variables.put("comment", "新增周保工单默认启动流程"); |
| | | // } else { |
| | | // variables.put("organization", entity.getRemark()); |
| | | // variables.put("comment", entity.getRemark()); |
| | | // } |
| | | // variables.put("proofreading", true); |
| | | // List<String> usernames = new ArrayList<>(); |
| | | // usernames.add(entity.getOperator()); |
| | | // variables.put("NextAssignee", usernames); |
| | | // Result result = flowDefinitionService.startProcessInstanceByKey("week_maintenance_process", variables); |
| | | // if (result != null) { |
| | | // //更新周保状态 |
| | | // entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name()); |
| | | // entity.setActualStartTime(new Date()); |
| | | // eamWeekMaintenanceOrderMapper.updateById(entity); |
| | | // //更新设备保养状态 |
| | | // eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name()); |
| | | // return result.isSuccess(); |
| | | // } |
| | | //启动流程 |
| | | flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备三保", |
| | | entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | | if (StrUtil.isEmpty(entity.getRemark())) { |
| | | variables.put("organization", "新增三保工单默认启动流程"); |
| | | variables.put("comment", "新增三保工单默认启动流程"); |
| | | } else { |
| | | variables.put("organization", entity.getRemark()); |
| | | variables.put("comment", entity.getRemark()); |
| | | } |
| | | variables.put("proofreading", true); |
| | | //并行任务会签 |
| | | variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //更新设备保养状态 |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name()); |
| | | return result.isSuccess(); |
| | | } |
| | | |
| | | } |
| | | return true; |