|
|
|
@ -436,7 +436,7 @@ public class IoAddInoutService {
|
|
|
|
|
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
|
|
|
|
|
|
|
|
|
|
BaseResponse baseResponse = checkInv(bussinessTypeEntity, pdaPostOrderRequest.getOrderDetailCodeEntities(), orderEntity, pdaPostOrderRequest.getCodeTempEntities());
|
|
|
|
|
BaseResponse baseResponse = checkInv(bussinessTypeEntity, pdaPostOrderRequest.getOrderDetailBizEntities(), orderEntity, pdaPostOrderRequest.getCodeTempEntities());
|
|
|
|
|
if (baseResponse != null)
|
|
|
|
|
return baseResponse;
|
|
|
|
|
|
|
|
|
@ -823,7 +823,7 @@ public class IoAddInoutService {
|
|
|
|
|
/**
|
|
|
|
|
* 手持终端上传校验库存
|
|
|
|
|
*/
|
|
|
|
|
public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, List<IoOrderDetailCodeEntity> orderDetailCodeEntities, IoOrderEntity orderEntity, List<IoCodeTempEntity> codeTempEntities) {
|
|
|
|
|
public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, List<IoOrderDetailBizEntity> orderDetailBizEntities, IoOrderEntity orderEntity, List<IoCodeTempEntity> codeTempEntities) {
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN);
|
|
|
|
@ -840,35 +840,35 @@ public class IoAddInoutService {
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count < IntUtil.value(codeTempEntity.getReCount())) {
|
|
|
|
|
return ResultVOUtils.error(500, "UDI码:" + codeTempEntity.getCode() + "预验收库存数量不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE);
|
|
|
|
|
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
|
|
|
|
|
for (IoOrderDetailBizEntity orderDetailCodeEntity : orderDetailBizEntities) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, invWarehouseEntity.getCode(), orderEntity.getPreCurSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else { //校验普通库存
|
|
|
|
|
if (bussinessTypeEntity.isVailInv() && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
|
|
|
|
|
for (IoOrderDetailBizEntity orderDetailCodeEntity : orderDetailBizEntities) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), orderEntity.getCurSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|