|
|
|
@ -461,9 +461,6 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//校验库存是否存在
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (addOrderRequest.getFromCorp() == null) {
|
|
|
|
|
BasicCorpEntity basicCorpEntity = basicUnitMaintainService.selectByName(addOrderRequest.getFromCorp());
|
|
|
|
|
if (basicCorpEntity == null && bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT && bussinessTypeEntity.isGenUnit()) {
|
|
|
|
@ -802,28 +799,34 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/addCode/updateBindSup")
|
|
|
|
|
public BaseResponse updateBindSup(@RequestBody IoCodeTempEntity warehouseEntity, BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse updateBindSup(@RequestBody IoCodeTempEntity codeTempEntity, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(warehouseEntity.getMySupId())) {
|
|
|
|
|
warehouseEntity.setSupId(warehouseEntity.getMySupId());
|
|
|
|
|
codeTempService.updateById(warehouseEntity);
|
|
|
|
|
} else if (warehouseEntity.getRelId() != null) {
|
|
|
|
|
warehouseEntity = codeTempService.selectById(warehouseEntity.getId());
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(warehouseEntity);
|
|
|
|
|
warehouseEntity.setReCount(reCount);
|
|
|
|
|
codeTempService.updateById(warehouseEntity);
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(warehouseEntity.getAction());
|
|
|
|
|
BaseResponse baseResponse = checkSupId(bussinessTypeEntity, warehouseEntity, warehouseEntity.getSupId());
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSupId())) {
|
|
|
|
|
codeTempEntity.setSupId(codeTempEntity.getSupId());
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
} else if (codeTempEntity.getRelId() != null) {
|
|
|
|
|
codeTempEntity = codeTempService.selectById(codeTempEntity.getId());
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(codeTempEntity);
|
|
|
|
|
codeTempEntity.setReCount(reCount);
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(codeTempEntity.getAction());
|
|
|
|
|
BaseResponse baseResponse = checkSupId(bussinessTypeEntity, codeTempEntity, codeTempEntity.getSupId());
|
|
|
|
|
if (baseResponse != null)
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
codeTempEntity = codeTempService.selectById(codeTempEntity.getId());
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(codeTempEntity.getOrderId());
|
|
|
|
|
ioAddInoutService.genOrderDetailCode(orderEntity, codeTempEntity);
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("绑定成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoAddInoutService ioAddInoutService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeService ioOrderDetailCodeService;
|
|
|
|
|
|
|
|
|
|