| | |
| | | import com.ruoyi.project.tr.specialCheck.domin.DTO.SpecialCheckItemDangerLogReportDTO;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.DTO.SpecialCheckTaskLogReportDTO;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckScoreAndDangerLog;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog;
|
| | | import com.ruoyi.project.tr.specialCheck.mapper.*;
|
| | | import org.apache.commons.lang3.ObjectUtils;
|
| | |
| | | private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
| | |
|
| | | @Autowired
|
| | | private TbSpecialCheckItemDangerLogMapper itemDangerLogMapper;
|
| | | private TbSpecialCheckItemLogMapper itemLogMapper;
|
| | |
|
| | | @Autowired
|
| | | private TbSpecialCheckScoreAndDangerLogMapper scoreAndDangerLogMapper;
|
| | |
|
| | | String token = "GT6gGJV7JV";
|
| | | String key = "Bv+NeBolwqg2Pbc1yVwrZA==";
|
| | |
| | | * */
|
| | | System.out.println("【2】检查项与隐患上报-处理数据...");
|
| | | // List<TbSpecialCheckTaskLog> CJRiskAnaUnits = .listReportUnitDate();
|
| | | List<TbSpecialCheckItemDangerLog> itemDangerLogLists = itemDangerLogMapper.listItemDangerReportTask();
|
| | | if (ObjectUtils.isNotEmpty(itemDangerLogLists)){
|
| | | List<TbSpecialCheckScoreAndDangerLog> scoreAndDangerLogs = scoreAndDangerLogMapper.listScoreAndDangerLogReportList();
|
| | | if (ObjectUtils.isNotEmpty(scoreAndDangerLogs)){
|
| | | //封装上报数据,时间格式化
|
| | | List<SpecialCheckItemDangerLogReportDTO> list = new ArrayList<>();
|
| | |
|
| | | for (TbSpecialCheckItemDangerLog itemDangerLog : itemDangerLogLists) {
|
| | | SpecialCheckItemDangerLogReportDTO specialCheckItemDangerLogReportDTO = BeanCopyUtils.copyBean(itemDangerLog, SpecialCheckItemDangerLogReportDTO.class);
|
| | | specialCheckItemDangerLogReportDTO.setCreateDate(dateFormat.format(itemDangerLog.getCreateDate()));
|
| | | specialCheckItemDangerLogReportDTO.setUpdateDate(dateFormat.format(itemDangerLog.getUpdateDate()));
|
| | | specialCheckItemDangerLogReportDTO.setCheckDate(dateFormatCheckData.format(itemDangerLog.getCheckDate()));
|
| | | specialCheckItemDangerLogReportDTO.setDeleted(itemDangerLog.getDeleted().toString());
|
| | | for (TbSpecialCheckScoreAndDangerLog scoreAndDangerLog : scoreAndDangerLogs) {
|
| | | SpecialCheckItemDangerLogReportDTO specialCheckItemDangerLogReportDTO = BeanCopyUtils.copyBean(scoreAndDangerLog, SpecialCheckItemDangerLogReportDTO.class);
|
| | | specialCheckItemDangerLogReportDTO.setCreateDate(dateFormat.format(scoreAndDangerLog.getCreateDate()));
|
| | | specialCheckItemDangerLogReportDTO.setUpdateDate(dateFormat.format(scoreAndDangerLog.getUpdateDate()));
|
| | | specialCheckItemDangerLogReportDTO.setCheckDate(dateFormatCheckData.format(scoreAndDangerLog.getCheckDate()));
|
| | | specialCheckItemDangerLogReportDTO.setDeleted(scoreAndDangerLog.getDeleted().toString());
|
| | | list.add(specialCheckItemDangerLogReportDTO);
|
| | | }
|
| | | // logger.info("【【原始数据】】" + JSONObject.toJSONString(list));
|
| | |
| | | logger.info("【检查项与隐患】数据上报结果:" + CJOverhaulLogResult.getCode());
|
| | | //设置所有数据上报成功
|
| | | if (CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCCESS.getCode()) || CJOverhaulLogResult.getCode().equals(CJReportEnum.SUCESS_AND_FAIL.getCode())){
|
| | | for (TbSpecialCheckItemDangerLog itemDangerLo : itemDangerLogLists) {
|
| | | for (TbSpecialCheckScoreAndDangerLog itemDangerLo : scoreAndDangerLogs) {
|
| | | HandlerSpecialCheckReportParam handlerCJReportParam = new HandlerSpecialCheckReportParam();
|
| | | //封装数据
|
| | | handlerCJReportParam.setId(itemDangerLo.getId());
|
| | | handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode());
|
| | | handlerCJReportParam.setReportTime(nowDate);
|
| | | itemDangerLogMapper.updateItemDangerReportStatusById(handlerCJReportParam);
|
| | | scoreAndDangerLogMapper.updateItemDangerReportStatusById(handlerCJReportParam);
|
| | | }
|
| | | }
|
| | | //设置上报失败的数据,上报失败
|
| | |
| | | handlerCJReportParam.setId(failId);
|
| | | handlerCJReportParam.setReportStatus(SyncEnum.SYNC_EXEC_FAIL.getCode());
|
| | | handlerCJReportParam.setReportTime(nowDate);
|
| | | itemDangerLogMapper.updateItemDangerReportStatusById(handlerCJReportParam);
|
| | | scoreAndDangerLogMapper.updateItemDangerReportStatusById(handlerCJReportParam);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | // logger.info("【1】安全风险分析单元-数据处理完成");
|