Pu Zhibing
2025-06-04 831cc2d574125852a8806e3d357fa1b114ff2d02
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/server/WarnMsgService.java
@@ -215,6 +215,7 @@
      upWarnMsgFileListAckDao.save(upWarnMsgFileListAck);
      //修改报警处理结果
      UPWarnMsgAdptInfo upWarnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(upWarnMsgFileListAck.getInfoId());
      if(upWarnMsgFileListAck.getFileList().size() > 0){
      StringJoiner joiner = new StringJoiner(",");
      upWarnMsgFileListAck.getFileList().forEach(file->{
         if(file.getFileType() == 0x00){
@@ -222,13 +223,14 @@
         }
      });
      upWarnMsgAdptInfo.setPicUrl(joiner.toString());
      }
      upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo);
   }
   
   
   
   /**
    * 定时任务督办报警请求
    * 定时任务督办报警请求和附件请求
    */
   public void taskUrgeTodo() {
      List<UPWarnMsgAdptInfo> list = upWarnMsgAdptInfoDao.findByResultIsAndLevelNotNullAndPushTimeBefore(0x00, LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)));
@@ -237,7 +239,7 @@
         //海康威视直接走接口
         if(25439966 == inferiorPlatformId){
            try {
               if("***".equals(upWarnMsgAdptInfo.getPicUrl())){
               if(!StringUtils.hasLength(upWarnMsgAdptInfo.getPicUrl())){
                  FindPicturesByAlarmIdRequest findPicturesByAlarmIdRequest = new FindPicturesByAlarmIdRequest();
                  findPicturesByAlarmIdRequest.setAlarmId(upWarnMsgAdptInfo.getInfoId());
                  long warnTime = upWarnMsgAdptInfo.getWarnTime();
@@ -259,16 +261,27 @@
                     upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo);
                  }
               }
            }catch (Exception e){
               e.printStackTrace();
            }
         }
         //请求报警附件(川标协议)
         if(enterprise.contains(inferiorPlatformId) && !StringUtils.hasLength(upWarnMsgAdptInfo.getPicUrl())){
            DOWNWarnMsgFileListReq downWarnMsgFileListReq = new DOWNWarnMsgFileListReq();
            downWarnMsgFileListReq.setVehicleNo(upWarnMsgAdptInfo.getVehicleNo());
            downWarnMsgFileListReq.setVehicleColor(upWarnMsgAdptInfo.getVehicleColor());
            downWarnMsgFileListReq.setDataType(DataType.DOWN_WARN_MSG_FILELIST_REQ.getCode());
            downWarnMsgFileListReq.setDataLength(32);
            downWarnMsgFileListReq.setInfoId(upWarnMsgAdptInfo.getInfoId());
            byte[] body = downWarnMsgFileListReq.encode();
            OuterPacket out = new OuterPacket(DataType.DOWN_WARN_MSG.getCode(), inferiorPlatformId, body);
            //获取从链路通道
            Channel channel = ChannelMap.getClientChannel(inferiorPlatformId);
            if (null != channel && channel.isActive()) {
               channel.writeAndFlush(out);
               log.info("报警附件目录请求({}):{}", DataType.DOWN_WARN_MSG_FILELIST_REQ.getCode(), JSON.toJSONString(downWarnMsgFileListReq));
            }
         }
         
         down_warn_msg_urge_todo_req(upWarnMsgAdptInfo);
      }
@@ -357,7 +370,6 @@
               
               //获取报警抓拍图片
               if(data.getPicNum() > 0){
                  upWarnMsgAdptInfo.setPicUrl("***");
                  FindPicturesByAlarmIdRequest findPicturesByAlarmIdRequest = new FindPicturesByAlarmIdRequest();
                  findPicturesByAlarmIdRequest.setAlarmId(data.getAlarmId());
                  long warnTime = upWarnMsgAdptInfo.getWarnTime();