Commit 45d4109b authored by liqingjian's avatar liqingjian

2020-04-12 删除多余判断

parent 70dc6418
......@@ -3,6 +3,7 @@ package com.mushiny.beans.order.midea;
import com.mushiny.beans.Address;
import com.mushiny.beans.Robot;
import com.mushiny.beans.Section;
import com.mushiny.beans.enums.AddressStatus;
import com.mushiny.beans.enums.AddressType;
import com.mushiny.beans.enums.TripStatus;
import com.mushiny.beans.order.Order;
......@@ -95,24 +96,24 @@ public class PodRunOrder extends Order {
List<Address> addresses = section.getStorageAddrs();
for (int i = 0; i < addresses.size(); i++) {
Address address = addresses.get(i);
if(address.getType() == AddressType.STORAGE ){
success = noPodOnAddress(address)
&& address.robotLock(this.getRobot().getRobotId(),true);
if(address.getType() == AddressType.STORAGE && noPodOnAddress(address)){
//success = address.robotLock(this.getRobot().getRobotId(),true);
//如果该节点被某小车锁定,而小车锁定的目的地不是该节点,表示数据有问题 2020-01-20
Robot lockedRobot = this.getRobotManager().getRobotById(address.getLockedBy());
//@2020-04-11 判断空
if(lockedRobot == null || lockedRobot.getLockedAddr() != Long.parseLong(address.getId())){
logger.error("该位置锁定的小车目的地不是这个点 lockedRobot.getLockedAddr():"
logger.error("没有锁定的小车 或 该位置锁定的小车目的地不是这个点 lockedRobot.getLockedAddr():"
+lockedRobot+" address.getId():"+address.getId());
success = true;
}
if (success) {
//2020-04-12 可以使用的地址
logger.error(this.getOrderId() + "的POD="
+ this.getPod().getPodName()+" 获取到目标地址:"+address.getId());
this.getRobot().setLockedAddr(Long.parseLong(address.getId()));
address.setLockedBy(this.getRobot().getRobotId());
address.setNodeState(AddressStatus.RESERVED);
break;
}
}
//logger.debug("Address 不合适 :");
}
//还是没找到....
if (!success) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment