*
lsh
2025-10-22 41e4860f065a13b00441deff45455b62d3787e2c
*
4个文件已修改
85 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ConsoleController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/MainProcess.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/ServerBootstrap.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -76,14 +76,15 @@
            if (!systemSign){
                if (new LicenseVerify().verify()){
                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
                    return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
                    return R.ok();
                }
            }
        } catch (Exception e){
            log.error("许可证验证失败!!异常:{}",e.getMessage());
            return R.error();
        }
        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
        return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
        return R.ok();
    }
    /****************************************************************/
src/main/java/com/zy/core/MainProcess.java
@@ -74,13 +74,25 @@
    }
    private void licenseThreadRun(){
        int i = 0;
        while (true) {
            try{
                Thread.sleep(60*60*1000L);
                // 系统运行状态判断
                if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                    continue;
                }
                log.info("++++++++ 开始验证许可证 ++++++++");
                if (!mainService.licenseVerify()){
                    if (i>6){
                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
                    log.info("++++++++ 验证许可证失败 ++++++++");
                        i = 0;
                    } else {
                        i++;
                    }
                } else {
//                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
                    log.info("++++++++ 验证许可证成功 ++++++++");
src/main/java/com/zy/core/ServerBootstrap.java
@@ -132,36 +132,36 @@
    public void destroy() {
    }
    @Component
    class licenseVerifyThread {
        @Scheduled(cron = "0 0 4 * * ?")
        public void licenseVerify() {
            int licenseVerifySignCount = 0;
            boolean licenseVerifySign = false;
            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
            if (!new LicenseVerify().verify()){
                for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
                    try{
                        Thread.sleep(1000);
                    }catch (Exception e){
                    }
                    if (!new LicenseVerify().verify()){
                        log.info("++++++++ 验证许可证失败 ++++++++");
                    } else {
                        log.info("++++++++ 验证许可证成功 ++++++++");
                        licenseVerifySign = true;
                    }
                }
                if (licenseVerifySignCount>10 && !licenseVerifySign){
                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
                } else {
                    if (systemSign){
                        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
                    }
                }
            }
        }
    }
//    @Component
//    class licenseVerifyThread {
//
//        @Scheduled(cron = "0 0 4 * * ?")
//        public void licenseVerify() {
//            int licenseVerifySignCount = 0;
//            boolean licenseVerifySign = false;
//            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
//            if (!new LicenseVerify().verify()){
//                for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
//                    try{
//                        Thread.sleep(1000);
//                    }catch (Exception e){
//
//                    }
//                    if (!new LicenseVerify().verify()){
//                        log.info("++++++++ 验证许可证失败 ++++++++");
//                    } else {
//                        log.info("++++++++ 验证许可证成功 ++++++++");
//                        licenseVerifySign = true;
//                    }
//                }
//                if (licenseVerifySignCount>10 && !licenseVerifySign){
//                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
//                } else {
//                    if (systemSign){
//                        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
//                    }
//                }
//            }
//        }
//    }
}
src/main/webapp/views/index.html
@@ -636,7 +636,9 @@
                            method: 'POST',
                            success: function (res) {
                                if (res.code === 200) {
                                    that.valueSystem = res.data.status;
                                    that.$message.success(`状态更新成功`);
                                } else {
                                    that.$message.error('状态更新失败');
                                }
                            }
                        });