删除组织架构的同时删除员工(假删)

hehai
shijie 4 years ago
parent 834fcde002
commit 0bc201a82b
  1. 12
      src/main/java/com/msdw/tms/controller/SystemSettingController.java
  2. 2
      src/main/java/com/msdw/tms/dao/SystemSetttingDao.java
  3. 2
      src/main/java/com/msdw/tms/service/SystemSetttingService.java
  4. 5
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java
  5. 4
      src/main/resources/mapper/tms/SystemSetting.xml

@ -98,6 +98,18 @@ public class SystemSettingController implements SystemSetttingApi {
return R.ok(); return R.ok();
} }
/**
* 删除组织架构的同时删除员工假删
* @return
*/
@GetMapping("/dalStaffByStaffGradeId")
public R dalStaffByStaffGradeId(@RequestParam("staffGradeId") Integer staffGradeId){
//根据staffGradeId查询staff表中的userId,然后调用批量删除员工信息接口
List<Integer> userIds = systemSetttingService.queryUserIdsByGradeId(staffGradeId);
systemSetttingService.daleteBatchStaff(userIds);
return R.ok();
}
/** /**
* 新增部门 * 新增部门
*/ */

@ -57,4 +57,6 @@ public interface SystemSetttingDao {
List<StaffVo> judgmentGrade(String name,Integer schoolId); List<StaffVo> judgmentGrade(String name,Integer schoolId);
List<StaffVo> queryAccount(String account,Integer schoolId); List<StaffVo> queryAccount(String account,Integer schoolId);
List<Integer> queryUserIdsByGradeId(Integer staffGradeId);
} }

@ -36,4 +36,6 @@ public interface SystemSetttingService {
R queryAccount(String account,Integer schoolId); R queryAccount(String account,Integer schoolId);
R resetPwd(Integer userId,String newPwd); R resetPwd(Integer userId,String newPwd);
List<Integer> queryUserIdsByGradeId(Integer staffGradeId);
} }

@ -512,4 +512,9 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
} }
} }
@Override
public List<Integer> queryUserIdsByGradeId(Integer staffGradeId) {
return systemSetttingDao.queryUserIdsByGradeId(staffGradeId);
}
} }

@ -194,4 +194,8 @@ WHERE
AND s.isdel = 0 AND s.isdel = 0
GROUP BY u.userId GROUP BY u.userId
</select> </select>
<select id="queryUserIdsByGradeId" resultType="java.lang.Integer">
select userId from staff where staffGradeId =#{staffGradeId} and isdel = 0
</select>
</mapper> </mapper>
Loading…
Cancel
Save