Jelajahi Sumber

处理多订单子盘和工装出库

oyq28 2 tahun lalu
induk
melakukan
da1e50ade6

+ 11 - 7
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -1239,16 +1239,20 @@ public class RobotNodeServiceImpl implements NodeOperationService {
             List<StockInfo> currStockList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, stockList.get(1).getStorgeId()));
             Tray stockTray = trayService.getById(currStockList.get(0).getGoodsId());
             //判断是否已经翻面
-            if(stockTray.getFiveAxis().equals("0")){
+            if(stockTray.getFiveAxis().equals(0)){
                 // 获取三轴同类型子盘和工装
-                Tray otherTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType())).get(0);
-                StockInfo otherStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, otherTray.getId()));
-                returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, otherStock.getStorgeId()));
+                Tray otherTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType()).eq(Tray::getFiveAxis, 0)).get(0);
+                StockInfo otherStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, otherTray.getId()).in(StockInfo::getStorgeId,startProductionresourcePositionIds));
+                if(otherStock!=null){
+                    returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, otherStock.getStorgeId()));
+                }
             }else{
                 //翻面获取五轴同类型子盘和工装
-                Tray axisTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType()).eq(Tray::getFiveAxis, "1")).get(0);
-                StockInfo axisStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, axisTray.getId()));
-                returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, axisStock.getStorgeId()));
+                Tray axisTray = trayService.list(new LbqWrapper<Tray>().eq(Tray::getProductionType, currTray.getProductionType()).eq(Tray::getFiveAxis, 1)).get(0);
+                StockInfo axisStock = stockInfoMapper.selectOne(new LbqWrapper<StockInfo>().eq(StockInfo::getGoodsId, axisTray.getId()).in(StockInfo::getStorgeId,startProductionresourcePositionIds));
+                if(axisStock!=null) {
+                    returnList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, axisStock.getStorgeId()));
+                }
             }
         }
         return returnList;