Browse Source

增加船舶档案与其他列表位置信息

liangjianf 2 years ago
parent
commit
663090a089

+ 1 - 0
beidou-admin/src/main/java/cn/com/taiji/beidou/web/controller/system/SysLoginController.java

@@ -43,6 +43,7 @@ public class SysLoginController
      * @param loginBody 登录信息
      * @return 结果
      */
+    @ApiOperation("用户名密码登录")
     @PostMapping("/login")
     public AjaxResult login(@RequestBody LoginBody loginBody)
     {

+ 3 - 0
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/archives/domain/ShipArchivesData.java

@@ -114,4 +114,7 @@ public class ShipArchivesData {
     private String deviceStatus;
 
     private String kwh;
+
+    @ApiModelProperty("位置")
+    private String location;
 }

+ 5 - 1
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/archives/service/impl/ShipArchivesServiceImpl.java

@@ -42,7 +42,11 @@ public class ShipArchivesServiceImpl implements ShipArchivesService {
 
     @Override
     public ShipArchivesData findShipById(String devideNo) {
-        return shipArchivesMapper.selectById(devideNo);
+        ShipArchivesData data = shipArchivesMapper.selectById(devideNo);
+        if(null==data.getLastStatus()){
+            data.setLastStatus(1);
+        }
+        return data;
     }
 
     @Override

+ 2 - 0
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/warning/record/domain/WarningRecordListResult.java

@@ -23,6 +23,8 @@ public class WarningRecordListResult {
     private String warningTime;
     @ApiModelProperty("预警详情,暂时没数据")
     private String warningDetail;
+    @ApiModelProperty("位置信息")
+    private String location;
     private String modelCode;
 
     @ApiModelProperty("处置ID 空为未读")

+ 14 - 5
beidou-ship/src/main/resources/mapper/ShipArchivesMapper.xml

@@ -26,6 +26,7 @@
         <result property="locationTime"    column="location_time"    />
         <result property="longitude"    column="longitude"    />
         <result property="latitude"    column="latitude"    />
+        <result property="location"    column="location"    />
         <result property="kwh" column="kwh"/>
     </resultMap>
 
@@ -106,13 +107,21 @@
     
     
     <select id="selectShipArchivesList" parameterType="shipArchivesREQ" resultMap="ShipResult">
-        select archives.*,(CASE sta.is_online WHEN 'ONLINE' THEN 1  WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 END) as status,
-        <!--dispose_temp.dispose_type as device_status,-->
-        dept.pscmc as dept_name,location.longitude,location.latitude
-        from ax_beidou_ship_archives archives
+        SELECT
+        archives.*,
+        ( CASE sta.is_online WHEN 'ONLINE' THEN 1 WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 ELSE 1 END ) AS STATUS,
+        ( CASE ISNULL(disp.dispose_type) WHEN 0 THEN disp.dispose_type WHEN 1 THEN 1 END) AS device_status,
+        dept.pscmc AS dept_name,
+        location.longitude,
+        location.latitude,
+        location.location,
+        location.kwh
+        FROM
+        ax_beidou_ship_archives archives
         LEFT JOIN ax_beidou_ship_status sta ON archives.devide_no = sta.device_id
         INNER JOIN ax_beidou_dept dept ON archives.police_station_id = dept.pscbh
-        LEFT JOIN ax_beidou_ship_location location on archives.devide_no = location.device_id
+        LEFT JOIN ax_beidou_ship_location location ON archives.devide_no = location.device_id
+        LEFT JOIN ax_beidou_ship_dispose disp ON archives.devide_no = disp.devide_no
         <!--LEFT JOIN (select devide_no,max(id) as id from ax_beidou_ship_dispose GROUP BY devide_no) as dispose on dispose.devide_no = archives.devide_no
         LEFT JOIN ax_beidou_ship_dispose dispose_temp on dispose.id = dispose_temp.id-->
         where

+ 3 - 1
beidou-ship/src/main/resources/mapper/WarningRecordMapper.xml

@@ -22,7 +22,8 @@
         SELECT record.id, archives.devide_no AS devideNo, archives.ship_id AS shipId,
         archives.owner_name AS ownerName, archives.owner_tel_no AS ownerTelNo,
         record.model_code as modelCode,area.name as warningDetail,
-        record.warning_time AS warningTime, dis.id AS disposeId ,temp.num as num
+        record.warning_time AS warningTime, dis.id AS disposeId ,temp.num as num,
+        location.location
         FROM ax_beidou_warning_record record
         INNER JOIN (select rec.device_id,MAX(rec.id) as id,count(rec.device_id) AS num
                     from ax_beidou_warning_record rec
@@ -33,6 +34,7 @@
         INNER JOIN ax_beidou_ship_archives archives ON archives.devide_no = record.device_id
         LEFT JOIN ax_beidou_ship_dispose dis ON record.id = dis.warning_id
         LEFT JOIN ax_beidou_warning_area area ON area.id = record.area_id
+        LEFT JOIN ax_beidou_ship_location location ON location.device_id = record.device_id
         <if test="deptId != null and deptId != ''">
         INNER JOIN ax_beidou_dept dept ON archives.police_station_id = dept.pscbh
         </if>