Browse Source

fixed 库存操作问题

fushengqian 11 months ago
parent
commit
81f9561b1b

+ 3 - 0
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendGoodsController.java

@@ -820,6 +820,9 @@ public class BackendGoodsController extends BaseController {
         if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
         if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
             params.put("merchantId", accountInfo.getMerchantId());
             params.put("merchantId", accountInfo.getMerchantId());
         }
         }
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
+            params.put("storeId", accountInfo.getStoreId());
+        }
         PaginationResponse<GoodsDto> paginationResponse = goodsService.selectGoodsList(params);
         PaginationResponse<GoodsDto> paginationResponse = goodsService.selectGoodsList(params);
         String imagePath = settingService.getUploadBasePath();
         String imagePath = settingService.getUploadBasePath();
 
 

+ 10 - 9
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendStockController.java

@@ -187,19 +187,20 @@ public class BackendStockController extends BaseController {
         }
         }
 
 
         Integer myStoreId = accountDto.getStoreId();
         Integer myStoreId = accountDto.getStoreId();
-        if (myStoreId > 0) {
+        if (myStoreId != null && myStoreId > 0) {
             storeId = myStoreId;
             storeId = myStoreId;
         }
         }
 
 
-        MtStock info = new MtStock();
-        info.setMerchantId(accountDto.getMerchantId());
-        info.setDescription(description);
-        info.setStatus(status);
-        info.setStoreId(storeId);
-        info.setType(type);
+        MtStock mtStock = new MtStock();
+        mtStock.setMerchantId(accountDto.getMerchantId());
+        mtStock.setDescription(description);
+        mtStock.setStatus(status);
+        mtStock.setStoreId(storeId);
+        mtStock.setType(type);
         String operator = accountDto.getAccountName();
         String operator = accountDto.getAccountName();
-        info.setOperator(operator);
-        stockService.addStock(info, goodsList);
+        mtStock.setOperator(operator);
+        stockService.addStock(mtStock, goodsList);
+
         return getSuccessResult(true);
         return getSuccessResult(true);
     }
     }