| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasLiftErr; |
| | | import com.zy.asrs.service.BasLiftErrService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.ForkLiftIoModeType; |
| | | import com.zy.core.enums.ForkLiftProtocolStatusType; |
| | | import com.zy.core.enums.ForkLiftTaskModeType; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | * 任务号 |
| | | */ |
| | | private Integer taskNo = 0; |
| | | |
| | | /** |
| | | * PLC任务号 |
| | | */ |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * 任务状态 |
| | |
| | | return basLiftErr.getErrName(); |
| | | } |
| | | |
| | | public Integer getTaskNo() { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if (null != redisUtil) { |
| | | Object o = redisUtil.get(RedisKeyType.FORK_LIFT_FLAG.key + this.liftNo); |
| | | if (!Cools.isEmpty(o)) { |
| | | this.taskNo = Integer.parseInt(String.valueOf(o)); |
| | | } |
| | | } |
| | | return this.taskNo == null ? 0 : this.taskNo; |
| | | } |
| | | |
| | | public synchronized void setSyncTaskNo(Integer taskNo) { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if (null != redisUtil) { |
| | | redisUtil.set(RedisKeyType.FORK_LIFT_FLAG.key + this.liftNo, taskNo); |
| | | this.taskNo = taskNo; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ForkLiftProtocol clone() { |
| | | try { |