|
@@ -32,10 +32,13 @@ import com.github.zuihou.business.productionReadyCenter.service.PlateService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.TrayService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.impl.RobotNodeServiceImpl;
|
|
|
import com.github.zuihou.business.util.MsgUtil;
|
|
|
import com.github.zuihou.common.constant.BizConstant;
|
|
@@ -113,6 +116,12 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
|
|
|
@Autowired
|
|
|
private TrayService trayService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZZoneProductionresourceMapper zZoneProductionresourceMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZZoneService zoneService;
|
|
|
+
|
|
|
private static Logger logger = LoggerFactory.getLogger(StorgeServiceImpl.class);
|
|
|
|
|
|
@Override
|
|
@@ -658,4 +667,50 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
|
|
|
logger.warn("三坐标节点{}取放条件不通过", taskNode.getId());
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 恒轮点位处理
|
|
|
+ * @param taskNode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String getHellerPoint(TaskNode taskNode) {
|
|
|
+ ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
+ long zoneId = zoneProductionresource.getZoneId();
|
|
|
+ ZZone zZone = zoneService.getById(zoneId);
|
|
|
+
|
|
|
+ String instructionUrl = "/api/hellerFreeStatus";
|
|
|
+ //动态调用接口和新增指令执行时间
|
|
|
+ String paramKey = zZone.getNo() + "_plc";
|
|
|
+ String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+ instructionUrl = plcUrl + instructionUrl;
|
|
|
+
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ Map<String, String> hellerMap = DictionaryKey.RESOURCE_NET.get("heller");
|
|
|
+ jsonParam.put("url", hellerMap.get("url"));
|
|
|
+ jsonParam.put("port", hellerMap.get("port"));
|
|
|
+ jsonParam.put("taskId",taskNode.getTaskId() + "");
|
|
|
+ jsonParam.put("taskNodeId",taskNode.getId() + "");
|
|
|
+
|
|
|
+ logger.warn("调用【恒轮调试空闲接口】地址{}", instructionUrl);
|
|
|
+ logger.warn("调用【恒轮调试空闲接口】传参{}", jsonParam.toJSONString());
|
|
|
+ String returnData = msgUtil.httpForPost(instructionUrl,jsonParam.toString());
|
|
|
+ if(StringUtil.isEmpty(returnData)) logger.warn("【恒轮调试空闲接口】返回数据为空");
|
|
|
+ logger.warn("【恒轮调试空闲接口】返回值:{}",returnData);
|
|
|
+
|
|
|
+ JSONObject returnObj = JSONObject.parseObject(returnData);
|
|
|
+ Object result = returnObj.get("result");
|
|
|
+ Object work = returnObj.get("data");
|
|
|
+
|
|
|
+ result = "true";
|
|
|
+ work = "1";
|
|
|
+
|
|
|
+ String point = null;
|
|
|
+ if(!Objects.isNull(result) && "true".equals(result) && !Objects.isNull(work)){
|
|
|
+ point = DictionaryKey.HL_WORK_LOCATION.get(work.toString());
|
|
|
+ }else{
|
|
|
+ logger.warn("【恒轮调试空闲接口】条件不满足:result={},work={}",result,work);
|
|
|
+ }
|
|
|
+ return point;
|
|
|
+ }
|
|
|
}
|