|
@@ -1930,22 +1930,37 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
String srcStorgeId = callBackJson.getString("srcPosition");
|
|
|
String targetStorgeId = "";
|
|
|
String stationId = callBackJson.getString("stationId");
|
|
|
+
|
|
|
+ String uniqueCode = callBackJson.containsKey("uniqueCode") ? callBackJson.getString("uniqueCode") : "";
|
|
|
+ //boolean bool = StringUtil.isNotEmpty(uniqueCode) && taskService.confirmCode(new HashMap<String, Object>(){{put("uniqueCode" , uniqueCode); put("orderId", currWorkpiece.getOrderId());}}).getIsSuccess();
|
|
|
+ boolean bool = StringUtil.isNotEmpty(uniqueCode) && workpieceService.count(new LbqWrapper<TWorkpiece>().eq(TWorkpiece::getUniqueCode, uniqueCode).eq(TWorkpiece::getOrderId, currWorkpiece.getOrderId()))>0;
|
|
|
+
|
|
|
+ //更新目标位置
|
|
|
if (StringUtils.isNotBlank(stationId)) {
|
|
|
- //三坐标检测位与虚拟位切换
|
|
|
- int count = storgeService.count(new LbqWrapper<Storge>().eq(Storge::getPointId, DictionaryKey.ZEISS_LOCATION.get("L")));
|
|
|
+ /*
|
|
|
+ Long storgeId = storgeService.getOne(new LbqWrapper<Storge>().eq(Storge::getPointId, DictionaryKey.ZEISS_LOCATION.get("L"))).getId();
|
|
|
+ List<ProductionresourcePosition> productionresourcePositionList =
|
|
|
+ productionresourcePositionService.list(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, taskNode.getTargetResourceId()).in(ProductionresourcePosition::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("L"), DictionaryKey.ZEISS_LOCATION.get("M"))).orderByDesc(ProductionresourcePosition::getStatus));
|
|
|
+ int count = stockInfoService.count(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, storgeId));
|
|
|
String getPoint = (count == 0)? DictionaryKey.ZEISS_LOCATION.get("L"): DictionaryKey.ZEISS_LOCATION.get("M");
|
|
|
- ProductionresourcePosition productionresourcePosition =
|
|
|
- productionresourcePositionService.getOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, taskNode.getTargetResourceId()).eq(ProductionresourcePosition::getPointId, getPoint));
|
|
|
- targetStorgeId = String.valueOf(productionresourcePosition.getStorgeId());
|
|
|
+ targetStorgeId = (lPointList.size() == 0)? String.valueOf(storgeList.get(0).getId()) : String.valueOf(storgeList.get(1).getId());
|
|
|
+ */
|
|
|
+ List<Storge> storgeList = storgeService.list(new LbqWrapper<Storge>().in(Storge::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("M"), DictionaryKey.ZEISS_LOCATION.get("L"))));
|
|
|
+ List<StockInfo> mPointList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, storgeList.get(0).getId()));
|
|
|
+ List<StockInfo> lPointList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, storgeList.get(1).getId()));
|
|
|
+ targetStorgeId = storgeList.get(1).getId().toString();
|
|
|
+ if(lPointList.size() > 0 && mPointList.size() == 0){
|
|
|
+ //三坐标检测位与虚拟位切换 原虚拟位替换为M位
|
|
|
+ lPointList.forEach(item->item.setStorgeId(storgeList.get(0).getId()));
|
|
|
+ stockInfoService.updateBatchById(lPointList);
|
|
|
+ logger.warn("三坐标检测节点{}将上一零件从虚拟位切换到M位", taskNode.getId());
|
|
|
+ }
|
|
|
+ // 三坐标检测零件默认放置在M点位上
|
|
|
+ workpieceService.setWorkPieceStock(currWorkpiece, storgeList.get(0).getId().toString(), "", taskNode, uniqueCode);
|
|
|
} else {
|
|
|
targetStorgeId = callBackJson.getString("targetPostion");
|
|
|
+ workpieceService.setWorkPieceStock(currWorkpiece, targetStorgeId, "", taskNode, uniqueCode);
|
|
|
}
|
|
|
- // end modify by yejian on 20221019 for 滑台三座标结果返回需动态更新取位子
|
|
|
- String uniqueCode = callBackJson.containsKey("uniqueCode") ? callBackJson.getString("uniqueCode") : "";
|
|
|
- //boolean bool = StringUtil.isNotEmpty(uniqueCode) && taskService.confirmCode(new HashMap<String, Object>(){{put("uniqueCode" , uniqueCode); put("orderId", currWorkpiece.getOrderId());}}).getIsSuccess();
|
|
|
- boolean bool = StringUtil.isNotEmpty(uniqueCode) && workpieceService.count(new LbqWrapper<TWorkpiece>().eq(TWorkpiece::getUniqueCode, uniqueCode).eq(TWorkpiece::getOrderId, currWorkpiece.getOrderId()))>0;
|
|
|
- //更新目标位置
|
|
|
- workpieceService.setWorkPieceStock(currWorkpiece, targetStorgeId, "", taskNode, uniqueCode);
|
|
|
|
|
|
if (DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_RK.equals(stockType)) {
|
|
|
List<BomProcedureMeterial> meterialList =
|