Pu Zhibing
2025-07-18 fdfa8b3b237d8bba8964bda67364f54c08d79432
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java
@@ -97,17 +97,21 @@
         warn.setWarnNumber(1);
         warn.setSpeed(null == vo.getSpeed() ? BigDecimal.ZERO : new BigDecimal(vo.getSpeed()));
         if(null != vo.getLongitude() && 0 != vo.getLongitude()){
            warn.setLongitude(new BigDecimal(vo.getLongitude()).divide(new BigDecimal(1000000)).toString());
            String s = vo.getLongitude().toString();
            warn.setLongitude(s.substring(0, 3) + "." + s.substring(3));
         }
         if(null != vo.getLatitude() && 0 != vo.getLatitude()){
            warn.setLatitude(new BigDecimal(vo.getLatitude()).divide(new BigDecimal(1000000)).toString());
            String s = vo.getLatitude().toString();
            warn.setLatitude(s.substring(0, 2) + "." + s.substring(2));
            Map<String, String> geocode = null;
            try {
               geocode = GDMapGeocodingUtil.geocode(warn.getLongitude(), warn.getLatitude());
            } catch (Exception e) {
               e.printStackTrace();
            }
            warn.setAddress(geocode.get("address"));
            if(null != geocode){
               warn.setAddress(geocode.get("address"));
            }
         }
         switch (vo.getResult()) {
            case 0x00:
@@ -193,8 +197,14 @@
   public void taskUpdateWarnStatus() {
      List<Warn> warnList = this.list(new LambdaQueryWrapper<Warn>().eq(Warn::getTreatmentState, "处理中"));
      for (Warn warn : warnList) {
         if(null == warn.getObjectId()){
            continue;
         }
         UPWarnMsgAdptInfoVo vo = upWarnMsgAdptInfoClient.findByInfoId(warn.getObjectId()).getData();
         if (null != vo && null != warn && vo.getResult() != 0x00) {
         if(null == vo){
            continue;
         }
         if (null != warn && vo.getResult() != 0x00) {
            switch (vo.getResult()) {
               case 0x00:
                  warn.setTreatmentState("处理中");
@@ -213,7 +223,7 @@
         if(null == warn.getPicUrl()){
            warn.setPicUrl(vo.getPicUrl());
         }
         if(0x00 != vo.getResult() && null == warn.getTreatmentTime()){
         if(0x00 != vo.getResult()){
            UPWarnMsgOperationInfoVo upWarnMsgOperationInfoVo = upWarnMsgOperationInfoClient.getUPWarnMsgOperationInfo(warn.getObjectId()).getData();
            if(null != upWarnMsgOperationInfoVo){
               warn.setTreatmentUser(upWarnMsgOperationInfoVo.getOperator());