Browse Source

bug更新

minghao-chen 2 years ago
parent
commit
f0b9296e0b

+ 1 - 1
beidou-common/src/main/java/cn/com/taiji/beidou/common/utils/poi/ExcelUtil.java

@@ -762,7 +762,7 @@ public class ExcelUtil<T>
         style.setVerticalAlignment(VerticalAlignment.CENTER);
         Font titleFont = wb.createFont();
         titleFont.setFontName("Arial");
-        titleFont.setFontHeightInPoints((short) 16);
+        titleFont.setFontHeightInPoints((short) 12);
         titleFont.setBold(true);
         style.setFont(titleFont);
         styles.put("title", style);

+ 9 - 1
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/focus/mapper/FocusShipMapper.java

@@ -28,9 +28,10 @@ public interface FocusShipMapper {
     /**
      * 获取详情
      * @param focusId
+     * @param devideNo
      * @return
      */
-    FocusShipResult selectById(Long focusId);
+    FocusShipResult selectById(@Param("devideNo") Long devideNo,@Param("focusId") Long focusId);
 
     /**
      * 列表
@@ -53,4 +54,11 @@ public interface FocusShipMapper {
      * @return
      */
     List<SimpleFocusShipResult> getShipByUserId(@Param("userId") String userId);
+
+    /**
+     * 获取北斗ID
+     * @param focusId
+     * @return
+     */
+    Long getDeviceByFocusId(Long focusId);
 }

+ 2 - 1
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/focus/service/impl/FocusShipServiceImpl.java

@@ -42,7 +42,8 @@ public class FocusShipServiceImpl implements FocusShipService {
 
     @Override
     public FocusShipResult selectById(Long focusId) {
-        return focusShipMapper.selectById(focusId);
+        Long device = focusShipMapper.getDeviceByFocusId(focusId);
+        return focusShipMapper.selectById(device,focusId);
     }
 
     @Override

+ 3 - 2
beidou-ship/src/main/java/cn/com/taiji/beidou/ship/track/domain/ShipTrackResult.java

@@ -10,8 +10,9 @@ import lombok.Data;
 @Data
 public class ShipTrackResult {
 
-    private String id;
-    @Excel(name = "设备编号")
+    @Excel(name = "序号")
+    private String serial;
+
     private String deviceId;
 
     @Excel(name = "发送位置时间")

+ 9 - 1
beidou-ship/src/main/resources/mapper/FocusShipMapper.xml

@@ -71,12 +71,16 @@
     <select id="selectList" parameterType="focusShipReq"  resultMap="focusShipDetail">
         select focus.user_id,focus.focus_id,focus.focus_type,focus.create_time as focus_create,dept.pscmc as dept_name,
         (CASE st.is_online WHEN 'ONLINE' THEN 1 WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 ELSE 1 END ) AS STATUS,
-        location.kwh,location.location,archives.*
+        location.kwh,location.location,
+        IFNULL(dispose_temp.dispose_type,'0') as device_status,
+        archives.*
         from ax_beidou_ship_archives archives
         INNER JOIN ax_beidou_focus_ship focus on archives.devide_no = focus.devide_no
         INNER JOIN ax_beidou_dept dept on archives.police_station_id = dept.pscbh
         LEFT JOIN ax_beidou_ship_status st on st.device_id = focus.devide_no
         LEFT JOIN ax_beidou_ship_location location on focus.devide_no = location.device_id
+        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 1=1
         <if test="shipId != null and shipId != ''">and (archives.ship_id like concat('%', #{shipId},'%') or archives.devide_no like concat('%', #{shipId},'%'))</if>
         <if test="deptId != null and deptId != ''">and dept.xw_dept_id like concat('%',#{deptId},'%')</if>
@@ -97,4 +101,8 @@
         where focus.user_id = #{userId} order by focus.create_time desc
     </select>
 
+    <select id="getDeviceByFocusId" parameterType="long" resultType="long">
+        select devide_no from ax_beidou_focus_ship where focus_id = #{focusId}
+    </select>
+
 </mapper>

+ 3 - 0
beidou-ship/src/main/resources/mapper/ShipArchivesMapper.xml

@@ -137,6 +137,9 @@
         select archives.*,
         (CASE sta.is_online WHEN 'ONLINE' THEN 1  WHEN 'OFFLINE' THEN 2 WHEN 'MARK' THEN 3 END) as status,
         IFNULL(dispose.dispose_type,'0') as device_status,location.kwh as kwh,focus.focus_id as focusId,
+        location.longitude,
+        location.latitude,
+        location.location,
         dept.pscmc as dept_name
         from ax_beidou_ship_archives archives
         LEFT JOIN ax_beidou_ship_status sta ON archives.devide_no = sta.device_id

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

@@ -65,7 +65,7 @@
         </if>
         <if test="isStasis != null and isStasis != ''">
             and st.is_anchor = #{isStasis}
-             and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*1
+             and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*7
         </if>
     </select>
 
@@ -96,7 +96,7 @@
         </if>
         <if test="isStasis != null and isStasis != ''">
             and st.is_anchor = #{isStasis}
-             and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*1
+             and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*7
         </if>
         <if test="shipId != null and shipId != ''">and (archives.ship_id like concat('%', #{shipId},'%') or archives.devide_no like concat('%', #{devideNo},'%'))</if>
         <if test="deptId != null and deptId != ''">and dept.xw_dept_id like concat('%',#{deptId},'%')</if>
@@ -134,7 +134,7 @@
         inner join ax_beidou_dept dept on archives.police_station_id = dept.pscbh
         </if>
         where st.is_anchor='TRUE'
-         and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*1
+         and TIMESTAMPDIFF(MINUTE,st.anchor_change_time,NOW())>24*60*7
         <if test="shipId != null and shipId != ''">and (archives.ship_id like concat('%', #{shipId},'%') or archives.devide_no like concat('%', #{devideNo},'%'))</if>
         <if test="deptId != null and deptId != ''">and dept.xw_dept_id like concat('%',#{deptId},'%')</if>
     </select>

+ 2 - 2
beidou-ship/src/main/resources/mapper/ShipTrackMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="cn.com.taiji.beidou.ship.track.mapper.ShipTrackMapper">
 
     <resultMap type="shipTrackResult" id="shipTrackResult">
-        <id property="id" column="id"/>
+        <result property="serial" column="serial"/>
         <result property="deviceId" column="device_id"/>
         <result property="sendTime" column="send_time"/>
         <result property="longitude" column="longitude"/>
@@ -15,7 +15,7 @@
     </resultMap>
 
     <select id="selectShipTrackDetail" parameterType="shipTrackReq" resultMap="shipTrackResult">
-        select id,device_id,send_time,longitude,latitude,direction,speed from ax_beidou_track track
+        select ROW_NUMBER() over(ORDER BY track.location_time) as serial,device_id,send_time,longitude,latitude,direction,speed from ax_beidou_track track
         where track.device_id = #{deviceId}
         <if test="endTime != null and endTime != ''">and track.location_time &lt; #{endTime}</if>
         <if test="startTime != null and startTime != ''">and track.location_time &gt; #{startTime}</if>

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

@@ -39,7 +39,7 @@
         FROM ax_beidou_warning_record record
         INNER JOIN (select rec.device_id,MAX(UNIX_TIMESTAMP(rec.warning_time)) as `time`,count(rec.device_id) AS num
                     from ax_beidou_warning_record rec
-                    where rec.rule_id = #{ruleId}
+                    where rec.rule_id = #{ruleId} and (rec.`start` is null or rec.`start` != 'false')
                     <if test="startTime != null and startTime != ''">and rec.warning_time &gt; #{startTime}</if>
                     <if test="endTime != null and endTime != ''">and rec.warning_time &lt; #{endTime}</if>
                      GROUP BY rec.device_id) as temp on UNIX_TIMESTAMP(record.warning_time) = temp.time and record.device_id = temp.device_id