Browse Source

fix获取实时信息

songzhengming 3 months ago
parent
commit
559a9334b4

+ 4 - 1
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/controller/BoatController.java

@@ -17,6 +17,7 @@ import com.shanghaichengdi.ghjgitem.vo.response.ResultRes;
 import com.shanghaichengdi.ghjgitem.vo.response.ReturnMsg;
 import java.text.ParseException;
 import java.util.List;
+import java.util.Map;
 import javax.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -59,7 +60,9 @@ public class BoatController extends CommonController {
       return ReturnMsg.error(HttpStatus.BAD_REQUEST, "key值有误,请确认您输入的key值正确!");
     }
     String paramJsonData = getParamJsonData(vo.getData());
-    JSONArray mmsiList = JSONArray.parseArray(paramJsonData);
+    AISRealTimeVo aisRealTimeVo = JSONObject.parseObject(paramJsonData,
+            AISRealTimeVo.class);
+    List<String> mmsiList = aisRealTimeVo.getMmsi();
     if(mmsiList.size()>100){
       throw new EnumException("查询条数不得超过100");
     }

+ 1 - 1
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/mapper/CommonMapper.java

@@ -55,5 +55,5 @@ public interface CommonMapper {
 
   List<String> selectPdPortDrawPicture(PortDrawReq portDrawReq);
 
-  List<BoatAISVo> selectAisRealTimePointList(JSONArray mmsiList);
+  List<BoatAISVo> selectAisRealTimePointList(List mmsiList);
 }

+ 1 - 1
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/service/CommonService.java

@@ -46,5 +46,5 @@ public interface CommonService {
 
     List<String> getPortDrawPicture(PortDrawReq portDrawReq);
 
-  List<BoatAISVo> selectAisRealTimePointList(JSONArray mmsiList);
+  List<BoatAISVo> selectAisRealTimePointList(List mmsiList);
 }

+ 1 - 1
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/service/impl/CommonServiceImpl.java

@@ -45,7 +45,7 @@ public class CommonServiceImpl implements CommonService {
 
 
     @Override
-    public List<BoatAISVo> selectAisRealTimePointList(JSONArray mmsiList) {
+    public List<BoatAISVo> selectAisRealTimePointList(List mmsiList) {
         return mapper.selectAisRealTimePointList(mmsiList);
 
     }

+ 11 - 0
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/vo/AISRealTimeVo.java

@@ -0,0 +1,11 @@
+package com.shanghaichengdi.ghjgitem.vo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class AISRealTimeVo {
+
+    public List<String> mmsi;
+
+}