|
@@ -42,6 +42,9 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
|
|
@Resource
|
|
@Resource
|
|
private InventoryLogService inventoryLogService;
|
|
private InventoryLogService inventoryLogService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private MaterialService materialService;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
|
|
public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
|
|
@@ -121,6 +124,7 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
|
|
log.setType(type);
|
|
log.setType(type);
|
|
inventoryLogService.save(log);
|
|
inventoryLogService.save(log);
|
|
update(new UpdateWrapper<MaterialBatch>().set("inventory",materialBatch.getInventory()).eq("id",materialBatch.getId()));
|
|
update(new UpdateWrapper<MaterialBatch>().set("inventory",materialBatch.getInventory()).eq("id",materialBatch.getId()));
|
|
|
|
+ depotItemService.updateCurrentStockFun(materialBatch.getMaterialId(),materialBatch.getDepotId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -155,16 +159,17 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 根据商品条码获取商品批次信息
|
|
|
|
|
|
+ * 根据商品条码和仓库id获取商品批次信息
|
|
* @param barCodes 商品条码字符集合
|
|
* @param barCodes 商品条码字符集合
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<MaterialBatch> findBySelectWithBarCode(String barCodes) {
|
|
|
|
|
|
+ public List<MaterialBatch> findBySelectWithBarCode(String barCodes,Long depotId) {
|
|
List<String> barCodeList = null;
|
|
List<String> barCodeList = null;
|
|
if (barCodes != null && !barCodes.isEmpty()){
|
|
if (barCodes != null && !barCodes.isEmpty()){
|
|
barCodeList = Arrays.asList(barCodes.split(","));
|
|
barCodeList = Arrays.asList(barCodes.split(","));
|
|
}
|
|
}
|
|
- List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().inIfPresent(MaterialBatch::getBarCode,barCodeList).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
|
|
|
|
|
|
+ List<Long> ids = materialExtendService.selectIdsByBarCode(barCodeList);
|
|
|
|
+ List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDepotId,depotId).inIfPresent(MaterialBatch::getMaterialId,ids).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|