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/DeviceGroupServiceImpl.java | 156 +++++++++++++++++++++++++-------------------------- 1 files changed, 77 insertions(+), 79 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceGroupServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceGroupServiceImpl.java index e518cdb..077f156 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceGroupServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceGroupServiceImpl.java @@ -39,8 +39,6 @@ @Autowired private IDeviceGroupDepartService deviceGroupDepartService; @Autowired - private IDepartmentService departmentService; - @Autowired @Lazy private IDeviceInfoService deviceInfoService; @Autowired @@ -375,83 +373,83 @@ return deviceGroupDepartService.getDepartNonPermsByGroupId(groupId); } - @Override - @Transactional(rollbackFor = {Exception.class}) - public boolean assignAddDepartment(String groupId, Integer relativeFlag, String[] departmentIds) { - if(!ValidateUtil.validateString(groupId) || !ValidateUtil.validateInteger(relativeFlag) || departmentIds == null || departmentIds.length < 1) - ExceptionCast.cast(CommonCode.INVALID_PARAM); - List<String> ids = new ArrayList<>(departmentIds.length); - Collections.addAll(ids, departmentIds); - Collection<Department> departmentList = departmentService.listByIds(ids); - if(departmentList == null || departmentList.isEmpty() || departmentList.size() != departmentIds.length) - ExceptionCast.cast(CommonCode.INVALID_PARAM); - DeviceGroup deviceGroup = super.getById(groupId); - if(deviceGroup == null) - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); - boolean b1 = deviceInfoService.checkDevicePerm(1, deviceGroup.getGroupId()); - if(!b1) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - b1 = assignAddDepartment(deviceGroup, departmentList); - if(!b1) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - if(relativeFlag == 1) { - //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<DeviceGroup> childrenList = getChildrenByParentId(deviceGroup.getGroupId()); - if(childrenList != null && !childrenList.isEmpty()) { - childrenList.forEach(item -> { - boolean b = deviceInfoService.checkDevicePerm(1, item.getGroupId()); - if(b) { - b = assignAddDepartment(item, departmentList); - if(!b) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - } - }); - } - } - return true; - } - - @Override - @Transactional(rollbackFor = {Exception.class}) - public boolean assignRemoveDepartment(String groupId, Integer relativeFlag, String[] departmentIds) { - if(!ValidateUtil.validateString(groupId) || !ValidateUtil.validateInteger(relativeFlag) || departmentIds == null || departmentIds.length < 1) - ExceptionCast.cast(CommonCode.INVALID_PARAM); - List<String> ids = new ArrayList<>(departmentIds.length); - Collections.addAll(ids, departmentIds); - Collection<Department> departmentList = departmentService.listByIds(ids); - if(departmentList == null || departmentList.isEmpty() || departmentList.size() != departmentIds.length) - ExceptionCast.cast(CommonCode.INVALID_PARAM); - DeviceGroup deviceGroup = super.getById(groupId); - if(deviceGroup == null) - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); - boolean b1 = deviceInfoService.checkDevicePerm(1, deviceGroup.getGroupId()); - if(!b1) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - b1 = assignRemoveDepartment(deviceGroup, departmentList); - if(!b1) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - if(relativeFlag == 1) { - //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� - List<DeviceGroup> childrenList = getChildrenByParentId(deviceGroup.getGroupId()); - if(childrenList != null && !childrenList.isEmpty()) { - childrenList.forEach(item -> { - boolean b = deviceInfoService.checkDevicePerm(1, item.getGroupId()); - if(b) { - b = assignRemoveDepartment(item, departmentList); - if(!b) { - ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); - } - } - }); - } - } - return true; - } +// @Override +// @Transactional(rollbackFor = {Exception.class}) +// public boolean assignAddDepartment(String groupId, Integer relativeFlag, String[] departmentIds) { +// if(!ValidateUtil.validateString(groupId) || !ValidateUtil.validateInteger(relativeFlag) || departmentIds == null || departmentIds.length < 1) +// ExceptionCast.cast(CommonCode.INVALID_PARAM); +// List<String> ids = new ArrayList<>(departmentIds.length); +// Collections.addAll(ids, departmentIds); +// Collection<Department> departmentList = departmentService.listByIds(ids); +// if(departmentList == null || departmentList.isEmpty() || departmentList.size() != departmentIds.length) +// ExceptionCast.cast(CommonCode.INVALID_PARAM); +// DeviceGroup deviceGroup = super.getById(groupId); +// if(deviceGroup == null) +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); +// boolean b1 = deviceInfoService.checkDevicePerm(1, deviceGroup.getGroupId()); +// if(!b1) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// b1 = assignAddDepartment(deviceGroup, departmentList); +// if(!b1) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// if(relativeFlag == 1) { +// //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� +// List<DeviceGroup> childrenList = getChildrenByParentId(deviceGroup.getGroupId()); +// if(childrenList != null && !childrenList.isEmpty()) { +// childrenList.forEach(item -> { +// boolean b = deviceInfoService.checkDevicePerm(1, item.getGroupId()); +// if(b) { +// b = assignAddDepartment(item, departmentList); +// if(!b) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// } +// }); +// } +// } +// return true; +// } +// +// @Override +// @Transactional(rollbackFor = {Exception.class}) +// public boolean assignRemoveDepartment(String groupId, Integer relativeFlag, String[] departmentIds) { +// if(!ValidateUtil.validateString(groupId) || !ValidateUtil.validateInteger(relativeFlag) || departmentIds == null || departmentIds.length < 1) +// ExceptionCast.cast(CommonCode.INVALID_PARAM); +// List<String> ids = new ArrayList<>(departmentIds.length); +// Collections.addAll(ids, departmentIds); +// Collection<Department> departmentList = departmentService.listByIds(ids); +// if(departmentList == null || departmentList.isEmpty() || departmentList.size() != departmentIds.length) +// ExceptionCast.cast(CommonCode.INVALID_PARAM); +// DeviceGroup deviceGroup = super.getById(groupId); +// if(deviceGroup == null) +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_NOT_EXIST); +// boolean b1 = deviceInfoService.checkDevicePerm(1, deviceGroup.getGroupId()); +// if(!b1) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// b1 = assignRemoveDepartment(deviceGroup, departmentList); +// if(!b1) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// if(relativeFlag == 1) { +// //鑾峰彇鍒嗙粍涓嬫墍鏈夌殑瀛愬垎缁� +// List<DeviceGroup> childrenList = getChildrenByParentId(deviceGroup.getGroupId()); +// if(childrenList != null && !childrenList.isEmpty()) { +// childrenList.forEach(item -> { +// boolean b = deviceInfoService.checkDevicePerm(1, item.getGroupId()); +// if(b) { +// b = assignRemoveDepartment(item, departmentList); +// if(!b) { +// ExceptionCast.cast(DeviceGroupCode.DEVICE_GROUP_PERM_ERROR); +// } +// } +// }); +// } +// } +// return true; +// } @Override @Transactional(rollbackFor = {Exception.class}) -- Gitblit v1.9.3