| | |
| | | package com.ruoyi.doublePrevention.scheduls;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONArray;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | |
|
| | | import com.ruoyi.common.utils.BeanCopyUtils;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.*;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.CJReportResultData;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.Data;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.ErrorMsgDetails;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.HandlerDO.*;
|
| | | import com.ruoyi.doublePrevention.enums.CJReportEnum;
|
| | | import com.ruoyi.doublePrevention.enums.SyncEnum;
|
| | | import com.ruoyi.doublePrevention.repository.param.HandlerCJReportParam;
|
| | | import com.ruoyi.doublePrevention.service.baseService.*;
|
| | | import com.ruoyi.project.tr.report.service.ReportService;
|
| | | import org.apache.commons.lang3.ObjectUtils;
|
| | | 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 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.nio.charset.StandardCharsets;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.*;
|
| | |
|
| | | @Component
|
| | | public class ExecCJReportDateSchedule {
|
| | |
|
| | | 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;
|
| | |
|
| | | 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/1 * * * ?")
|
| | | //@Scheduled(cron = "0/30 * * * * ?")
|
| | | public void execReportDateSchedule() throws UnsupportedEncodingException {
|
| | | logger.info("【####】上报数据开始...");
|
| | |
|
| | | 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);
|
| | |
|
| | | logger.info("【token时间】" + formatDate);
|
| | |
|
| | | /**
|
| | | * 1、处理安全风险分析单元数据
|
| | | * */
|
| | |
|
| | | logger.info("【1】安全风险分析单元-处理数据...");
|
| | | List<PreventCJReportRiskAnaUnit> CJRiskAnaUnits = CJRiskAnaUnitService.listReportUnitDate();
|
| | | if (ObjectUtils.isNotEmpty(CJRiskAnaUnits)){
|
| | | //封装上报数据,时间格式化
|
| | | List<CJReportRiskAnaUnitDTO> list = new ArrayList<>();
|
| | | for (PreventCJReportRiskAnaUnit cjRiskAnaUnit : CJRiskAnaUnits) {
|
| | | CJReportRiskAnaUnitDTO riskAnaUnit = BeanCopyUtils.copyBean(cjRiskAnaUnit, CJReportRiskAnaUnitDTO.class);
|
| | | riskAnaUnit.setCreateDate(dateFormat.format(cjRiskAnaUnit.getCreateDate()));
|
| | | riskAnaUnit.setUpdateDate(dateFormat.format(cjRiskAnaUnit.getUpdateDate()));
|
| | | list.add(riskAnaUnit);
|
| | | }
|
| | | // logger.info("【【原始数据】】" + JSONObject.toJSONString(list));
|
| | | String AESReportUnitDate = encrypt(JSONObject.toJSONString(list), key.getBytes(), iv.getBytes());
|
| | | // logger.info("【【AES加密结果】】"+ AESReportUnitDate);{0JRK`$6X.jpg)min/Desktop/所有桌面文件存放/9}AM56M10$6WX){0JRK`$6X.jpg)
|
| | | StringBuffer unitResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/unitMsg");
|
| | | //得到连接对象
|
| | | con = (HttpURLConnection) url.openConnection();
|
| | | //设置请求类型
|
| | | con.setRequestMethod("POST");
|
| | | //允许写出
|
| | | con.setDoOutput(true);
|
| | | //允许读入
|
| | | con.setDoInput(true);
|
| | | //不使用缓存
|
| | | con.setUseCaches(false);
|
| | | con.setInstanceFollowRedirects(true);
|
| | | //设置请求头
|
| | | con.setRequestProperty("X-Access-Token",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());
|
| | | //组装入参,设置请求体
|
| | | 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<>();
|
| | | //接收参数,转为对象
|
| | | 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());
|
| | | }
|
| | | }
|
| | | 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】风险分析单元-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 2、处理安全风险事件数据
|
| | | * */
|
| | | logger.info("【2】安全风险事件-处理数据...");
|
| | | List<PreventCJReportRiskEvent> CJEvents = CJEventService.listReportEventDate();
|
| | | if (ObjectUtils.isNotEmpty(CJEvents)){
|
| | | //封装上报数据
|
| | | List<CJReportRiskEventDTO> eventList = new ArrayList<>();
|
| | |
|
| | | for (PreventCJReportRiskEvent cjEvent : CJEvents) {
|
| | | CJReportRiskEventDTO CJReportRiskEvent = BeanCopyUtils.copyBean(cjEvent, CJReportRiskEventDTO.class);
|
| | | CJReportRiskEvent.setCreateDate(dateFormat.format(cjEvent.getCreateDate()));
|
| | | CJReportRiskEvent.setUpdateDate(dateFormat.format(cjEvent.getUpdateDate()));
|
| | | eventList.add(CJReportRiskEvent);
|
| | | }
|
| | | logger.info("【【风险事件原始数据】】" + JSONObject.toJSONString(eventList));
|
| | | //加密数据
|
| | | String AESReportUnitDate = encrypt(JSONObject.toJSONString(eventList), key.getBytes(), iv.getBytes());
|
| | |
|
| | | StringBuffer eventResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/eventMsg");
|
| | | //得到连接对象
|
| | | 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());
|
| | | con.setInstanceFollowRedirects(true);
|
| | | OutputStream os = con.getOutputStream();
|
| | | Map paraMap = new HashMap();
|
| | | paraMap.put("data", AESReportUnitDate); /**封装数据*/
|
| | | //组装入参,设置请求体
|
| | | os.write(JSON.toJSONString(paraMap).getBytes());
|
| | | //得到响应码
|
| | | responseCode = con.getResponseCode();
|
| | | //本段日志,测试成功后,可注释掉
|
| | | if (responseCode == HttpURLConnection.HTTP_OK) {
|
| | | //得到响应流
|
| | | InputStream inputStream = con.getInputStream();
|
| | | //将响应流转换成字符串
|
| | | eventResultBuffer = new StringBuffer();
|
| | | String line;
|
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
| | | while ((line = buffer.readLine()) != null) {
|
| | | eventResultBuffer.append(line);
|
| | | }
|
| | | logger.info("result:" + eventResultBuffer.toString());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | 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);
|
| | | }
|
| | | }
|
| | | logger.info("【2】安全风险事件-数据处理完成");
|
| | | }else {
|
| | | logger.info("【2】风险事件-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 3、处理风险管控措施数据
|
| | | * */
|
| | | logger.info("【3】风险管控措施-处理数据...");
|
| | | List<PreventCJReportRiskControlMeasure> CJMeasures = CJMeasureService.listReportMeasureDate();
|
| | | //封装上报数据
|
| | | List<CJReportRiskControlMeasureDTO> reportMeasureList = new ArrayList<>();
|
| | | if (ObjectUtils.isNotEmpty(CJMeasures)){
|
| | | for (PreventCJReportRiskControlMeasure cjMeasure : CJMeasures) {
|
| | | CJReportRiskControlMeasureDTO cjReportRiskControlMeasureDTO = BeanCopyUtils.copyBean(cjMeasure, CJReportRiskControlMeasureDTO.class);
|
| | | cjReportRiskControlMeasureDTO.setCreateDate(dateFormat.format(cjMeasure.getCreateDate()));
|
| | | cjReportRiskControlMeasureDTO.setUpdateDate(dateFormat.format(cjMeasure.getUpdateDate()));
|
| | | reportMeasureList.add(cjReportRiskControlMeasureDTO);
|
| | | }
|
| | | //数据上报
|
| | | String AESReportMeasure = encrypt(JSONObject.toJSONString(reportMeasureList), key.getBytes(), iv.getBytes());
|
| | |
|
| | | logger.info("【原始数据】" + JSONObject.toJSONString(reportMeasureList));
|
| | |
|
| | | StringBuffer measureResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/controlMeasuresMsg");
|
| | | //得到连接对象
|
| | | 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", AESReportMeasure); /**封装数据*/
|
| | | //组装入参,设置请求体
|
| | | os.write(JSON.toJSONString(paraMap).getBytes());
|
| | | //得到响应码
|
| | | responseCode = con.getResponseCode();
|
| | | //本段日志,测试成功后,可注释掉
|
| | | if (responseCode == HttpURLConnection.HTTP_OK) {
|
| | | //得到响应流
|
| | | InputStream inputStream = con.getInputStream();
|
| | | //将响应流转换成字符串
|
| | | measureResultBuffer = new StringBuffer();
|
| | | String line;
|
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
| | | while ((line = buffer.readLine()) != null) {
|
| | | measureResultBuffer.append(line);
|
| | | }
|
| | | logger.info("result:" + measureResultBuffer.toString());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | 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);
|
| | | }
|
| | | }
|
| | | logger.info("【3】风险管控措施-数据处理完成");
|
| | | }else {
|
| | | logger.info("【3】风险管控措施-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 4、处理 任务-配置 数据
|
| | | * */
|
| | | logger.info("【4】任务-处理数据...");
|
| | | List<PreventCJReportCheckTaskFromWork> CJTaskFromWorks = CJTaskFromWorkService.listReportTaskFromWorkDate();
|
| | | if(ObjectUtils.isNotEmpty(CJTaskFromWorks)){
|
| | | //封装上报数据
|
| | | List<CJReportCheckTaskFromWorkDTO> reportCheckTaskFromWorkList = new ArrayList<>();
|
| | | for (PreventCJReportCheckTaskFromWork cjTaskFromWork : CJTaskFromWorks) {
|
| | | CJReportCheckTaskFromWorkDTO cjReportCheckTaskFromWorkDTO = BeanCopyUtils.copyBean(cjTaskFromWork, CJReportCheckTaskFromWorkDTO.class);
|
| | | cjReportCheckTaskFromWorkDTO.setCreateDate(dateFormat.format(cjTaskFromWork.getCreateDate()));
|
| | | cjReportCheckTaskFromWorkDTO.setUpdateDate(dateFormat.format(cjTaskFromWork.getUpdateDate()));
|
| | | reportCheckTaskFromWorkList.add(cjReportCheckTaskFromWorkDTO);
|
| | | }
|
| | | //数据上报
|
| | | String AESReportTaskFromWork = encrypt(JSONObject.toJSONString(reportCheckTaskFromWorkList), key.getBytes(), iv.getBytes());
|
| | | StringBuffer taskFromWorkResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskMsg");
|
| | | //得到连接对象
|
| | | 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", AESReportTaskFromWork); /**封装数据*/
|
| | | //组装入参,设置请求体
|
| | | os.write(JSON.toJSONString(paraMap).getBytes());
|
| | | //得到响应码
|
| | | responseCode = con.getResponseCode();
|
| | | //本段日志,测试成功后,可注释掉
|
| | | if (responseCode == HttpURLConnection.HTTP_OK) {
|
| | | //得到响应流
|
| | | InputStream inputStream = con.getInputStream();
|
| | | //将响应流转换成字符串
|
| | | taskFromWorkResultBuffer = new StringBuffer();
|
| | | String line;
|
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
| | | while ((line = buffer.readLine()) != null) {
|
| | | taskFromWorkResultBuffer.append(line);
|
| | | }
|
| | | logger.info("result:" + taskFromWorkResultBuffer.toString());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | 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);
|
| | | }
|
| | | }
|
| | | //设置上报失败的数据,上报失败
|
| | | 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】任务-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 5、处理 任务-记录 数据
|
| | | * */
|
| | | logger.info("【5】任务记录-处理数据...");
|
| | | List<PreventCJReportCheckRecordFromTask> CJRecordFromTasks = CJTaskRecordService.listReportTaskRecordDate();
|
| | | if (ObjectUtils.isNotEmpty(CJRecordFromTasks)){
|
| | | //封装上报数据
|
| | | List<CJReportCheckRecordFromTaskDTO> reportRecordFromTaskList = new ArrayList<>();
|
| | | for (PreventCJReportCheckRecordFromTask cjRecordFromTask : CJRecordFromTasks) {
|
| | | CJReportCheckRecordFromTaskDTO cjReportCheckRecordFromTaskDTO = BeanCopyUtils.copyBean(cjRecordFromTask, CJReportCheckRecordFromTaskDTO.class);
|
| | | cjReportCheckRecordFromTaskDTO.setCreateDate(dateFormat.format(cjRecordFromTask.getCreateDate()));
|
| | | cjReportCheckRecordFromTaskDTO.setUpdateDate(dateFormat.format(cjRecordFromTask.getUpdateDate()));
|
| | | cjReportCheckRecordFromTaskDTO.setCheckTime(dateFormat.format(cjRecordFromTask.getCheckTime()));
|
| | | reportRecordFromTaskList.add(cjReportCheckRecordFromTaskDTO);
|
| | | }
|
| | | //数据加密
|
| | | String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
|
| | |
|
| | | StringBuffer recordFromTaskResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskRecordMsg");
|
| | | //得到连接对象
|
| | | 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", AESReportRecordFromTask);/**封装数据*/
|
| | | //组装入参,设置请求体
|
| | | os.write(JSON.toJSONString(paraMap).getBytes());
|
| | | //得到响应码
|
| | | responseCode = con.getResponseCode();
|
| | | //本段日志,测试成功后,可注释掉
|
| | | if (responseCode == HttpURLConnection.HTTP_OK) {
|
| | | //得到响应流
|
| | | InputStream inputStream = con.getInputStream();
|
| | | //将响应流转换成字符串
|
| | | recordFromTaskResultBuffer = new StringBuffer();
|
| | | String line;
|
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
| | | while ((line = buffer.readLine()) != null) {
|
| | | recordFromTaskResultBuffer.append(line);
|
| | | }
|
| | | logger.info("result:" + recordFromTaskResultBuffer.toString());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | 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);
|
| | | }
|
| | | }
|
| | | logger.info("【5】任务记录-数据处理完成");
|
| | | }else {
|
| | | logger.info("【5】任务记录-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 6、处理隐患信息数据
|
| | | * */
|
| | | logger.info("【6】隐患信息-处理数据...");
|
| | | List<PreventCJReportDangerInfo> CJDangerInfos = CJDangerInfoService.listReportDangerDate();
|
| | | if (ObjectUtils.isNotEmpty(CJDangerInfos)){
|
| | | //封装上报数据
|
| | | List<CJReportDangerInfoDTO> reportDangerInfoLists = new ArrayList<>();
|
| | | for (PreventCJReportDangerInfo cjDangerInfo : CJDangerInfos) {
|
| | | CJReportDangerInfoDTO cjReportDangerInfoDTO = BeanCopyUtils.copyBean(cjDangerInfo, CJReportDangerInfoDTO.class);
|
| | | cjReportDangerInfoDTO.setCreateDate(dateFormat.format(cjDangerInfo.getCreateDate()));
|
| | | cjReportDangerInfoDTO.setUpdateDate(dateFormat.format(cjDangerInfo.getUpdateDate()));
|
| | | if (ObjectUtils.isNotEmpty(cjDangerInfo.getCheckAcceptTime())){
|
| | | cjReportDangerInfoDTO.setCheckAcceptTime(dateFormat.format(cjDangerInfo.getCheckAcceptTime()));
|
| | | }else {
|
| | | cjReportDangerInfoDTO.setCheckAcceptTime(null);
|
| | | }
|
| | | cjReportDangerInfoDTO.setRegistTime(dateFormat.format(cjDangerInfo.getRegistTime()));
|
| | | cjReportDangerInfoDTO.setDangerManageDeadline(dateFormat.format(cjDangerInfo.getDangerManageDeadline()));
|
| | | reportDangerInfoLists.add(cjReportDangerInfoDTO);
|
| | | }
|
| | | //数据上报
|
| | | logger.info("【原始数据】" + JSONObject.toJSONString(reportDangerInfoLists));
|
| | | String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportDangerInfoLists), key.getBytes(), iv.getBytes());
|
| | | StringBuffer dangerInfoResultBuffer = null;
|
| | | //上报数据
|
| | | try {
|
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/dangerInvestigationMsg");
|
| | | //得到连接对象
|
| | | 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 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);
|
| | | }
|
| | | }
|
| | | logger.info("【6】隐患信息-数据处理完成");
|
| | | }else {
|
| | | logger.info("【6】隐患信息-无数据上报昌吉州");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | package com.ruoyi.doublePrevention.scheduls; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.utils.BeanCopyUtils; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.CJReportResultData; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.Data; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.ErrorMsgDetails; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.CJdto.HandlerDO.*; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.*; |
| | | import com.ruoyi.doublePrevention.entity.PreventReportConfig; |
| | | import com.ruoyi.doublePrevention.enums.CJReportEnum; |
| | | import com.ruoyi.doublePrevention.enums.SyncEnum; |
| | | import com.ruoyi.doublePrevention.repository.param.HandlerCJReportParam; |
| | | import com.ruoyi.doublePrevention.service.baseService.*; |
| | | import com.ruoyi.project.tr.report.service.ReportService; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | 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 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.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | public class ExecCJReportDateSchedule { |
| | | |
| | | 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/5 * * * ? ") // 分钟 |
| | | // @Scheduled(cron = "0 0/5 * * * ? ") |
| | | @Scheduled(cron = "0 0/1 * * * ? ") |
| | | public void execReportDateSchedule() throws UnsupportedEncodingException { |
| | | logger.info("【####】上报数据开始..."); |
| | | |
| | | 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); |
| | | |
| | | logger.info("【token时间】" + formatDate); |
| | | |
| | | //使用风险分析单元数据上报主配置,作为自动上报开关 |
| | | PreventReportConfig reportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); |
| | | if (reportConfig.getReportType() == 0){ |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 1、处理安全风险分析单元数据 |
| | | * */ |
| | | logger.info("【1】安全风险分析单元-处理数据..."); |
| | | List<PreventCJReportRiskAnaUnit> CJRiskAnaUnits = CJRiskAnaUnitService.listReportUnitDate(); |
| | | if (ObjectUtils.isNotEmpty(CJRiskAnaUnits)){ |
| | | //封装上报数据,时间格式化 |
| | | List<CJReportRiskAnaUnitDTO> list = new ArrayList<>(); |
| | | for (PreventCJReportRiskAnaUnit cjRiskAnaUnit : CJRiskAnaUnits) { |
| | | CJReportRiskAnaUnitDTO riskAnaUnit = BeanCopyUtils.copyBean(cjRiskAnaUnit, CJReportRiskAnaUnitDTO.class); |
| | | riskAnaUnit.setCreateDate(dateFormat.format(cjRiskAnaUnit.getCreateDate())); |
| | | riskAnaUnit.setUpdateDate(dateFormat.format(cjRiskAnaUnit.getUpdateDate())); |
| | | list.add(riskAnaUnit); |
| | | } |
| | | // logger.info("【【原始数据】】" + JSONObject.toJSONString(list)); |
| | | String AESReportUnitDate = encrypt(JSONObject.toJSONString(list), key.getBytes(), iv.getBytes()); |
| | | // logger.info("【【AES加密结果】】"+ AESReportUnitDate);{0JRK`$6X.jpg)min/Desktop/所有桌面文件存放/9}AM56M10$6WX){0JRK`$6X.jpg) |
| | | StringBuffer unitResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/unitMsg"); |
| | | //得到连接对象 |
| | | con = (HttpURLConnection) url.openConnection(); |
| | | //设置请求类型 |
| | | con.setRequestMethod("POST"); |
| | | //允许写出 |
| | | con.setDoOutput(true); |
| | | //允许读入 |
| | | con.setDoInput(true); |
| | | //不使用缓存 |
| | | con.setUseCaches(false); |
| | | con.setInstanceFollowRedirects(true); |
| | | //设置请求头 |
| | | con.setRequestProperty("X-Access-Token",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()); |
| | | //组装入参,设置请求体 |
| | | 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<>(); |
| | | //接收参数,转为对象 |
| | | 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()); |
| | | } |
| | | } |
| | | 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】风险分析单元-无数据上报昌吉州"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 2、处理安全风险事件数据 |
| | | * */ |
| | | logger.info("【2】安全风险事件-处理数据..."); |
| | | List<PreventCJReportRiskEvent> CJEvents = CJEventService.listReportEventDate(); |
| | | if (ObjectUtils.isNotEmpty(CJEvents)){ |
| | | //封装上报数据 |
| | | List<CJReportRiskEventDTO> eventList = new ArrayList<>(); |
| | | |
| | | for (PreventCJReportRiskEvent cjEvent : CJEvents) { |
| | | CJReportRiskEventDTO CJReportRiskEvent = BeanCopyUtils.copyBean(cjEvent, CJReportRiskEventDTO.class); |
| | | CJReportRiskEvent.setCreateDate(dateFormat.format(cjEvent.getCreateDate())); |
| | | CJReportRiskEvent.setUpdateDate(dateFormat.format(cjEvent.getUpdateDate())); |
| | | eventList.add(CJReportRiskEvent); |
| | | } |
| | | logger.info("【【风险事件原始数据】】" + JSONObject.toJSONString(eventList)); |
| | | //加密数据 |
| | | String AESReportUnitDate = encrypt(JSONObject.toJSONString(eventList), key.getBytes(), iv.getBytes()); |
| | | |
| | | StringBuffer eventResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/eventMsg"); |
| | | //得到连接对象 |
| | | 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()); |
| | | con.setInstanceFollowRedirects(true); |
| | | OutputStream os = con.getOutputStream(); |
| | | Map paraMap = new HashMap(); |
| | | paraMap.put("data", AESReportUnitDate); /**封装数据*/ |
| | | //组装入参,设置请求体 |
| | | os.write(JSON.toJSONString(paraMap).getBytes()); |
| | | //得到响应码 |
| | | responseCode = con.getResponseCode(); |
| | | //确认响应流不为空 |
| | | if (responseCode == HttpURLConnection.HTTP_OK) { |
| | | //得到响应流 |
| | | InputStream inputStream = con.getInputStream(); |
| | | //将响应流转换成字符串 |
| | | eventResultBuffer = new StringBuffer(); |
| | | String line; |
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | while ((line = buffer.readLine()) != null) { |
| | | eventResultBuffer.append(line); |
| | | } |
| | | logger.info("result:" + eventResultBuffer.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | 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); |
| | | } |
| | | } |
| | | logger.info("【2】安全风险事件-数据处理完成"); |
| | | }else { |
| | | logger.info("【2】风险事件-无数据上报昌吉州"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 3、处理风险管控措施数据 |
| | | * */ |
| | | logger.info("【3】风险管控措施-处理数据..."); |
| | | List<PreventCJReportRiskControlMeasure> CJMeasures = CJMeasureService.listReportMeasureDate(); |
| | | //封装上报数据 |
| | | List<CJReportRiskControlMeasureDTO> reportMeasureList = new ArrayList<>(); |
| | | if (ObjectUtils.isNotEmpty(CJMeasures)){ |
| | | for (PreventCJReportRiskControlMeasure cjMeasure : CJMeasures) { |
| | | CJReportRiskControlMeasureDTO cjReportRiskControlMeasureDTO = BeanCopyUtils.copyBean(cjMeasure, CJReportRiskControlMeasureDTO.class); |
| | | cjReportRiskControlMeasureDTO.setCreateDate(dateFormat.format(cjMeasure.getCreateDate())); |
| | | cjReportRiskControlMeasureDTO.setUpdateDate(dateFormat.format(cjMeasure.getUpdateDate())); |
| | | reportMeasureList.add(cjReportRiskControlMeasureDTO); |
| | | } |
| | | //数据上报 |
| | | String AESReportMeasure = encrypt(JSONObject.toJSONString(reportMeasureList), key.getBytes(), iv.getBytes()); |
| | | |
| | | logger.info("【原始数据】" + JSONObject.toJSONString(reportMeasureList)); |
| | | |
| | | StringBuffer measureResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/controlMeasuresMsg"); |
| | | //得到连接对象 |
| | | 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", AESReportMeasure); /**封装数据*/ |
| | | //组装入参,设置请求体 |
| | | os.write(JSON.toJSONString(paraMap).getBytes()); |
| | | //得到响应码 |
| | | responseCode = con.getResponseCode(); |
| | | //本段日志,测试成功后,可注释掉 |
| | | if (responseCode == HttpURLConnection.HTTP_OK) { |
| | | //得到响应流 |
| | | InputStream inputStream = con.getInputStream(); |
| | | //将响应流转换成字符串 |
| | | measureResultBuffer = new StringBuffer(); |
| | | String line; |
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | while ((line = buffer.readLine()) != null) { |
| | | measureResultBuffer.append(line); |
| | | } |
| | | logger.info("result:" + measureResultBuffer.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | 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); |
| | | } |
| | | } |
| | | logger.info("【3】风险管控措施-数据处理完成"); |
| | | }else { |
| | | logger.info("【3】风险管控措施-无数据上报昌吉州"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 4、处理 任务-配置 数据 |
| | | * */ |
| | | logger.info("【4】任务-处理数据..."); |
| | | List<PreventCJReportCheckTaskFromWork> CJTaskFromWorks = CJTaskFromWorkService.listReportTaskFromWorkDate(); |
| | | if(ObjectUtils.isNotEmpty(CJTaskFromWorks)){ |
| | | //封装上报数据 |
| | | List<CJReportCheckTaskFromWorkDTO> reportCheckTaskFromWorkList = new ArrayList<>(); |
| | | for (PreventCJReportCheckTaskFromWork cjTaskFromWork : CJTaskFromWorks) { |
| | | CJReportCheckTaskFromWorkDTO cjReportCheckTaskFromWorkDTO = BeanCopyUtils.copyBean(cjTaskFromWork, CJReportCheckTaskFromWorkDTO.class); |
| | | cjReportCheckTaskFromWorkDTO.setCreateDate(dateFormat.format(cjTaskFromWork.getCreateDate())); |
| | | cjReportCheckTaskFromWorkDTO.setUpdateDate(dateFormat.format(cjTaskFromWork.getUpdateDate())); |
| | | cjReportCheckTaskFromWorkDTO.setTaskStartTime(dateFormat.format(cjTaskFromWork.getCreateDate())); |
| | | reportCheckTaskFromWorkList.add(cjReportCheckTaskFromWorkDTO); |
| | | } |
| | | System.out.println(Arrays.toString(reportCheckTaskFromWorkList.toArray())); |
| | | //数据上报 |
| | | String AESReportTaskFromWork = encrypt(JSONObject.toJSONString(reportCheckTaskFromWorkList), key.getBytes(), iv.getBytes()); |
| | | StringBuffer taskFromWorkResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskMsg"); |
| | | //得到连接对象 |
| | | 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", AESReportTaskFromWork); |
| | | //组装入参,设置请求体 |
| | | os.write(JSON.toJSONString(paraMap).getBytes()); |
| | | //得到响应码 |
| | | responseCode = con.getResponseCode(); |
| | | //本段日志,测试成功后,可注释掉 |
| | | if (responseCode == HttpURLConnection.HTTP_OK) { |
| | | //得到响应流 |
| | | InputStream inputStream = con.getInputStream(); |
| | | //将响应流转换成字符串 |
| | | taskFromWorkResultBuffer = new StringBuffer(); |
| | | String line; |
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | while ((line = buffer.readLine()) != null) { |
| | | taskFromWorkResultBuffer.append(line); |
| | | } |
| | | logger.info("result:" + taskFromWorkResultBuffer.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | 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); |
| | | } |
| | | } |
| | | //设置上报失败的数据,上报失败 |
| | | 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】任务-无数据上报昌吉州"); |
| | | } |
| | | |
| | | /** |
| | | * 5、处理 任务-记录 数据 |
| | | * */ |
| | | logger.info("【5】任务记录-处理数据..."); |
| | | List<PreventCJReportCheckRecordFromTask> CJRecordFromTasks = CJTaskRecordService.listReportTaskRecordDate(); |
| | | if (ObjectUtils.isNotEmpty(CJRecordFromTasks)){ |
| | | //封装上报数据 |
| | | List<CJReportCheckRecordFromTaskDTO> reportRecordFromTaskList = new ArrayList<>(); |
| | | for (PreventCJReportCheckRecordFromTask cjRecordFromTask : CJRecordFromTasks) { |
| | | CJReportCheckRecordFromTaskDTO cjReportCheckRecordFromTaskDTO = BeanCopyUtils.copyBean(cjRecordFromTask, CJReportCheckRecordFromTaskDTO.class); |
| | | // cjReportCheckRecordFromTaskDTO.setCreateDate(dateFormat.format(cjRecordFromTask.getCreateDate())); |
| | | // cjReportCheckRecordFromTaskDTO.setUpdateDate(dateFormat.format(cjRecordFromTask.getUpdateDate())); |
| | | cjReportCheckRecordFromTaskDTO.setCheckTime(dateFormat.format(cjRecordFromTask.getCheckTime())); |
| | | cjReportCheckRecordFromTaskDTO.setMobileMe(cjRecordFromTask.getMobileCode()); |
| | | cjReportCheckRecordFromTaskDTO.setIsDefend(cjRecordFromTask.getDefend()); |
| | | reportRecordFromTaskList.add(cjReportCheckRecordFromTaskDTO); |
| | | } |
| | | // System.out.println(Arrays.toString(reportRecordFromTaskList.toArray())); |
| | | //数据加密 |
| | | String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes()); |
| | | logger.info("【test】数据加密完成,开始上报数据"); |
| | | |
| | | StringBuffer recordFromTaskResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | // URL url = new URL("http://120.71.182.198:9999/v1/data/receive/measuresTaskRecordMsg"); |
| | | URL url = new URL("https://cjzjg.gtaq.com.cn:7004/v1/data/receive/measuresTaskRecordMsg"); //备用地址 |
| | | //得到连接对象 |
| | | con = (HttpURLConnection) url.openConnection(); |
| | | //设置请求类型 |
| | | con.setRequestMethod("POST"); |
| | | //设置Content-Type,此处根据实际情况确定 |
| | | con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); |
| | | // con.setRequestProperty(HTTP.CONN_DIRECTIVE,HTTP.CONN_CLOSE); |
| | | con.setConnectTimeout(600000); |
| | | con.setReadTimeout(600000); |
| | | |
| | | //允许写出 |
| | | con.setDoOutput(true); |
| | | //允许读入 |
| | | con.setDoInput(true); |
| | | //不使用缓存 |
| | | con.setUseCaches(false); |
| | | //设置请求头 |
| | | con.setRequestProperty("X-Access-Token",token+tokenDate.format(new Date()).toString()); |
| | | OutputStream os = con.getOutputStream(); |
| | | Map paraMap = new HashMap(); |
| | | paraMap.put("data", AESReportRecordFromTask);/**封装数据*/ |
| | | //组装入参,设置请求体 |
| | | os.write(JSON.toJSONString(paraMap).getBytes()); |
| | | //得到响应码 |
| | | responseCode = con.getResponseCode(); |
| | | //本段日志,测试成功后,可注释掉 |
| | | if (responseCode == HttpURLConnection.HTTP_OK) { |
| | | //得到响应流 |
| | | InputStream inputStream = con.getInputStream(); |
| | | //将响应流转换成字符串 |
| | | recordFromTaskResultBuffer = new StringBuffer(); |
| | | String line; |
| | | buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | while ((line = buffer.readLine()) != null) { |
| | | recordFromTaskResultBuffer.append(line); |
| | | } |
| | | logger.info("result:" + recordFromTaskResultBuffer.toString()); |
| | | }else { |
| | | logger.info("Http结果:" + responseCode); |
| | | } |
| | | } catch (Exception e) { |
| | | 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); |
| | | //接收返回值,保存返回值 |
| | | logger.info("【test】保存上报结果"); |
| | | 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); |
| | | } |
| | | } |
| | | logger.info("【5】任务记录-数据处理完成"); |
| | | }else { |
| | | logger.info("【5】任务记录-无数据上报昌吉州"); |
| | | } |
| | | |
| | | /** |
| | | * 6、处理隐患信息数据 |
| | | * */ |
| | | logger.info("【6】隐患信息-处理数据..."); |
| | | List<PreventCJReportDangerInfo> CJDangerInfos = CJDangerInfoService.listReportDangerDate(); |
| | | if (ObjectUtils.isNotEmpty(CJDangerInfos)){ |
| | | //封装上报数据 |
| | | List<CJReportDangerInfoDTO> reportDangerInfoLists = new ArrayList<>(); |
| | | for (PreventCJReportDangerInfo cjDangerInfo : CJDangerInfos) { |
| | | CJReportDangerInfoDTO cjReportDangerInfoDTO = BeanCopyUtils.copyBean(cjDangerInfo, CJReportDangerInfoDTO.class); |
| | | cjReportDangerInfoDTO.setCreateDate(dateFormat.format(cjDangerInfo.getCreateDate())); |
| | | cjReportDangerInfoDTO.setUpdateDate(dateFormat.format(cjDangerInfo.getUpdateDate())); |
| | | if (ObjectUtils.isNotEmpty(cjDangerInfo.getCheckAcceptTime())){ |
| | | cjReportDangerInfoDTO.setCheckAcceptTime(dateFormat.format(cjDangerInfo.getCheckAcceptTime())); |
| | | }else { |
| | | cjReportDangerInfoDTO.setCheckAcceptTime(null); |
| | | } |
| | | cjReportDangerInfoDTO.setRegistTime(dateFormat.format(cjDangerInfo.getRegistTime())); |
| | | cjReportDangerInfoDTO.setDangerManageDeadline(dateFormat.format(cjDangerInfo.getDangerManageDeadline())); |
| | | reportDangerInfoLists.add(cjReportDangerInfoDTO); |
| | | } |
| | | //数据上报 |
| | | logger.info("【原始数据】" + JSONObject.toJSONString(reportDangerInfoLists)); |
| | | String AESReportDangerInfo = encrypt(JSONObject.toJSONString(reportDangerInfoLists), key.getBytes(), iv.getBytes()); |
| | | StringBuffer dangerInfoResultBuffer = null; |
| | | //上报数据 |
| | | try { |
| | | URL url = new URL("http://120.71.182.198:9999/v1/data/receive/dangerInvestigationMsg"); |
| | | //得到连接对象 |
| | | 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 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); |
| | | } |
| | | } |
| | | logger.info("【6】隐患信息-数据处理完成"); |
| | | }else { |
| | | logger.info("【6】隐患信息-无数据上报昌吉州"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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】检修停用记录-无数据上报昌吉州"); |
| | | } |
| | | |
| | | } |
| | | } |