|
|
@ -91,9 +91,10 @@ public class ThrDeptController {
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/spms/thrsys/warehouse/edit")
|
|
|
|
@PostMapping("/spms/thrsys/warehouse/edit")
|
|
|
|
public BaseResponse edit(@RequestBody @Valid ThrDeptEntity thrDeptEntity,
|
|
|
|
public BaseResponse edit(@RequestBody @Valid ThrDeptEntity thrDeptEntity,
|
|
|
|
BindingResult bindingResult,FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest,FilterThrDeptRequest filterThrDeptRequest) {
|
|
|
|
BindingResult bindingResult, FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest, FilterThrDeptRequest filterThrDeptRequest) {
|
|
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
@ -116,8 +117,7 @@ public class ThrDeptController {
|
|
|
|
filterThrDeptRequest.setName(thrDeptEntity.getName());
|
|
|
|
filterThrDeptRequest.setName(thrDeptEntity.getName());
|
|
|
|
filterThrDeptRequest.setThirdSysFk(thrDeptEntity.getThirdSysFk());
|
|
|
|
filterThrDeptRequest.setThirdSysFk(thrDeptEntity.getThirdSysFk());
|
|
|
|
filterThrDeptRequest.setStatus(thrDeptEntity.getStatus());
|
|
|
|
filterThrDeptRequest.setStatus(thrDeptEntity.getStatus());
|
|
|
|
List<ThrDeptEntity> thrDeptEntities = thrDeptService.filterThrInvWarehouse(filterThrDeptRequest);
|
|
|
|
if (!thrDeptService.editExit(thrDeptEntity.getCode(), thrDeptEntity.getCode(), thrDeptEntity.getId())) {
|
|
|
|
if(thrDeptEntities.size()==0 ){
|
|
|
|
|
|
|
|
thrDeptEntity.setPid(null); // 不能修改父级 pid
|
|
|
|
thrDeptEntity.setPid(null); // 不能修改父级 pid
|
|
|
|
thrDeptEntity.setUpdateTime(new Date());
|
|
|
|
thrDeptEntity.setUpdateTime(new Date());
|
|
|
|
boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity);
|
|
|
|
boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity);
|
|
|
@ -125,7 +125,7 @@ public class ThrDeptController {
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|