|
|
|
@ -677,16 +677,16 @@ public class IoAddInoutService {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isMuti){
|
|
|
|
|
if (isMuti) {
|
|
|
|
|
//过滤掉库存数量为0的供应商
|
|
|
|
|
if (relId != null && StrUtil.isNotEmpty(batchNo)){
|
|
|
|
|
unitFks = invProductService.filterReCount(relId,batchNo,unitFks);
|
|
|
|
|
if (unitFks!=null && unitFks.size() == 1){
|
|
|
|
|
if (relId != null && StrUtil.isNotEmpty(batchNo)) {
|
|
|
|
|
unitFks = invProductService.filterReCount(relId, batchNo, unitFks);
|
|
|
|
|
if (unitFks != null && unitFks.size() == 1) {
|
|
|
|
|
return unitFks.get(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "MUTI"; //绑定多个供应商
|
|
|
|
|
}else return unitFk;
|
|
|
|
|
} else return unitFk;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -931,34 +931,40 @@ public class IoAddInoutService {
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN);
|
|
|
|
|
for (IoCodeTempEntity codeTempEntity : codeTempEntities) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), null, codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
if (count < IntUtil.value(codeTempEntity.getReCount())) {
|
|
|
|
|
return ResultVOUtils.error(500, "UDI码:" + codeTempEntity.getCode() + "预验收库存数量不足!");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (checkDiAttribute(bussinessTypeEntity, codeTempEntity.getRelId(), 2)) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), null, codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
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 (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 < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
if (checkDiAttribute(bussinessTypeEntity, orderDetailCodeEntity.getBindRlFk(), 3)) {
|
|
|
|
|
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 < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -970,14 +976,16 @@ public class IoAddInoutService {
|
|
|
|
|
outInvCode = invWarehouseEntity.getCode();
|
|
|
|
|
}
|
|
|
|
|
for (IoOrderDetailBizEntity orderDetailCodeEntity : orderDetailBizEntities) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, outInvCode, 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 < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
if (checkDiAttribute(bussinessTypeEntity, orderDetailCodeEntity.getBindRlFk(), 1)) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(orderDetailCodeEntity.getBindRlFk(), orderDetailCodeEntity.getBatchNo(), orderDetailCodeEntity.getSupId(), null, outInvCode, 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 < orderDetailCodeEntity.getScanCount()) {
|
|
|
|
|
return ResultVOUtils.error(500, "提交失败," + orderDetailCodeEntity.getCoName() + "库存数量不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -985,6 +993,20 @@ public class IoAddInoutService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public boolean checkDiAttribute(BasicBussinessTypeEntity bussinessTypeEntity, Long relId, Integer purType) {
|
|
|
|
|
if (bussinessTypeEntity.getUseDyCount() == 2) {
|
|
|
|
|
if (udiRelevanceService.findPurType(relId) == IntUtil.value(purType)) {
|
|
|
|
|
return true;
|
|
|
|
|
} else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 手持终端上传校验价格
|
|
|
|
@ -1068,6 +1090,4 @@ public class IoAddInoutService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|