16639036659
2023-12-11 e6ab9c2b7af85ac676ef9fbe616327eb20f04139
暂时提交
已修改35个文件
已添加3个文件
1367 ■■■■■ 文件已修改
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportCheckRecordFromTaskDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportCheckTaskFromWorkDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportDangerInfoDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportOverhaulLogDTO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportPointDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportRiskAnaUnitDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/PreventCJReportRiskAnaUnit.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/ReportResultDTO.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/ReportResultObjDTO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/PreventRiskControlMeasure.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportCheckRecordFromTaskRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportCheckTaskFromWorkRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportDangerInfoRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskAnaUnitRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskControlMeasureRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskEventRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/param/HandlerReportParam.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/scheduls/CheckExecResultSchedule.java 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java 646 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/scheduls/SearchReportDateSchedule.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportCheckRecordFromTaskService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportCheckTaskFromWorkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportDangerInfoService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskAnaUnitService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskControlMeasureService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskEventService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportCheckRecordFromTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportCheckTaskFromWorkServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportDangerInfoServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskAnaUnitServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskControlMeasureServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskEventServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/utilsCJ/AesGcm256Util.java 288 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/tr/riskMeasure/controller/riskMeasureController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mybatis/doublePrevention/PreventCJReportDangerInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mybatis/doublePrevention/PreventRiskControlMeasureMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportCheckRecordFromTaskDTO.java
@@ -8,6 +8,7 @@
     * 主键
     */
    private String id;
    /**
     * 公司编码
     */
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportCheckTaskFromWorkDTO.java
@@ -63,6 +63,7 @@
    private String taskNum;
    /**
     * 删除标志:0-有效,1-删除
     */
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportDangerInfoDTO.java
@@ -105,6 +105,7 @@
     * 创建时间
     */
    private String createDate;
    /**
     * 创建人
     */
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportOverhaulLogDTO.java
@@ -52,10 +52,7 @@
    private String updateBy;
//    /**
//     * 删除标志:0-有效,1-删除
//     */
//    private String deleted;
}
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportPointDTO.java
@@ -1,11 +1,9 @@
package com.ruoyi.doublePrevention.entity.CJReport.CJdto.HandlerDO;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
//@TableName("prevent_cj_report_point")
public class CJReportPointDTO implements Serializable {
    /**
     * 主键
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/CJdto/HandlerDO/CJReportRiskAnaUnitDTO.java
@@ -1,6 +1,11 @@
package com.ruoyi.doublePrevention.entity.CJReport.CJdto.HandlerDO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.util.Date;
@Data
public class CJReportRiskAnaUnitDTO {
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/PreventCJReportRiskAnaUnit.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
@@ -48,6 +49,7 @@
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    /**
     * 创建人
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/ReportResultDTO.java
对比新文件
@@ -0,0 +1,34 @@
package com.ruoyi.doublePrevention.entity.CJReport;
public class ReportResultDTO {
    private String code;
    private String msg;
    private ReportResultObjDTO obj;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public ReportResultObjDTO getObj() {
        return obj;
    }
    public void setObj(ReportResultObjDTO obj) {
        this.obj = obj;
    }
}
src/main/java/com/ruoyi/doublePrevention/entity/CJReport/ReportResultObjDTO.java
对比新文件
@@ -0,0 +1,14 @@
package com.ruoyi.doublePrevention.entity.CJReport;
public class ReportResultObjDTO {
    private String batchId;
    public String getBatchId() {
        return batchId;
    }
    public void setBatchId(String batchId) {
        this.batchId = batchId;
    }
}
src/main/java/com/ruoyi/doublePrevention/entity/PreventRiskControlMeasure.java
@@ -116,6 +116,26 @@
    private String checkContent;
    private String workType;
    private String taskNum;
    public String getWorkType() {
        return workType;
    }
    public void setWorkType(String workType) {
        this.workType = workType;
    }
    public String getTaskNum() {
        return taskNum;
    }
    public void setTaskNum(String taskNum) {
        this.taskNum = taskNum;
    }
    public Long getId() {
        return id;
    }
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java
@@ -47,7 +47,25 @@
     */
    private String measureDesc;
    private String workType;
    private String taskNum;
    public String getWorkType() {
        return workType;
    }
    public void setWorkType(String workType) {
        this.workType = workType;
    }
    public String getTaskNum() {
        return taskNum;
    }
    public void setTaskNum(String taskNum) {
        this.taskNum = taskNum;
    }
    public Byte getControlType() {
        return controlType;
    }
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java
@@ -46,6 +46,26 @@
     */
    private String checkContent;
    private String workType;
    private String taskNum;
    public String getWorkType() {
        return workType;
    }
    public void setWorkType(String workType) {
        this.workType = workType;
    }
    public String getTaskNum() {
        return taskNum;
    }
    public void setTaskNum(String taskNum) {
        this.taskNum = taskNum;
    }
    public String getCheckContent() {
        return checkContent;
    }
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportCheckRecordFromTaskRepository.java
@@ -25,7 +25,7 @@
    /**
     * 任务-待上报状态变更
     * */
    int updateTaskReportStatus(HandlerReportParam handlerReportParam);
    int updateTaskReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 任务-待上报状态变更 - 通过id
     * */
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportCheckTaskFromWorkRepository.java
@@ -20,7 +20,7 @@
    /**
     * 任务配置 -待上报状态变更
     * */
    int updateWorkReportStatus(HandlerReportParam handlerReportParam);
    int updateWorkReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 任务配置 -待上报状态变更 -通过id
     * */
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportDangerInfoRepository.java
@@ -24,7 +24,7 @@
    /**
     * 上报数据-待上报状态变更
     */
    int updateTaskReportStatus(HandlerReportParam handlerReportParam);
    int updateDangerInfoReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 上报数据-待上报状态变更-通过id
     */
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskAnaUnitRepository.java
@@ -21,7 +21,7 @@
    /**
     * 上报数据-修改待上报
     */
    int updateReportStatus();
    int updateReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 上报数据-修改待上报-通过id
     */
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskControlMeasureRepository.java
@@ -27,7 +27,7 @@
    /**
     * 管控措施-修改上报状态
     * */
    int updateMeasureReportStatus(HandlerReportParam handlerReportParam);
    int updateMeasureReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 管控措施-修改上报状态-通过id
     * */
src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportRiskEventRepository.java
@@ -29,7 +29,7 @@
    /**
     * 修改上报状态
     * */
    int updateEventReportStatus(HandlerReportParam handlerReportParam);
    int updateEventReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 修改上报状态-通过id
     * */
src/main/java/com/ruoyi/doublePrevention/repository/param/HandlerReportParam.java
@@ -1,7 +1,9 @@
package com.ruoyi.doublePrevention.repository.param;
import java.util.Date;
import lombok.Data;
import java.util.Date;
@Data
public class HandlerReportParam {
    /**
     * 主键
@@ -15,28 +17,4 @@
     * 上报时间
     */
    private Date reportTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Byte getReportStatus() {
        return reportStatus;
    }
    public void setReportStatus(Byte reportStatus) {
        this.reportStatus = reportStatus;
    }
    public Date getReportTime() {
        return reportTime;
    }
    public void setReportTime(Date reportTime) {
        this.reportTime = reportTime;
    }
}
src/main/java/com/ruoyi/doublePrevention/scheduls/CheckExecResultSchedule.java
对比新文件
@@ -0,0 +1,188 @@
package com.ruoyi.doublePrevention.scheduls;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.doublePrevention.entity.CJReport.ReportResultDTO;
import com.ruoyi.doublePrevention.entity.PreventReportConfig;
import com.ruoyi.doublePrevention.enums.SyncEnum;
import com.ruoyi.doublePrevention.service.baseService.*;
import com.ruoyi.doublePrevention.utilsCJ.AesGcm256Util;
import com.ruoyi.project.tr.report.service.ReportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.*;
@Component
public class CheckExecResultSchedule {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private ReportService reportService;
    @Autowired
    private PreventCJReportRiskAnaUnitService CJRiskAnaUnitService;
    @Autowired
    private PreventCJReportRiskEventService CJEventService;
    @Autowired
    private PreventCJReportRiskControlMeasureService CJMeasureService;
    @Autowired
    private PreventCJReportCheckTaskFromWorkService CJTaskFromWorkService;
    @Autowired
    private PreventCJReportCheckRecordFromTaskService CJTaskRecordService;
    @Autowired
    private PreventCJReportDangerInfoService CJDangerInfoService;
    @Autowired
    private PreventCJReportPointService CJPointService;
    @Autowired
    private PreventCJReportOverhaulLogService CJOverhaulLogService;
    @Autowired
    private PreventReportConfigService preventReportConfigService;
    String token = "GT6gGJV7JV";
    String key = "Bv+NeBolwqg2Pbc1yVwrZA==";
    String iv = "4QC9V8eAiB7tdlgBkMsTAw==";
    public static final int MAC_BIT_SIZE = 128;
//    public static String encrypt(String plainText, byte[] key, byte[] iv) {
//        String sr;
//        try {
//            byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8);
//            GCMBlockCipher cipher = new GCMBlockCipher(new
//                    AESFastEngine());
//            AEADParameters parameters =
//                    new AEADParameters(new KeyParameter(key),
//                            MAC_BIT_SIZE, iv, null);
//            cipher.init(true, parameters);
//            byte[] encryptedBytes = new
//                    byte[cipher.getOutputSize(plainBytes.length)];
//            int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length,
//                    encryptedBytes, 0);
//            cipher.doFinal(encryptedBytes, retLen);
//            sr = Base64.getEncoder().encodeToString(encryptedBytes);
//        } catch (Exception ex) {
//            throw new RuntimeException(ex.getMessage());
//        }
//        return sr;
//    }
//
    @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/10 * * * * ?")
    public void execReportDateSchedule() throws UnsupportedEncodingException {
        logger.info("【¥¥】检查上报结果...");
        String token = "4348187236";  // todo token暂时使用众泰
        String key = "84702E415A73CE27077B5F726E7BDBB0";
        String iv = "1C7AA98593AA69F4AAE119BD5C01D9ED";
        HttpURLConnection con = null;
        BufferedReader buffer = null;
        int responseCode = 200;
        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");
        Date date = new Date();
        //格式化时间,作为token的时间戳
        SimpleDateFormat tokenDate= new SimpleDateFormat("yyyyMMddHHMMssSSS");
        String formatDate = tokenDate.format(date);
        //使用风险分析单元数据上报主配置,作为自动上报开关
        PreventReportConfig reportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode());
        if (reportConfig.getReportType() == 0){
            return;
        }
        /**
         * 1、处理安全风险分析单元数据
         * */
        logger.info("查询处理数据...");
        //加密数据
        StringBuffer unitResultBuffer = null;
        List<String> batchId = new ArrayList<>();
        batchId.add("e7272b6b-fb68-4db7-ad06-f763a43b351c");
        //上报数据
        try {
            URL url = new URL("http://117.190.86.66:6022/v2/data/receive/getLog");
            //得到连接对象
            con = (HttpURLConnection) url.openConnection();
            //设置请求类型
            con.setRequestMethod("POST");
            //允许写出
            con.setDoOutput(true);
            //允许读入
            con.setDoInput(true);
            //不使用缓存
            con.setUseCaches(false);
            con.setInstanceFollowRedirects(true);
            //设置请求头
            con.setRequestProperty("Authorization",token + formatDate.toString());
            //设置Content-Type,此处根据实际情况确定
            con.setRequestProperty("Content-Type", "application/json;charset=utf8");
            OutputStream os = con.getOutputStream();
            Map paraMap = new HashMap();
            paraMap.put("batchId", batchId);
            /**封装数据*/
            //组装入参,设置请求体
            os.write(JSON.toJSONString(paraMap).getBytes());
            //本段日志,测试成功后,可注释掉
            if (responseCode == HttpURLConnection.HTTP_OK) {
                //得到响应流
                InputStream inputStream = con.getInputStream();
                //将响应流转换成字符串
                unitResultBuffer = new StringBuffer();
                String line;
                buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
                while ((line = buffer.readLine()) != null) {
                    unitResultBuffer.append(line);
                }
                logger.info("result:" + unitResultBuffer.toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        //接收返回值,保存返回值
        List<String> errorIdList= new ArrayList<>();
        //拼接上报数据的uuid
        StringBuffer idTextBuffer = new StringBuffer();
        //接收参数,转为对象
        ReportResultDTO unitResult = JSONObject.parseObject(unitResultBuffer.toString(), ReportResultDTO.class);
        //设置所有数据上报成功
//            for (PreventCJReportRiskAnaUnit riskAnaUnit : CJRiskAnaUnits) {
//                HandlerReportParam handlerReportParam = new HandlerReportParam();
//                //封装数据
//                handlerReportParam.setId(riskAnaUnit.getRiskUnitId());
//                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
//                handlerReportParam.setReportTime(date);
//                CJRiskAnaUnitService.updateReportStatus(handlerReportParam);
//                idTextBuffer.append(riskAnaUnit.getId() + ";");
//            }
    }
}
src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java
@@ -14,7 +14,9 @@
import com.ruoyi.doublePrevention.enums.CJReportEnum;
import com.ruoyi.doublePrevention.enums.SyncEnum;
import com.ruoyi.doublePrevention.repository.param.HandlerCJReportParam;
import com.ruoyi.doublePrevention.repository.param.HandlerReportParam;
import com.ruoyi.doublePrevention.service.baseService.*;
import com.ruoyi.doublePrevention.utilsCJ.AesGcm256Util;
import com.ruoyi.project.tr.report.service.ReportService;
import org.apache.commons.lang3.ObjectUtils;
import org.bouncycastle.crypto.engines.AESFastEngine;
@@ -33,8 +35,11 @@
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.ruoyi.doublePrevention.utilsCJ.AesGcm256Util.encrypt;
@Component
public class ExecCJReportDateSchedule {
@@ -69,27 +74,28 @@
    public static final int MAC_BIT_SIZE = 128;
    public static String encrypt(String plainText, byte[] key, byte[] iv) {
        String sr;
        try {
            byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8);
            GCMBlockCipher cipher = new GCMBlockCipher(new
                    AESFastEngine());
            AEADParameters parameters =
                    new AEADParameters(new KeyParameter(key),
                            MAC_BIT_SIZE, iv, null);
            cipher.init(true, parameters);
            byte[] encryptedBytes = new
                    byte[cipher.getOutputSize(plainBytes.length)];
            int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length,
                    encryptedBytes, 0);
            cipher.doFinal(encryptedBytes, retLen);
            sr = Base64.getEncoder().encodeToString(encryptedBytes);
        } catch (Exception ex) {
            throw new RuntimeException(ex.getMessage());
        }
        return sr;
    }
//    public static String encrypt(String plainText, byte[] key, byte[] iv) {
//        String sr;
//        try {
//            byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8);
//            GCMBlockCipher cipher = new GCMBlockCipher(new
//                    AESFastEngine());
//            AEADParameters parameters =
//                    new AEADParameters(new KeyParameter(key),
//                            MAC_BIT_SIZE, iv, null);
//            cipher.init(true, parameters);
//            byte[] encryptedBytes = new
//                    byte[cipher.getOutputSize(plainBytes.length)];
//            int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length,
//                    encryptedBytes, 0);
//            cipher.doFinal(encryptedBytes, retLen);
//            sr = Base64.getEncoder().encodeToString(encryptedBytes);
//        } catch (Exception ex) {
//            throw new RuntimeException(ex.getMessage());
//        }
//        return sr;
//    }
//
    @Transactional
@@ -97,50 +103,59 @@
//    @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/10 * * * * ?")
    public void execReportDateSchedule() throws UnsupportedEncodingException {
        logger.info("【####】上报数据开始...");
        logger.info("【¥¥】上报数据开始...");
        String token = "4348187236";  // todo token暂时使用众泰
        String key = "84702E415A73CE27077B5F726E7BDBB0";
        String iv = "1C7AA98593AA69F4AAE119BD5C01D9ED";
        HttpURLConnection con = null;
        BufferedReader buffer = null;
        int responseCode = 200;
        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        //格式化时间,作为token的时间戳
        SimpleDateFormat tokenDate= new SimpleDateFormat("yyyyMMddHHmmssSSS");
        SimpleDateFormat tokenDate = new SimpleDateFormat("yyyyMMddHHMMssSSS");
        String formatDate = tokenDate.format(date);
        logger.info("【token时间】" + formatDate);
        //使用风险分析单元数据上报主配置,作为自动上报开关
        PreventReportConfig reportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode());
        if (reportConfig.getReportType() == 0){
        if (reportConfig.getReportType() == 0) {
            return;
        }
        /**
         * 1、处理安全风险分析单元数据
         * */
        logger.info("【1】安全风险分析单元-处理数据...");
        List<PreventCJReportRiskAnaUnit> CJRiskAnaUnits = CJRiskAnaUnitService.listReportUnitDate();
        if (ObjectUtils.isNotEmpty(CJRiskAnaUnits)){
        if (ObjectUtils.isNotEmpty(CJRiskAnaUnits)) {
            logger.info("【【原始数据】】" + JSONObject.toJSONString(CJRiskAnaUnits));
            //封装上报数据,时间格式化
            List<CJReportRiskAnaUnitDTO> list = new ArrayList<>();
            for (PreventCJReportRiskAnaUnit cjRiskAnaUnit : CJRiskAnaUnits) {
                CJReportRiskAnaUnitDTO riskAnaUnit = BeanCopyUtils.copyBean(cjRiskAnaUnit, CJReportRiskAnaUnitDTO.class);
                System.out.println("创建时间:" + dateFormat.format(cjRiskAnaUnit.getCreateDate()));
                riskAnaUnit.setCreateDate(dateFormat.format(cjRiskAnaUnit.getCreateDate()));
                riskAnaUnit.setUpdateDate(dateFormat.format(cjRiskAnaUnit.getUpdateDate()));
                list.add(riskAnaUnit);
            }
            logger.info("【【风险单元原始数据】】" + JSONObject.toJSONString(list));
//            logger.info("【【原始数据】】" + JSONObject.toJSONString(list));
            String AESReportUnitDate = encrypt(JSONObject.toJSONString(list), key.getBytes(), iv.getBytes());
//            logger.info("【【AES加密结果】】"+ AESReportUnitDate);![](C:/Users/Ad![](C:/Users/Admin/Desktop/所有桌面文件存放/9}AM56M10$6WX){0JRK`$6X.jpg)min/Desktop/所有桌面文件存放/9}AM56M10$6WX){0JRK`$6X.jpg)
            String AESReportUnitDate = AesGcm256Util.encrypt(JSONArray.toJSON(list).toString(),
                    AesGcm256Util.hexToByte(key),
                    AesGcm256Util.hexToByte(iv));
            StringBuffer unitResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://120.71.182.198:9999/v1/data/receive/unitMsg");
                URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveUnitList");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
@@ -153,14 +168,15 @@
                con.setUseCaches(false);
                con.setInstanceFollowRedirects(true);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token+formatDate.toString());
                con.setRequestProperty("Authorization", token + formatDate.toString());
                //设置Content-Type,此处根据实际情况确定
                con.setRequestProperty("Content-Type", "application/json;charset=utf8");
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportUnitDate); /**封装数据*/
                logger.info("【【加密请求体】】" +  JSONArray.toJSON(paraMap).toString());
                paraMap.put("data", AESReportUnitDate);
                /**封装数据*/
                logger.info("【【加密请求体】】" + JSONArray.toJSON(paraMap).toString());
                //组装入参,设置请求体
                os.write(JSON.toJSONString(paraMap).getBytes());
@@ -176,74 +192,33 @@
                        unitResultBuffer.append(line);
                    }
                    logger.info("result:" + unitResultBuffer.toString());
                    System.out.println("result:" + unitResultBuffer.toString());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            List<String> errorIdList = new ArrayList<>();
            //拼接上报数据的uuid
            StringBuffer idTextBuffer = new StringBuffer();
            //接收参数,转为对象
            CJReportResultData CJUnitResult = JSONObject.parseObject(unitResultBuffer.toString(), CJReportResultData.class);
//            Object parse = JSON.parse(CJUnitResult.getData());
            //取出需要的data部分,再次转换为对象
            Data data = JSONObject.parseObject(CJUnitResult.getData(), Data.class);
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            ReportResultDTO unitResult = JSONObject.parseObject(unitResultBuffer.toString(), ReportResultDTO.class);
            //设置所有数据上报成功
            for (PreventCJReportRiskAnaUnit riskAnaUnit : CJRiskAnaUnits) {
                HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
                //封装数据
                handlerReportParam.setId(riskAnaUnit.getId());
                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                handlerReportParam.setReportTime(date);
                CJRiskAnaUnitService.updateReportStatus(handlerReportParam);
                idTextBuffer.append(riskAnaUnit.getId() + ";");
            }
            if (CJUnitResult.getCode().equals(CJReportEnum.SUCCESS.getCode())){
                logger.info("【#】RiskAnaUnit所有数据全部入库成功");
                for (PreventCJReportRiskAnaUnit CJRiskAnaUnit : CJRiskAnaUnits) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJRiskAnaUnit.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJRiskAnaUnitService.updateCJReportStatusById(handlerCJReportParam);
                }
            }else if (CJUnitResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                logger.info("【#】RiskAnaUnit部分数据上传失败原因" + CJUnitResult.getErrorMsg());
                CJUnitResult.getData();
                //遍历数据,设置数据上报成功
                for (PreventCJReportRiskAnaUnit CJRiskAnaUnit : CJRiskAnaUnits) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJRiskAnaUnit.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJRiskAnaUnitService.updateCJReportStatusById(handlerCJReportParam);
                }
                //遍历失败数据,设置数据上报失败
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJRiskAnaUnitService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            else if (CJUnitResult.getCode().equals(CJReportEnum.FAIL.getCode())){
                logger.info("【#】RiskAnaUnit所有数据全部入库失败");
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJRiskAnaUnitService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            logger.info("【1】安全风险分析单元-数据处理完成");
        }else {
            logger.info("【1】风险分析单元-无数据上报昌吉州");
            logger.info("【1】风险单元-无数据上报昌吉州");
        }
        /**
         * 2、处理安全风险事件数据
@@ -262,12 +237,14 @@
            }
            logger.info("【【风险事件原始数据】】" + JSONObject.toJSONString(eventList));
            //加密数据
            String AESReportUnitDate = encrypt(JSONObject.toJSONString(eventList), key.getBytes(), iv.getBytes());
//            String AESReportEventDate = encrypt(JSONObject.toJSONString(eventList), key.getBytes(), iv.getBytes());
            String AESReportEventDate = AesGcm256Util.encrypt(JSONArray.toJSON(eventList).toString(),
                    AesGcm256Util.hexToByte(key),
                    AesGcm256Util.hexToByte(iv));
            StringBuffer eventResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://120.71.182.198:9999/v1/data/receive/eventMsg");
                URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveEventList");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
@@ -281,11 +258,11 @@
                //不使用缓存
                con.setUseCaches(false);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token+formatDate.toString());
                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
                con.setInstanceFollowRedirects(true);
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportUnitDate); /**封装数据*/
                paraMap.put("data", AESReportEventDate); /**封装数据*/
                //组装入参,设置请求体
                os.write(JSON.toJSONString(paraMap).getBytes());
                //得到响应码
@@ -307,59 +284,14 @@
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            CJReportResultData CJEventResult = JSONObject.parseObject(eventResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJEventResult.getData(), Data.class);
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            }
            if (CJEventResult.getCode().equals(CJReportEnum.SUCCESS.getCode())){
                logger.info("【#】Event所有数据全部入库成功");
                for (PreventCJReportRiskEvent CJEvent : CJEvents) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJEvent.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJEventService.updateCJReportStatusById(handlerCJReportParam);
                }
            }else if (CJEventResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                logger.info("【#】Event部分数据上传失败原因" + CJEventResult.getErrorMsg());
                //遍历数据,上报数据设置为成功状态
                for (PreventCJReportRiskEvent CJEvent : CJEvents) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJEvent.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJEventService.updateCJReportStatusById(handlerCJReportParam);
                }
                //遍历失败数据,设置为失败状态
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJEventService.updateCJReportStatusById(handlerCJReportParam);
                }
            } else if (CJEventResult.getCode().equals(CJReportEnum.FAIL.getCode())){
                logger.info("【#】Event所有数据全部入库失败");
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJEventService.updateCJReportStatusById(handlerCJReportParam);
                }
            //设置所有数据上报成功
            for (PreventCJReportRiskEvent cjEvent : CJEvents) {
                HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
                //封装数据
                handlerReportParam.setId(cjEvent.getId());
                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                handlerReportParam.setReportTime(date);
                CJEventService.updateEventReportStatus(handlerReportParam);
            }
            logger.info("【2】安全风险事件-数据处理完成");
        }else {
@@ -382,14 +314,16 @@
                reportMeasureList.add(cjReportRiskControlMeasureDTO);
            }
            //数据上报
            String AESReportMeasure = encrypt(JSONObject.toJSONString(reportMeasureList), key.getBytes(), iv.getBytes());
//            String AESReportMeasure = encrypt(JSONObject.toJSONString(reportMeasureList), key.getBytes(), iv.getBytes());
            String AESReportMeasure = AesGcm256Util.encrypt(JSONArray.toJSON(reportMeasureList).toString(),
                    AesGcm256Util.hexToByte(key),
                    AesGcm256Util.hexToByte(iv));
            logger.info("【原始数据】" + JSONObject.toJSONString(reportMeasureList));
            StringBuffer measureResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://120.71.182.198:9999/v1/data/receive/controlMeasuresMsg");
                URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveControlMeasuresList");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
@@ -403,7 +337,7 @@
                //不使用缓存
                con.setUseCaches(false);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token+formatDate.toString());
                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportMeasure); /**封装数据*/
@@ -428,40 +362,14 @@
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            CJReportResultData CJMeasureResult = JSONObject.parseObject(measureResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJMeasureResult.getData(), Data.class);
            //保存失败结果
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            }
            logger.info("【】管控措施-数据上报结果:" + CJMeasureResult.getCode());
            //设置所有数据上报成功
            if (CJMeasureResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJMeasureResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (PreventCJReportRiskControlMeasure CJMeasure : CJMeasures) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJMeasure.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJMeasureService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            //设置上报失败的数据,上报失败
            if (CJMeasureResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJMeasureResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJMeasureService.updateCJReportStatusById(handlerCJReportParam);
                }
            for (PreventCJReportRiskControlMeasure cjMeasure : CJMeasures) {
                HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
                //封装数据
                handlerReportParam.setId(cjMeasure.getId());
                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                handlerReportParam.setReportTime(date);
                CJMeasureService.updateMeasureReportStatus(handlerReportParam);
            }
            logger.info("【3】风险管控措施-数据处理完成");
        }else {
@@ -486,11 +394,15 @@
            }
            System.out.println(Arrays.toString(reportCheckTaskFromWorkList.toArray()));
            //数据上报
            String AESReportTaskFromWork = encrypt(JSONObject.toJSONString(reportCheckTaskFromWorkList), key.getBytes(), iv.getBytes());
//            String AESReportTaskFromWork = encrypt(JSONObject.toJSONString(reportCheckTaskFromWorkList), key.getBytes(), iv.getBytes());
            String AESReportTaskFromWork = AesGcm256Util.encrypt(JSONArray.toJSON(reportCheckTaskFromWorkList).toString(),
                    AesGcm256Util.hexToByte(key),
                    AesGcm256Util.hexToByte(iv));
            StringBuffer taskFromWorkResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskMsg");
                URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveMeasuresTaskList");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
@@ -504,7 +416,7 @@
                //不使用缓存
                con.setUseCaches(false);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token+formatDate.toString());
                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportTaskFromWork);
@@ -529,41 +441,16 @@
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            CJReportResultData CJTaskFromWorkResult = JSONObject.parseObject(taskFromWorkResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJTaskFromWorkResult.getData(), Data.class);
            //保存失败结果
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            }
            logger.info("【】任务:数据上报结果:" + CJTaskFromWorkResult.getCode());
            //设置所有数据上报成功
            if (CJTaskFromWorkResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJTaskFromWorkResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (PreventCJReportCheckTaskFromWork CJTaskFromWork : CJTaskFromWorks) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJTaskFromWork.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJTaskFromWorkService.updateCJReportStatusById(handlerCJReportParam);
                }
            for (PreventCJReportCheckTaskFromWork cjTaskFromWork : CJTaskFromWorks) {
                HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
                //封装数据
                handlerReportParam.setId(cjTaskFromWork.getId());
                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                handlerReportParam.setReportTime(date);
                CJTaskFromWorkService.updateWorkReportStatus(handlerReportParam);
            }
            //设置上报失败的数据,上报失败
            if (CJTaskFromWorkResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJTaskFromWorkResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJTaskFromWorkService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            logger.info("【4】任务-数据处理完成");
        }else {
            logger.info("【4】任务-无数据上报昌吉州");
@@ -588,12 +475,15 @@
            }
//            System.out.println(Arrays.toString(reportRecordFromTaskList.toArray()));
            //数据加密
            String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
//            String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
            String AESReportRecordFromTask = AesGcm256Util.encrypt(JSONArray.toJSON(reportRecordFromTaskList).toString(),
                    AesGcm256Util.hexToByte(key),
                    AesGcm256Util.hexToByte(iv));
            StringBuffer recordFromTaskResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskRecordMsg");
                URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveMeasuresTaskRecordList");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
@@ -607,7 +497,7 @@
                //不使用缓存
                con.setUseCaches(false);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token+formatDate.toString());
                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportRecordFromTask);/**封装数据*/
@@ -632,40 +522,14 @@
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            CJReportResultData CJRecordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJRecordFromTaskResult.getData(), Data.class);
            //保存失败结果
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            }
            logger.info("【】CJRecordFromTask数据上报结果:" + CJRecordFromTaskResult.getCode());
            //设置所有数据上报成功
            if (CJRecordFromTaskResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJRecordFromTaskResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (PreventCJReportCheckRecordFromTask CJRecordFromTask : CJRecordFromTasks) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(CJRecordFromTask.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJTaskRecordService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            //设置上报失败的数据,上报失败
            if (CJRecordFromTaskResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJRecordFromTaskResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJTaskRecordService.updateCJReportStatusById(handlerCJReportParam);
                }
            for (PreventCJReportCheckRecordFromTask cjRecordFromTask : CJRecordFromTasks) {
                HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
                //封装数据
                handlerReportParam.setId(cjRecordFromTask.getId());
                handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                handlerReportParam.setReportTime(date);
                CJTaskRecordService.updateTaskReportStatus(handlerReportParam);
            }
            logger.info("【5】任务记录-数据处理完成");
        }else {
@@ -695,11 +559,15 @@
           }
           //数据上报
           logger.info("【原始数据】" + JSONObject.toJSONString(reportDangerInfoLists));
           String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportDangerInfoLists), key.getBytes(), iv.getBytes());
//           String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportDangerInfoLists), key.getBytes(), iv.getBytes());
           String AESReportDangerInfo = AesGcm256Util.encrypt(JSONArray.toJSON(reportDangerInfoLists).toString(),
                   AesGcm256Util.hexToByte(key),
                   AesGcm256Util.hexToByte(iv));
           StringBuffer dangerInfoResultBuffer = null;
           //上报数据
           try {
               URL url = new URL("http://120.71.182.198:9999/v1/data/receive/dangerInvestigationMsg");
               URL url = new URL("http://117.190.86.66:6022/v2/data/receive/receiveDangerInvestigationList");
               //得到连接对象
               con = (HttpURLConnection) url.openConnection();
               //设置请求类型
@@ -738,40 +606,14 @@
               e.printStackTrace();
           }
           //接收返回值,保存返回值
           CJReportResultData CJDangerInfoResult = JSONObject.parseObject(dangerInfoResultBuffer.toString(), CJReportResultData.class);
           //接收返回值,保存返回值
           List<String> errorIdList= new ArrayList<>();
           Data data = JSONObject.parseObject(CJDangerInfoResult.getData(), Data.class);
           //保存失败结果
           if (ObjectUtils.isNotEmpty(data)){
               for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                   errorIdList.add(errorMsgDetail.getId());
               }
           }
           logger.info("【】CJDangerInfo数据上报结果:" + CJDangerInfoResult.getCode());
           //设置所有数据上报成功
           if (CJDangerInfoResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJDangerInfoResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
               for (PreventCJReportDangerInfo CJDangerInfo : CJDangerInfos) {
                   HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                   //封装数据
                   handlerCJReportParam.setId(CJDangerInfo.getId());
                   handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                   handlerCJReportParam.setReportTime(date);
                   CJDangerInfoService.updateCJReportStatusById(handlerCJReportParam);
               }
           }
           //设置上报失败的数据,上报失败
           if (CJDangerInfoResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJDangerInfoResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
               for (String failId : errorIdList) {
                   //上报失败
                   HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                   //封装数据
                   handlerCJReportParam.setId(failId);
                   handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                   handlerCJReportParam.setReportTime(date);
                   CJDangerInfoService.updateCJReportStatusById(handlerCJReportParam);
               }
           for (PreventCJReportDangerInfo cjDangerInfo : CJDangerInfos) {
               HandlerCJReportParam handlerReportParam = new HandlerCJReportParam();
               //封装数据
               handlerReportParam.setId(cjDangerInfo.getId());
               handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
               handlerReportParam.setReportTime(date);
               CJDangerInfoService.updateDangerInfoReportStatus(handlerReportParam);
           }
           logger.info("【6】隐患信息-数据处理完成");
       }else {
@@ -779,113 +621,113 @@
       }
        /**
         * 7、检修停用记录信息数据
         * */
        logger.info("【7】检修停用记录-处理数据...");
        List<PreventCJReportOverhaulLog> CJOverhaulLogs = CJOverhaulLogService.listReportOverhaulDate();
        if (ObjectUtils.isNotEmpty(CJOverhaulLogs)){
            //封装上报数据
            List<CJReportOverhaulLogDTO> reportOverhaulLogDTOS = new ArrayList<>();
            for (PreventCJReportOverhaulLog cjOverhaulLog : CJOverhaulLogs) {
                CJReportOverhaulLogDTO cjReportOverhaulLogDTO = BeanCopyUtils.copyBean(cjOverhaulLog, CJReportOverhaulLogDTO.class);
                cjReportOverhaulLogDTO.setCreateDate(dateFormat.format(cjOverhaulLog.getCreateDate()));
                cjReportOverhaulLogDTO.setUpdateDate(dateFormat.format(cjOverhaulLog.getUpdateDate()));
                cjReportOverhaulLogDTO.setStopStartTime(dateFormat.format(cjOverhaulLog.getStopStartTime()));
                if (ObjectUtils.isNotEmpty(cjOverhaulLog.getStopEndTime())){
                    cjReportOverhaulLogDTO.setStopEndTime(dateFormat.format(cjOverhaulLog.getStopEndTime()));
                }else {
                    cjReportOverhaulLogDTO.setStopEndTime(null);
                }
                reportOverhaulLogDTOS.add(cjReportOverhaulLogDTO);
            }
            //数据上报
            logger.info("【原始数据】" + JSONObject.toJSONString(reportOverhaulLogDTOS));
            String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportOverhaulLogDTOS), key.getBytes(), iv.getBytes());
            StringBuffer dangerInfoResultBuffer = null;
            //上报数据
            try {
                URL url = new URL("http://v1/data/receive/receiveUnitStop");
                //得到连接对象
                con = (HttpURLConnection) url.openConnection();
                //设置请求类型
                con.setRequestMethod("POST");
                //设置Content-Type,此处根据实际情况确定
                con.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
                //允许写出
                con.setDoOutput(true);
                //允许读入
                con.setDoInput(true);
                //不使用缓存
                con.setUseCaches(false);
                //设置请求头
                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
                OutputStream os = con.getOutputStream();
                Map paraMap = new HashMap();
                paraMap.put("data", AESReportDangerInfo);/**封装数据*/
                //组装入参,设置请求体
                os.write(JSON.toJSONString(paraMap).getBytes());
                //得到响应码
                responseCode = con.getResponseCode();
                //本段日志,测试成功后,可注释掉
                if (responseCode == HttpURLConnection.HTTP_OK) {
                    //得到响应流
                    InputStream inputStream = con.getInputStream();
                    //将响应流转换成字符串
                    dangerInfoResultBuffer = new StringBuffer();
                    String line;
                    buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
                    while ((line = buffer.readLine()) != null) {
                        dangerInfoResultBuffer.append(line);
                    }
                    logger.info("result:" + dangerInfoResultBuffer.toString());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            //接收返回值,保存返回值
            CJReportResultData CJOverhaulLogResult = JSONObject.parseObject(dangerInfoResultBuffer.toString(), CJReportResultData.class);
            //接收返回值,保存返回值
            List<String> errorIdList= new ArrayList<>();
            Data data = JSONObject.parseObject(CJOverhaulLogResult.getData(), Data.class);
            //保存失败结果
            if (ObjectUtils.isNotEmpty(data)){
                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
                    errorIdList.add(errorMsgDetail.getId());
                }
            }
            logger.info("【】CJOverhaulLog数据上报结果:" + CJOverhaulLogResult.getCode());
            //设置所有数据上报成功
            if (CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (PreventCJReportOverhaulLog cjOverhaulLog : CJOverhaulLogs) {
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(cjOverhaulLog.getId());
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJOverhaulLogService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            //设置上报失败的数据,上报失败
            if (CJOverhaulLogResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
                for (String failId : errorIdList) {
                    //上报失败
                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
                    //封装数据
                    handlerCJReportParam.setId(failId);
                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
                    handlerCJReportParam.setReportTime(date);
                    CJOverhaulLogService.updateCJReportStatusById(handlerCJReportParam);
                }
            }
            logger.info("【7】检修停用记录-数据处理完成");
        }else {
            logger.info("【7】检修停用记录-无数据上报昌吉州");
        }
//        /**
//         * 7、检修停用记录信息数据
//         * */
//        logger.info("【7】检修停用记录-处理数据...");
//        List<PreventCJReportOverhaulLog> CJOverhaulLogs = CJOverhaulLogService.listReportOverhaulDate();
//        if (ObjectUtils.isNotEmpty(CJOverhaulLogs)){
//            //封装上报数据
//            List<CJReportOverhaulLogDTO> reportOverhaulLogDTOS = new ArrayList<>();
//            for (PreventCJReportOverhaulLog cjOverhaulLog : CJOverhaulLogs) {
//                CJReportOverhaulLogDTO cjReportOverhaulLogDTO = BeanCopyUtils.copyBean(cjOverhaulLog, CJReportOverhaulLogDTO.class);
//
//                cjReportOverhaulLogDTO.setCreateDate(dateFormat.format(cjOverhaulLog.getCreateDate()));
//                cjReportOverhaulLogDTO.setUpdateDate(dateFormat.format(cjOverhaulLog.getUpdateDate()));
//                cjReportOverhaulLogDTO.setStopStartTime(dateFormat.format(cjOverhaulLog.getStopStartTime()));
//                if (ObjectUtils.isNotEmpty(cjOverhaulLog.getStopEndTime())){
//                    cjReportOverhaulLogDTO.setStopEndTime(dateFormat.format(cjOverhaulLog.getStopEndTime()));
//                }else {
//                    cjReportOverhaulLogDTO.setStopEndTime(null);
//                }
//                reportOverhaulLogDTOS.add(cjReportOverhaulLogDTO);
//            }
//
//            //数据上报
//            logger.info("【原始数据】" + JSONObject.toJSONString(reportOverhaulLogDTOS));
//            String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportOverhaulLogDTOS), key.getBytes(), iv.getBytes());
//            StringBuffer dangerInfoResultBuffer = null;
//            //上报数据
//            try {
//                URL url = new URL("http://117.190.86.66:6022/v1/data/receive/receiveUnitStop");
//                //得到连接对象
//                con = (HttpURLConnection) url.openConnection();
//                //设置请求类型
//                con.setRequestMethod("POST");
//                //设置Content-Type,此处根据实际情况确定
//                con.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
//                //允许写出
//                con.setDoOutput(true);
//                //允许读入
//                con.setDoInput(true);
//                //不使用缓存
//                con.setUseCaches(false);
//                //设置请求头
//                con.setRequestProperty("X-Access-Token",token + formatDate.toString());
//                OutputStream os = con.getOutputStream();
//                Map paraMap = new HashMap();
//                paraMap.put("data", AESReportDangerInfo);/**封装数据*/
//                //组装入参,设置请求体
//                os.write(JSON.toJSONString(paraMap).getBytes());
//                //得到响应码
//                responseCode = con.getResponseCode();
//                //本段日志,测试成功后,可注释掉
//                if (responseCode == HttpURLConnection.HTTP_OK) {
//                    //得到响应流
//                    InputStream inputStream = con.getInputStream();
//                    //将响应流转换成字符串
//                    dangerInfoResultBuffer = new StringBuffer();
//                    String line;
//                    buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
//                    while ((line = buffer.readLine()) != null) {
//                        dangerInfoResultBuffer.append(line);
//                    }
//                    logger.info("result:" + dangerInfoResultBuffer.toString());
//                }
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//
//            //接收返回值,保存返回值
//            CJReportResultData CJOverhaulLogResult = JSONObject.parseObject(dangerInfoResultBuffer.toString(), CJReportResultData.class);
//            //接收返回值,保存返回值
//            List<String> errorIdList= new ArrayList<>();
//            Data data = JSONObject.parseObject(CJOverhaulLogResult.getData(), Data.class);
//            //保存失败结果
//            if (ObjectUtils.isNotEmpty(data)){
//                for (ErrorMsgDetails errorMsgDetail : data.getErrorMsgDetails()) {
//                    errorIdList.add(errorMsgDetail.getId());
//                }
//            }
//            logger.info("【】CJOverhaulLog数据上报结果:" + CJOverhaulLogResult.getCode());
//            //设置所有数据上报成功
//
//            if (CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
//                for (PreventCJReportOverhaulLog cjOverhaulLog : CJOverhaulLogs) {
//                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
//                    //封装数据
//                    handlerCJReportParam.setId(cjOverhaulLog.getId());
//                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
//                    handlerCJReportParam.setReportTime(date);
//                    CJOverhaulLogService.updateCJReportStatusById(handlerCJReportParam);
//                }
//            }
//            //设置上报失败的数据,上报失败
//            if (CJOverhaulLogResult.getCode().equals(CJReportEnum.FAIL.getCode()) || CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
//                for (String failId : errorIdList) {
//                    //上报失败
//                    HandlerCJReportParam handlerCJReportParam = new HandlerCJReportParam();
//                    //封装数据
//                    handlerCJReportParam.setId(failId);
//                    handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
//                    handlerCJReportParam.setReportTime(date);
//                    CJOverhaulLogService.updateCJReportStatusById(handlerCJReportParam);
//                }
//            }
//            logger.info("【7】检修停用记录-数据处理完成");
//        }else {
//            logger.info("【7】检修停用记录-无数据上报昌吉州");
//        }
    }
}
src/main/java/com/ruoyi/doublePrevention/scheduls/SearchReportDateSchedule.java
@@ -168,6 +168,7 @@
                        CJReportRiskAnaUnit.setUpdateBy(updateUser.getUserName());
                        CJReportRiskAnaUnit.setUpdateDate(infoByRiskId.getCreateTime());
                    }
                    CJReportRiskAnaUnit.setDataSource((byte) 1);
                    CJReportRiskAnaUnit.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode());
                    CJReportRiskAnaUnit.setReportTime(null);
@@ -404,6 +405,13 @@
                    CJTaskFromWork.setTaskStartTime(jobById.getStartTime());
                    CJTaskFromWork.setWorkDayType("0");
                    CJTaskFromWork.setWorkStartTime("00:00:01");
                    CJTaskFromWork.setWorkEndTime("23:59:59");
                    CJTaskFromWork.setWorkType(measureById.getWorkType());
                    if (ObjectUtils.isNotEmpty(measureById.getTaskNum())){
                        CJTaskFromWork.setTaskNum(measureById.getTaskNum());
                    }
                    List<PreventTaskType> typeByJobId = taskTypeService.getInfoByJobId(work.getJobId());
                    int typeTag = 0;
                    for (PreventTaskType taskType : typeByJobId) {
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportCheckRecordFromTaskService.java
@@ -23,7 +23,7 @@
    /**PreventReportBatchService
     * 任务-待上报状态变更
     * */
    void updateTaskReportStatus(HandlerReportParam handlerReportParam);
    void updateTaskReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 任务-待上报状态变更 - 通过id
     * */
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportCheckTaskFromWorkService.java
@@ -24,7 +24,7 @@
    /**
     * 任务配置 -待上报状态变更
     * */
    void updateWorkReportStatus(HandlerReportParam handlerReportParam);
    void updateWorkReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 任务配置 -待上报状态变更 -通过id
     * */
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportDangerInfoService.java
@@ -23,7 +23,7 @@
    /**
     * 上报数据-待上报状态变更
     */
    void updateTaskReportStatus(HandlerReportParam handlerReportParam);
    void updateDangerInfoReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 上报数据-待上报状态变更-通过id
     */
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskAnaUnitService.java
@@ -24,7 +24,7 @@
    /**
     * 上报数据-修改待上报
     */
    void updateReportStatus(HandlerReportParam handlerReportParam);
    void updateReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 上报数据-修改待上报-通过id
     */
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskControlMeasureService.java
@@ -24,7 +24,7 @@
    /**
     * 管控措施-修改上报状态
     * */
    void updateMeasureReportStatus(HandlerReportParam handlerReportParam);
    void updateMeasureReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 管控措施-修改上报状态-通过id
     * */
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventCJReportRiskEventService.java
@@ -24,7 +24,7 @@
    /**
     * 修改上报状态
     * */
    int updateEventReportStatus(HandlerReportParam handlerReportParam);
    int updateEventReportStatus(HandlerCJReportParam handlerReportParam);
    /**
     * 修改上报状态-通过id
     * */
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportCheckRecordFromTaskServiceImpl.java
@@ -49,7 +49,7 @@
     * 任务-待上报状态变更
     * */
    @Override
    public void updateTaskReportStatus(HandlerReportParam handlerReportParam) {
    public void updateTaskReportStatus(HandlerCJReportParam handlerReportParam) {
        int result = preventCJReportCheckRecordFromTaskRepository.updateTaskReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.UPDATE_FAIL.getCode(), "修改任务配置数据上报状态失败");
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportCheckTaskFromWorkServiceImpl.java
@@ -51,7 +51,7 @@
     * 任务配置 -待上报状态变更
     * */
    @Override
    public void updateWorkReportStatus(HandlerReportParam handlerReportParam) {
    public void updateWorkReportStatus(HandlerCJReportParam handlerReportParam) {
        int result = preventCJReportCheckTaskFromWorkRepository.updateWorkReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.ADD_FAIL.getCode(), "任务-配置 状态变更失败");
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportDangerInfoServiceImpl.java
@@ -46,8 +46,8 @@
     * 上报数据-待上报状态变更
     */
    @Override
    public void updateTaskReportStatus(HandlerReportParam handlerReportParam) {
        int result = preventCJReportDangerInfoRepository.updateTaskReportStatus(handlerReportParam);
    public void updateDangerInfoReportStatus(HandlerCJReportParam handlerReportParam) {
        int result = preventCJReportDangerInfoRepository.updateDangerInfoReportStatus(handlerReportParam);
        if (result < 0){
            throw new AusinessException(E.UPDATE_FAIL.getCode(), "隐患信息状态变更失败");
        }
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskAnaUnitServiceImpl.java
@@ -52,8 +52,8 @@
     * 上报数据-修改待上报
     */
    @Override
    public void updateReportStatus(HandlerReportParam handlerReportParam) {
        int result = preventCJReportRiskAnaUnitRepository.updateReportStatus();
    public void updateReportStatus(HandlerCJReportParam handlerReportParam) {
        int result = preventCJReportRiskAnaUnitRepository.updateReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.ADD_FAIL.getCode(), "CJ保存风险单元失败");
        }
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskControlMeasureServiceImpl.java
@@ -51,7 +51,7 @@
     * 管控措施-修改上报状态
     * */
    @Override
    public void updateMeasureReportStatus(HandlerReportParam handlerReportParam) {
    public void updateMeasureReportStatus(HandlerCJReportParam handlerReportParam) {
        int result =  preventCJReportRiskControlMeasureRepository.updateMeasureReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.ADD_FAIL.getCode(), "风险单元状态更新失败");
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventCJReportRiskEventServiceImpl.java
@@ -53,7 +53,7 @@
     * 修改上报状态
     * */
    @Override
    public int updateEventReportStatus(HandlerReportParam handlerReportParam) {
    public int updateEventReportStatus(HandlerCJReportParam handlerReportParam) {
         int result = preventCJReportRiskEventRepository.updateEventReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.ADD_FAIL.getCode(), "修改上报-事件状态失败");
src/main/java/com/ruoyi/doublePrevention/utilsCJ/AesGcm256Util.java
@@ -1,149 +1,139 @@
package com.ruoyi.doublePrevention.utilsCJ;//package com.gkhy.safePlatform.doublePrevention.utilsCJ;
//
//import com.f2bpm.upload.interfaces.ConstantUpload;
//import org.bouncycastle.crypto.DataLengthException;
//import org.bouncycastle.crypto.InvalidCipherTextException;
//import org.bouncycastle.crypto.engines.AESFastEngine;
//import org.bouncycastle.crypto.modes.GCMBlockCipher;
//import org.bouncycastle.crypto.params.AEADParameters;
//import org.bouncycastle.crypto.params.KeyParameter;
//
//import java.io.UnsupportedEncodingException;
//import java.nio.charset.StandardCharsets;
//import java.security.SecureRandom;
//import java.util.Base64;
//
///**
// * AES-GCM-256 工具类
// *
// * @author :LX(长沙麓谷)
// * @date 创建时间: 2022/8/3 14:05
// */
//public class AesGcm256Util {
//
//    /**
//     * 随机数生成
//     */
//    private static final SecureRandom SECURE_RANDOM = new SecureRandom();
//
//    public static final int NONCE_BIT_SIZE = 128;
//    public static final int MAC_BIT_SIZE = 128;
//    public static final int KEY_BIT_SIZE = 256;
//
//
//    private AesGcm256Util(){}
//
//
//    /**
//     * 创建密钥
//     * @return 密钥
//     */
//    public static byte[] key() {
//        byte[] key = new byte[KEY_BIT_SIZE / 8];
//        SECURE_RANDOM.nextBytes(key);
//        return key;
//    }
//
//    /**
//     * 创建向量
//     * @return 向量
//     */
//    public static byte[] iv() {
//        byte[] iv = new byte[NONCE_BIT_SIZE / 8];
//        SECURE_RANDOM.nextBytes(iv);
//        return iv;
//    }
//
//    /**
//     * 编码
//     * @param hexStr 要编码的文本
//     * @return 字节数组
//     */
//    public static byte[] hexToByte(String hexStr) {
//        int len = hexStr.length();
//        byte[] data = new byte[len / 2];
//        for (int i = 0; i < len; i += 2) {
//            data[i / 2] = (byte) ((Character.digit(hexStr.charAt(i), 16) << 4)
//                    + Character.digit(hexStr.charAt(i + 1), 16));
//        }
//        return data;
//    }
//
//    /**
//     * 转换为十六进制
//     * @param data 字节数组
//     * @return 转换的十六进制数据
//     */
//    public static String toHex(byte[] data) {
//        StringBuilder ret = new StringBuilder();
//        for (byte datum : data) {
//            String hex = Integer.toHexString(datum & 0xFF);
//            if (hex.length() == 1) {
//                hex = '0' + hex;
//            }
//            ret.append(hex.toUpperCase());
//        }
//        return ret.toString();
//    }
//
//    /**
//     * 加密
//     * @param plainText 要加密的明文文本
//     * @param key 密钥
//     * @param iv 向量
//     * @return
//     */
//    public static String encrypt(String plainText, String key, String iv) throws UnsupportedEncodingException {
//        return encrypt(plainText, key.getBytes(ConstantUpload.Base.UTF-8), iv.getBytes(ConstantUpload.Base.UTF-8));
//    }
//
//    /**
//     * 加密
//     * @param plainText 要加密的明文文本
//     * @param key 密钥
//     * @param iv 向量
//     * @return
//     */
//    public static String encrypt(String plainText, byte[] key, byte[] iv) {
//        String sr;
//        try {
//            byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8);
//            GCMBlockCipher cipher = new GCMBlockCipher(new AESFastEngine());
//            AEADParameters parameters = new AEADParameters(new KeyParameter(key), MAC_BIT_SIZE, iv, null);
//            cipher.init(true, parameters);
//            byte[] encryptedBytes = new byte[cipher.getOutputSize(plainBytes.length)];
//            int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length, encryptedBytes, 0);
//            cipher.doFinal(encryptedBytes, retLen);
//            sr = Base64.getEncoder().encodeToString(encryptedBytes);
//        } catch (Exception ex) {
//            throw new RuntimeException("加密异常! Encryption exception:" + ex.getMessage());
//        }
//        return sr;
//    }
//
//    /**
//     * 解密
//     * @param encryptedText 已加密文本
//     * @param key 密钥
//     * @param iv 向量
//     * @return
//     */
//    public static String decrypt(String encryptedText, byte[] key, byte[] iv) {
//        String sr;
//        try {
//            byte[] encryptedBytes = Base64.getDecoder().decode(encryptedText);
//            GCMBlockCipher cipher = new GCMBlockCipher(new AESFastEngine());
//            AEADParameters parameters = new AEADParameters(new KeyParameter(key), MAC_BIT_SIZE, iv, null);
//            cipher.init(false, parameters);
//            byte[] plainBytes = new byte[cipher.getOutputSize(encryptedBytes.length)];
//            int retLen = cipher.processBytes(encryptedBytes, 0, encryptedBytes.length, plainBytes, 0);
//            cipher.doFinal(plainBytes, retLen);
//            sr = new String(plainBytes, StandardCharsets.UTF_8);
//
//        } catch (IllegalArgumentException | IllegalStateException | DataLengthException | InvalidCipherTextException ex) {
//            throw new RuntimeException("解密异常! Decryption exception:" + ex.getMessage());
//        }
//        return sr;
//    }
//}
//
package com.ruoyi.doublePrevention.utilsCJ;
import org.bouncycastle.crypto.DataLengthException;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.engines.AESFastEngine;
import org.bouncycastle.crypto.modes.GCMBlockCipher;
import org.bouncycastle.crypto.params.AEADParameters;
import org.bouncycastle.crypto.params.KeyParameter;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Base64;
/**
* AES-GCM-256 工具类
* 加解密方法中已调用 Base64 方法
*/
public class AesGcm256Util {
 private static final SecureRandom SECURE_RANDOM = new
SecureRandom();
 public static final int NONCE_BIT_SIZE = 128;
 public static final int MAC_BIT_SIZE = 128;
 public static final int KEY_BIT_SIZE = 256;
 private AesGcm256Util() {
 }
 /**
 * 创建密钥
 *
 * @return 密钥
 */
 public static byte[] key() {
 byte[] key = new byte[KEY_BIT_SIZE / 8];
 SECURE_RANDOM.nextBytes(key);
 return key;
 }
 /**
 * 创建向量
 *
 * @return 向量
 */
//双重预防机制接口技术文档
 public static byte[] iv() {
 byte[] iv = new byte[NONCE_BIT_SIZE / 8];
 SECURE_RANDOM.nextBytes(iv);
 return iv;
 }
 /**
 * 编码
 *
 * @param hexStr 文本
 * @return 字节数组
 */
 public static byte[] hexToByte(String hexStr) {
 int len = hexStr.length();
 byte[] data = new byte[len / 2];
 for (int i = 0; i < len; i += 2) {
 data[i / 2] = (byte) ((Character.digit(hexStr.charAt(i), 16) << 4)
 + Character.digit(hexStr.charAt(i + 1), 16));
 }
 return data;
 }
 /**
 * 转为十六进制
 *
 * @param data 字节数组
 * @return 转换结果
 */
 public static String toHex(byte[] data) {
 StringBuilder ret = new StringBuilder();
 for (byte datum : data) {
 String hex = Integer.toHexString(datum & 0xFF);
 if (hex.length() == 1) {
 hex = '0' + hex;
 }
 ret.append(hex.toUpperCase());
 }
 return ret.toString();
 }
 /**
 * 加密
 * @param plainText 明文文本
双重预防机制接口技术文档
 * @param key 密钥
 * @param iv 向量
 * @return 加密字符串
 */
 public static String encrypt(String plainText, byte[] key, byte[] iv) {
 String sr;
 try {
 byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8);
 GCMBlockCipher cipher = new GCMBlockCipher(new
         AESFastEngine());
 AEADParameters parameters =
 new AEADParameters(new KeyParameter(key),
MAC_BIT_SIZE, iv, null);
 cipher.init(true, parameters);
 byte[] encryptedBytes = new
byte[cipher.getOutputSize(plainBytes.length)];
 int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length,
encryptedBytes, 0);
 cipher.doFinal(encryptedBytes, retLen);
 sr = Base64.getEncoder().encodeToString(encryptedBytes);
 } catch (Exception ex) {
 throw new RuntimeException(ex.getMessage());
 }
 return sr;
 }
 /**
 * 解密
 *
 * @param encryptedText 已加密文本
 * @param key 密钥
 * @param iv 向量
 * @return 已解密文本
 */
 public static String decrypt(String encryptedText, byte[] key, byte[] iv) {
 String sr;
 try {
 byte[] encryptedBytes = Base64.getDecoder().decode(encryptedText);
 GCMBlockCipher cipher = new GCMBlockCipher(new
         AESFastEngine());
//双重预防机制接口技术文档
 AEADParameters parameters =
 new AEADParameters(new KeyParameter(key),
MAC_BIT_SIZE, iv, null);
 cipher.init(false, parameters);
 byte[] plainBytes = new
byte[cipher.getOutputSize(encryptedBytes.length)];
 int retLen = cipher.processBytes
 (encryptedBytes, 0, encryptedBytes.length, plainBytes, 0);
 cipher.doFinal(plainBytes, retLen);
 sr = new String(plainBytes, StandardCharsets.UTF_8);
 } catch (IllegalArgumentException | IllegalStateException |
         DataLengthException | InvalidCipherTextException ex) {
 throw new RuntimeException(ex.getMessage());
 }
 return sr;
 }
}
src/main/java/com/ruoyi/project/tr/riskMeasure/controller/riskMeasureController.java
@@ -13,7 +13,9 @@
import com.ruoyi.framework.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -141,4 +143,34 @@
        }
    }
    /**
     * 新增风险管控措施 - 最大风险源
     */
    @GetMapping("/addOne")
    public String addOne(ModelMap mmap)
    {
        ResultVO<List<PreventRiskEventListQueryRespDTO>> resultVO = riskService.listRiskEvent();
        Object data = resultVO.getData();
        mmap.put("riskEvents", data);
        return prefix + "/add";
    }
    /**
     * 新增保存
     */
    @Log(title = "风险单元类型", businessType = BusinessType.INSERT)
    @PostMapping("/addOne")
    @ResponseBody
    public AjaxResult addSaveOne(PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO)
    {
        ResultVO<PreventRiskControlMeasure> resultVO = riskService.saveRiskControlMeasure(measureSaveReqDTO);
        String code = resultVO.getCode();
        if ("200".equals(code)){
            return toAjax(1);
        }else {
            return AjaxResult.error(resultVO.getMsg());
        }
    }
}
src/main/resources/mybatis/doublePrevention/PreventCJReportDangerInfoMapper.xml
@@ -52,7 +52,7 @@
    </select>
    <!--int updateTaskReportStatus(HandlerReportParam handlerReportParam);-->
    <update id="updateTaskReportStatus">
    <update id="updateDangerInfoReportStatus">
        update prevent_cj_report_danger_info set
            report_status =  #{reportStatus},
            report_time = #{reportTime}
src/main/resources/mybatis/doublePrevention/PreventRiskControlMeasureMapper.xml
@@ -25,6 +25,8 @@
        <result column="update_report_data_time" property="updateReportDataTime"/>
        <result column="report_switch" property="reportSwitch"/>
        <result column="check_content" property="checkContent"/>
        <result column="work_type" property="workType"/>
        <result column="task_num" property="taskNum"/>
    </resultMap>
    <insert id="savePreventRiskControlMeasure" parameterType="com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure">
@@ -51,6 +53,8 @@
            <if test="updateReportDataTime != null ">update_report_data_time,</if>
            <if test="reportSwitch != null ">report_switch,</if>
            <if test="checkContent != null ">check_content,</if>
            <if test="workType != null and workType != ''">work_type,</if>
            <if test="taskNum != null and taskNum != ''">task_num,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="uuid != null ">#{uuid},</if>
@@ -74,6 +78,8 @@
            <if test="updateReportDataTime != null ">#{updateReportDataTime},</if>
            <if test="reportSwitch != null ">#{reportSwitch},</if>
            <if test="checkContent != null ">#{checkContent},</if>
            <if test="workType != null and workType != ''">#{work_type},</if>
            <if test="taskNum != null and taskNum != ''">#{task_num},</if>
        </trim>
    </insert>
@@ -126,6 +132,12 @@
            <if test="checkContent != null">
                check_content = #{checkContent},
            </if>
            <if test="workType != null and workType != ''">
                work_type = #{workType},
            </if>
            <if test="taskNum != null and taskNum != ''">
                task_num = #{taskNum},
            </if>
        </set>
        where id = #{id} and delete_status = 0
    </update>