Pu Zhibing
2025-06-19 a05b419384e148fc950c77553816a2d05144f4ae
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/server/WarnMsgService.java
@@ -60,9 +60,17 @@
   @Resource
   private UPExgMsgRealLocationDao upExgMsgRealLocationDao;
   //走川标的公司
   private List<Integer> enterprise = Arrays.asList(17458936, 43984060, 13914394);
   //固定报警类型
   private List<Integer> warnType = Arrays.asList(0x0201, 0x0202, 0x0301, 0x000B, 0x0012, 0x0203, 0x0208, 0x0002, 0x0211, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307);
   private List<Integer> enterprise = Arrays.asList(17458936,13914394,43984060,25439966);
   //富临报警类型
   private List<Integer> fl_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0203, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217);
   //均辉报警类型
   private List<Integer> jh_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0203, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307);
   //出租车报警类型
   private List<Integer> cz_warnType = Arrays.asList(0x0001, 0x0005);
   //公交报警类型
   private List<Integer> gj_warnType = Arrays.asList(0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0001);
   //平安报警类型
   private List<Integer> pa_warnType = Arrays.asList(0x0201, 0x0012, 0x0202, 0x0208, 0x0002, 0x0212, 0x0214, 0x0213, 0x0215, 0x0217, 0x0307);
   
   
   public void up_warn_msg(ChannelHandlerContext ctx, OuterPacket out) {
@@ -147,8 +155,31 @@
    */
   public void up_warn_msg_adpt_info(ChannelHandlerContext ctx, int inferiorPlatformId, WarnMsg warnMsg) {
      UPWarnMsgAdptInfo upWarnMsgAdptInfo = enterprise.contains(inferiorPlatformId) ? new UPWarnMsgAdptInfo().decode2(warnMsg) : new UPWarnMsgAdptInfo().decode1(warnMsg);
      if(!warnType.contains(upWarnMsgAdptInfo.getWarnType())){
         return;
      switch (inferiorPlatformId) {
         case 17458936:
            if(!fl_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
         case 43984060:
            if(!jh_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
         case 17235341:
            if(!cz_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
         case 82296583:
            if(!cz_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
         case 25439966:
            if(!gj_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
         case 13914394:
            if(!pa_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               return;
            }
      }
      upWarnMsgAdptInfo.setResult(0x00);
      upWarnMsgAdptInfo.setInferiorPlatformId(inferiorPlatformId);
@@ -215,7 +246,7 @@
      upWarnMsgFileListAck.setInferiorPlatformId(inferiorPlatformId);
      upWarnMsgFileListAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)));
      upWarnMsgFileListAckDao.save(upWarnMsgFileListAck);
      //修改报警处理结果
      //修改报警附件数据
      UPWarnMsgAdptInfo upWarnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(upWarnMsgFileListAck.getInfoId());
      if(upWarnMsgFileListAck.getFileList().size() > 0){
         StringJoiner joiner = new StringJoiner(",");
@@ -225,6 +256,8 @@
            }
         });
         upWarnMsgAdptInfo.setPicUrl(joiner.toString());
      }else{
         upWarnMsgAdptInfo.setPicUrl("*");
      }
      upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo);
   }
@@ -259,7 +292,7 @@
                        String url = jsonObject1.getString("url");
                        joiner.add(url);
                     }
                     upWarnMsgAdptInfo.setPicUrl(joiner.toString());
                     upWarnMsgAdptInfo.setPicUrl(joiner.length() > 0 ? joiner.toString() : "*");
                     upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo);
                  }
               }
@@ -285,7 +318,7 @@
            }
         }
         
         down_warn_msg_urge_todo_req(upWarnMsgAdptInfo);
//         down_warn_msg_urge_todo_req(upWarnMsgAdptInfo);
      }
   }
   
@@ -343,11 +376,21 @@
               }
               upWarnMsgAdptInfo.setInfoId(data.getAlarmId());
               upWarnMsgAdptInfo.setLevel(getLevel(data.getLevel()));
               if(null != data.getLatitude()){
                  upWarnMsgAdptInfo.setLongitude(data.getLatitude().intValue() * 10);
               }
               if(null != data.getLongitude()){
                  upWarnMsgAdptInfo.setLatitude(data.getLongitude().intValue());
//               if(null != data.getLatitude()){
//                  upWarnMsgAdptInfo.setLongitude(data.getLatitude().intValue() * 10);
//               }
//               if(null != data.getLongitude()){
//                  upWarnMsgAdptInfo.setLatitude(data.getLongitude().intValue());
//               }
               //调用获取实时定位数据
               UPExgMsgRealLocation upExgMsgRealLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(upWarnMsgAdptInfo.getVehicleNo());
               if (null != upExgMsgRealLocation) {
                  GnssData gnssData = upExgMsgRealLocation.getGnssData();
                  upWarnMsgAdptInfo.setSpeed(gnssData.getVec1());
                  upWarnMsgAdptInfo.setLongitude(gnssData.getLon());
                  upWarnMsgAdptInfo.setLatitude(gnssData.getLat());
               }else{
                  return;
               }
               if(null != data.getHeight()){
                  upWarnMsgAdptInfo.setAltitude(data.getHeight().intValue() / 10);
@@ -365,7 +408,7 @@
               upWarnMsgAdptInfo.setInfoContent(data.getAlarmInfo());
               upWarnMsgAdptInfo.setInferiorPlatformId(25439966);
               upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)));
               if(!warnType.contains(upWarnMsgAdptInfo.getWarnType())){
               if(!gj_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
                  return;
               }
               upWarnMsgAdptInfo.setResult(0x00);
@@ -391,6 +434,8 @@
                     }
                     upWarnMsgAdptInfo.setPicUrl(joiner.toString());
                  }
               }else{
                  upWarnMsgAdptInfo.setPicUrl("*");
               }
               upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo);