diff --git a/src/main/java/com/msdw/tms/controller/SystemSettingController.java b/src/main/java/com/msdw/tms/controller/SystemSettingController.java index 48f3346..b45f290 100644 --- a/src/main/java/com/msdw/tms/controller/SystemSettingController.java +++ b/src/main/java/com/msdw/tms/controller/SystemSettingController.java @@ -108,6 +108,9 @@ public class SystemSettingController implements SystemSetttingApi { List userIds = systemSetttingService.queryUserIdsByGradeId(staffGradeId); if(userIds.size()>0){ systemSetttingService.daleteBatchStaff(userIds); + systemSetttingService.daleteBatchStaffPs(staffGradeId); + }else{//如果组织架构下面没有员工,则只删除组织架构 + systemSetttingService.daleteBatchStaffPs(staffGradeId); } return R.ok(); } diff --git a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java index 4f74d61..a7d2807 100644 --- a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java +++ b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java @@ -63,4 +63,6 @@ public interface SystemSetttingDao { List queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId); List queryStaffId(Integer userId); + + boolean daleteBatchStaffPs(Integer staffGradeId); } diff --git a/src/main/java/com/msdw/tms/service/SystemSetttingService.java b/src/main/java/com/msdw/tms/service/SystemSetttingService.java index 93f0865..d75afb4 100644 --- a/src/main/java/com/msdw/tms/service/SystemSetttingService.java +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -41,4 +41,5 @@ public interface SystemSetttingService { List queryUserIdsByProfessionalId(Integer staffProfessionalArchitectureId); + boolean daleteBatchStaffPs(Integer staffGradeId); } diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java index 58e65eb..87e54a5 100644 --- a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -252,6 +252,12 @@ public class SystemSettingServiceImpl implements SystemSetttingService { return result; } + @Override + public boolean daleteBatchStaffPs(Integer staffGradeId) { + boolean result = systemSetttingDao.daleteBatchStaffPs(staffGradeId); + return result; + } + @Override @Transactional diff --git a/src/main/resources/mapper/tms/SystemSetting.xml b/src/main/resources/mapper/tms/SystemSetting.xml index a433787..6dd6eb3 100644 --- a/src/main/resources/mapper/tms/SystemSetting.xml +++ b/src/main/resources/mapper/tms/SystemSetting.xml @@ -65,6 +65,11 @@ #{userId} ) + + + UPDATE staff_grade SET isdel = 1 where staffGradeId = #{staffGradeId} + + UPDATE staff