package com.gkhy.safePlatform.doublePrevention.scheduls; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; import com.gkhy.safePlatform.doublePrevention.entity.*; import com.gkhy.safePlatform.doublePrevention.entity.dto.report.HandlerDO.*; import com.gkhy.safePlatform.doublePrevention.entity.dto.report.ReportResultDTO; import com.gkhy.safePlatform.doublePrevention.enums.SyncEnum; import com.gkhy.safePlatform.doublePrevention.repository.param.HandlerReportParam; import com.gkhy.safePlatform.doublePrevention.service.ReportService; import com.gkhy.safePlatform.doublePrevention.service.baseService.*; import com.gkhy.safePlatform.doublePrevention.utils.AesGcm256Util; import com.sun.corba.se.impl.orbutil.concurrent.Sync; 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.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @Component public class ExecReportDateSchedule { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private ReportService reportService; @Autowired private PreventReportRiskAnaUnitService riskAnaUnitService; @Autowired private PreventReportRiskEventService eventService; @Autowired private PreventReportRiskControlMeasureService measureService; @Autowired private PreventReportCheckTaskFromWorkService taskFromWorkService; @Autowired private PreventReportCheckRecordFromTaskService taskRecordService; @Autowired private PreventReportDangerInfoService dangerInfoService; @Autowired private PreventRiskAnaUnitService preventRiskUnitService; @Autowired private PreventRiskEventService preventRiskEventService; @Autowired private PreventRiskControlMeasureService preventRiskControlMeasureService; @Autowired private PreventDangerCheckContentService preventDangerCheckContentService; @Autowired private PreventRiskControlTemplateService preventRiskControlTemplateService; @Autowired private PreventDangerCheckWorkService preventDangerCheckWorkService; @Autowired private PreventDangerCheckTaskService preventDangerCheckTaskService; @Autowired private PreventDangerManageService preventDangerManageService; @Autowired private PreventDangerRectifyService preventDangerRectifyService; @Autowired private PreventWorkAndMeasureService preventWorkAndMeasureService; @Autowired private PreventTaskAndMeasureService preventTaskAndMeasureService; @Autowired private PreventReportBatchService preventReportBatchService; @Transactional //@Scheduled(cron = "0 0/30 * * * ?") public void execReportDateSchedule(){ logger.info("【双重预防】上报数据开始..."); Date date = new Date(); HttpURLConnection con = null; BufferedReader buffer = null; int responseCode = 0; //格式化时间,作为token的时间戳 SimpleDateFormat tokenDate= new SimpleDateFormat("yyyyMMddHHMMssSSS"); String formatDate = tokenDate.format(date); PreventReportBatch reportBatch = new PreventReportBatch(); /**1、处理安全风险分析单元数据*/ logger.info("【【处理安全风险分析单元数据】】"); List riskAnaUnits = riskAnaUnitService.listReportUnitDate(); //封装上报数据 List reportRiskAnaUnitList = BeanCopyUtils.copyBeanList(riskAnaUnits, ReportRiskAnaUnitDTO.class); //加密数据 String reportUnitDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRiskAnaUnitList).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer unitResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveUnitList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportUnitDate); /**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO unitResult = JSONObject.parseObject(unitResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 //根据返回值处理结果 if(unitResult.getObj().getBatchId() != null){ //遍历数据,更改原始表、上报表状态 for (PreventReportRiskAnaUnit riskAnaUnit : riskAnaUnits) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(riskAnaUnit.getRiskUnitId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventRiskUnitService.updateReportStatus(handlerReportParam); riskAnaUnitService.updateReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(unitResult.getObj().getBatchId()); reportBatch.setDataSource("unit"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportRiskAnaUnit riskAnaUnit : riskAnaUnits) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(riskAnaUnit.getRiskUnitId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventRiskUnitService.updateReportStatus(handlerReportParam); riskAnaUnitService.updateReportStatus(handlerReportParam); } } /**2、处理安全风险事件数据*/ logger.info("【【处理安全风险事件数据】】"); List events = eventService.listReportEventDate(); //封装上报数据 List reportRiskEventList = BeanCopyUtils.copyBeanList(events, ReportRiskEventDTO.class); //加密数据 String reportEventDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRiskEventList).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer eventResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveEventList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportEventDate); /**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO eventResult = JSONObject.parseObject(eventResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 //根据返回值处理结果 if (eventResult.getObj().getBatchId() == null){ //遍历数据,更改原始表、上报表状态 for (PreventReportRiskEvent event : events) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(event.getRiskEventId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventRiskEventService.updateEventReportStatus(handlerReportParam); eventService.updateEventReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(eventResult.getObj().getBatchId()); reportBatch.setDataSource("event"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportRiskEvent event : events) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(event.getRiskEventId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventRiskEventService.updateEventReportStatus(handlerReportParam); eventService.updateEventReportStatus(handlerReportParam); } } /**3、处理风险管控措施数据*/ logger.info("【【处理风险管控措施数据】】"); List measures = measureService.listReportMeasureDate(); //封装上报数据 List reportMeasureList = BeanCopyUtils.copyBeanList(measures, ReportRiskControlMeasureDTO.class); //数据上报 String reportMeasureDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportMeasureList).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer measureResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveControlMeasuresList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportMeasureDate); /**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO measureResult = JSONObject.parseObject(measureResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 if (measureResult.getObj().getBatchId() != null){ //遍历数据,更改原始表、上报表状态 for (PreventReportRiskControlMeasure measure : measures) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(measure.getRiskMeasureId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventRiskControlMeasureService.updateMeasureReportStatus(handlerReportParam); measureService.updateMeasureReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(measureResult.getObj().getBatchId()); reportBatch.setDataSource("measure"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportRiskControlMeasure measure : measures) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(measure.getRiskMeasureId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventRiskControlMeasureService.updateMeasureReportStatus(handlerReportParam); measureService.updateMeasureReportStatus(handlerReportParam); } } /**4、处理 任务-配置 数据*/ logger.info("【【处理 任务-配置 数据】】"); List taskFromWorks = taskFromWorkService.listReportTaskFromWorkDate(); //封装上报数据 List reportCheckTaskFromWorkList = BeanCopyUtils.copyBeanList(taskFromWorks, ReportCheckTaskFromWorkDTO.class); //数据上报 String reportTaskFromWorkDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportCheckTaskFromWorkList).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer taskFromWorkResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveMeasuresTaskList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportTaskFromWorkDate); /**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO taskFromWorkResult = JSONObject.parseObject(taskFromWorkResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 if(taskFromWorkResult.getObj().getBatchId() != null){ //遍历数据,更改原始表、上报表状态 for (PreventReportCheckTaskFromWork taskFromWork : taskFromWorks) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(taskFromWork.getWorkId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventDangerCheckWorkService.updateWorkReportStatus(handlerReportParam); taskFromWorkService.updateWorkReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(taskFromWorkResult.getObj().getBatchId()); reportBatch.setDataSource("taskFromWork"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportCheckTaskFromWork taskFromWork : taskFromWorks) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(taskFromWork.getWorkId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventDangerCheckWorkService.updateWorkReportStatus(handlerReportParam); taskFromWorkService.updateWorkReportStatus(handlerReportParam); } } /**5、处理 任务-记录 数据*/ logger.info("【【处理 任务-记录 数据】】"); List recordFromTasks = taskRecordService.listReportTaskRecordDate(); //封装上报数据 List reportRecordFromTaskList = BeanCopyUtils.copyBeanList(recordFromTasks, ReportCheckRecordFromTaskDTO.class); //数据上报 String reportRecordFromTaskDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRecordFromTaskList).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer recordFromTaskResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveMeasuresTaskRecordList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportRecordFromTaskDate);/**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO recordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 if (recordFromTaskResult.getObj().getBatchId() != null){ //遍历数据,更改原始表、上报表状态 for (PreventReportCheckRecordFromTask recordFromTask : recordFromTasks) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(recordFromTask.getTaskId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventDangerCheckTaskService.updateTaskReportStatus(handlerReportParam); taskRecordService.updateTaskReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(recordFromTaskResult.getObj().getBatchId()); reportBatch.setDataSource("recordFromTask"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportCheckRecordFromTask recordFromTask : recordFromTasks) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(recordFromTask.getTaskId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventDangerCheckTaskService.updateTaskReportStatus(handlerReportParam); taskRecordService.updateTaskReportStatus(handlerReportParam); } } /**6、处理隐患信息数据*/ logger.info("【【处理隐患信息数据】】"); List dangerInfos = dangerInfoService.listReportDangerDate(); //封装上报数据 List reportDangerInfoLists = BeanCopyUtils.copyBeanList(dangerInfos, ReportDangerInfoDTO.class); //数据上报 String reportDangerInfoDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportDangerInfoLists).toString(), AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); StringBuffer dangerInfoResultBuffer = null; //上报数据 try { URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveDangerInvestigationList"); //得到连接对象 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("Authorization","4348187236"+formatDate.toString()); OutputStream os = con.getOutputStream(); Map paraMap = new HashMap(); paraMap.put("data", reportDangerInfoDate);/**封装数据*/ //组装入参,设置请求体 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(); } ReportResultDTO dangerInfoResult = JSONObject.parseObject(dangerInfoResultBuffer.toString(), ReportResultDTO.class); //todo 条件要改,所有返回值均为200,无法使用 if (dangerInfoResult.getObj().getBatchId() != null){ //遍历数据,更改原始表、上报表状态 for (PreventReportDangerInfo dangerInfo : dangerInfos) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(dangerInfo.getDangerManagerId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); handlerReportParam.setReportTime(date); preventDangerManageService.updateManageReportStatus(handlerReportParam); preventDangerRectifyService.updateRectifyReportStatus(handlerReportParam); dangerInfoService.updateTaskReportStatus(handlerReportParam); //封装返回值BatchId reportBatch.setBatchId(dangerInfoResult.getObj().getBatchId()); reportBatch.setDataSource("dangerInfo"); reportBatch.setBatchTime(date); preventReportBatchService.insertBatchId(reportBatch); } }else { //遍历数据,更改原始表、上报表状态 for (PreventReportDangerInfo dangerInfo : dangerInfos) { HandlerReportParam handlerReportParam = new HandlerReportParam(); //封装数据 handlerReportParam.setId(dangerInfo.getDangerManagerId()); handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode()); handlerReportParam.setReportTime(null); preventDangerManageService.updateManageReportStatus(handlerReportParam); preventDangerRectifyService.updateRectifyReportStatus(handlerReportParam); dangerInfoService.updateTaskReportStatus(handlerReportParam); } } logger.info("【¥¥】上报数据完成..."); } }