| | |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleCommand; |
| | | import com.zy.asrs.wcs.core.model.enums.ShuttleCommandModeType; |
| | | import com.zy.asrs.wcs.core.service.LocService; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.OutputQueue; |
| | |
| | | if (data != null) { |
| | | if (null == shuttleProtocol) { |
| | | shuttleProtocol = new ShuttleProtocol(); |
| | | shuttleProtocol.setShuttleNo(device.getDeviceNo()); |
| | | shuttleProtocol.setShuttleNo(Integer.valueOf(device.getDeviceNo())); |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE); |
| | | shuttleProtocol.setDevice(device); |
| | | } |
| | | |
| | | //----------读取四向穿梭车状态----------- |
| | | //小车忙状态位 |
| | | shuttleProtocol.setDeviceStatus(data.getInteger("deviceStatus")); |
| | | //小车设备状态 |
| | | Integer deviceStatus = data.getInteger("deviceStatus"); |
| | | shuttleProtocol.setDeviceStatus(deviceStatus); |
| | | //当前二维码 |
| | | shuttleProtocol.setCurrentCode(data.getString("deviceLocation") == null ? "0" : data.getString("deviceLocation")); |
| | | shuttleProtocol.setCurrentCode(data.getString("groundCode") == null ? "0" : data.getString("groundCode")); |
| | | //电池电量 |
| | | shuttleProtocol.setBatteryPower(data.getString("battery") == null ? "0%" : data.getString("battery")); |
| | | |
| | | |
| | | //是否顶升 |
| | | shuttleProtocol.setHasLift(data.getInteger("palletStatus") == 1 ? true : false); |
| | | //是否有托盘 |
| | | shuttleProtocol.setHasPallet(data.getInteger("hasPallet") != 2 ? true : false); |
| | | //行驶方向 |
| | | shuttleProtocol.setRunDirection(data.getString("direction") == null ? "none" : data.getString("direction")); |
| | | //是否为充电状态 |
| | | shuttleProtocol.setHasCharge((deviceStatus == 5 || deviceStatus == 13) ? true : false); |
| | | |
| | | ///读取四向穿梭车状态-end |
| | | |
| | |
| | | ShuttleCommand command = new ShuttleCommand(); |
| | | command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo())); |
| | | command.setBody(JSON.toJSONString(body)); |
| | | command.setMode(ShuttleCommandModeType.MOVE.id); |
| | | command.setTargetLocNo(loc.getLocNo()); |
| | | return command; |
| | | } |
| | | |