|
|
|
@ -6,14 +6,18 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.Log;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.BusinessType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.auth.DeptUserEntity;
|
|
|
|
|
import com.glxp.api.entity.auth.SysRole;
|
|
|
|
|
import com.glxp.api.entity.auth.WarehouseUserEntity;
|
|
|
|
|
import com.glxp.api.req.auth.FilterAuthUserRequest;
|
|
|
|
|
import com.glxp.api.req.auth.AuthUserSaveRequest;
|
|
|
|
|
import com.glxp.api.req.auth.FilterAuthUserRequest;
|
|
|
|
|
import com.glxp.api.req.auth.FilterDeptUserReqeust;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.auth.AuthAdminResponse;
|
|
|
|
|
import com.glxp.api.res.auth.DeptUserResponse;
|
|
|
|
@ -23,13 +27,9 @@ import com.glxp.api.service.auth.ISysRoleService;
|
|
|
|
|
import com.glxp.api.service.auth.WarehouseUserService;
|
|
|
|
|
import com.glxp.api.util.PasswordUtils;
|
|
|
|
|
import com.glxp.api.util.StreamUtils;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.util.StringUtils;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -264,9 +264,25 @@ public class SysUserController extends BaseController {
|
|
|
|
|
userService.updateAuthAdmin(authAdmin);
|
|
|
|
|
|
|
|
|
|
//默认插入第一部门
|
|
|
|
|
List<Long> deptCodeList=authUserSaveRequest.getDepts();
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
|
List<Long> deptCodeList = null;
|
|
|
|
|
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
|
|
|
|
|
filterDeptUserReqeust.setUserId(authUserSaveRequest.getId());
|
|
|
|
|
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
|
|
|
|
|
if(deptUserEntities == null){
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
|
}else{
|
|
|
|
|
Boolean checkDeptId=false;
|
|
|
|
|
for (DeptUserEntity deptUserEntity : deptUserEntities) {
|
|
|
|
|
if(deptUserEntity.getDeptId() == 1){
|
|
|
|
|
checkDeptId=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(checkDeptId==false){
|
|
|
|
|
deptCodeList.add(1L);
|
|
|
|
|
authUserSaveRequest.setDepts(deptCodeList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改所属部门
|
|
|
|
|
deptUserService.deleteByUser(authUserSaveRequest.getId());
|
|
|
|
|