#
Junjie
7 天以前 2c1e3b7b10c0d4afbf09a9151e132f1ee85b9c6f
src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
@@ -56,6 +56,17 @@
                List<TrafficControlDataModel> allTrafficControl = getAllTrafficControl();
                //更新交管信息
                redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_MAP.key, allTrafficControl);
                for (TrafficControlDataModel dataModel : allTrafficControl) {
                    Integer shuttleNo = dataModel.getShuttleNo();
                    Integer taskNo = dataModel.getTaskNo();
                    Object object1 = redisUtil.get(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo);
                    if(object1 == null) {
                        redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo, 1, 60 * 60);
                    }
                }
                Thread.sleep(200);
            }catch (Exception e){
                e.printStackTrace();
@@ -199,6 +210,7 @@
        operateTrafficControl(param);
        applyRecordsMap.remove(shuttleNo);
        redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo, 1, 60 * 60);
        News.info("receipt traffic {},{}", shuttleNo, taskNo);
        return true;
    }
@@ -259,7 +271,7 @@
    }
    @Override
    public synchronized boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) {
    public boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) {
        TrafficControlDataModel dataModel = queryTrafficControl(shuttleNo, taskNo);
        if (dataModel == null) {
            return false;
@@ -273,7 +285,7 @@
    }
    @Override
    public synchronized boolean forceCancelTrafficControl(Integer shuttleNo) {
    public boolean forceCancelTrafficControl(Integer shuttleNo) {
        TrafficControlDataModel dataModel = queryTrafficControl(shuttleNo);
        if (dataModel == null) {
            return false;
@@ -381,6 +393,7 @@
        }
        trafficControlDataList.remove(idx);//取消管制
        redisUtil.del(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo);
        return true;
    }