Selaa lähdekoodia

盘点任务新增-查询批次接口新增仓库条件,盘点核对刷新库存

huang 1 viikko sitten
vanhempi
commit
9b06d7a45e

+ 0 - 1
src/main/java/com/jsh/erp/controller/MaterialController.java

@@ -866,7 +866,6 @@ public class MaterialController extends BaseController {
     public BaseResponseInfo findBatchNumberSBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
                                            @RequestParam(value = "q", required = false) String q,
                                            @RequestParam(value = "standardOrModel", required = false) String standardOrModel,
-                                           @RequestParam(value = "mpList", required = false) String mpList,
                                            @RequestParam(value = "depotId", required = false) Long depotId,
                                            @RequestParam(value = "color", required = false) String color,
                                            @RequestParam(value = "brand", required = false) String brand,

+ 3 - 2
src/main/java/com/jsh/erp/controller/materialBatch/MaterialBatchController.java

@@ -46,8 +46,9 @@ public class MaterialBatchController extends BaseController {
 
     @GetMapping(value = "/findBatchNumbersByBarCode")
     @ApiOperation(value = "根据条码查询批次号")
-    public AjaxResult findBatchNumbersByBarCode(@RequestParam(value = "barCodes",required = false) String barCodes){
-        List<MaterialBatch> dataList = materialBatchService.findBySelectWithBarCode(barCodes);
+    public AjaxResult findBatchNumbersByBarCode(@RequestParam(value = "barCodes",required = false) String barCodes,
+                                                @RequestParam(value = "depotId") Long depotId){
+        List<MaterialBatch> dataList = materialBatchService.findBySelectWithBarCode(barCodes,depotId);
         StringBuffer str = new StringBuffer();
         if (null != dataList) {
             for (MaterialBatch material : dataList) {

+ 1 - 1
src/main/java/com/jsh/erp/service/MaterialBatchService.java

@@ -56,7 +56,7 @@ public interface MaterialBatchService extends IService<MaterialBatch> {
      * 根据商品条码获取商品批次信息
      * @param barCodes 商品条码字符集合
      */
-    List<MaterialBatch> findBySelectWithBarCode(String barCodes);
+    List<MaterialBatch> findBySelectWithBarCode(String barCodes,Long depotId);
 
     /**
      * 根据批次号数组查询商品批次信息

+ 4 - 3
src/main/java/com/jsh/erp/service/impl/MaterialBatchServiceImpl.java

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