双重预防项目-国泰新华二开定制版
换个名字嗨起来
2024-07-25 3cde2386c1ddaeeacc8b815d25af3b6a84541e46
src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java
@@ -95,9 +95,8 @@
    @Transactional
//    @Scheduled(cron = "0 0 23 * * ?")    //每天晚上23点执行一次0 0 22,23 * * ?
//    @Scheduled(cron = "0 0 22,23 * * ?")    //每天晚上22、23点执行一次
//    @Scheduled(cron = "0 0/1 * * * ? ")    // 分钟
    @Scheduled(cron = "0 0/20 * * * ? ")    // 分钟
    //@Scheduled(cron = "0/30 * * * * ?")
    @Scheduled(cron = "0 0/10 * * * ? ")    // 分钟
//    @Scheduled(cron = "0/30 * * * * ?")
    public void execReportDateSchedule() throws UnsupportedEncodingException {
        logger.info("【####】上报数据开始...");
@@ -116,7 +115,7 @@
        //使用风险分析单元数据上报主配置,作为自动上报开关
        PreventReportConfig reportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode());
        if (reportConfig.getReportState() == 0){
        if (reportConfig.getReportType() == 0){
            return;
        }
@@ -589,7 +588,7 @@
//            System.out.println(Arrays.toString(reportRecordFromTaskList.toArray()));
            //数据加密
            String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
            logger.info("【test】数据加密完成,开始上报数据");
            StringBuffer recordFromTaskResultBuffer = null;
            //上报数据
            try {
@@ -632,9 +631,22 @@
                e.printStackTrace();
            }
            logger.info("【test】接收返回值");
            CJReportResultData CJRecordFromTaskResult = new CJReportResultData();
            try {
                CJRecordFromTaskResult =  JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
                if (ObjectUtils.isEmpty(CJRecordFromTaskResult)){
                    throw new RuntimeException("返回值为空");
                }
            }catch (Exception e){
                e.printStackTrace();
                logger.info("【test】接收返回值异常");
            }
            //接收返回值,保存返回值
            CJReportResultData CJRecordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
//            CJReportResultData CJRecordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            logger.info("【test】保存上报结果");
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJRecordFromTaskResult.getData(), Data.class);
            //保存失败结果