|
|
|
@ -250,12 +250,12 @@ public class DeptController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断状态
|
|
|
|
|
String msg=isCheckStatus(deptEntity.getStatus(),deptEntity);
|
|
|
|
|
if(msg!=""){
|
|
|
|
|
return ResultVOUtils.error(999,msg);
|
|
|
|
|
String msg = isCheckStatus(deptEntity.getStatus(), deptEntity);
|
|
|
|
|
if (msg != "") {
|
|
|
|
|
return ResultVOUtils.error(999, msg);
|
|
|
|
|
}
|
|
|
|
|
//判断供应商状态
|
|
|
|
|
if(deptEntity.isSpUse()==false){
|
|
|
|
|
if (deptEntity.isSpUse() == false) {
|
|
|
|
|
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
|
|
|
|
|
filterDeptUserReqeust.setDeptId(deptEntity.getId().longValue());
|
|
|
|
|
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
|
|
|
|
@ -295,8 +295,8 @@ public class DeptController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DeptEntity deptEntity = deptService.selectById(deleteRequest.getId());
|
|
|
|
|
if(deptEntity.getLevel()!=null && deptEntity.getLevel() == 1){
|
|
|
|
|
return ResultVOUtils.error(500,"删除失败,一级部门不允许删除!");
|
|
|
|
|
if (deptEntity.getLevel() != null && deptEntity.getLevel() == 1) {
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,一级部门不允许删除!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.findByParentId(deptEntity.getCode());
|
|
|
|
@ -310,7 +310,7 @@ public class DeptController extends BaseController {
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,请先移除该部门关联用户信息!");
|
|
|
|
|
}
|
|
|
|
|
List<DeptEntity> deptEntities = deptService.selectByPcode(deptEntity.getCode());
|
|
|
|
|
if(deptEntities.size()>0){
|
|
|
|
|
if (deptEntities.size() > 0) {
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,请先移除该部门下的子部门!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -366,20 +366,20 @@ public class DeptController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String isCheckStatus(Integer status,DeptEntity deptEntity){
|
|
|
|
|
public String isCheckStatus(Integer status, DeptEntity deptEntity) {
|
|
|
|
|
//启用的时候需要判断上级是不是被禁用
|
|
|
|
|
if(status==1){
|
|
|
|
|
if (status == 1) {
|
|
|
|
|
//查询所有的上级
|
|
|
|
|
List<DeptEntity> deptEntityList= deptService.selectupDeptAll(deptEntity.getPcode());
|
|
|
|
|
for(DeptEntity obj:deptEntityList){
|
|
|
|
|
if(obj.getStatus()==0){
|
|
|
|
|
List<DeptEntity> deptEntityList = deptService.selectupDeptAll(deptEntity.getPcode());
|
|
|
|
|
for (DeptEntity obj : deptEntityList) {
|
|
|
|
|
if (obj.getStatus() == 0) {
|
|
|
|
|
return "上级存在禁用的部门修改失败!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
List<DeptEntity> deptEntityList= deptService.selectLowDeptAll(deptEntity.getCode());
|
|
|
|
|
for(DeptEntity obj:deptEntityList){
|
|
|
|
|
if(obj.getStatus()==1){
|
|
|
|
|
} else {
|
|
|
|
|
List<DeptEntity> deptEntityList = deptService.selectLowDeptAll(deptEntity.getCode());
|
|
|
|
|
for (DeptEntity obj : deptEntityList) {
|
|
|
|
|
if (obj.getStatus() == 1) {
|
|
|
|
|
return "下级存在启用的部门修改失败!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|