| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.enums.RedisKeyType; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | | import java.util.concurrent.BlockingQueue; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | |
| | | } |
| | | |
| | | if (!checkTaskNoInArea(context.taskNo) && getFakeAllowCheckBlock() |
| | | && !isSpecialStation(context.currentStationId) |
| | | && System.currentTimeMillis() - context.lastStepAt > getFakeRunBlockTimeoutMs()) { |
| | | boolean blocked = runBlockStation(context.taskNo, context.currentStationId, currentDeviceNo, context.taskNo, |
| | | context.currentStationId); |
| | |
| | | return fakeAllowCheckBlock; |
| | | } |
| | | |
| | | private boolean isSpecialStation(Integer stationId) { |
| | | if (stationId == null) { |
| | | return false; |
| | | } |
| | | BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | List<BasDevp> basDevps = basDevpService.list(); |
| | | Set<Integer> specialStationIds = new HashSet<>(); |
| | | for (BasDevp basDevp : basDevps) { |
| | | for (StationObjModel station : basDevp.getInStationList$()) { |
| | | specialStationIds.add(station.getStationId()); |
| | | } |
| | | for (StationObjModel station : basDevp.getOutStationList$()) { |
| | | specialStationIds.add(station.getStationId()); |
| | | } |
| | | for (StationObjModel station : basDevp.getBarcodeStationList$()) { |
| | | specialStationIds.add(station.getStationId()); |
| | | } |
| | | } |
| | | return specialStationIds.contains(stationId); |
| | | } |
| | | |
| | | private long getFakeRunBlockTimeoutMs() { |
| | | long timeoutMs = DEFAULT_FAKE_RUN_BLOCK_TIMEOUT_MS; |
| | | Object systemConfigMapObj = redisUtil == null ? null : redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |