Merge branch 'ww'

master
wangwei 2 years ago
commit 05a0809a99

@ -88,7 +88,7 @@ public class ThrDeptController {
@PostMapping("/spms/thrsys/warehouse/edit")
public BaseResponse edit(@RequestBody @Valid ThrDeptEntity thrDeptEntity,
BindingResult bindingResult,FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest) {
BindingResult bindingResult,FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest,FilterThrDeptRequest filterThrDeptRequest) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
@ -106,13 +106,23 @@ public class ThrDeptController {
//修改仓库
thrInvWarehouseService.updateThrInvWarehouse(thrInvWarehouseEntity);
}
thrDeptEntity.setPid(null); // 不能修改父级 pid
thrDeptEntity.setUpdateTime(new Date());
boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
//判断部门是否存在
filterThrDeptRequest.setCode(thrDeptEntity.getCode());
filterThrDeptRequest.setName(thrDeptEntity.getName());
filterThrDeptRequest.setThirdSysFk(thrDeptEntity.getThirdSysFk());
List<ThrDeptEntity> thrDeptEntities = thrDeptService.filterThrInvWarehouse(filterThrDeptRequest);
if(thrDeptEntities.size()==0){
thrDeptEntity.setPid(null); // 不能修改父级 pid
thrDeptEntity.setUpdateTime(new Date());
boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success();
}else{
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
}
return ResultVOUtils.success();
}
@PostMapping("/spms/thrsys/warehouse/delete")

Loading…
Cancel
Save