| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import java.util.Random; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | |
| | | |
| | | Integer nextStationId = null; |
| | | Integer nextStationDeviceNo = null; |
| | | NavigateNode nextNode = null; |
| | | try { |
| | | NavigateNode nextNode = navigateNodes.get(i + 1); |
| | | nextNode = navigateNodes.get(i + 1); |
| | | JSONObject nextValueObject = JSON.parseObject(nextNode.getNodeValue()); |
| | | nextStationId = nextValueObject.getInteger("stationId"); |
| | | nextStationDeviceNo = nextValueObject.getInteger("deviceNo"); |
| | |
| | | continue; |
| | | } |
| | | lastStationId = currentStationId; |
| | | |
| | | if (nextNode.getIsInflectionPoint()) { |
| | | sleep(4000); |
| | | } |
| | | } |
| | | |
| | | i++; |
| | |
| | | return false; |
| | | } |
| | | |
| | | Random random = new Random(); |
| | | |
| | | String barcodeTime = String.valueOf(System.currentTimeMillis()); |
| | | String barcode = barcodeTime.substring(5); |
| | | String barcode = String.valueOf(random.nextInt(10)) + String.valueOf(random.nextInt(10)) + barcodeTime.substring(7); |
| | | |
| | | boolean result = updateStationData(lockTaskNo, currentStationId, currentStationDeviceNo, null, null, null, barcode, null); |
| | | if (!result) { |
| | |
| | | return executeResult; |
| | | } |
| | | |
| | | public synchronized boolean lockExecute(Integer taskNo, Supplier<Boolean> function) { |
| | | public boolean lockExecute(Integer taskNo, Supplier<Boolean> function) { |
| | | if (!setLockStation(taskNo)) { |
| | | return false; |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | private synchronized boolean checkTaskNoInArea(Integer taskNo) { |
| | | private boolean checkTaskNoInArea(Integer taskNo) { |
| | | Object fakeTaskNoAreaObj = redisUtil.get(RedisKeyType.FAKE_TASK_NO_AREA.key); |
| | | if (fakeTaskNoAreaObj == null) { |
| | | return false; |