|
|
@@ -27,11 +27,11 @@ import com.github.zuihou.business.operationManagementCenter.service.WorkpieceSer
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
|
|
|
-import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
-import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
-import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.*;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureTrayService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.MToolClampService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.TrayService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.*;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.*;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
|
|
|
@@ -128,6 +128,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
private RestTemplate restTemplate;
|
|
|
@Autowired
|
|
|
private PlanMapper planMapper;
|
|
|
+ @Autowired
|
|
|
+ private TrayService trayService;
|
|
|
|
|
|
private Map<String, Object> map = Maps.newHashMap();
|
|
|
|
|
|
@@ -1207,11 +1209,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
List<ProductionresourcePosition> startProductionresourcePositions = productionresourcePositionMapper.selectList(Wraps.<ProductionresourcePosition>lbQ().in(ProductionresourcePosition::getResourceId, productionresourceIds).eq(ProductionresourcePosition::getStatus,"0"));
|
|
|
List<Long> startProductionresourcePositionIds = startProductionresourcePositions.stream().map(t->t.getStorgeId()).collect(Collectors.toList());
|
|
|
|
|
|
- List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId, task.getProcedureId()));
|
|
|
+ List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId, task.getProcedureId()).orderByAsc(BomProcedureTray::getBizType));
|
|
|
List<Long>trayIdList = trayList.stream().map(t->t.getTrayId()).collect(Collectors.toList());
|
|
|
// 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
|
|
|
|
|
|
- List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).orderByAsc(StockInfo::getWeight, StockInfo::getGoodsType));
|
|
|
+ List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).orderByAsc(StockInfo::getGoodsType));
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(allStockInfos)){
|
|
|
//托盘和夹具判断
|
|
|
@@ -1231,6 +1233,23 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
returnList = allStockInfos;
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ List<StockInfo> stockList = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).orderByAsc(StockInfo::getGoodsType));
|
|
|
+ Tray currTray = trayService.getById(trayIdList.get(0));
|
|
|
+ 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")){
|
|
|
+ // 获取三轴同类型子盘和工装
|
|
|
+ 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()));
|
|
|
+ }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()));
|
|
|
+ }
|
|
|
}
|
|
|
return returnList;
|
|
|
}
|