浏览代码

* 施工实时坐标补充

chen.cheng 4 月之前
父节点
当前提交
361db18d5a

+ 26 - 1
bd-park/park-backend/park-application/src/main/java/com/huashe/park/application/web/controller/cons/ConsPileHoleInfoController.java

@@ -20,9 +20,11 @@ import org.springframework.web.bind.annotation.RestController;
 import com.huashe.common.domain.AjaxResult;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.core.service.IMachineProcessService;
+import com.huashe.park.core.service.IPileMachineInfoService;
 import com.huashe.park.domain.dto.cons.PileRealtimeIndex;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.PileMachineInfo;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -44,6 +46,9 @@ public class ConsPileHoleInfoController extends BaseController {
     @Autowired
     private IMachineProcessService machineProcessService;
 
+    @Autowired
+    private IPileMachineInfoService machineInfoService;
+
     /**
      * 查询施工桩点信息列表
      */
@@ -64,12 +69,32 @@ public class ConsPileHoleInfoController extends BaseController {
     }
 
     @PreAuthorize("@ss.hasPermi('cons:pileHoleInfo:list')")
+    @GetMapping("/list/realtime/index/{pileHoleId}")
+    public AjaxResult pileHoleIndex(@PathVariable("pileHoleId") Long pileHoleId) {
+        List<PileRealtimeIndex> pileRealtimeIndices = consPileHoleInfoService
+            .selectConsPileHoleRealtimeIndex(new ConsPileHoleInfo() {
+                {
+                    setId(pileHoleId);
+                }
+            });
+        if (ObjectUtils.isEmpty(pileRealtimeIndices)) {
+            return AjaxResult.success();
+        }
+        PileRealtimeIndex pileRealtimeIndex = pileRealtimeIndices.get(0);
+        PileMachineInfo pileMachineInfo = machineInfoService
+            .selectPileMachineInfoById(pileRealtimeIndex.getMachineId());
+        pileRealtimeIndex.setPileMachineInfo(pileMachineInfo);
+
+        return AjaxResult.success(pileRealtimeIndex);
+    }
+
+    @PreAuthorize("@ss.hasPermi('cons:pileHoleInfo:list')")
     @GetMapping("/list/his/index")
     public AjaxResult listHisIndex(ConsPileHoleInfo consPileHoleInfo) {
         ConsPileHoleInfo consPileHoleInfoDb = consPileHoleInfoService
             .selectConsPileHoleInfoById(consPileHoleInfo.getId());
         List<MachineProcess> machineProcesses = new ArrayList<>();
-        if (ObjectUtils.isEmpty(consPileHoleInfo)) {
+        if (ObjectUtils.isNotEmpty(consPileHoleInfo)) {
             machineProcesses = machineProcessService.selectMachineProcessList(new MachineProcess() {
                 {
                     setPileId(consPileHoleInfoDb.getByteId());

+ 7 - 0
bd-park/park-backend/park-application/src/main/resources/application.yml

@@ -30,6 +30,13 @@ server:
       max: 800
       # Tomcat启动初始化的线程数,默认值10
       min-spare: 100
+  compression:
+    ## 开启服务端的报文压缩
+    enabled: true
+    ## 只压缩响应类型为application/json的报文
+    mime-types: application/json
+    ## 触发压缩报文的最小响应体大小,默认2048字节(2KB)
+    min-response-size: 2048
 
 # 日志配置
 logging:

+ 6 - 2
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java

@@ -57,6 +57,10 @@ public class MachineRealtimeEventListener {
         pileHoleIndexRealtime.setSprayVolume(event.getMessage().getSprayVolume());
         pileHoleIndexRealtime.setVerticalDeviation(event.getMessage().getVerticalAngle());
         pileHoleIndexRealtime.setStatus(CONS_STATUS_02.getCode());
+        pileHoleIndexRealtime.setRealLat(event.getMessage().getLatitude());
+        pileHoleIndexRealtime.setRealLng(event.getMessage().getLongitude());
+        pileHoleIndexRealtime.setRealX(event.getMessage().getRealX());
+        pileHoleIndexRealtime.setRealY(event.getMessage().getRealY());
         int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
         if (!(cnt > 0)) {
             String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getDataTime());
@@ -66,8 +70,8 @@ public class MachineRealtimeEventListener {
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
             {
                 setId(pileMachineInfo.getId());
-                setLat(consPileHoleInfo.getLat());
-                setLng(consPileHoleInfo.getLng());
+                setLat(event.getMessage().getLatitude());
+                setLng(event.getMessage().getLongitude());
                 setStatus(MachineStatus.MACHINE_STATUS_00.getCode());
             }
         });

+ 6 - 1
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsPileHoleInfoMapper.xml

@@ -68,7 +68,12 @@
         cphir.end_time,
         cphir.status,
         cphir.tilt_angle,
-        cphir.forward_tilt_angle
+        cphir.forward_tilt_angle,
+        cphir.machine_id,
+        cphir.real_x,
+        cphir.real_y,
+        cphir.real_lat,
+        cphir.real_lng
         from cons_pile_hole_info cphi
         left join cons_pile_hole_index_realtime cphir
         on

+ 1 - 0
bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessMapper.xml

@@ -132,6 +132,7 @@
             <if test="recordTime != null">and record_time = #{recordTime}</if>
             <if test="createTime != null">and create_time #{createTime}</if>
         </where>
+        order by record_time asc
     </select>
 
     <select id="selectMachineProcessById" parameterType="Long" resultMap="MachineProcessResult">

+ 24 - 0
bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml

@@ -20,6 +20,10 @@
         <result property="status" column="status"/>
         <result property="tiltAngle" column="tilt_angle"/>
         <result property="forwardTiltAngle" column="forward_tilt_angle"/>
+        <result property="realX" column="real_x"/>
+        <result property="realY" column="real_y"/>
+        <result property="realLat" column="real_lat"/>
+        <result property="realLng" column="real_lng"/>
         <result property="updateTime" column="update_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
@@ -42,6 +46,10 @@
                status,
                tilt_angle,
                forward_tilt_angle,
+               real_x,
+               real_y,
+               real_lat,
+               real_lng,
                update_time,
                create_time,
                create_by,
@@ -93,6 +101,10 @@
             <if test="status != null">status,</if>
             <if test="tiltAngle != null ">tilt_angle,</if>
             <if test="forwardTiltAngle != null ">forward_tilt_angle,</if>
+            <if test="realX != null">real_x,</if>
+            <if test="realY != null">real_y,</if>
+            <if test="realLat != null">real_lat,</if>
+            <if test="realLng != null">real_lng,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
@@ -113,6 +125,10 @@
             <if test="status != null">#{status},</if>
             <if test="tiltAngle != null ">#{tiltAngle},</if>
             <if test="forwardTiltAngle != null ">#{forwardTiltAngle},</if>
+            <if test="realX != null">#{realX},</if>
+            <if test="realY != null">#{realY},</if>
+            <if test="realLat != null">#{realLat},</if>
+            <if test="realLng != null">#{realLng},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -137,6 +153,10 @@
             <if test="status != null">status = #{status},</if>
             <if test="tiltAngle != null ">tilt_angle = #{tiltAngle},</if>
             <if test="forwardTiltAngle != null ">forward_tilt_angle = #{forwardTiltAngle},</if>
+            <if test="realX != null">real_x = #{realX},</if>
+            <if test="realY != null">real_y = #{realY},</if>
+            <if test="realLat != null">real_lat = #{realLat},</if>
+            <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
@@ -158,6 +178,10 @@
             <if test="status != null">status = #{status},</if>
             <if test="tiltAngle != null ">tilt_angle = #{tiltAngle},</if>
             <if test="forwardTiltAngle != null ">forward_tilt_angle = #{forwardTiltAngle},</if>
+            <if test="realX != null">real_x = #{realX},</if>
+            <if test="realY != null">real_y = #{realY},</if>
+            <if test="realLat != null">real_lat = #{realLat},</if>
+            <if test="realLng != null">real_lng = #{realLng},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 13 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/dto/cons/PileRealtimeIndex.java

@@ -5,6 +5,7 @@ import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huashe.common.annotation.Excel;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
+import com.huashe.park.domain.entity.PileMachineInfo;
 
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -14,6 +15,8 @@ import lombok.EqualsAndHashCode;
 public class PileRealtimeIndex extends ConsPileHoleInfo {
     private String machineByteKey;
 
+    private Long machineId;
+
     private Double tiltAngle;
 
     private Double forwardTiltAngle;
@@ -51,4 +54,14 @@ public class PileRealtimeIndex extends ConsPileHoleInfo {
     /** 桩点状态 */
     @Excel(name = "桩点状态")
     private String status;
+
+    private Double realX;
+
+    private Double realY;
+
+    private Double realLat;
+
+    private Double realLng;
+
+    private PileMachineInfo pileMachineInfo;
 }

+ 11 - 116
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java

@@ -9,12 +9,19 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huashe.common.annotation.Excel;
 import com.huashe.common.domain.BaseEntity;
 
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
 /**
  * 桩点最新指标对象 cons_pile_hole_index_realtime
  *
  * @author ruoyi
  * @date 2025-03-03
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
 public class PileHoleIndexRealtime extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
@@ -75,125 +82,13 @@ public class PileHoleIndexRealtime extends BaseEntity {
     @Excel(name = "桩点状态")
     private String status;
 
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setHoleId(Long holeId) {
-        this.holeId = holeId;
-    }
+    private Double realX;
 
-    public Long getHoleId() {
-        return holeId;
-    }
+    private Double realY;
 
-    public void setHoleByteKey(String holeByteKey) {
-        this.holeByteKey = holeByteKey;
-    }
+    private Double realLat;
 
-    public String getHoleByteKey() {
-        return holeByteKey;
-    }
-
-    public void setMachineId(Long machineId) {
-        this.machineId = machineId;
-    }
-
-    public Long getMachineId() {
-        return machineId;
-    }
-
-    public void setMachineByteKey(String machineByteKey) {
-        this.machineByteKey = machineByteKey;
-    }
-
-    public String getMachineByteKey() {
-        return machineByteKey;
-    }
-
-    public void setDepth(Double depth) {
-        this.depth = depth;
-    }
-
-    public Double getDepth() {
-        return depth;
-    }
-
-    public void setCurrent(Double current) {
-        this.current = current;
-    }
-
-    public Double getCurrent() {
-        return current;
-    }
-
-    public Double getVerticalDeviation() {
-        return verticalDeviation;
-    }
-
-    public void setVerticalDeviation(Double verticalDeviation) {
-        this.verticalDeviation = verticalDeviation;
-    }
-
-    public void setSprayVolume(Double sprayVolume) {
-        this.sprayVolume = sprayVolume;
-    }
-
-    public Double getSprayVolume() {
-        return sprayVolume;
-    }
-
-    public void setSprayPressure(Double sprayPressure) {
-        this.sprayPressure = sprayPressure;
-    }
-
-    public Double getSprayPressure() {
-        return sprayPressure;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public Double getTiltAngle() {
-        return tiltAngle;
-    }
-
-    public void setTiltAngle(Double tiltAngle) {
-        this.tiltAngle = tiltAngle;
-    }
-
-    public Double getForwardTiltAngle() {
-        return forwardTiltAngle;
-    }
-
-    public void setForwardTiltAngle(Double forwardTiltAngle) {
-        this.forwardTiltAngle = forwardTiltAngle;
-    }
+    private Double realLng;
 
     @Override
     public String toString() {