Browse Source

* 桩孔实时指标更新逻辑

chen.cheng 5 months ago
parent
commit
ede14b37ee
15 changed files with 454 additions and 172 deletions
  1. 7 1
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java
  2. 58 3
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java
  3. 22 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsResultEvent.java
  4. 2 2
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/handle/RootMsgHandler.java
  5. 29 37
      bd-park/park-backend/park-collect/src/main/resources/application-topic.yml
  6. 4 1
      bd-park/park-backend/park-collect/src/main/resources/application.yml
  7. 4 0
      bd-park/park-backend/park-common/pom.xml
  8. 41 41
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/DateTimeUtil.java
  9. 3 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/PileHoleIndexRealtimeMapper.java
  10. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IPileHoleIndexRealtimeService.java
  11. 5 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileHoleIndexRealtimeServiceImpl.java
  12. 36 1
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessResultMapper.xml
  13. 96 31
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml
  14. 40 0
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcessResult.java
  15. 105 55
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java

+ 7 - 1
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java

@@ -5,14 +5,20 @@ import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.stereotype.Service;
 
 import com.huashe.park.domain.entity.MachineProcess;
+import com.huashe.park.domain.entity.MachineProcessResult;
 
 @Service
 public class EventPublisherService {
     @Autowired
     private ApplicationEventPublisher applicationEventPublisher;
 
-    public void publishCustomEvent(final MachineProcess message) {
+    public void publishMachineProcessEvent(final MachineProcess message) {
         PileMachineConsRealtimeEvent customEvent = new PileMachineConsRealtimeEvent(this, message);
         applicationEventPublisher.publishEvent(customEvent);
     }
+
+    public void publishMachineResultEvent(final MachineProcessResult message) {
+        PileMachineConsResultEvent customEvent = new PileMachineConsResultEvent(this, message);
+        applicationEventPublisher.publishEvent(customEvent);
+    }
 }

+ 58 - 3
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java

@@ -1,11 +1,14 @@
 package com.huashe.park.collect.event;
 
+import static com.huashe.park.common.consts.enums.ConsStatus.CONS_STATUS_02;
+
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.event.EventListener;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
+import com.huashe.park.common.DateTimeUtil;
 import com.huashe.park.common.consts.enums.MachineStatus;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
@@ -31,7 +34,7 @@ public class MachineRealtimeEventListener {
 
     @EventListener
     @Async
-    public void handleCustomEvent(PileMachineConsRealtimeEvent event) {
+    public void handleConsProcessEvent(PileMachineConsRealtimeEvent event) {
         ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService
             .selectConsPileHoleInfoByteId(event.getMessage().getPileId());
         PileMachineInfo pileMachineInfo = machineInfoService
@@ -40,10 +43,22 @@ public class MachineRealtimeEventListener {
             return;
         }
         PileHoleIndexRealtime pileHoleIndexRealtime = new PileHoleIndexRealtime();
-        // TODO 初始化桩孔实施指标
+        pileHoleIndexRealtime.setHoleId(consPileHoleInfo.getId());
+        pileHoleIndexRealtime.setHoleByteKey(consPileHoleInfo.getByteId());
+        pileHoleIndexRealtime.setMachineByteKey(pileMachineInfo.getByteId());
+        pileHoleIndexRealtime.setMachineId(pileMachineInfo.getId());
 
-        int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtime(pileHoleIndexRealtime);
+        pileHoleIndexRealtime.setCurrent(event.getMessage().getCurrent());
+        pileHoleIndexRealtime.setDepth(event.getMessage().getPileLength());
+        pileHoleIndexRealtime.setSprayPressure(event.getMessage().getSprayPressure());
+        // 回带量
+        pileHoleIndexRealtime.setSprayVolume(event.getMessage().getSprayVolume());
+        pileHoleIndexRealtime.setVerticalDeviation(event.getMessage().getVerticalAngle());
+        pileHoleIndexRealtime.setStatus(CONS_STATUS_02.getCode());
+        int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
         if (!(cnt > 0)) {
+            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getStartTime());
+            pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
             pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
         }
         pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
@@ -53,4 +68,44 @@ public class MachineRealtimeEventListener {
             }
         });
     }
+
+    @EventListener
+    @Async
+    public void handleConsResultEvent(PileMachineConsResultEvent event) {
+        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoService
+            .selectConsPileHoleInfoByteId(event.getMessage().getPileId());
+        PileMachineInfo pileMachineInfo = machineInfoService
+            .selectPileMachineInfoByByteId(event.getMessage().getMachineId());
+        if (ObjectUtils.isEmpty(consPileHoleInfo) || ObjectUtils.isEmpty(pileMachineInfo)) {
+            return;
+        }
+        PileHoleIndexRealtime pileHoleIndexRealtime = new PileHoleIndexRealtime();
+        pileHoleIndexRealtime.setHoleId(consPileHoleInfo.getId());
+        pileHoleIndexRealtime.setHoleByteKey(consPileHoleInfo.getByteId());
+        pileHoleIndexRealtime.setMachineByteKey(pileMachineInfo.getByteId());
+        pileHoleIndexRealtime.setMachineId(pileMachineInfo.getId());
+        pileHoleIndexRealtime.setDepth(event.getMessage().getPileLength());
+
+        pileHoleIndexRealtime.setSprayVolume(event.getMessage().getSprayVolume());
+        pileHoleIndexRealtime.setVerticalDeviation(event.getMessage().getVerticalDeviation());
+
+        if (ObjectUtils.isNotEmpty(event.getMessage().getEndTime())) {
+            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getEndTime());
+            pileHoleIndexRealtime.setEndTime(DateTimeUtil.parseDate(dateFromMills));
+        }
+
+        int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
+        if (!(cnt > 0)) {
+            String dateFromMills = DateTimeUtil.getDateFromMills(event.getMessage().getStartTime());
+            pileHoleIndexRealtime.setStartTime(DateTimeUtil.parseDate(dateFromMills));
+            pileHoleIndexRealtimeService.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
+        }
+        pileMachineInfoService.updatePileMachineInfo(new PileMachineInfo() {
+            {
+                setId(pileMachineInfo.getId());
+                setStatus(MachineStatus.MACHINE_STATUS_00.getCode());
+            }
+        });
+    }
+
 }

+ 22 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsResultEvent.java

@@ -0,0 +1,22 @@
+package com.huashe.park.collect.event;
+
+import org.springframework.context.ApplicationEvent;
+
+import com.huashe.park.domain.entity.MachineProcessResult;
+
+public class PileMachineConsResultEvent extends ApplicationEvent {
+    private MachineProcessResult message;
+
+    public PileMachineConsResultEvent(Object source, MachineProcessResult message) {
+        super(source);
+        this.message = message;
+    }
+
+    public MachineProcessResult getMessage() {
+        return message;
+    }
+
+    public void setMessage(MachineProcessResult message) {
+        this.message = message;
+    }
+}

+ 2 - 2
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/handle/RootMsgHandler.java

@@ -100,7 +100,7 @@ public class RootMsgHandler extends TopicMsgEngine {
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
             machineProcessResultService.insertMachineProcessResult(machineProcess);
-
+            eventPublisherService.publishMachineResultEvent(machineProcess);
         }
         if (topic.endsWith(topicDataCfg.getProcessTopic().getName())) {
             byte[] bytes = json.getBytes(TOPIC_PAYLOAD);
@@ -110,7 +110,7 @@ public class RootMsgHandler extends TopicMsgEngine {
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
             machineProcessService.insertMachineProcess(machineProcess);
-            eventPublisherService.publishCustomEvent(machineProcess);
+            eventPublisherService.publishMachineProcessEvent(machineProcess);
         }
     }
 

+ 29 - 37
bd-park/park-backend/park-collect/src/main/resources/application-topic.yml

@@ -92,7 +92,7 @@ aliyun:
         range:
           - 99
           - 102
-      #灌浆体积
+      #灌浆体积 回带量
       spray_volume:
         type: float
         range:
@@ -184,29 +184,39 @@ aliyun:
         range:
           - 171
           - 174
-      # 送土总次数
-      send_total_number:
-        type: int
+      # 沉管开始时间
+      send_start_time:
+        type: long
+        byte-sort: big
         range:
           - 175
-          - 178
-      # 送土总时长
-      send_total_time:
-        type: float
-        range:
-          - 179
           - 182
-      # 总夯击次数
-      total_hammer_number:
-        type: int
+      # 沉管结束时间
+      send_end_time:
+        type: long
+        byte-sort: big
         range:
           - 183
-          - 186
+          - 190
+      # 拔管开始时间
+      pulling_start_time:
+        type: long
+        byte-sort: big
+        range:
+          - 191
+          - 198
+      # 拔管结束时间
+      pulling_end_time:
+        type: long
+        byte-sort: big
+        range:
+          - 199
+          - 206
       # uuid
       uuid:
         type: string
         range:
-          - 187
+          - 207
   process-topic:
     name: /machine/piling/process
     protocol:
@@ -318,7 +328,7 @@ aliyun:
         range:
           - 103
           - 106
-      #灌浆体积
+      #灌浆体积 送带量
       spray_volume:
         type: float
         range:
@@ -336,13 +346,13 @@ aliyun:
         range:
           - 115
           - 118
-      #水泵电流
+      #水泵电流 喷浆流量
       pump_current:
         type: float
         range:
           - 119
           - 122
-      # 喷浆压力
+      # 喷浆压力 压力值
       spray_pressure:
         type: float
         range:
@@ -386,26 +396,8 @@ aliyun:
         range:
           - 155
           - 158
-      # 当前层
-      current_layer:
-        type: int
-        range:
-          - 159
-          - 162
-      # 当前层送土时长
-      current_layer_send_time:
-        type: float
-        range:
-          - 163
-          - 166
-      # 当前层夯击次数
-      current_layer_hammer_number:
-        type: int
-        range:
-          - 167
-          - 170
       # uuid
       uuid:
         type: string
         range:
-          - 171
+          - 159

+ 4 - 1
bd-park/park-backend/park-collect/src/main/resources/application.yml

@@ -112,4 +112,7 @@ id:
 logging:
   level:
     com.ruoyi: debug
-    com.huashe: debug
+    com.huashe: debug
+date:
+  time:
+    zone: GMT+8:00

+ 4 - 0
bd-park/park-backend/park-common/pom.xml

@@ -136,6 +136,10 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-websocket</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 41 - 41
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/DateTimeUtil.java

@@ -1,7 +1,5 @@
 package com.huashe.park.common;
 
-import org.apache.commons.lang3.StringUtils;
-
 import java.text.SimpleDateFormat;
 import java.time.DayOfWeek;
 import java.time.Duration;
@@ -18,6 +16,8 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.lang3.StringUtils;
+
 /**
  * The type Date time util.
  *
@@ -49,7 +49,7 @@ public class DateTimeUtil {
     /**
      * Parse date date.
      *
-     * @param dateString  the date string
+     * @param dateString the date string
      * @param formatRegex the format regex
      * @return the date
      * @author chen.cheng
@@ -57,7 +57,7 @@ public class DateTimeUtil {
     public static Date parseDate(String dateString, String formatRegex) {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern(formatRegex);
         LocalDateTime dateTime = LocalDateTime.parse(dateString, formatter);
-        Instant instant = dateTime.atZone(ZoneId.of("GMT+08:00")).toInstant();
+        Instant instant = dateTime.atZone(ZoneId.systemDefault()).toInstant();
         return Date.from(instant);
     }
 
@@ -70,7 +70,7 @@ public class DateTimeUtil {
      */
     public static Date minusDay(Long dayNum) {
         LocalDateTime now = LocalDateTime.now();
-        Instant instant = now.atZone(ZoneId.of("GMT+08:00")).toInstant();
+        Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
         return Date.from(instant);
     }
 
@@ -78,7 +78,7 @@ public class DateTimeUtil {
      * Parse date string.
      *
      * @param localDateTime the local date time
-     * @param formatRegex   the format regex
+     * @param formatRegex the format regex
      * @return the string
      * @author chen.cheng
      */
@@ -90,7 +90,7 @@ public class DateTimeUtil {
     /**
      * Parse date string.
      *
-     * @param localDate   the local date
+     * @param localDate the local date
      * @param formatRegex the format regex
      * @return the string
      * @author chen.cheng
@@ -130,11 +130,10 @@ public class DateTimeUtil {
         return getDateFromMills(mills, DateFormatter.yyyy_MM_dd_HHmmss);
     }
 
-
     /**
      * Parse local date local date time.
      *
-     * @param dateString  the date string
+     * @param dateString the date string
      * @param formatRegex the format regex
      * @return the local date time
      * @author chen.cheng
@@ -156,7 +155,7 @@ public class DateTimeUtil {
     /**
      * Parse local date local date.
      *
-     * @param dateString  the date string
+     * @param dateString the date string
      * @param formatRegex the format regex
      * @return the local date
      * @author chen.cheng
@@ -170,7 +169,7 @@ public class DateTimeUtil {
     /**
      * Parse date string string.
      *
-     * @param dateString  the date string
+     * @param dateString the date string
      * @param formatRegex the format regex
      * @return the string
      * @author chen.cheng
@@ -184,9 +183,9 @@ public class DateTimeUtil {
     /**
      * Parse date string string.
      *
-     * @param dateString     the date string
+     * @param dateString the date string
      * @param srcFormatRegex the src format regex
-     * @param formatRegex    the format regex
+     * @param formatRegex the format regex
      * @return the string
      * @author chen.cheng
      */
@@ -199,9 +198,9 @@ public class DateTimeUtil {
     /**
      * Parse short date string string(yyyyMMdd).
      *
-     * @param dateString     the date string
+     * @param dateString the date string
      * @param srcFormatRegex the src format regex
-     * @param formatRegex    the format regex
+     * @param formatRegex the format regex
      * @return the string
      * @author chen.cheng
      */
@@ -215,8 +214,8 @@ public class DateTimeUtil {
      * Days of range list.
      *
      * @param startDate the start date
-     * @param endDate   the end date DateTimeUtil.daysOfRange("2020-05-06",
-     *                  "2020-09-02",DateFormatter.yyyy_MM_dd,DateFormatter.yyyyMMdd)
+     * @param endDate the end date DateTimeUtil.daysOfRange("2020-05-06",
+     *            "2020-09-02",DateFormatter.yyyy_MM_dd,DateFormatter.yyyyMMdd)
      * @return the list
      * @author chen.cheng
      */
@@ -227,7 +226,7 @@ public class DateTimeUtil {
     /**
      * Minus month string.
      *
-     * @param monthNum   the month num
+     * @param monthNum the month num
      * @param formatRegx the format regx
      * @return the string
      * @author chen.cheng
@@ -242,7 +241,7 @@ public class DateTimeUtil {
     /**
      * Minus month string
      *
-     * @param monthNum   month num
+     * @param monthNum month num
      * @param formatRegx format regx
      * @return the string
      * @author chen.cheng
@@ -265,7 +264,7 @@ public class DateTimeUtil {
     /**
      * Minus month string.
      *
-     * @param monthNum   the month num
+     * @param monthNum the month num
      * @param formatRegx the format regx
      * @return the string
      * @author chen.cheng
@@ -280,9 +279,9 @@ public class DateTimeUtil {
     /**
      * Date minus month string
      *
-     * @param date       date
+     * @param date date
      * @param formatRegx format regx
-     * @param monthNum   month num
+     * @param monthNum month num
      * @return the string
      * @author chen.cheng
      */
@@ -293,10 +292,10 @@ public class DateTimeUtil {
     /**
      * Date minus month string
      *
-     * @param date          date
+     * @param date date
      * @param srcFormatRegx src format regx
-     * @param formatRegx    format regx
-     * @param monthNum      month num
+     * @param formatRegx format regx
+     * @param monthNum month num
      * @return the string
      * @author chen.cheng
      */
@@ -310,7 +309,7 @@ public class DateTimeUtil {
     /**
      * Minus day string.
      *
-     * @param dayNum     the day num
+     * @param dayNum the day num
      * @param formatRegx the format regx
      * @return the string
      * @author chen.cheng
@@ -325,9 +324,9 @@ public class DateTimeUtil {
     /**
      * Days of range list.
      *
-     * @param startDate    the start date
-     * @param endDate      the end date
-     * @param paramFormat  the param format
+     * @param startDate the start date
+     * @param endDate the end date
+     * @param paramFormat the param format
      * @param resultFormat the result format
      * @return the list
      * @author chen.cheng
@@ -367,8 +366,8 @@ public class DateTimeUtil {
     /**
      * Days of range list.
      *
-     * @param startDate   the start date
-     * @param endDate     the end date
+     * @param startDate the start date
+     * @param endDate the end date
      * @param paramFormat the param format
      * @return the list
      * @author chen.cheng
@@ -389,7 +388,7 @@ public class DateTimeUtil {
     /**
      * Gets time step of time index.
      *
-     * @param tp  the tp
+     * @param tp the tp
      * @param gap the gap (now + gap minutes)
      * @return the time step of time index
      * @author chen.cheng
@@ -401,24 +400,24 @@ public class DateTimeUtil {
     /**
      * Get time step index of now integer.
      *
-     * @param tp         the tp
+     * @param tp the tp
      * @param toDateTime the to date time
      * @return the integer
      * @author chen.cheng
      */
     public static int getTimeStepIndexOfNow(Integer tp, LocalDateTime toDateTime) {
-        LocalDateTime zero = LocalDateTime.of(toDateTime.getYear(), toDateTime.getMonth(), toDateTime.getDayOfMonth(), 0, 0, 0);
+        LocalDateTime zero = LocalDateTime.of(toDateTime.getYear(), toDateTime.getMonth(), toDateTime.getDayOfMonth(),
+            0, 0, 0);
         Duration duration = Duration.between(zero, toDateTime);
         double minutes = duration.toMinutes();
         return (int) Math.floor(minutes / tp);
     }
 
-
     /**
      * Gets time from step index. tp is min the format hh:mm:00
      *
      * @param stepIndex the step index
-     * @param tp        the tp
+     * @param tp the tp
      * @return the time from step index
      * @author chen.cheng
      */
@@ -433,7 +432,7 @@ public class DateTimeUtil {
      * Gets time from step index with out second.
      *
      * @param stepIndex the step index
-     * @param tp        the tp
+     * @param tp the tp
      * @return the time from step index with out second
      * @author chen.cheng
      */
@@ -447,7 +446,7 @@ public class DateTimeUtil {
     /**
      * Gets day of week.
      *
-     * @param date           the date
+     * @param date the date
      * @param paramFormatter the param formatter
      * @return the day of week
      * @author chen.cheng
@@ -502,7 +501,7 @@ public class DateTimeUtil {
     /**
      * Cal week of year integer.
      *
-     * @param date           the date
+     * @param date the date
      * @param paramFormatter the param formatter
      * @return the integer
      * @author chen.cheng
@@ -550,7 +549,9 @@ public class DateTimeUtil {
         firstTime = firstTime.plusDays(-(weekIndex * 7L));
         // 结束时间
         lastTime = lastTime.plusDays(-1);
-        return new String[]{firstTime.format(resultDateFormat), lastTime.format(resultDateFormat)};
+        return new String[] {
+            firstTime.format(resultDateFormat), lastTime.format(resultDateFormat)
+        };
     }
 
     public static String getFirstDayOfRecentYear(String dateFormat) {
@@ -599,7 +600,6 @@ public class DateTimeUtil {
         System.out.println(DateTimeUtil.getStepIndexFromMills(10, System.currentTimeMillis()));
     }
 
-
     /**
      * The interface Date formatter.
      *

+ 3 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/PileHoleIndexRealtimeMapper.java

@@ -44,6 +44,9 @@ public interface PileHoleIndexRealtimeMapper
      */
     public int updatePileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
 
+
+    public int updatePileHoleIndexRealtimeByHoleIdAndMachineId(PileHoleIndexRealtime pileHoleIndexRealtime);
+
     /**
      * 删除桩点最新指标
      * 

+ 2 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IPileHoleIndexRealtimeService.java

@@ -43,6 +43,8 @@ public interface IPileHoleIndexRealtimeService {
      */
     public int updatePileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
 
+    int updatePileHoleIndexRealtimeByHoleIdAndMachineId(PileHoleIndexRealtime pileHoleIndexRealtime);
+
     /**
      * 批量删除桩点最新指标
      * 

+ 5 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileHoleIndexRealtimeServiceImpl.java

@@ -64,6 +64,11 @@ public class PileHoleIndexRealtimeServiceImpl implements IPileHoleIndexRealtimeS
         return pileHoleIndexRealtimeMapper.updatePileHoleIndexRealtime(pileHoleIndexRealtime);
     }
 
+    @Override
+    public int updatePileHoleIndexRealtimeByHoleIdAndMachineId(PileHoleIndexRealtime pileHoleIndexRealtime){
+        return pileHoleIndexRealtimeMapper.updatePileHoleIndexRealtimeByHoleIdAndMachineId(pileHoleIndexRealtime);
+    }
+
     /**
      * 批量删除桩点最新指标
      * 

+ 36 - 1
bd-park/park-backend/park-core/src/main/resources/mapper/cons/MachineProcessResultMapper.xml

@@ -3,7 +3,6 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huashe.park.core.mapper.MachineProcessResultMapper">
-
     <resultMap type="MachineProcessResult" id="MachineProcessResultResult">
         <result property="id" column="id"/>
         <result property="consType" column="cons_type"/>
@@ -45,6 +44,10 @@
         <result property="dt" column="dt"/>
         <result property="createTime" column="create_time"/>
         <result property="recordTime" column="record_time"/>
+        <result property="sendStartTime" column="send_start_time"/>
+        <result property="sendEndTime" column="send_end_time"/>
+        <result property="pullingStartTime" column="pulling_start_time"/>
+        <result property="pullingEndTime" column="pulling_end_time"/>
     </resultMap>
 
     <sql id="selectMachineProcessResultVo">
@@ -83,6 +86,10 @@
                current_mechanical_type,
                send_total_number,
                send_total_time,
+               send_start_time,
+               send_end_time,
+               pulling_start_time,
+               pulling_end_time,
                total_hammer_number,
                uuid,
                dt,
@@ -127,6 +134,10 @@
             <if test="dt != null  and dt != ''">and dt = #{dt}</if>
             <if test="recordTime != null">and record_time = #{recordTime}</if>
             <if test="createTime != null">and create_time #{createTime}</if>
+            <if test="sendStartTime != null">and send_start_time = #{sendStartTime}</if>
+            <if test="sendEndTime != null">and send_end_time = #{sendEndTime}</if>
+            <if test="pullingStartTime != null">and pulling_start_time = #{pullingStartTime}</if>
+            <if test="pullingEndTime != null">and pulling_end_time = #{pullingEndTime}</if>
         </where>
     </select>
 
@@ -178,6 +189,10 @@
             <if test="dt != null">dt,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="sendStartTime != null">send_start_time,</if>
+            <if test="sendEndTime != null">send_end_time,</if>
+            <if test="pullingStartTime != null">pulling_start_time,</if>
+            <if test="pullingEndTime != null">pulling_end_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
@@ -219,6 +234,10 @@
             <if test="dt != null">#{dt},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="sendStartTime != null">#{sendStartTime},</if>
+            <if test="sendEndTime != null">#{sendEndTime},</if>
+            <if test="pullingStartTime != null">#{pullingStartTime},</if>
+            <if test="pullingEndTime != null">#{pullingEndTime},</if>
         </trim>
     </insert>
     <insert id="insertMachineProcessResultOnUpdate" parameterType="MachineProcessResult" useGeneratedKeys="true"
@@ -264,6 +283,10 @@
             <if test="dt != null">dt,</if>
             <if test="recordTime != null">record_time,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="sendStartTime != null">send_start_time,</if>
+            <if test="sendEndTime != null">send_end_time,</if>
+            <if test="pullingStartTime != null">pulling_start_time,</if>
+            <if test="pullingEndTime != null">pulling_end_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="consType != null">#{consType},</if>
@@ -305,6 +328,10 @@
             <if test="dt != null">#{dt},</if>
             <if test="recordTime != null">#{recordTime},</if>
             <if test="createTime != null">now(),</if>
+            <if test="sendStartTime != null">#{sendStartTime},</if>
+            <if test="sendEndTime != null">#{sendEndTime},</if>
+            <if test="pullingStartTime">#{pullingStartTime},</if>
+            <if test="pullingEndTime">#{pullingEndTime},</if>
         </trim>
         ON DUPLICATE KEY UPDATE
         <trim suffixOverrides=",">
@@ -346,6 +373,10 @@
             <if test="dt != null">dt = VALUES(dt),</if>
             <if test="recordTime != null">record_time = VALUES(record_time),</if>
             <if test="createTime != null">create_time = NOW(),</if>
+            <if test="sendStartTime != null">send_start_time = VALUES(send_start_time),</if>
+            <if test="sendEndTime != null">send_end_time = VALUES(send_end_time),</if>
+            <if test="pullingStartTime != null">pulling_start_time = VALUES(pulling_start_time),</if>
+            <if test="pullingEndTime != null">pulling_end_time = VALUES(pulling_end_time),</if>
         </trim>
 
     </insert>
@@ -392,6 +423,10 @@
             <if test="dt != null">dt = #{dt},</if>
             <if test="recordTime != null">record_time = #{recordTime},</if>
             <if test="createTime != null">create_time = NOW(),</if>
+            <if test="sendStartTime != null">send_start_time = #{sendStartTime},</if>
+            <if test="sendEndTime != null">send_end_time = #{sendEndTime},</if>
+            <if test="pullingStartTime != null">pulling_start_time = #{pullingStartTime},</if>
+            <if test="pullingEndTime != null">pulling_end_time = #{pullingEndTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 96 - 31
bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml

@@ -1,47 +1,76 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huashe.park.core.mapper.PileHoleIndexRealtimeMapper">
-    
+
     <resultMap type="PileHoleIndexRealtime" id="PileHoleIndexRealtimeResult">
-        <result property="id"    column="id"    />
-        <result property="holeId"    column="hole_id"    />
-        <result property="holeByteKey"    column="hole_byte_key"    />
-        <result property="machineId"    column="machine_id"    />
-        <result property="machineByteKey"    column="machine_byte_key"    />
-        <result property="depth"    column="depth"    />
-        <result property="current"    column="current"    />
-        <result property="verticalDeviation"    column="vertical_deviation"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
+        <result property="id" column="id"/>
+        <result property="holeId" column="hole_id"/>
+        <result property="holeByteKey" column="hole_byte_key"/>
+        <result property="machineId" column="machine_id"/>
+        <result property="machineByteKey" column="machine_byte_key"/>
+        <result property="depth" column="depth"/>
+        <result property="current" column="current"/>
+        <result property="verticalDeviation" column="vertical_deviation"/>
+        <result property="sprayVolume" column="spray_volume"/>
+        <result property="sprayPressure" column="spray_pressure"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="status" column="status"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
     </resultMap>
 
     <sql id="selectPileHoleIndexRealtimeVo">
-        select id, hole_id, hole_byte_key, machine_id, machine_byte_key, depth, current, vertical_deviation, update_time, create_time, create_by, update_by from cons_pile_hole_index_realtime
+        select id,
+               hole_id,
+               hole_byte_key,
+               machine_id,
+               machine_byte_key,
+               depth,
+               `current`,
+               vertical_deviation,
+               spray_volume,
+               spray_pressure,
+               start_time,
+               end_time,
+               status,
+               update_time,
+               create_time,
+               create_by,
+               update_by
+        from cons_pile_hole_index_realtime
     </sql>
 
-    <select id="selectPileHoleIndexRealtimeList" parameterType="PileHoleIndexRealtime" resultMap="PileHoleIndexRealtimeResult">
+    <select id="selectPileHoleIndexRealtimeList" parameterType="PileHoleIndexRealtime"
+            resultMap="PileHoleIndexRealtimeResult">
         <include refid="selectPileHoleIndexRealtimeVo"/>
-        <where>  
-            <if test="holeId != null "> and hole_id = #{holeId}</if>
-            <if test="holeByteKey != null  and holeByteKey != ''"> and hole_byte_key = #{holeByteKey}</if>
-            <if test="machineId != null "> and machine_id = #{machineId}</if>
-            <if test="machineByteKey != null  and machineByteKey != ''"> and machine_byte_key = #{machineByteKey}</if>
-            <if test="depth != null "> and depth = #{depth}</if>
-            <if test="current != null "> and current = #{current}</if>
-            <if test="verticalDeviation != null "> and vertical_deviation = #{verticalDeviation}</if>
+        <where>
+            <if test="holeId != null ">and hole_id = #{holeId}</if>
+            <if test="holeByteKey != null  and holeByteKey != ''">and hole_byte_key = #{holeByteKey}</if>
+            <if test="machineId != null ">and machine_id = #{machineId}</if>
+            <if test="machineByteKey != null  and machineByteKey != ''">and machine_byte_key = #{machineByteKey}</if>
+            <if test="depth != null ">and depth = #{depth}</if>
+            <if test="current != null ">and current = #{current}</if>
+            <if test="verticalDeviation != null ">and vertical_deviation = #{verticalDeviation}</if>
+            <if test="sprayVolume != null ">and spray_volume = #{sprayVolume}</if>
+            <if test="sprayPressure != null ">and spray_pressure = #{sprayPressure}</if>
+            <if test="startTime != null ">and start_time = #{startTime}</if>
+            <if test="endTime != null ">and end_time = #{endTime}</if>
+            <if test="status != null  and status != ''">and status = #{status}</if>
         </where>
     </select>
-    
+
     <select id="selectPileHoleIndexRealtimeById" parameterType="Long" resultMap="PileHoleIndexRealtimeResult">
         <include refid="selectPileHoleIndexRealtimeVo"/>
         where id = #{id}
     </select>
 
-    <insert id="insertPileHoleIndexRealtime" parameterType="PileHoleIndexRealtime" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertPileHoleIndexRealtime" parameterType="PileHoleIndexRealtime" useGeneratedKeys="true"
+            keyProperty="id">
         insert into cons_pile_hole_index_realtime
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="holeId != null">hole_id,</if>
@@ -51,11 +80,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="depth != null">depth,</if>
             <if test="current != null">current,</if>
             <if test="verticalDeviation != null">vertical_deviation,</if>
+            <if test="sprayVolume != null">spray_volume,</if>
+            <if test="sprayPressure != null">spray_pressure,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="status != null">status,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="holeId != null">#{holeId},</if>
             <if test="holeByteKey != null and holeByteKey != ''">#{holeByteKey},</if>
@@ -64,11 +98,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="depth != null">#{depth},</if>
             <if test="current != null">#{current},</if>
             <if test="verticalDeviation != null">#{verticalDeviation},</if>
+            <if test="sprayVolume != null">#{sprayVolume},</if>
+            <if test="sprayPressure != null">#{sprayPressure},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="status != null">#{status},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updatePileHoleIndexRealtime" parameterType="PileHoleIndexRealtime">
@@ -81,6 +120,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="depth != null">depth = #{depth},</if>
             <if test="current != null">current = #{current},</if>
             <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
+            <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
+            <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="status != null">status = #{status},</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>
@@ -89,12 +133,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
+    <update id="updatePileHoleIndexRealtimeByHoleIdAndMachineId" parameterType="PileHoleIndexRealtime">
+        update cons_pile_hole_index_realtime
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="depth != null">depth = #{depth},</if>
+            <if test="current != null">current = #{current},</if>
+            <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</if>
+            <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
+            <if test="sprayPressure != null">spray_pressure = #{sprayPressure},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="status != null">status = #{status},</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>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where hole_id = #{holeId} and machine_id = #{machineId}
+    </update>
+
     <delete id="deletePileHoleIndexRealtimeById" parameterType="Long">
-        delete from cons_pile_hole_index_realtime where id = #{id}
+        delete
+        from cons_pile_hole_index_realtime
+        where id = #{id}
     </delete>
 
     <delete id="deletePileHoleIndexRealtimeByIds" parameterType="String">
-        delete from cons_pile_hole_index_realtime where id in 
+        delete from cons_pile_hole_index_realtime where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 40 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/MachineProcessResult.java

@@ -158,6 +158,14 @@ public class MachineProcessResult extends BaseEntity {
     @Excel(name = "总夯击次数")
     private Integer totalHammerNumber;
 
+    private Long sendStartTime;
+
+    private Long sendEndTime;
+
+    private Long pullingStartTime;
+
+    private Long pullingEndTime;
+
     /** 设备唯一标识(UUID) */
     @Excel(name = "设备唯一标识", readConverterExp = "U=UID")
     private String uuid;
@@ -478,6 +486,38 @@ public class MachineProcessResult extends BaseEntity {
         this.recordTime = recordTime;
     }
 
+    public Long getSendStartTime() {
+        return sendStartTime;
+    }
+
+    public void setSendStartTime(Long sendStartTime) {
+        this.sendStartTime = sendStartTime;
+    }
+
+    public Long getSendEndTime() {
+        return sendEndTime;
+    }
+
+    public void setSendEndTime(Long sendEndTime) {
+        this.sendEndTime = sendEndTime;
+    }
+
+    public Long getPullingStartTime() {
+        return pullingStartTime;
+    }
+
+    public void setPullingStartTime(Long pullingStartTime) {
+        this.pullingStartTime = pullingStartTime;
+    }
+
+    public Long getPullingEndTime() {
+        return pullingEndTime;
+    }
+
+    public void setPullingEndTime(Long pullingEndTime) {
+        this.pullingEndTime = pullingEndTime;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())

+ 105 - 55
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java

@@ -1,18 +1,21 @@
 package com.huashe.park.domain.entity;
 
-import com.huashe.common.annotation.Excel;
-import com.huashe.common.domain.BaseEntity;
+import java.util.Date;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huashe.common.annotation.Excel;
+import com.huashe.common.domain.BaseEntity;
+
 /**
  * 桩点最新指标对象 cons_pile_hole_index_realtime
- * 
+ *
  * @author ruoyi
- * @date 2025-02-28
+ * @date 2025-03-03
  */
-public class PileHoleIndexRealtime extends BaseEntity
-{
+public class PileHoleIndexRealtime extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
     /**  */
@@ -36,104 +39,151 @@ public class PileHoleIndexRealtime extends BaseEntity
 
     /** 桩机实际深度 */
     @Excel(name = "桩机实际深度")
-    private Long depth;
+    private Double depth;
 
     /** 电机电流 */
     @Excel(name = "电机电流")
-    private Long current;
+    private Double current;
 
     /** 垂直偏差 */
     @Excel(name = "垂直偏差")
-    private Long verticalDeviation;
+    private Double verticalDeviation;
+
+    /** 灌浆体积(m³)ups200送带量 */
+    @Excel(name = "灌浆体积", readConverterExp = "m=³")
+    private Double sprayVolume;
+
+    /** 喷浆压力 ups200 压力值 */
+    @Excel(name = "喷浆压力 ups200 压力值")
+    private Double sprayPressure;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
 
-    public void setId(Long id) 
-    {
+    /** 桩点状态 */
+    @Excel(name = "桩点状态")
+    private String status;
+
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
-    public void setHoleId(Long holeId) 
-    {
+
+    public void setHoleId(Long holeId) {
         this.holeId = holeId;
     }
 
-    public Long getHoleId() 
-    {
+    public Long getHoleId() {
         return holeId;
     }
-    public void setHoleByteKey(String holeByteKey) 
-    {
+
+    public void setHoleByteKey(String holeByteKey) {
         this.holeByteKey = holeByteKey;
     }
 
-    public String getHoleByteKey() 
-    {
+    public String getHoleByteKey() {
         return holeByteKey;
     }
-    public void setMachineId(Long machineId) 
-    {
+
+    public void setMachineId(Long machineId) {
         this.machineId = machineId;
     }
 
-    public Long getMachineId() 
-    {
+    public Long getMachineId() {
         return machineId;
     }
-    public void setMachineByteKey(String machineByteKey) 
-    {
+
+    public void setMachineByteKey(String machineByteKey) {
         this.machineByteKey = machineByteKey;
     }
 
-    public String getMachineByteKey() 
-    {
+    public String getMachineByteKey() {
         return machineByteKey;
     }
-    public void setDepth(Long depth) 
-    {
+
+    public void setDepth(Double depth) {
         this.depth = depth;
     }
 
-    public Long getDepth() 
-    {
+    public Double getDepth() {
         return depth;
     }
-    public void setCurrent(Long current) 
-    {
+
+    public void setCurrent(Double current) {
         this.current = current;
     }
 
-    public Long getCurrent() 
-    {
+    public Double getCurrent() {
         return current;
     }
-    public void setVerticalDeviation(Long verticalDeviation) 
-    {
+
+    public Double getVerticalDeviation() {
+        return verticalDeviation;
+    }
+
+    public void setVerticalDeviation(Double verticalDeviation) {
         this.verticalDeviation = verticalDeviation;
     }
 
-    public Long getVerticalDeviation() 
-    {
-        return 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;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("holeId", getHoleId())
-            .append("holeByteKey", getHoleByteKey())
-            .append("machineId", getMachineId())
-            .append("machineByteKey", getMachineByteKey())
-            .append("depth", getDepth())
-            .append("current", getCurrent())
-            .append("verticalDeviation", getVerticalDeviation())
-            .append("updateTime", getUpdateTime())
-            .append("createTime", getCreateTime())
-            .append("createBy", getCreateBy())
-            .append("updateBy", getUpdateBy())
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
+            .append("holeId", getHoleId()).append("holeByteKey", getHoleByteKey()).append("machineId", getMachineId())
+            .append("machineByteKey", getMachineByteKey()).append("depth", getDepth()).append("current", getCurrent())
+            .append("verticalDeviation", getVerticalDeviation()).append("sprayVolume", getSprayVolume())
+            .append("sprayPressure", getSprayPressure()).append("startTime", getStartTime())
+            .append("endTime", getEndTime()).append("status", getStatus()).append("updateTime", getUpdateTime())
+            .append("createTime", getCreateTime()).append("createBy", getCreateBy()).append("updateBy", getUpdateBy())
             .toString();
     }
 }