1.修复新建扫码单据校验库存不包含当前单据扫码信息导致超出未提示问题

zhairh
x_z 2 years ago committed by wangwei
parent 118efa8b27
commit 86e64cec5e

@ -755,9 +755,15 @@ public class WareHouseController {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
}
} else {
int count = invProductDetailService.vailStockCount(code);
int count = invProductDetailService.vailStockCount(code, addOrderRequest.getInvStorageCode(), addOrderRequest.getInvWarehouseCode(), null);
if (count <= 0) {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
} else {
//查询此单据已扫描的条码数量
WarehouseEntity warehouse = codesTempService.findByUnique(addOrderRequest.getOrderId(), addOrderRequest.getCode());
if (null != warehouse && warehouse.getCount() > count) {
return ResultVOUtils.error(500, "当前库存不足不允许0库存出库");
}
}
}
}

@ -431,7 +431,7 @@ public class InvProductsController {
@AuthRuleAnnotation("")
@GetMapping("spms/inv/products/vailInvCount")
public BaseResponse vailInvCount(FilterInvProductDetailRequest filterInvProductDetailRequest) {
int count = invProductDetailService.vailStockCount(filterInvProductDetailRequest.getCode());
int count = invProductDetailService.vailStockCount(filterInvProductDetailRequest.getCode(), filterInvProductDetailRequest.getInvStorageCode(), filterInvProductDetailRequest.getInvWarehouseCode(), filterInvProductDetailRequest.getInvSpaceCode());
return ResultVOUtils.success(count);
}

@ -38,7 +38,7 @@ public interface InvProductDetailService {
InvProductDetailEntity statInvPreInDetail(String code);
int vailStockCount(String code);
int vailStockCount(String code, String invStorageCode, String invWarehouseCode, String invSpaceCode);
/**
*

@ -145,15 +145,23 @@ public class InvMAOrderDetailServiceImpl implements InvMAOrderDetailService {
codeList.forEach(code -> codeMap.put(code, 0));
//计算当前在库存中的码明细
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
Integer count = codeMap.get(invProductDetailEntity.getOriginCode());
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
//出库
count = count - 1;
UdiEntity udi = FilterUdiUtils.getUdi(invProductDetailEntity.getOriginCode());
if (StrUtil.isNotBlank(udi.getSerialNo())) {
//有序列号产品,根据产品数量计算即可
Integer count = codeMap.get(invProductDetailEntity.getOriginCode());
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
//出库
count = count - 1;
} else {
//入库
count = count + 1;
}
codeMap.put(invProductDetailEntity.getOriginCode(), count);
} else {
//入库
count = count + 1;
//无序列号产品条码,直接查询库存,使用此库存信息计算出养护数量
int count = invProductEntity.getInCount() - invProductEntity.getOutCount();
codeMap.put(invProductDetailEntity.getOriginCode(), count);
}
codeMap.put(invProductDetailEntity.getOriginCode(), count);
}
//根据库存中的码明细,生成库存养护记录详情

@ -141,12 +141,15 @@ public class InvProductDetailServiceImpl implements InvProductDetailService {
@Override
public int vailStockCount(String code) {
public int vailStockCount(String code, String invStorageCode, String invWarehouseCode, String invSpaceCode) {
if (StrUtil.isEmpty(code)) {
return 0;
}
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
filterInvProductDetailRequest.setInvStorageCode(invStorageCode);
filterInvProductDetailRequest.setInvWarehouseCode(invWarehouseCode);
filterInvProductDetailRequest.setInvSpaceCode(invSpaceCode);
List<InvProductDetailEntity> datas = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
if (CollUtil.isEmpty(datas)) {
filterInvProductDetailRequest.setOriginCode(null);

Loading…
Cancel
Save