#
Junjie
1 天以前 4227b39d7a4fc6bc3ba012a09b59f653ab92ab23
src/main/java/com/zy/core/plugin/FakeProcess.java
@@ -41,6 +41,8 @@
    private static Map<Integer,Long> stationStayTimeMap = new HashMap<>();
    private static String enableFake = "N";
    private static String fakeRealTaskRequestWms = "N";
    private static String fakeGenerateInTask = "Y";
    private static String fakeGenerateOutTask = "Y";
    @Autowired
    private WrkMastService wrkMastService;
@@ -75,6 +77,16 @@
            fakeRealTaskRequestWms = fakeRealTaskRequestWmsConfig.getValue();
        }
        Config fakeGenerateInTaskConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "fakeGenerateInTask"));
        if (fakeGenerateInTaskConfig != null) {
            fakeGenerateInTask = fakeGenerateInTaskConfig.getValue();
        }
        Config fakeGenerateOutTaskConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "fakeGenerateOutTask"));
        if (fakeGenerateOutTaskConfig != null) {
            fakeGenerateOutTask = fakeGenerateOutTaskConfig.getValue();
        }
        //检测入库站是否有任务生成,并仿真生成模拟入库站点数据
        checkInStationHasTask();
        //生成仿真模拟入库任务
@@ -105,6 +117,10 @@
    //检测入库站是否有任务生成,并仿真生成模拟入库站点数据
    private synchronized void checkInStationHasTask() {
        if (!enableFake.equals("Y")) {
            return;
        }
        if (!fakeGenerateInTask.equals("Y")) {
            return;
        }
@@ -154,6 +170,10 @@
        }
        if (fakeRealTaskRequestWms.equals("Y")) {
            return;
        }
        if (!fakeGenerateInTask.equals("Y")) {
            return;
        }
@@ -233,6 +253,10 @@
        }
        if (fakeRealTaskRequestWms.equals("Y")) {
            return;
        }
        if (!fakeGenerateOutTask.equals("Y")) {
            return;
        }
@@ -358,6 +382,8 @@
                        continue;
                    }
                    redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 15);
                    HashMap<String, Object> requestParam = new HashMap<>();
                    String response = null;
                    try {
@@ -387,10 +413,8 @@
                        } else {
                            News.error("请求WMS接口失败!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response);
                        }
                        redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 10);
                    } catch (Exception e) {
                        e.printStackTrace();
                        News.error("请求WMS接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e);
                    } finally {
                        HttpRequestLog httpRequestLog = new HttpRequestLog();
                        httpRequestLog.setName(wmsUrl + wmsSystemInUrl);
@@ -582,6 +606,8 @@
                        StationCommand command = stationThread.getMoveCommand(9998, wrkMast.getSourceStaNo(), 0, 0);
                        MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
                    }
                }else if(wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts){
                    updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts;
                }else{
                    News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo());
                    continue;