|
|
|
@ -89,8 +89,9 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
InvPreinDetailService invPreinDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvProductDetailService invProductDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoCodeLostService codeLostService;
|
|
|
|
|
IoOrderDetailBizService orderDetailBizService;
|
|
|
|
|
|
|
|
|
|
//手持端扫码单据上传调用接口
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@ -636,8 +637,16 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseResponse baseResponse = checkRelId(codeEnttity, unitFk);
|
|
|
|
|
if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew()) {
|
|
|
|
|
|
|
|
|
|
boolean isBillExit = orderDetailBizService.isExit(orderEntity.getBillNo());
|
|
|
|
|
if (!isBillExit) {
|
|
|
|
|
return ResultVOUtils.error(500, "请先录入业务详情");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseResponse baseResponse = checkRelId(codeEnttity, unitFk);
|
|
|
|
|
BaseResponse invRes = checkInv(bussinessTypeEntity, codeEnttity);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
return invRes;
|
|
|
|
@ -857,24 +866,39 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新供应商
|
|
|
|
|
IoCodeTempEntity codeTempEntity = codeTempService.selectById(codeSaveRequest.getId());
|
|
|
|
|
codeTempEntity.setSupId(codeSaveRequest.getSupId());
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSupId())) {
|
|
|
|
|
codeTempEntity.setSupId(codeTempEntity.getSupId());
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
if (StrUtil.isNotEmpty(codeSaveRequest.getMySupId())) {
|
|
|
|
|
codeTempEntity.setSupId(codeSaveRequest.getMySupId());
|
|
|
|
|
codeTempService.updateById(codeSaveRequest);
|
|
|
|
|
}
|
|
|
|
|
if (codeTempEntity.getRelId() != null) {
|
|
|
|
|
codeTempEntity = codeTempService.selectById(codeTempEntity.getId());
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(codeTempEntity);
|
|
|
|
|
codeTempEntity.setReCount(reCount);
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新耗材字典
|
|
|
|
|
if (codeSaveRequest.getRelId() != null) {
|
|
|
|
|
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(codeTempEntity.getAction());
|
|
|
|
|
BaseResponse baseResponse = checkSupId(bussinessTypeEntity, codeTempEntity, codeTempEntity.getSupId());
|
|
|
|
|
if (baseResponse != null)
|
|
|
|
|
return baseResponse;
|
|
|
|
|
|
|
|
|
|
codeTempEntity.setRelId(codeSaveRequest.getRelId());
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(codeTempEntity);
|
|
|
|
|
codeTempEntity.setReCount(reCount);
|
|
|
|
|
}
|
|
|
|
|
codeTempEntity = codeTempService.selectById(codeTempEntity.getId());
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(codeTempEntity.getOrderId());
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
|
|
|
|
|
|
|
|
|
|
if (orderEntity.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable() && bussinessTypeEntity.isCheckWebNew()) {
|
|
|
|
|
String errMsg = ioCheckInoutService.checkCode(codeTempEntity);
|
|
|
|
|
if (errMsg != null) {
|
|
|
|
|
return ResultVOUtils.error(500, errMsg);
|
|
|
|
|
} else
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
} else {
|
|
|
|
|
codeTempService.updateById(codeTempEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ioAddInoutService.genOrderDetailCode(orderEntity, codeTempEntity);
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("绑定成功");
|
|
|
|
|