| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasLift; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.entity.DeviceDataLog; |
| | | import com.zy.asrs.service.BasLiftService; |
| | | import com.zy.asrs.service.DeviceDataLogService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.ExecuteSupport; |
| | |
| | | //************补充扩展字段************* |
| | | InnerLiftExtend liftExtend = (InnerLiftExtend) liftProtocol.getExtend(); |
| | | liftProtocol.setExtend(liftExtend); |
| | | liftExtend.setFrontOverrun(data.getBoolean("frontOverrun")); |
| | | liftExtend.setBackOverrun(data.getBoolean("backOverrun")); |
| | | liftExtend.setLeftOverrun(data.getBoolean("leftOverrun")); |
| | | liftExtend.setRightOverrun(data.getBoolean("rightOverrun")); |
| | | liftExtend.setOverHeight(data.getBoolean("overHeight")); |
| | | liftExtend.setOverWeight(data.getBoolean("overWeight")); |
| | | JSONObject extend = data.getJSONObject("extend"); |
| | | liftExtend.setFrontOverrun(extend.getInteger("frontOverrun") == 1); |
| | | liftExtend.setBackOverrun(extend.getInteger("backOverrun") == 1); |
| | | liftExtend.setLeftOverrun(extend.getInteger("leftOverrun") == 1); |
| | | liftExtend.setRightOverrun(extend.getInteger("rightOverrun") == 1); |
| | | liftExtend.setOverHeight(extend.getInteger("overHeight") == 1); |
| | | liftExtend.setOverWeight(extend.getInteger("overWeight") == 1); |
| | | liftExtend.setPlcTaskNoComplete(extend.getInteger("plcTaskNoComplete")); |
| | | |
| | | if (!liftExtend.getPlcTaskNoComplete().equals(liftProtocol.getPlcTaskNo())) { |
| | | //设备状态 |
| | | liftProtocol.setDeviceStatus(LiftDeviceStatusType.BUSY.id); |
| | | } |
| | | |
| | | //读取站点 |
| | | JSONArray stationList = data.getJSONArray("stationList"); |
| | |
| | | || this.liftProtocol.getPlcTaskNo() == null |
| | | || this.liftProtocol.getProtocolStatus() == null |
| | | || this.liftProtocol.getModel() == null |
| | | || this.liftProtocol.getDeviceStatus() == null |
| | | || this.liftProtocol.getErrorCode() == null |
| | | || this.liftProtocol.getExtend() == null |
| | | ) { |
| | |
| | | // && this.liftProtocol.getPlcTaskNo() == 0 |
| | | && this.liftProtocol.getTaskNo() == 0 |
| | | && this.liftProtocol.getModel() == 2 |
| | | && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id |
| | | && this.liftProtocol.getErrorCode() == 0 |
| | | && !extend.getFrontOverrun() |
| | | && !extend.getBackOverrun() |
| | |
| | | |
| | | if (this.liftProtocol.getProtocolStatus() == null |
| | | || this.liftProtocol.getModel() == null |
| | | || this.liftProtocol.getDeviceStatus() == null |
| | | || this.liftProtocol.getErrorCode() == null |
| | | || this.liftProtocol.getExtend() == null |
| | | ) { |
| | |
| | | |
| | | boolean res = this.liftProtocol.getProtocolStatus() == LiftProtocolStatusType.IDLE.id |
| | | && this.liftProtocol.getModel() == 2 |
| | | && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id |
| | | && this.liftProtocol.getErrorCode() == 0 |
| | | && !extend.getFrontOverrun() |
| | | && !extend.getBackOverrun() |
| | |
| | | command.setPick(pick); |
| | | command.setPut(put); |
| | | |
| | | LiftStaProtocol pickSta = findSta(pick); |
| | | LiftStaProtocol putSta = findSta(put); |
| | | command.setPickLev(pickSta.getLev()); |
| | | command.setPutLev(putSta.getLev()); |
| | | return command; |
| | | } |
| | | |
| | |
| | | command.setPick(pick); |
| | | command.setPut(put); |
| | | |
| | | LiftStaProtocol pickSta = findSta(pick); |
| | | LiftStaProtocol putSta = findSta(put); |
| | | command.setPickLev(pickSta.getLev()); |
| | | command.setPutLev(putSta.getLev()); |
| | | return command; |
| | | } |
| | | |
| | |
| | | command.setPick(pick); |
| | | command.setPut(put); |
| | | |
| | | LiftStaProtocol pickSta = findSta(pick); |
| | | LiftStaProtocol putSta = findSta(put); |
| | | command.setPickLev(pickSta.getLev()); |
| | | command.setPutLev(putSta.getLev()); |
| | | return command; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private LiftStaProtocol findSta(Integer staNo) { |
| | | for (LiftStaProtocol liftStaProtocol : this.liftStaProtocols) { |
| | | if (liftStaProtocol.getSiteId().equals(staNo)) { |
| | | return liftStaProtocol; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 扩展字段 |
| | | */ |
| | |
| | | */ |
| | | private Boolean overWeight; |
| | | |
| | | //提升机站点 |
| | | private List<LiftStaProtocol> liftStaProtocols; |
| | | //PLC已完成任务号 |
| | | private Integer plcTaskNoComplete; |
| | | |
| | | } |
| | | } |