Browse Source

优化二维码系统兼容
优化巡检点位上报异常问题
优化实时监控设备查询异常问题

linzhiwei 2 years ago
parent
commit
28727062ff

+ 4 - 0
snws-gps/snws-gps-api/src/main/java/com/tofly/pojo/plan/PlanFactory.java

@@ -68,6 +68,10 @@ public class PlanFactory extends Model<PlanFactory> {
     @ApiModelProperty(value = "设备id")
     private Long deviceId;
 
+    @ApiModelProperty(value = "设备名称")
+    @TableField(exist = false)
+    private String deviceName;
+
     @ApiModelProperty(value = "设备类型")
     private Long deviceType;
     @TableField(exist = false)

+ 2 - 0
snws-gps/snws-gps-api/src/main/java/com/tofly/pojo/plan/dto/PlanDeviceDTO.java

@@ -17,6 +17,8 @@ public class PlanDeviceDTO {
     private String belongStationName;
     @ApiModelProperty(value = "泵站名称(模糊查询)")
     private String belongPumpName;
+    @ApiModelProperty(value = "设备名称(模糊查询)")
+    private String deviceName;
     @ApiModelProperty(value = "巡检状态(是否到位/维护 0否 1是)")
     private String isOver;
     @ApiModelProperty(value = "污水厂id")

+ 5 - 2
snws-gps/snws-gps-boot/src/main/java/com/tofly/gpsboot/service/es/impl/GpsUploadServiceImpl.java

@@ -97,8 +97,11 @@ public class GpsUploadServiceImpl implements IGpsUploadService {
     @Override
     public Page<List<GpsUpload>> getPageGpsInfo(Page page, EsQueryDto dto) {
         GpsUpload gpsUpload = new GpsUpload();
-        QueryBuilder[] queryBuilders = EsQueryUtil.putQUery(page, dto);
-        return gpsUploadRepository.getPage(gpsUpload, page, queryBuilders);
+        Page pagen = new Page();
+        pagen.setCurrent(page.getCurrent());
+        pagen.setSize(page.getSize());
+        QueryBuilder[] queryBuilders = EsQueryUtil.putQUery(pagen, dto);
+        return gpsUploadRepository.getPage(gpsUpload, pagen, queryBuilders);
     }
 
     @Override

+ 12 - 0
snws-gps/snws-gps-boot/src/main/resources/mapper/plan/PlanFactoryMapper.xml

@@ -39,9 +39,15 @@
         <association property="inspectTypeName" column="INSPECT_TYPE_ID"
                      select="com.tofly.gpsboot.mapper.plan.InspecttypeMapper.getInspectTypeName"/>
         <association property="device" column="DEVICE_Id" select="getDeviceInfo"/>
+        <association property="deviceName" column="DEVICE_Id" select="getDeviceName"/>
         <association property="stationSiteInfo" column="FACTORY_ID" select="getStationSiteInfo"/>
     </resultMap>
 
+    <select id="getDeviceName" resultType="string">
+        select name
+        from tf_ywpn_monitor_device_w
+        where id = #{deviceId}
+    </select>
     <select id="getBelongPumpName" resultType="string">
         select name
         from tf_monitor_pump_station_w
@@ -109,6 +115,9 @@
         <if test="dto.category != null ">
             and t1.category =#{dto.category}
         </if>
+        <if test="dto.deviceName != null ">
+            and t1.name like CONCAT ('%',#{dto.deviceName,jdbcType=VARCHAR},'%')
+        </if>
         <if test="dto.belongStationId != null ">
             and t1.belong_station_id =#{dto.belongStationId}
         </if>
@@ -152,6 +161,9 @@
         <if test="dto.category != null ">
             and t1.category =#{dto.category}
         </if>
+        <if test="dto.deviceName != null ">
+            and t1.name like CONCAT ('%',#{dto.deviceName,jdbcType=VARCHAR},'%')
+        </if>
         <if test="dto.belongStationId != null ">
             and t1.belong_station_id =#{dto.belongStationId}
         </if>

+ 1 - 1
snws-gps/snws-gps-boot/src/main/resources/mapper/plan/PlanchildtypeMapper.xml

@@ -15,7 +15,7 @@
         <result property="userId" column="USER_ID"/>
         <result property="overLength" column="OVER_LENGTH"/>
         <result property="totalLength" column="TOTAL_LENGTH"/>
-        <association property="typeName" column="TYPE_ID" select="com.tofly.gpsboot.mapper.plan.PlantypeMapper.getTypeName"/>
+        <association property="typeName" column="TYPE_ID" select="com.tofly.gpsboot.mapper.plan.PlantypeMapper.getInspectTypeName"/>
         <association property="userIdName" column="USER_ID"
                      select="com.tofly.gpsboot.mapper.plan.HydrantrecordMapper.getRealName"/>
     </resultMap>

+ 4 - 1
snws-gps/snws-gps-boot/src/main/resources/mapper/plan/PlantypeMapper.xml

@@ -14,6 +14,9 @@
         <result property="overLength" column="OVER_LENGTH"/>
         <result property="totalLength" column="TOTAL_LENGTH"/>
         <result property="leakageRate" column="LEAKAGE_RATE"/>
-        <association property="typeName" column="TYPE_ID" select="com.tofly.gpsboot.mapper.plan.InspecttypeMapper.getInspectTypeName"/>
+        <association property="typeName" column="TYPE_ID" select="getInspectTypeName"/>
     </resultMap>
+    <select id="getInspectTypeName" resultType="string">
+        select name from TF_YWPN_INSPECTTYPE_W where ID = #{id}
+    </select>
 </mapper>

+ 2 - 2
snws-monitor/snws-monitor-boot/src/main/java/com/tofly/monitor/util/PdfUtil.java

@@ -87,7 +87,7 @@ public class PdfUtil {
     public static void imagesToPdf(String fileName, String imagesPath, Qrcode qrcode) {
         try {
             if(!fileName.endsWith(".pdf")){
-                fileName = imagesPath + "\\" + fileName + ".pdf";
+                fileName = imagesPath + File.separator + fileName + ".pdf";
             }
             File file = new File(fileName);
             if (!file.getParentFile().exists()) {
@@ -121,7 +121,7 @@ public class PdfUtil {
                         || images.get(i).toLowerCase().endsWith(".jpeg")
                         || images.get(i).toLowerCase().endsWith(".gif")
                         || images.get(i).toLowerCase().endsWith(".png")) {
-                    String temp = imagesPath + "\\" + images.get(i);
+                    String temp = imagesPath + File.separator + images.get(i);
                     Image img = Image.getInstance(temp);
                     PdfPCell cell = new PdfPCell();
                     cell.addElement(img);