|
|
|
@ -89,7 +89,7 @@ public class ThrInvWarehouseController {
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/thirdSys/sub/inv/warehouse/edit")
|
|
|
|
|
public BaseResponse edit(@RequestBody @Valid ThrInvWarehouseEntity invSubWarehouseEntity,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
BindingResult bindingResult,FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest ) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -97,9 +97,18 @@ public class ThrInvWarehouseController {
|
|
|
|
|
if (invSubWarehouseEntity.getId() == null) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
boolean b = thrInvWarehouseService.updateThrInvWarehouse(invSubWarehouseEntity);
|
|
|
|
|
if (!b) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
|
//先判断该部门下存不存在此仓库
|
|
|
|
|
filterThrSubInvWarehouseRequest.setCode(invSubWarehouseEntity.getCode());
|
|
|
|
|
filterThrSubInvWarehouseRequest.setName(invSubWarehouseEntity.getName());
|
|
|
|
|
filterThrSubInvWarehouseRequest.setParentId(invSubWarehouseEntity.getParentId());
|
|
|
|
|
List<ThrInvWarehouseEntity> thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrSubInvWarehouseRequest);
|
|
|
|
|
if(thrInvWarehouseEntities.size()==0){
|
|
|
|
|
boolean b = thrInvWarehouseService.updateThrInvWarehouse(invSubWarehouseEntity);
|
|
|
|
|
if (!b) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ThrDeptEntity thrDeptEntity = thrDeptService.selectByCode(invSubWarehouseEntity.getParentId(), invSubWarehouseEntity.getThirdSysFk());
|
|
|
|
|