459242451@qq.com 3 years ago
parent
commit
9d99882b25

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/BlackGasController.java

@@ -61,7 +61,7 @@ public class BlackGasController extends BaseController {
         // 组装查询条件
         equalsCondition.put("mmsi", StrUtil.isBlank(shipRecognition.getMmsi()) ? null : StrUtil.concat(true, "*", shipRecognition.getMmsi(), "*"));
         equalsCondition.put("shipName", StrUtil.isBlank(shipRecognition.getShipName()) ? null : StrUtil.concat(true, "*", shipRecognition.getShipName(), "*"));
-        equalsCondition.put("monitorPointName", StrUtil.isBlank(shipRecognition.getMonitorPointName()) ? null : StrUtil.concat(true, "*", shipRecognition.getMonitorPointName(), "*"));
+        equalsCondition.put("monitorPointName", shipRecognition.getMonitorPointName());
         equalsCondition.put("shipRegionType", shipRecognition.getShipRegionType());
         equalsCondition.put("rcgSoot", shipRecognition.getRcgSoots());
         equalsCondition.put("illegalStatus", shipRecognition.getIllegalStatus());

+ 4 - 16
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/GasCommonController.java

@@ -106,16 +106,6 @@ public class GasCommonController {
     @GetMapping("/illegalShipStatic")
     @ApiOperation("获取硫、黑烟超标数量统计")
     public AjaxResult illegalShipStatic() {
-//        Map<String, Object> params = baseEntity.getParams();
-//        if (ObjectUtil.isNotEmpty(params.get("beginTime"))) {
-//            params.put("beginTime", params.get("beginTime") + " 00:00:00");
-//        }
-//        if (ObjectUtil.isNotEmpty(params.get("endTime"))) {
-//            params.put("endTime", params.get("endTime") + " 23:59:59");
-//        }
-//        Map<String, Object> so2RangeCondition = new HashMap<>();
-//        so2RangeCondition.put("createTime", StrUtil.concat(true, "[", Convert.toStr(params.get("beginTime")), ",", Convert.toStr(params.get("endTime")), "]"));
-//        so2RangeCondition.put("peakTime", StrUtil.concat(true, "[", Convert.toStr(params.get("beginTime")), ",", Convert.toStr(params.get("endTime")), "]"));
         Map<String, Object> equalsCondition = new HashMap<>();
         equalsCondition.put("illegalStatus", 2);
         long so2Count = client.count(equalsCondition, null, ElasticConstants.SO2_ALERT, ElasticConstants.AIS_ILLEGAL_SHIP);
@@ -510,12 +500,10 @@ public class GasCommonController {
             Map<String, Object> afterDataMap = so2Service.queryById(id);
 
             // 船舶记录
-            if ("prod".equals(env)) {
-                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                if (shipInfo != null) {
-                    afterDataMap.put("shipName", shipInfo.getShipName());
-                    afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                }
+            AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+            if (shipInfo != null) {
+                afterDataMap.put("shipName", shipInfo.getShipName());
+                afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
             }
             // 判断是否大于阈值
             if (ObjectUtil.isNotEmpty(afterDataMap.get("so2Percent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("so2Percent")), Convert.toBigDecimal(so2ThresholdVal))) {

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/So2Controller.java

@@ -131,6 +131,7 @@ public class So2Controller extends BaseController {
     @GetMapping("/static/device")
     @ApiOperation("设备安装位置统计")
     public AjaxResult deviceStatic() {
+
         if (redisCache.hasKey(CacheConstants.DEVICE_STATIC)) {
             return AjaxResult.success(redisCache.getCacheMap(CacheConstants.DEVICE_STATIC));
         }

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -33,7 +33,7 @@ server:
 # 日志配置
 logging:
   level:
-    com.ruoyi: debug
+    com.ruoyi: info
     org.springframework: warn
 
 # Spring配置

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/AisShipInfo.java

@@ -1,7 +1,9 @@
 package com.ruoyi.system.domain.vo;
 
+import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * @Description: TODO
@@ -11,6 +13,8 @@ import lombok.Data;
  */
 @Data
 @Builder
+@NoArgsConstructor
+@AllArgsConstructor
 public class AisShipInfo {
     /**
      * 船名
@@ -20,4 +24,5 @@ public class AisShipInfo {
      * 船舶类型(0=内河船;1-海船)
      */
     private String shipRegionType;
+
 }

+ 20 - 9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AisInfoServiceImpl.java

@@ -1,15 +1,18 @@
 package com.ruoyi.system.service.impl;
 
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.system.domain.vo.AisShipInfo;
 import com.ruoyi.system.domain.vo.ShipEepReportRecInfo;
 import com.ruoyi.system.service.IAisInfoService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -32,8 +35,9 @@ public class AisInfoServiceImpl implements IAisInfoService {
     private String shipEepReportRecInfoUrl;
     @Value("${third.shipBaseInfo}")
     private String shipBaseInfo;
-    @Value("${third.shipDynamicInfo}")
-    private String shipDynamicInfo;
+
+    @Autowired
+    private RedisCache redisCache;
 
     /**
      * 获取船舶进出港记录
@@ -57,7 +61,7 @@ public class AisInfoServiceImpl implements IAisInfoService {
             try {
                 String para = HttpUtil.toParams(params);
                 String getResult = HttpUtil.get(shipEepReportRecInfoUrl + "?" + para);
-                log.info("入参:{},获取进出港数据:{}", para, getResult);
+                log.debug("入参:{},获取进出港数据:{}", para, getResult);
                 JSONObject jsonObject = JSON.parseObject(getResult);
                 if (jsonObject != null && 200 == jsonObject.getInteger("code")) {
                     JSONArray result = jsonObject.getJSONArray("result");
@@ -76,23 +80,30 @@ public class AisInfoServiceImpl implements IAisInfoService {
 
     @Override
     public AisShipInfo getShipInfo(String shipnameCn, String mmsi, String shipId, String shipNo) {
-        log.info("当前环境:{}", profile);
+        log.debug("当前环境:{}", profile);
         if ("prod".equals(profile) && StrUtil.isNotBlank(mmsi) && mmsi.length() == 9) {
+            // 先从缓存找
+            AisShipInfo baseInfo = redisCache.getCacheMapValue("ais:base", mmsi);
+            if (ObjectUtil.isNotEmpty(baseInfo)) {
+                return baseInfo;
+            }
+
             Map<String, Object> params = new HashMap<>();
-//            params.put("shipnameCn", shipnameCn);
             params.put("mmsi", mmsi);
-//            params.put("shipId", shipId);
-//            params.put("shipNo", shipNo);
             try {
                 String url = shipBaseInfo + "?" + HttpUtil.toParams(params);
                 String getResult = HttpUtil.get(url);
-                log.info("调用地址:{}。获取船舶数据:{}", url, getResult);
+                log.debug("调用地址:{}。获取船舶数据:{}", url, getResult);
                 JSONObject jsonObject = JSON.parseObject(getResult);
                 if (jsonObject != null && 200 == jsonObject.getInteger("code")) {
                     JSONArray result = jsonObject.getJSONArray("data");
                     if (result != null && !result.isEmpty()) {
                         Map<String, String> stringStringMap = Convert.toMap(String.class, String.class, result.get(0));
-                        return AisShipInfo.builder().shipName(stringStringMap.get("shipnameCn")).shipRegionType(stringStringMap.get("shipRegionType")).build();
+                        AisShipInfo build = AisShipInfo.builder().shipName(stringStringMap.get("shipnameCn")).shipRegionType(stringStringMap.get("shipRegionType")).build();
+                        if (StrUtil.isNotBlank(stringStringMap.get("shipnameCn"))) {
+                            redisCache.setCacheMapValue("ais:base", mmsi, build);
+                        }
+                        return build;
                     }
                 }
             } catch (Exception e) {

+ 2 - 2
ruoyi-ui/src/components/map/index.vue

@@ -442,8 +442,8 @@ export default {
 
       d_activeName: 'd_first',
       tableData: {minor: [], main: []},
-      addrlist: [{name: "南京四桥", location: [1, 1]}],
-      caddr: "南京四桥",
+      addrlist: [],
+      caddr: "",
       cselect: [],
       shipShow: false,
       shipdata: {},

+ 7 - 21
ruoyi-ui/src/views/components/table/liuTable.vue

@@ -10,7 +10,8 @@
           <el-date-picker
             v-model="queryParams.startTime"
             type="date"
-            placeholder="选择日期">
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd">
           </el-date-picker>
         </el-col>
         <el-col :span="2">
@@ -21,7 +22,8 @@
           <el-date-picker
             v-model="queryParams.endTime"
             type="date"
-            placeholder="选择日期">
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd">
           </el-date-picker>
         </el-col>
         <el-col :span="2">
@@ -407,23 +409,7 @@ export default {
         value: '选项2',
         label: '已处置'
       }],
-      tableData: [{
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }, {
-        date: '2016-05-04',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1517 弄'
-      }, {
-        date: '2016-05-01',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1519 弄'
-      }, {
-        date: '2016-05-03',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1516 弄'
-      }]
+      tableData: []
     }
   },
   // mounted() {
@@ -472,8 +458,8 @@ export default {
       var dateRange = '';
       if (this.queryParams.startTime != undefined && this.queryParams.startTime != "" && this.queryParams.endTime != undefined && this.queryParams.endTime != "") {
         dateRange = [];
-        dateRange.push(this.queryParams.startTime.toJSON().split("T")[0]);
-        dateRange.push(this.queryParams.endTime.toJSON().split("T")[0]);
+        dateRange.push(this.queryParams.startTime);
+        dateRange.push(this.queryParams.endTime);
       }
 
 

+ 22 - 12
ruoyi-ui/src/views/components/table/xtTable.vue

@@ -11,7 +11,8 @@
           <el-date-picker
             v-model="queryParams.beginTime"
             type="date"
-            placeholder="选择日期时间">
+            placeholder="选择日期时间"
+            value-format="yyyy-MM-dd">
           </el-date-picker>
         </el-col>
         <el-col :span="2">
@@ -22,7 +23,8 @@
           <el-date-picker
             v-model="queryParams.endTime"
             type="date"
-            placeholder="选择日期时间">
+            placeholder="选择日期时间"
+            value-format="yyyy-MM-dd">
           </el-date-picker>
         </el-col>
         <el-col :span="2">
@@ -75,14 +77,14 @@
           </el-form-item>
         </el-col>
         <el-col :span="3">
-          <el-input
-            v-model="queryParams.monitorPointName"
-            placeholder="请输入抓拍地点"
-            clearable
-            size="small"
-
-            @keyup.enter.native="handleQuery"
-          />
+          <el-select v-model="queryParams.monitorPointName" clearable placeholder="请选择抓拍地点">
+            <el-option
+              v-for="item in jianceOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue">
+            </el-option>
+          </el-select>
         </el-col>
 
         <el-col :span="2">
@@ -258,6 +260,7 @@ style="width:20rem;height:20rem;display:inline-block;margin-right:10px"
 
 <script>
 import {getBlackList} from "@/api/data/blackData";
+import {getDicts} from "@/api/system/dict/data";
 
 export default {
   name: "xtTable",
@@ -318,13 +321,20 @@ export default {
           label: '5'
         }
       ],
+      jianceOptions: [],
       tableData: []
     }
   },
   created() {
     this.getBlackList();
+    this.getDicts();
   },
   methods: {
+    getDicts() {
+      getDicts('heiyan_snap_pos').then(data => {
+        this.jianceOptions = data.data
+      });
+    },
     getBlackList() {
       // console.log('1'+this.queryParams);
       this.loading = true;
@@ -333,8 +343,8 @@ export default {
       var dateRange = '';
       if (this.queryParams.beginTime != undefined && this.queryParams.beginTime != "" && this.queryParams.endTime != undefined && this.queryParams.endTime != "") {
         dateRange = [];
-        dateRange.push(this.queryParams.beginTime.toJSON().split("T")[0]);
-        dateRange.push(this.queryParams.endTime.toJSON().split("T")[0]);
+        dateRange.push(this.queryParams.beginTime);
+        dateRange.push(this.queryParams.endTime);
       }
 
       getBlackList(this.addDateRange(this.queryParams, dateRange)).then(response => {

+ 2 - 2
ruoyi-ui/src/views/home.vue

@@ -106,8 +106,8 @@
       </div>
     </div>
     <div style="position: absolute;right: 0;color: #3FC9FD;top: 28rem;font-size: 9rem;">
-      <div style="display: inline-block;margin-right:6rem"><a target="view_window" :href="gosubsys('http://198.17.188.56:82','admin','111111',1)"><img style="width:20px;vertical-align: middle;margin-right:2px"
-                                                                                                                                                       src="../assets/images/txsb_selected@2x.png"/>光谱</a></div>
+      <div style="display: inline-block;margin-right:6rem"><a target="view_window" :href="gosubsys('http://198.17.188.56:9020/door','manager','admin123',1)"><img style="width:20px;vertical-align: middle;margin-right:2px"
+                                                                                                                                                                  src="../assets/images/txsb_selected@2x.png"/>光谱</a></div>
       <div
         style="display: inline-block;margin-right:6rem"><a target="view_window" :href="gosubsys('http://198.17.188.2:83/index.html','js_admin','js@123456',1)"><img style="width:20px;vertical-align: middle;margin-right:2px"
                                                                                                                                                                     src="../assets/images/gpsb@2x.png"/>嗅探</a></div>