|
|
|
@ -12,13 +12,16 @@ 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.DeptEntity;
|
|
|
|
|
import com.glxp.api.entity.auth.DeptUserEntity;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.req.auth.FilterDeptUserReqeust;
|
|
|
|
|
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.auth.DeptService;
|
|
|
|
|
import com.glxp.api.service.auth.DeptUserService;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
@ -82,7 +85,7 @@ public class DeptController extends BaseController {
|
|
|
|
|
if (isHosUser()) {
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
|
filterInvWarehouseRequest.setUserId(authAdmin.getId());
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -261,6 +264,9 @@ public class DeptController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeptUserService deptUserService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/spms/inv/warehouse/delete")
|
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
|
|
@ -270,18 +276,19 @@ public class DeptController extends BaseController {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//todo 代码未迁移完,后续记得修改
|
|
|
|
|
DeptEntity deptEntity = deptService.selectById(deleteRequest.getId());
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.findByParentId(deptEntity.getCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,请先移除该部门关联仓库信息!");
|
|
|
|
|
}
|
|
|
|
|
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
|
|
|
|
|
filterDeptUserReqeust.setDeptId(deptEntity.getId().longValue());
|
|
|
|
|
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
|
|
|
|
|
if (CollUtil.isNotEmpty(deptUserEntities)) {
|
|
|
|
|
return ResultVOUtils.error(500, "删除失败,请先移除该部门关联用户信息!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DeptEntity deptEntity = deptService.selectById(deleteRequest.getId());
|
|
|
|
|
// InvProductDetailEntity invProductDetailEntity = invProductDetailService.isExit(deptEntity.getCode());
|
|
|
|
|
// if (invProductDetailEntity != null) {
|
|
|
|
|
// return ResultVOUtils.error(500, "该仓库已有库存,不能删除!");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<InvSubWarehouseEntity> invSubWarehouseEntities = invSubWarehouseService.findByParentId(deptEntity.getCode());
|
|
|
|
|
// if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
|
|
|
|
|
// return ResultVOUtils.error(500, "删除失败,请先移除该部门关联仓库信息!");
|
|
|
|
|
// }
|
|
|
|
|
boolean b = deptService.deleteById(deleteRequest.getId());
|
|
|
|
|
if (!b) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
|