Merge branch 'ww'

master
wangwei 2 years ago
commit 05a0809a99

@ -88,7 +88,7 @@ public class ThrDeptController {
@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) { 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());
@ -106,13 +106,23 @@ public class ThrDeptController {
//修改仓库 //修改仓库
thrInvWarehouseService.updateThrInvWarehouse(thrInvWarehouseEntity); thrInvWarehouseService.updateThrInvWarehouse(thrInvWarehouseEntity);
} }
thrDeptEntity.setPid(null); // 不能修改父级 pid //判断部门是否存在
thrDeptEntity.setUpdateTime(new Date()); filterThrDeptRequest.setCode(thrDeptEntity.getCode());
boolean b = thrDeptService.updateInvWarehouse(thrDeptEntity); filterThrDeptRequest.setName(thrDeptEntity.getName());
if (!b) { filterThrDeptRequest.setThirdSysFk(thrDeptEntity.getThirdSysFk());
return ResultVOUtils.error(ResultEnum.NOT_NETWORK); 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") @PostMapping("/spms/thrsys/warehouse/delete")

Loading…
Cancel
Save