|
|
@@ -11,11 +11,13 @@ import com.poteviohealth.cgp.sso.module.system.controller.admin.dept.vo.dept.Dep
|
|
|
import com.poteviohealth.cgp.sso.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.dataobject.dept.DeptDO;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.dataobject.sequence.SequenceDO;
|
|
|
+import com.poteviohealth.cgp.sso.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.mysql.dept.DeptMapper;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.mysql.sequence.SequenceMapper;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.mysql.user.AdminUserMapper;
|
|
|
import com.poteviohealth.cgp.sso.module.system.dal.redis.RedisKeyConstants;
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
|
+import com.poteviohealth.cgp.sso.module.system.enums.permission.RoleTypeEnum;
|
|
|
import com.poteviohealth.cgp.sso.module.system.service.user.AdminUserService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
@@ -193,14 +195,15 @@ public class DeptServiceImpl implements DeptService {
|
|
|
}
|
|
|
|
|
|
@VisibleForTesting
|
|
|
- void validateDeptExists(Long id) {
|
|
|
+ DeptDO validateDeptExists(Long id) {
|
|
|
if (id == null) {
|
|
|
- return;
|
|
|
+ return null;
|
|
|
}
|
|
|
DeptDO dept = deptMapper.selectById(id);
|
|
|
if (dept == null) {
|
|
|
throw exception(DEPT_NOT_FOUND);
|
|
|
}
|
|
|
+ return dept;
|
|
|
}
|
|
|
|
|
|
@VisibleForTesting
|
|
|
@@ -326,4 +329,15 @@ public class DeptServiceImpl implements DeptService {
|
|
|
}
|
|
|
return deptMapper.selectDeptByIds(ids);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateUserStatus(Long id, Integer status) {
|
|
|
+ // 校验用户存在
|
|
|
+ DeptDO deptDO = validateDeptExists(id);
|
|
|
+ // 更新状态
|
|
|
+ DeptDO updateObj = new DeptDO();
|
|
|
+ updateObj.setId(id);
|
|
|
+ updateObj.setStatus(status);
|
|
|
+ deptMapper.updateById(updateObj);
|
|
|
+ }
|
|
|
}
|