|
@@ -618,47 +618,55 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean szbStockHandle(boolean isFetched, TaskNode taskNode){
|
|
|
- List<Storge> storgeList = baseMapper.selectList(new LbqWrapper<Storge>().in(Storge::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("M"), DictionaryKey.ZEISS_LOCATION.get("L"))));
|
|
|
+ List<Storge> storgeList = baseMapper.selectList(new LbqWrapper<Storge>().in(Storge::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("M"))));
|
|
|
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()));
|
|
|
+// List<StockInfo> lPointList = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().eq(StockInfo::getStorgeId, storgeList.get(1).getId()));
|
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
//三坐标中间位取操作
|
|
|
if(isFetched) {
|
|
|
- String fetchStatus = msgUtil.getCcsData("/api/GetMiddleThreeCoordinates", params, taskNode);
|
|
|
+ //todo wang.sq三坐标调用地址释放
|
|
|
+ // 查询三坐标是否允许取
|
|
|
+// String fetchStatus = msgUtil.getCcsData("/api/GetMiddleThreeCoordinates", params, taskNode);
|
|
|
+ String fetchStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
|
|
|
+
|
|
|
JSONObject fetchObject = JSONObject.parseObject(fetchStatus);
|
|
|
logger.warn("三坐标节点{}取查询接口返回{}", taskNode.getId(), fetchObject.toJSONString());
|
|
|
//判断三坐标是否可取
|
|
|
if (null != fetchObject && fetchObject.containsKey("result") && StringUtils.isNotEmpty(fetchObject.getString("result")) && !fetchObject.getString("result").trim().equals("false")) {
|
|
|
if (mPointList.size() > 0) return true;
|
|
|
// M位可取但无零件工装且L位有零件工装
|
|
|
- if (lPointList.size() > 0 && mPointList.size() == 0) {
|
|
|
- List<Long> ids = lPointList.stream().map(StockInfo::getId).collect(toList());
|
|
|
- LambdaUpdateWrapper<StockInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<StockInfo>();
|
|
|
- //虚拟缓存位点位更新成为M点位
|
|
|
- lambdaUpdateWrapper.set(StockInfo::getStorgeId, storgeList.get(0).getId()).in(StockInfo::getId, ids);
|
|
|
- stockInfoMapper.update(null, lambdaUpdateWrapper);
|
|
|
- logger.warn("三坐标节点{}取操作,虚拟缓存位点位更新成为M点位", taskNode.getId());
|
|
|
- return true;
|
|
|
- }
|
|
|
+// if (lPointList.size() > 0 && mPointList.size() == 0) {
|
|
|
+// List<Long> ids = lPointList.stream().map(StockInfo::getId).collect(toList());
|
|
|
+// LambdaUpdateWrapper<StockInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<StockInfo>();
|
|
|
+// //虚拟缓存位点位更新成为M点位
|
|
|
+// lambdaUpdateWrapper.set(StockInfo::getStorgeId, storgeList.get(0).getId()).in(StockInfo::getId, ids);
|
|
|
+// stockInfoMapper.update(null, lambdaUpdateWrapper);
|
|
|
+// logger.warn("三坐标节点{}取操作,虚拟缓存位点位更新成为M点位", taskNode.getId());
|
|
|
+// return true;
|
|
|
+// }
|
|
|
}
|
|
|
}else{
|
|
|
//三坐标中间放操作
|
|
|
- String sendStatus = msgUtil.getCcsData("/api/QueryThreeCoordinatesFreePos", params, taskNode);
|
|
|
+ // 查询三坐标是否允许放
|
|
|
+ //todo wang.sq三坐标调用地址释放
|
|
|
+// String sendStatus = msgUtil.getCcsData("/api/QueryThreeCoordinatesFreePos", params, taskNode);
|
|
|
+ String sendStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
|
|
|
+
|
|
|
JSONObject sendObject = JSONObject.parseObject(sendStatus);
|
|
|
logger.warn("三坐标节点{}放查询接口返回{}", taskNode.getId(), sendObject.toJSONString());
|
|
|
if (null != sendObject && sendObject.containsKey("result") && StringUtils.isNotEmpty(sendObject.getString("result")) && !sendObject.getString("result").trim().equals("false")) {
|
|
|
if (mPointList.size() == 0) return true;
|
|
|
// M位可放但有零件工装更新到虚拟L位
|
|
|
- if (mPointList.size() > 0 && lPointList.size() == 0) {
|
|
|
- List<Long> ids = mPointList.stream().map(StockInfo::getId).collect(toList());
|
|
|
- LambdaUpdateWrapper<StockInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<StockInfo>();
|
|
|
- //M点位更新为L虚拟点位
|
|
|
- lambdaUpdateWrapper.set(StockInfo::getStorgeId, storgeList.get(1).getId()).in(StockInfo::getId, ids);
|
|
|
- stockInfoMapper.update(null, lambdaUpdateWrapper);
|
|
|
- logger.warn("三坐标节点{}放操作,M点位更新为L虚拟点位", taskNode.getId());
|
|
|
- return true;
|
|
|
- }
|
|
|
+// if (mPointList.size() > 0 && lPointList.size() == 0) {
|
|
|
+// List<Long> ids = mPointList.stream().map(StockInfo::getId).collect(toList());
|
|
|
+// LambdaUpdateWrapper<StockInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<StockInfo>();
|
|
|
+// //M点位更新为L虚拟点位
|
|
|
+// lambdaUpdateWrapper.set(StockInfo::getStorgeId, storgeList.get(1).getId()).in(StockInfo::getId, ids);
|
|
|
+// stockInfoMapper.update(null, lambdaUpdateWrapper);
|
|
|
+// logger.warn("三坐标节点{}放操作,M点位更新为L虚拟点位", taskNode.getId());
|
|
|
+// return true;
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
logger.warn("三坐标节点{}取放条件不通过", taskNode.getId());
|