From fb5aa087eaf6a68cf7ea8114beb270551016e7dd Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期二, 29 七月 2025 11:27:45 +0800 Subject: [PATCH] 添加定型指派设备 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java | 98 ++++++++++++++++++++++-------------------------- 1 files changed, 45 insertions(+), 53 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java index 74d7f13..6121b18 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java @@ -171,32 +171,28 @@ } //鍒ゆ柇鏄惁瀛樺湪淇濆吇浜� 濡傛灉瀛樺湪鍒欏惎鍔ㄦ祦绋� 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() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), + 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; @@ -246,32 +242,28 @@ } //鍒ゆ柇鏄惁瀛樺湪淇濆吇浜� 濡傛灉瀛樺湪鍒欏惎鍔ㄦ祦绋� 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() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), + 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; @@ -304,7 +296,7 @@ eamThirdMaintenanceOrderMapper.updateById(entity); //鍚姩娴佺▼ - flowCommonService.initActBusiness("宸ュ崟鍙�:" + entity.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";杩涜璁惧涓変繚", + flowCommonService.initActBusiness("宸ュ崟鍙�:" + entity.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null); Map<String, Object> variables = new HashMap<>(); boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId()); -- Gitblit v1.9.3