From 3f5737664d799ece89224079860505a009dec32b Mon Sep 17 00:00:00 2001 From: lyh <liuyuanheng@xalxzn.com> Date: 星期一, 24 二月 2025 09:29:47 +0800 Subject: [PATCH] 去除原有activiti 新增flowable工作流 --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java index d55f9d9..0a2e79f 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceInfoServiceImpl.java @@ -20,8 +20,10 @@ import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.entity.MdcProductionEquipment; +import org.jeecg.modules.system.entity.MdcUserProduction; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.IMdcProductionService; +import org.jeecg.modules.system.service.IMdcUserProductionService; import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.dnc.response.DeviceCode; import org.jeecg.modules.dnc.response.DeviceGroupCode; @@ -68,7 +70,8 @@ private IMdcEquipmentService mdcEquipmentService; @Autowired private IMdcProductionEquipmentService mdcProductionEquipmentService; - + @Autowired + private IMdcUserProductionService mdcUserProductionService; @Override @Transactional(rollbackFor = {Exception.class}) public boolean addDeviceInfo(DeviceInfo deviceInfo) { @@ -225,8 +228,8 @@ if(mdcProduction == null) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); } - DeviceGroupPermission permission = deviceGroupPermissionService.getByUserIdAndGroupId(userId, mdcProduction.getId()); - if(permission == null) + MdcUserProduction mdcUserProduction=mdcUserProductionService.getByUserIdAndGroupId(userId,mdcProduction.getId()); + if(mdcUserProduction == null) return false; return true; }else if(nodeType == 2) { @@ -243,13 +246,13 @@ } @Override - public List<UserDepartExt> getUserPermsList(Integer nodeType, String paramId) { + public List<SysUser> getUserPermsList(Integer nodeType, String paramId) { if(!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) return null; if(nodeType == 1) { - return deviceGroupPermissionService.getUserPermsByGroupId(paramId); + return mdcUserProductionService.getUserPermsByGroupId(paramId); }else if(nodeType == 2) { - return devicePermissionService.getUserPermsByDeviceId(paramId); + return mdcUserProductionService.getUserPermsByDeviceId(paramId); }else { return null; } @@ -260,9 +263,9 @@ if(!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) return null; if(nodeType == 1) { - return deviceGroupPermissionService.getUserNonPermsByGroupId(paramId); + return mdcUserProductionService.getUserNonPermsByGroupId(paramId); }else if(nodeType == 2) { - return devicePermissionService.getUserNonPermsByDeviceId(paramId); + return mdcUserProductionService.getUserNonPermsByDeviceId(paramId); }else { return null; } @@ -296,14 +299,14 @@ ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<MdcProduction> childrenList = mdcProductionService.queryProdByPid(mdcProduction.getId()); + List<MdcProduction> childrenList = mdcProductionService.recursionChildrenByPid(mdcProduction.getId()); List<String> childrenIds = new ArrayList<>(); if(childrenList != null && !childrenList.isEmpty()) { childrenList.forEach(item -> { childrenIds.add(item.getId()); boolean b = checkDevicePerm(1, item.getId()); if(b) { - b = deviceGroupPermissionService.assignAddUser(mdcProduction, userList); + b = deviceGroupPermissionService.assignAddUser(item, userList); if(!b) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } @@ -486,14 +489,14 @@ ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<MdcProduction> childrenList = mdcProductionService.queryProdByPid(mdcProduction.getId()); + List<MdcProduction> childrenList = mdcProductionService.recursionChildrenByPid(mdcProduction.getId()); List<String> childrenIds = new ArrayList<>(); if(childrenList != null && !childrenList.isEmpty()) { childrenList.forEach(item -> { childrenIds.add(item.getId()); boolean b = checkDevicePerm(1, item.getId()); if(b) { - b = deviceGroupPermissionService.assignRemoveUser(mdcProduction, userList); + b = deviceGroupPermissionService.assignRemoveUser(item, userList); if(!b) { ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); } -- Gitblit v1.9.3