Sfoglia il codice sorgente

* 桩孔实时指标更新逻辑

chen.cheng 5 mesi fa
parent
commit
67f749e188
26 ha cambiato i file con 1075 aggiunte e 11 eliminazioni
  1. 15 7
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/SpingMqttApplication.java
  2. 18 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java
  3. 56 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java
  4. 22 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/PileMachineConsRealtimeEvent.java
  5. 6 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/handle/RootMsgHandler.java
  6. 32 0
      bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/schedule/SyncSignalCtlPlanStatJob.java
  7. 4 0
      bd-park/park-backend/park-collect/src/main/resources/application-locale.yml
  8. 10 0
      bd-park/park-backend/park-collect/src/main/resources/application-schedule.yml
  9. 9 2
      bd-park/park-backend/park-collect/src/main/resources/application.yml
  10. 42 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/MachineStatus.java
  11. 23 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/bean/JobInfoVO.java
  12. 33 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/ITriggerTask.java
  13. 236 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/JobBase.java
  14. 50 0
      bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/TriggerTaskSupport.java
  15. 1 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsPileHoleInfoMapper.java
  16. 62 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/PileHoleIndexRealtimeMapper.java
  17. 2 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IConsPileHoleInfoService.java
  18. 61 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/IPileHoleIndexRealtimeService.java
  19. 17 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/ConsPileHoleInfoServiceImpl.java
  20. 88 0
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileHoleIndexRealtimeServiceImpl.java
  21. 13 1
      bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileMachineInfoServiceImpl.java
  22. 5 0
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsPileHoleInfoMapper.xml
  23. 102 0
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileHoleIndexRealtimeMapper.xml
  24. 19 1
      bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileMachineInfoMapper.xml
  25. 139 0
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java
  26. 10 0
      bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileMachineInfo.java

+ 15 - 7
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/SpingMqttApplication.java

@@ -7,17 +7,18 @@
  */
 package com.huashe.park.collect;
 
-import com.dtflys.forest.springboot.annotation.ForestScan;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import com.dtflys.forest.springboot.annotation.ForestScan;
+
 /**
- * Mqtt启动入口
- * <功能详细描述>
+ * Mqtt启动入口 <功能详细描述>
  *
  * @author learshaw
  * @version [版本号, 2021/04/26]
@@ -25,14 +26,21 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  * @since [产品/模块版本]
  */
 @EnableScheduling
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-@ComponentScan(basePackages = {"com.ruoyi", "com.huashe.park"})
+@SpringBootApplication(exclude = {
+    DataSourceAutoConfiguration.class
+})
+@ComponentScan(basePackages = {
+    "com.ruoyi", "com.huashe.park"
+})
 @MapperScan("com.huashe.park.core.mapper")
-@ForestScan(basePackages = {"com.huashe.park.infrastructure.uwb"})
+@ForestScan(basePackages = {
+    "com.huashe.park.infrastructure.uwb"
+})
+@EnableAsync
 public class SpingMqttApplication {
     public static void main(String[] args) {
         SpringApplicationBuilder builder = new SpringApplicationBuilder(SpingMqttApplication.class);
-//        builder.web(WebApplicationType.NONE);
+        // builder.web(WebApplicationType.NONE);
         builder.run(args);
     }
 }

+ 18 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/EventPublisherService.java

@@ -0,0 +1,18 @@
+package com.huashe.park.collect.event;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEventPublisher;
+import org.springframework.stereotype.Service;
+
+import com.huashe.park.domain.entity.MachineProcess;
+
+@Service
+public class EventPublisherService {
+    @Autowired
+    private ApplicationEventPublisher applicationEventPublisher;
+
+    public void publishCustomEvent(final MachineProcess message) {
+        PileMachineConsRealtimeEvent customEvent = new PileMachineConsRealtimeEvent(this, message);
+        applicationEventPublisher.publishEvent(customEvent);
+    }
+}

+ 56 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/event/MachineRealtimeEventListener.java

@@ -0,0 +1,56 @@
+package com.huashe.park.collect.event;
+
+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.consts.enums.MachineStatus;
+import com.huashe.park.core.service.IConsPileHoleInfoService;
+import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
+import com.huashe.park.core.service.IPileMachineInfoService;
+import com.huashe.park.domain.entity.ConsPileHoleInfo;
+import com.huashe.park.domain.entity.PileHoleIndexRealtime;
+import com.huashe.park.domain.entity.PileMachineInfo;
+
+@Component
+public class MachineRealtimeEventListener {
+
+    @Autowired
+    private IConsPileHoleInfoService consPileHoleInfoService;
+
+    @Autowired
+    private IPileMachineInfoService machineInfoService;
+
+    @Autowired
+    private IPileHoleIndexRealtimeService pileHoleIndexRealtimeService;
+
+    @Autowired
+    private IPileMachineInfoService pileMachineInfoService;
+
+    @EventListener
+    @Async
+    public void handleCustomEvent(PileMachineConsRealtimeEvent 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();
+        // TODO 初始化桩孔实施指标
+
+        int cnt = pileHoleIndexRealtimeService.updatePileHoleIndexRealtime(pileHoleIndexRealtime);
+        if (!(cnt > 0)) {
+            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/PileMachineConsRealtimeEvent.java

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

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

@@ -28,6 +28,7 @@ import com.alibaba.fastjson2.JSONObject;
 import com.huashe.common.utils.StringUtils;
 import com.huashe.park.collect.config.TopicDataCfg;
 import com.huashe.park.collect.core.TopicMsgEngine;
+import com.huashe.park.collect.event.EventPublisherService;
 import com.huashe.park.common.ByteArrayUtil;
 import com.huashe.park.common.DateTimeUtil;
 import com.huashe.park.core.service.IMachineProcessResultService;
@@ -63,6 +64,9 @@ public class RootMsgHandler extends TopicMsgEngine {
     @Autowired
     private IMachineProcessResultService machineProcessResultService;
 
+    @Autowired
+    private EventPublisherService eventPublisherService;
+
     @PostConstruct
     public void init() {
         super.init();
@@ -96,6 +100,7 @@ public class RootMsgHandler extends TopicMsgEngine {
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
             machineProcessResultService.insertMachineProcessResult(machineProcess);
+
         }
         if (topic.endsWith(topicDataCfg.getProcessTopic().getName())) {
             byte[] bytes = json.getBytes(TOPIC_PAYLOAD);
@@ -105,6 +110,7 @@ public class RootMsgHandler extends TopicMsgEngine {
             machineProcess.setDt(
                 DateTimeUtil.getDateFromMills(machineProcess.getDataTime(), DateTimeUtil.DateFormatter.yyyyMMdd));
             machineProcessService.insertMachineProcess(machineProcess);
+            eventPublisherService.publishCustomEvent(machineProcess);
         }
     }
 

+ 32 - 0
bd-park/park-backend/park-collect/src/main/java/com/huashe/park/collect/schedule/SyncSignalCtlPlanStatJob.java

@@ -0,0 +1,32 @@
+package com.huashe.park.collect.schedule;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.scheduling.support.CronTrigger;
+import org.springframework.stereotype.Component;
+
+import com.huashe.park.common.job.schedule.TriggerTaskSupport;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Component
+@ConditionalOnProperty(prefix = "huashe.job.sync-signal-ctl-stat-job", name = "enabled", havingValue = "true")
+public class SyncSignalCtlPlanStatJob extends TriggerTaskSupport {
+
+    @Value("${huashe.job.sync-signal-ctl-stat-job.desc}")
+    private String jobDesc;
+
+    @Override
+    @Value("${huashe.job.sync-signal-ctl-stat-job.cron}")
+    public CronTrigger setTrigger(String cron) {
+        super.trigger = new CronTrigger(cron);
+        return super.trigger;
+    }
+
+    @Override
+    public void scheduledJob() {
+        log.info("{} 启动", jobDesc);
+    }
+
+}

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

@@ -28,6 +28,10 @@ spring:
         max-active: 8
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         max-wait: 3s
+  cache:
+    cache-names:
+      - pileHoleList
+      - pileMachineList
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driverClassName: com.mysql.cj.jdbc.Driver

+ 10 - 0
bd-park/park-backend/park-collect/src/main/resources/application-schedule.yml

@@ -0,0 +1,10 @@
+huashe:
+  job:
+    sync-:
+      enabled: true
+      cron: 0/10 * * * * ?
+      batchSize: 50
+      desc: 信控状态同步job
+      cfg:
+        timeout-threshold: 5
+        thread-num: 3

+ 9 - 2
bd-park/park-backend/park-collect/src/main/resources/application.yml

@@ -3,7 +3,10 @@ spring:
   application:
     name: ems-collect
   profiles:
-    active: locale,topic
+    active: locale
+    include:
+      - topic
+      - schedule
 
   mvc:
     pathmatch:
@@ -105,4 +108,8 @@ mqtt:
       enabled: false
 id:
   generator:
-    machine-id: 2
+    machine-id: 2
+logging:
+  level:
+    com.ruoyi: debug
+    com.huashe: debug

+ 42 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/consts/enums/MachineStatus.java

@@ -0,0 +1,42 @@
+package com.huashe.park.common.consts.enums;
+
+/**
+ * The enum Cons status.
+ */
+public enum MachineStatus {
+    /**
+     * Cons status 00 cons status.
+     */
+    MACHINE_STATUS_00("00", "在线"),
+    /**
+     * Cons status 02 cons status.
+     */
+    MACHINE_STATUS_01("01", "离线");
+
+    private final String code;
+
+    private final String info;
+
+    MachineStatus(String code, String info) {
+        this.code = code;
+        this.info = info;
+    }
+
+    /**
+     * Gets code.
+     *
+     * @return the code
+     */
+    public String getCode() {
+        return code;
+    }
+
+    /**
+     * Gets info.
+     *
+     * @return the info
+     */
+    public String getInfo() {
+        return info;
+    }
+}

+ 23 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/bean/JobInfoVO.java

@@ -0,0 +1,23 @@
+package com.huashe.park.common.job.bean;
+
+public class JobInfoVO {
+    private String jobKey;
+
+    private String cron;
+
+    public String getJobKey() {
+        return jobKey;
+    }
+
+    public void setJobKey(String jobKey) {
+        this.jobKey = jobKey;
+    }
+
+    public String getCron() {
+        return cron;
+    }
+
+    public void setCron(String cron) {
+        this.cron = cron;
+    }
+}

+ 33 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/ITriggerTask.java

@@ -0,0 +1,33 @@
+package com.huashe.park.common.job.schedule;
+
+import org.springframework.scheduling.support.CronTrigger;
+
+public interface ITriggerTask {
+    /**
+     * 获取 类别,区分 不同的Bean 对象
+     *
+     * @return
+     */
+    String type();
+
+    /**
+     * 获取 run 方法
+     *
+     * @return
+     */
+    Runnable getTask();
+
+    /**
+     * 获取触发器,一般是 CronTrigger
+     *
+     * @return
+     */
+    CronTrigger getTrigger();
+
+    /**
+     * 接口 动态修改 定时任务的表达式
+     */
+    CronTrigger setTrigger(String cron);
+
+    void scheduledJob();
+}

+ 236 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/JobBase.java

@@ -0,0 +1,236 @@
+package com.huashe.park.common.job.schedule;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ScheduledFuture;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.lang.NonNull;
+import org.springframework.scheduling.TaskScheduler;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * The type Job config.
+ *
+ * @author chen.cheng
+ */
+@EnableScheduling
+@Configuration
+public class JobBase implements SchedulingConfigurer, DisposableBean {
+    /**
+     * The Logger.
+     *
+     * @author chen.cheng
+     */
+    private final Logger logger = LoggerFactory.getLogger(JobBase.class);
+
+    /**
+     * The Scheduled services. </br>
+     * 自定义,参考 TriggerTask,为了统一在实现类中,调用 getTrigger() 和 getTask()
+     *
+     * @author chen.cheng
+     */
+    public Collection<ITriggerTask> scheduledServices;
+
+    /**
+     * The Task scheduler. </br>
+     * 句柄,方便后期获取 future
+     *
+     * @author chen.cheng
+     */
+    private TaskScheduler taskScheduler;
+
+    /**
+     * Instantiates a new Job config. </br>
+     * spring特性: 初始化该类时,自动获取和装配 项目中 所有的子类 ITriggerTask
+     *
+     * @param scheduledServices the scheduled services
+     * @author chen.cheng
+     */
+    public JobBase(Collection<ITriggerTask> scheduledServices) {
+        this.scheduledServices = scheduledServices;
+    }
+
+    /**
+     * Future handles, to cancel the running jobs
+     */
+    private static final Map<String, ScheduledFuture> FUTURE_MAP = new ConcurrentHashMap<>();
+
+    /**
+     * 获取 定时任务的具体的类,用于后期 重启,更新等操作
+     */
+    private static final Map<String, ITriggerTask> SERVICE_MAP = new ConcurrentHashMap<>();
+
+    /**
+     * 线程池任务调度器
+     * <p>
+     * 支持注解方式,@Scheduled(cron = "0/5 * * * * ?")
+     */
+    @Bean
+    public TaskScheduler taskSchedulerHandle() {
+        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
+        scheduler.setPoolSize(Runtime.getRuntime().availableProcessors() * 2);
+        scheduler.setThreadNamePrefix("TaskScheduler-");
+        // 保证能立刻丢弃运行中的任务
+        scheduler.setRemoveOnCancelPolicy(true);
+        // 获取 句柄,方便后期获取 future
+        taskScheduler = scheduler;
+
+        return scheduler;
+    }
+
+    /**
+     * @see <a href=
+     *      'https://www.codota.com/code/java/methods/org.springframework.scheduling.config.ScheduledTaskRegistrar/addTriggerTask'>codota
+     *      代码提示工具</a>
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        // 不用担心,这里的scheduler跟 上面的注解 Bean 是同一个对象,亲自打断点验证
+        taskRegistrar.setScheduler(taskSchedulerHandle());
+
+        if (CollectionUtils.isEmpty(scheduledServices)) {
+            return;
+        }
+        for (final ITriggerTask service : scheduledServices) {
+            ScheduledFuture<?> schedule = taskScheduler.schedule(service.getTask(), service.getTrigger());
+            FUTURE_MAP.put(service.type().toLowerCase(), schedule);
+            SERVICE_MAP.put(service.type().toLowerCase(), service);
+        }
+    }
+
+    // =============================动态配置 cron 表达式,立刻生效,支持 停止、重启、更新cron==============================================
+
+    /**
+     * Get object.
+     *
+     * @return the object
+     * @author chen.cheng
+     */
+    public Object get() {
+        final Set<String> names = FUTURE_MAP.keySet();
+        Map<String, Object> map = new HashMap<>();
+
+        map.put("futures", names);
+        map.put("services", new HashMap<Object, Object>() {
+            {
+                for (Entry<String, ITriggerTask> entry : SERVICE_MAP.entrySet()) {
+                    put(entry.getKey(), entry.getValue().getTrigger().getExpression());
+                }
+            }
+        });
+
+        return map.toString();
+    }
+
+    /**
+     * 新增
+     */
+    public Object add(@NonNull ITriggerTask task) {
+        String type = task.type();
+        String cron = task.getTrigger().getExpression();
+
+        if (FUTURE_MAP.containsKey(type)) {
+            return "请重新指定 任务的 type 属性";
+        }
+
+        ScheduledFuture<?> future = taskScheduler.schedule(task.getTask(), task.getTrigger());
+        FUTURE_MAP.put(type, future);
+        SERVICE_MAP.put(type, task);
+
+        String format = String.format("添加新任务成功: :[%s],[%s]", type, cron);
+        logger.info(format);
+        return format;
+    }
+
+    /**
+     * 更新
+     */
+    public void update(@NonNull final String type, @NonNull final String cron) {
+        if (!FUTURE_MAP.containsKey(type)) {
+            return;
+        }
+        // BUG 修复
+        ScheduledFuture future = FUTURE_MAP.get(type);
+        if (future != null) {
+            future.cancel(true);
+        }
+
+        ITriggerTask service = SERVICE_MAP.get(type);
+        CronTrigger newTri = service.setTrigger(cron);
+
+        future = taskScheduler.schedule(service.getTask(), newTri);
+        // 必须更新一下对象,否则下次cencel 会失败
+        FUTURE_MAP.put(type, future);
+    }
+
+    /**
+     * 取消
+     */
+    public Object cancel(@NonNull String type) {
+        if (!FUTURE_MAP.containsKey(type)) {
+            return "取消失败,不存在该任务,请检查 type: " + type;
+        }
+        ScheduledFuture future = FUTURE_MAP.get(type);
+        if (future != null) {
+            future.cancel(true);
+        }
+
+        FUTURE_MAP.remove(type);
+
+        return "成功取消执行中的任务 : " + type;
+    }
+
+    /**
+     * 重启已经存在的任务
+     */
+    public Object restart(@NonNull String type) {
+        ITriggerTask service = SERVICE_MAP.get(type);
+        if (service == null) {
+            return "无法启动任务,请检查 type: " + type;
+        }
+
+        if (FUTURE_MAP.containsKey(type)) {
+            ScheduledFuture future = FUTURE_MAP.get(type);
+            if (future != null) {
+                future.cancel(true);
+            }
+        }
+
+        ScheduledFuture<?> future = taskScheduler.schedule(service.getTask(), service.getTrigger());
+        // 必须更新一下对象,否则下次cencel 会失败
+        FUTURE_MAP.put(type, future);
+
+        return "成功重启任务 type: " + type + ",cron: " + service.getTrigger().getExpression();
+    }
+
+    /**
+     * Destroy.
+     *
+     * @author chen.cheng
+     */
+    @Override
+    public void destroy() {
+        for (ScheduledFuture future : FUTURE_MAP.values()) {
+            if (future != null) {
+                future.cancel(true);
+            }
+        }
+        FUTURE_MAP.clear();
+        SERVICE_MAP.clear();
+        ((ThreadPoolTaskScheduler) taskScheduler).destroy();
+    }
+
+}

+ 50 - 0
bd-park/park-backend/park-common/src/main/java/com/huashe/park/common/job/schedule/TriggerTaskSupport.java

@@ -0,0 +1,50 @@
+package com.huashe.park.common.job.schedule;
+
+import org.springframework.scheduling.support.CronTrigger;
+
+public abstract class TriggerTaskSupport implements ITriggerTask {
+    public CronTrigger trigger;
+
+    /**
+     * 获取触发器,一般是 CronTrigger
+     *
+     * @return
+     */
+    @Override
+    public CronTrigger getTrigger() {
+        return trigger;
+    }
+
+    /**
+     * 接口 动态修改 定时任务的表达式
+     *
+     * @param cron
+     */
+    @Override
+    public CronTrigger setTrigger(String cron) {
+        this.trigger = new CronTrigger("0 0/10 * * * ?");
+        return this.trigger;
+    }
+
+    @Override
+    public String type() {
+        return this.getClass().getSimpleName().toLowerCase();
+    }
+
+    /**
+     * 获取 run 方法
+     *
+     * @return
+     */
+    @Override
+    public Runnable getTask() {
+        return this::scheduledJob;
+    }
+
+    @Override
+    public String toString() {
+        return "TriggerTask{" + "type=" + type() + ", task=" + getTask() + "cronTrigger=" + getTrigger().getExpression()
+            + '}';
+    }
+
+}

+ 1 - 0
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/mapper/ConsPileHoleInfoMapper.java

@@ -21,6 +21,7 @@ public interface ConsPileHoleInfoMapper {
      */
     public ConsPileHoleInfo selectConsPileHoleInfoById(Long id);
 
+    public ConsPileHoleInfo selectConsPileHoleInfoByByteId(String id);
     /**
      * 查询施工桩点信息列表
      *

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

@@ -0,0 +1,62 @@
+package com.huashe.park.core.mapper;
+
+import com.huashe.park.domain.entity.PileHoleIndexRealtime;
+
+import java.util.List;
+
+/**
+ * 桩点最新指标Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-02-28
+ */
+public interface PileHoleIndexRealtimeMapper 
+{
+    /**
+     * 查询桩点最新指标
+     * 
+     * @param id 桩点最新指标主键
+     * @return 桩点最新指标
+     */
+    public PileHoleIndexRealtime selectPileHoleIndexRealtimeById(Long id);
+
+    /**
+     * 查询桩点最新指标列表
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 桩点最新指标集合
+     */
+    public List<PileHoleIndexRealtime> selectPileHoleIndexRealtimeList(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 新增桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    public int insertPileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 修改桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    public int updatePileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 删除桩点最新指标
+     * 
+     * @param id 桩点最新指标主键
+     * @return 结果
+     */
+    public int deletePileHoleIndexRealtimeById(Long id);
+
+    /**
+     * 批量删除桩点最新指标
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePileHoleIndexRealtimeByIds(Long[] ids);
+}

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

@@ -19,6 +19,8 @@ public interface IConsPileHoleInfoService {
      */
     public ConsPileHoleInfo selectConsPileHoleInfoById(Long id);
 
+    ConsPileHoleInfo selectConsPileHoleInfoByteId(String byteKey);
+
     /**
      * 查询施工桩点信息列表
      * 

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

@@ -0,0 +1,61 @@
+package com.huashe.park.core.service;
+
+import java.util.List;
+
+import com.huashe.park.domain.entity.PileHoleIndexRealtime;
+
+/**
+ * 桩点最新指标Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-02-28
+ */
+public interface IPileHoleIndexRealtimeService {
+    /**
+     * 查询桩点最新指标
+     * 
+     * @param id 桩点最新指标主键
+     * @return 桩点最新指标
+     */
+    public PileHoleIndexRealtime selectPileHoleIndexRealtimeById(Long id);
+
+    /**
+     * 查询桩点最新指标列表
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 桩点最新指标集合
+     */
+    public List<PileHoleIndexRealtime> selectPileHoleIndexRealtimeList(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 新增桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    public int insertPileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 修改桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    public int updatePileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime);
+
+    /**
+     * 批量删除桩点最新指标
+     * 
+     * @param ids 需要删除的桩点最新指标主键集合
+     * @return 结果
+     */
+    public int deletePileHoleIndexRealtimeByIds(Long[] ids);
+
+    /**
+     * 删除桩点最新指标信息
+     * 
+     * @param id 桩点最新指标主键
+     * @return 结果
+     */
+    public int deletePileHoleIndexRealtimeById(Long id);
+}

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
 
 import com.huashe.park.common.EnhancedIDGenerator;
 import com.huashe.park.core.mapper.ConsPileHoleInfoMapper;
+import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.domain.entity.ConsPileHoleInfo;
 
@@ -24,6 +25,11 @@ public class ConsPileHoleInfoServiceImpl implements IConsPileHoleInfoService {
     @Autowired
     private EnhancedIDGenerator byte8Id;
 
+    @Autowired
+    private RedisProxy redisProxy;
+
+    private static final String CACHE_KEY = "consPileHoleInfo:byteId:%s";
+
     /**
      * 查询施工桩点信息
      * 
@@ -35,6 +41,17 @@ public class ConsPileHoleInfoServiceImpl implements IConsPileHoleInfoService {
         return consPileHoleInfoMapper.selectConsPileHoleInfoById(id);
     }
 
+    @Override
+    public ConsPileHoleInfo selectConsPileHoleInfoByteId(String byteKey) {
+        String redisKey = String.format(CACHE_KEY, byteKey);
+        if (redisProxy.hasKey(redisKey)) {
+            return redisProxy.getCacheObject(redisKey);
+        }
+        ConsPileHoleInfo consPileHoleInfo = consPileHoleInfoMapper.selectConsPileHoleInfoByByteId(byteKey);
+        redisProxy.setCacheObject(redisKey, consPileHoleInfo);
+        return consPileHoleInfo;
+    }
+
     /**
      * 查询施工桩点信息列表
      * 

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

@@ -0,0 +1,88 @@
+package com.huashe.park.core.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.huashe.park.core.mapper.PileHoleIndexRealtimeMapper;
+import com.huashe.park.core.service.IPileHoleIndexRealtimeService;
+import com.huashe.park.domain.entity.PileHoleIndexRealtime;
+
+/**
+ * 桩点最新指标Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-02-28
+ */
+@Service
+public class PileHoleIndexRealtimeServiceImpl implements IPileHoleIndexRealtimeService {
+    @Autowired
+    private PileHoleIndexRealtimeMapper pileHoleIndexRealtimeMapper;
+
+    /**
+     * 查询桩点最新指标
+     * 
+     * @param id 桩点最新指标主键
+     * @return 桩点最新指标
+     */
+    @Override
+    public PileHoleIndexRealtime selectPileHoleIndexRealtimeById(Long id) {
+        return pileHoleIndexRealtimeMapper.selectPileHoleIndexRealtimeById(id);
+    }
+
+    /**
+     * 查询桩点最新指标列表
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 桩点最新指标
+     */
+    @Override
+    public List<PileHoleIndexRealtime> selectPileHoleIndexRealtimeList(PileHoleIndexRealtime pileHoleIndexRealtime) {
+        return pileHoleIndexRealtimeMapper.selectPileHoleIndexRealtimeList(pileHoleIndexRealtime);
+    }
+
+    /**
+     * 新增桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    @Override
+    public int insertPileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime) {
+        return pileHoleIndexRealtimeMapper.insertPileHoleIndexRealtime(pileHoleIndexRealtime);
+    }
+
+    /**
+     * 修改桩点最新指标
+     * 
+     * @param pileHoleIndexRealtime 桩点最新指标
+     * @return 结果
+     */
+    @Override
+    public int updatePileHoleIndexRealtime(PileHoleIndexRealtime pileHoleIndexRealtime) {
+        return pileHoleIndexRealtimeMapper.updatePileHoleIndexRealtime(pileHoleIndexRealtime);
+    }
+
+    /**
+     * 批量删除桩点最新指标
+     * 
+     * @param ids 需要删除的桩点最新指标主键
+     * @return 结果
+     */
+    @Override
+    public int deletePileHoleIndexRealtimeByIds(Long[] ids) {
+        return pileHoleIndexRealtimeMapper.deletePileHoleIndexRealtimeByIds(ids);
+    }
+
+    /**
+     * 删除桩点最新指标信息
+     * 
+     * @param id 桩点最新指标主键
+     * @return 结果
+     */
+    @Override
+    public int deletePileHoleIndexRealtimeById(Long id) {
+        return pileHoleIndexRealtimeMapper.deletePileHoleIndexRealtimeById(id);
+    }
+}

+ 13 - 1
bd-park/park-backend/park-core/src/main/java/com/huashe/park/core/service/impl/PileMachineInfoServiceImpl.java

@@ -14,6 +14,7 @@ import com.huashe.common.utils.StringUtils;
 import com.huashe.park.common.EnhancedIDGenerator;
 import com.huashe.park.common.consts.enums.ConsStatus;
 import com.huashe.park.core.mapper.PileMachineInfoMapper;
+import com.huashe.park.core.redis.RedisProxy;
 import com.huashe.park.core.service.IConsPileHoleInfoService;
 import com.huashe.park.core.service.IConsUnitInfoService;
 import com.huashe.park.core.service.IConsUnitMachineRelService;
@@ -56,6 +57,11 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
     @Autowired
     private EnhancedIDGenerator byte8Id;
 
+    @Autowired
+    private RedisProxy redisProxy;
+
+    private static final String CACHE_KEY = "consPileMachineInfo:byteId:%s";
+
     /**
      * 查询施工桩机信息
      * 
@@ -69,7 +75,13 @@ public class PileMachineInfoServiceImpl implements IPileMachineInfoService {
 
     @Override
     public PileMachineInfo selectPileMachineInfoByByteId(String byteId) {
-        return pileMachineInfoMapper.selectPileMachineInfoByByteId(byteId);
+        String redisKey = String.format(CACHE_KEY, byteId);
+        if (redisProxy.hasKey(redisKey)) {
+            return redisProxy.getCacheObject(redisKey);
+        }
+        PileMachineInfo pileMachineInfo = pileMachineInfoMapper.selectPileMachineInfoByByteId(byteId);
+        redisProxy.setCacheObject(redisKey, pileMachineInfo);
+        return pileMachineInfo;
     }
 
     /**

+ 5 - 0
bd-park/park-backend/park-core/src/main/resources/mapper/cons/ConsPileHoleInfoMapper.xml

@@ -68,6 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
+    <select id="selectConsPileHoleInfoByByteId" parameterType="String" resultMap="ConsPileHoleInfoResult">
+        <include refid="selectConsPileHoleInfoVo"/>
+        where byte_id = #{byteId}
+    </select>
+
     <insert id="insertConsPileHoleInfo" parameterType="ConsPileHoleInfo" useGeneratedKeys="true" keyProperty="id">
         insert into cons_pile_hole_info
         <trim prefix="(" suffix=")" suffixOverrides=",">

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

@@ -0,0 +1,102 @@
+<?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">
+<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"    />
+    </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
+    </sql>
+
+    <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>
+    </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 into cons_pile_hole_index_realtime
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="holeId != null">hole_id,</if>
+            <if test="holeByteKey != null and holeByteKey != ''">hole_byte_key,</if>
+            <if test="machineId != null">machine_id,</if>
+            <if test="machineByteKey != null and machineByteKey != ''">machine_byte_key,</if>
+            <if test="depth != null">depth,</if>
+            <if test="current != null">current,</if>
+            <if test="verticalDeviation != null">vertical_deviation,</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 prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="holeId != null">#{holeId},</if>
+            <if test="holeByteKey != null and holeByteKey != ''">#{holeByteKey},</if>
+            <if test="machineId != null">#{machineId},</if>
+            <if test="machineByteKey != null and machineByteKey != ''">#{machineByteKey},</if>
+            <if test="depth != null">#{depth},</if>
+            <if test="current != null">#{current},</if>
+            <if test="verticalDeviation != null">#{verticalDeviation},</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>
+    </insert>
+
+    <update id="updatePileHoleIndexRealtime" parameterType="PileHoleIndexRealtime">
+        update cons_pile_hole_index_realtime
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="holeId != null">hole_id = #{holeId},</if>
+            <if test="holeByteKey != null and holeByteKey != ''">hole_byte_key = #{holeByteKey},</if>
+            <if test="machineId != null">machine_id = #{machineId},</if>
+            <if test="machineByteKey != null and machineByteKey != ''">machine_byte_key = #{machineByteKey},</if>
+            <if test="depth != null">depth = #{depth},</if>
+            <if test="current != null">current = #{current},</if>
+            <if test="verticalDeviation != null">vertical_deviation = #{verticalDeviation},</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 id = #{id}
+    </update>
+
+    <delete id="deletePileHoleIndexRealtimeById" parameterType="Long">
+        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 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 19 - 1
bd-park/park-backend/park-core/src/main/resources/mapper/cons/PileMachineInfoMapper.xml

@@ -19,6 +19,7 @@
         <result property="serverPort" column="server_port"/>
         <result property="serverUserName" column="server_user_name"/>
         <result property="serverPassword" column="server_password"/>
+        <result property="status" column="status"/>
         <result property="updateTime" column="update_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
@@ -29,7 +30,21 @@
         select id,
                byte_id,
                machine_num,
-               equipment, no, pwd, sn, product_key, device_secret, topic, server_host, server_port, server_user_name, server_password, update_time, create_time, create_by, update_by
+               equipment,
+               pwd,
+               sn,
+               product_key,
+               device_secret,
+               topic,
+               server_host,
+               server_port,
+               server_user_name,
+               server_password,
+               status,
+               update_time,
+               create_time,
+               create_by,
+               update_by, no
         from cons_pile_machine_info
     </sql>
 
@@ -68,6 +83,7 @@
             <if test="serverPort != null">server_port,</if>
             <if test="serverUserName != null">server_user_name,</if>
             <if test="serverPassword != null">server_password,</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>
@@ -87,6 +103,7 @@
             <if test="serverPort != null">#{serverPort},</if>
             <if test="serverUserName != null">#{serverUserName},</if>
             <if test="serverPassword != null">#{serverPassword},</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>
@@ -110,6 +127,7 @@
             <if test="serverPort != null">server_port = #{serverPort},</if>
             <if test="serverUserName != null">server_user_name = #{serverUserName},</if>
             <if test="serverPassword != null">server_password = #{serverPassword},</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>

+ 139 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileHoleIndexRealtime.java

@@ -0,0 +1,139 @@
+package com.huashe.park.domain.entity;
+
+import com.huashe.common.annotation.Excel;
+import com.huashe.common.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 桩点最新指标对象 cons_pile_hole_index_realtime
+ * 
+ * @author ruoyi
+ * @date 2025-02-28
+ */
+public class PileHoleIndexRealtime extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long id;
+
+    /** 桩点id */
+    @Excel(name = "桩点id")
+    private Long holeId;
+
+    /** 桩点编号 */
+    @Excel(name = "桩点编号")
+    private String holeByteKey;
+
+    /** 桩机id */
+    @Excel(name = "桩机id")
+    private Long machineId;
+
+    /** 桩机编号 */
+    @Excel(name = "桩机编号")
+    private String machineByteKey;
+
+    /** 桩机实际深度 */
+    @Excel(name = "桩机实际深度")
+    private Long depth;
+
+    /** 电机电流 */
+    @Excel(name = "电机电流")
+    private Long current;
+
+    /** 垂直偏差 */
+    @Excel(name = "垂直偏差")
+    private Long verticalDeviation;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setHoleId(Long holeId) 
+    {
+        this.holeId = holeId;
+    }
+
+    public Long getHoleId() 
+    {
+        return holeId;
+    }
+    public void setHoleByteKey(String holeByteKey) 
+    {
+        this.holeByteKey = holeByteKey;
+    }
+
+    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(Long depth) 
+    {
+        this.depth = depth;
+    }
+
+    public Long getDepth() 
+    {
+        return depth;
+    }
+    public void setCurrent(Long current) 
+    {
+        this.current = current;
+    }
+
+    public Long getCurrent() 
+    {
+        return current;
+    }
+    public void setVerticalDeviation(Long verticalDeviation) 
+    {
+        this.verticalDeviation = verticalDeviation;
+    }
+
+    public Long getVerticalDeviation() 
+    {
+        return verticalDeviation;
+    }
+
+    @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())
+            .toString();
+    }
+}

+ 10 - 0
bd-park/park-backend/park-domain/src/main/java/com/huashe/park/domain/entity/PileMachineInfo.java

@@ -65,6 +65,8 @@ public class PileMachineInfo extends BaseEntity {
     @JsonProperty("deviceSecret")
     private String deviceSecret;
 
+    private String status;
+
     public void setId(Long id) {
         this.id = id;
     }
@@ -193,6 +195,14 @@ public class PileMachineInfo extends BaseEntity {
         this.deviceSecret = deviceSecret;
     }
 
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())