jiangping
2024-07-30 eea92f23bf8ead897f346ae6ccc8603ac039e566
server/admin_sys_timer/src/main/java/com/doumee/task/ScheduleTool.java
@@ -53,33 +53,7 @@
    @Autowired
    private DataSyncConfig dataSyncConfig;
    /**
     * 每分钟拉取一次今日的访客预约数据
     * @throws Exception
     */
    @Scheduled(cron= "0 0 23 * * ?")
    public void syncVehicleUpdateData() throws Exception {
        hkSyncVehicleFromHKService.syncVehicleUpdateData(new Date(System.currentTimeMillis()-24*60*60*1000));
    }
    /**
     * 每分钟拉取一次今日的访客预约数据
     * @throws Exception
     */
    @Scheduled(fixedRate= 3*60*1000)
    public void syncVistAppointData() throws Exception {
        if(Constants.DEALING_FROM_HK_VISIT){
            return ;
        }
        try {
            Constants.DEALING_FROM_HK_VISIT =true;
            hkSyncVisitFromHKService.syncVistAppointData(new Date());
            Constants.DEALING_FROM_HK_VISIT =false;
        }catch (Exception e){
//            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~");
        }finally {
            Constants.DEALING_FROM_HK_VISIT =false;
        }
    }
    /**
     * 每10分钟拉取一次最新访客登记状态(预约成功和已登记)
     * @throws Exception
@@ -92,7 +66,7 @@
     * 下载海康系统图片数据
     * @throws Exception
     */
    @Scheduled(fixedRate= 60*1000)
//    @Scheduled(fixedRate= 60*1000)
    public void downloadHkImg() throws Exception {
        if(dataSyncConfig.getNeedDealImg()!=null && dataSyncConfig.getNeedDealImg()){
            hkSyncImgService.downHKImgs(0);
@@ -129,21 +103,31 @@
        hkSyncVisitService.syncVisitData();
    }
        /**
         * 每分钟拉取一次今日的访客预约数据
         * @throws Exception
         */
        @Scheduled(cron= "0 0 23 * * ?")
        public void syncVehicleUpdateData() throws Exception {
            hkSyncVehicleFromHKService.syncVehicleUpdateData(new Date(System.currentTimeMillis()-24*60*60*1000));
        }
    /**
     * 定时冻结内部人员
     */
        /**
         * 定时冻结内部人员
         */
//    @Scheduled(fixedRate= 60*1000)
    public void memberFreeze()  {
        memberService.memberFreeze();
    }
    /**
     * 每天清理超过一周的接口日志数据(清除和安防平台对接的接口数据)
     * @throws Exception
     */
//    @Scheduled(cron= "0 0 23 * * ?")
    public void clearThreeMonthLog() throws Exception {
        interfaceLogService.clearThreeMonthLog();
    }
        public void memberFreeze()  {
            memberService.memberFreeze();
        }
        /**
         * 每天清理超过一周的接口日志数据(清除和安防平台对接的接口数据)
         * @throws Exception
         */
    @Scheduled(cron= "0 0 23 * * ?")
        public void remainLastLogs() throws Exception {
            interfaceLogService.remainLastLogs();
        }
}