Просмотр исходного кода

fixed临时库库存状态接口,多品类产生的bug问题

hill.liu месяцев назад: 8
Родитель
Сommit
b7fa8f745d

+ 15 - 0
src/main/java/com/sy/coinage/workshop/controller/StockController.java

@@ -164,7 +164,22 @@ public class StockController extends BaseController {
         queryWrapper.eq(Stock::getWareId, req.getId());
         queryWrapper.orderByDesc(Stock::getId);
         List<Stock> list = this.stockService.list(queryWrapper);
+
+        // add by hliu date =20240313
+        String securities ="";
+        if(list!=null && list.size()>0){
+            securities = list.get(0).getSecurities();
+        }
+        // add end
+
         for (Stock stock : list) {
+            //FIXME add by hliu date=20240313 ,倒序,如果含有两个品类,最后那个品类会被之前的品类覆盖,
+            // 要确保是最后的品类的临时库数据,加入过滤条件
+            if(!stock.getSecurities().equals(securities)){
+                continue;
+            }
+            // add end
+
             if (stock.getAreaId().intValue() == 1) {
                 data.setProdWare(stock);
                 data.setDetailList(this.getDetailList(req.getId(), stock.getSecuritiesId()));