From 722f3d8cfd48e3db2836578b36cff648dee1f72a Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 03 十一月 2026 13:22:09 +0800
Subject: [PATCH] feat: 设备遥测实时采集与报警推送

---
 src/main/java/com/ruoyi/unattended/telemetry/service/impl/DeviceTelemetryServiceImpl.java |  160 +++++++++++++++
 src/main/java/com/ruoyi/unattended/telemetry/service/DeviceAlarmPushService.java          |   64 ++++++
 doc/unattended_upgrade.sql                                                                |   23 ++
 src/main/java/com/ruoyi/unattended/telemetry/controller/DeviceTelemetryController.java    |   22 ++
 doc/device_monitor_integration.md                                                         |   55 +++++
 src/main/java/com/ruoyi/unattended/telemetry/service/DeviceTelemetryService.java          |    5 
 src/main/resources/application-dev.yml                                                    |  222 ++++++++++++++++++++++
 src/main/resources/application-tide.yml                                                   |    6 
 src/main/resources/application.yml                                                        |    3 
 9 files changed, 554 insertions(+), 6 deletions(-)

diff --git a/doc/device_monitor_integration.md b/doc/device_monitor_integration.md
new file mode 100644
index 0000000..304344f
--- /dev/null
+++ b/doc/device_monitor_integration.md
@@ -0,0 +1,55 @@
+# 璁惧杩滅▼鐩戞帶鎺ュ叆璇存槑
+
+## 閬ユ祴鏁版嵁涓婃姤
+
+PLC 鎴栬竟缂樼綉鍏充娇鐢ㄧ櫥褰曞悗鐨� Bearer Token 璋冪敤锛�
+
+`POST /environmentAccess/deviceMonitor/report`
+
+```json
+{
+  "deviceLedgerId": 1,
+  "temperature": 72.5,
+  "pressure": 0.86,
+  "vibration": 3.2,
+  "energy": 12.6,
+  "collectTime": "2026-11-03 10:30:00"
+}
+```
+
+鏈嶅姟绔細鏍规嵁璁惧鍙拌处闃堝�煎垽瀹� `normal`銆乣warning` 鎴� `alarm`锛屽紓甯哥姸鎬侀娆″嚭鐜版垨鍗囩骇鏃讹紝閫氳繃 `/environmentAccess/deviceMonitor/alarm-stream` 瀹炴椂鎺ㄩ�佺粰鍦ㄧ嚎椤甸潰銆�
+
+## 杩滅▼鍚仠缃戝叧
+
+鍦ㄩ厤缃枃浠朵腑澧炲姞缁熶竴鎺у埗缃戝叧鍦板潃锛涗护鐗屽缓璁粠鐜鍙橀噺璇诲彇锛屼笉瑕佺洿鎺ュ啓鍏ョ増鏈簱锛�
+
+```yaml
+unattended:
+  device-control:
+    gateway-url: http://127.0.0.1:9000/api/device/control
+    auth-token: ${DEVICE_CONTROL_TOKEN:}
+```
+
+绯荤粺鍚戠綉鍏冲彂閫侊細
+
+```json
+{
+  "deviceId": 1,
+  "deviceName": "绌哄帇鏈� 1#",
+  "action": "start",
+  "commandTime": "2026-11-03T10:30:00"
+}
+```
+
+缃戝叧杩斿洖浠绘剰 2xx 鐘舵�佺爜瑙嗕负璁惧纭锛岄殢鍚庣郴缁熸洿鏂拌繍琛岀姸鎬侊紱杩炴帴澶辫触鎴栭潪 2xx 鏃朵笉浼氫慨鏀圭姸鎬併�傛湭閰嶇疆缃戝叧鍦板潃鏃朵娇鐢ㄦ湰鍦拌仈璋冩ā寮忋��
+
+## 鑷姩妯℃嫙閲囬泦
+
+榛樿姣� 30 绉掕嚜鍔ㄧ敓鎴愪竴缁勮仈璋冩暟鎹�傛帴鍏ョ湡瀹� PLC/缃戝叧鍚庡簲鍏抽棴妯℃嫙閲囬泦锛�
+
+```yaml
+unattended:
+  telemetry:
+    auto-collect-enabled: false
+    collect-interval-ms: 30000
+```
diff --git a/doc/unattended_upgrade.sql b/doc/unattended_upgrade.sql
index 0b10a79..f1c5a96 100644
--- a/doc/unattended_upgrade.sql
+++ b/doc/unattended_upgrade.sql
@@ -99,6 +99,29 @@
   KEY `idx_access_plate` (`plate_number`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='闂ㄧ杩涘嚭璁板綍';
 
+CREATE TABLE IF NOT EXISTS `access_vehicle` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `plate_number` varchar(32) NOT NULL COMMENT '杞︾墝鍙�',
+  `plate_color` varchar(16) DEFAULT NULL COMMENT '杞︾墝棰滆壊',
+  `rfid_tag` varchar(64) DEFAULT NULL COMMENT 'RFID鏍囩',
+  `carrier_name` varchar(120) DEFAULT NULL COMMENT '鎵胯繍鍟�',
+  `vehicle_type` varchar(64) DEFAULT NULL COMMENT '杞﹁締绫诲瀷',
+  `driver_name` varchar(64) DEFAULT NULL COMMENT '鍙告満濮撳悕',
+  `driver_phone` varchar(32) DEFAULT NULL COMMENT '鍙告満鐢佃瘽',
+  `valid_start` date DEFAULT NULL COMMENT '鏈夋晥鏈熷紑濮�',
+  `valid_end` date DEFAULT NULL COMMENT '鏈夋晥鏈熺粨鏉�',
+  `status` varchar(16) DEFAULT 'valid' COMMENT '鐘舵�� valid/disabled',
+  `remark` varchar(255) DEFAULT NULL,
+  `create_user` bigint DEFAULT NULL,
+  `create_time` datetime DEFAULT NULL,
+  `update_user` bigint DEFAULT NULL,
+  `update_time` datetime DEFAULT NULL,
+  `tenant_id` bigint DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `idx_access_vehicle_plate` (`plate_number`),
+  KEY `idx_access_vehicle_rfid` (`rfid_tag`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='杞﹁締閫氳鎺堟潈';
+
 -- ------------------------------------------------------------
 -- 3. 鏃犱汉鍊煎畧鍦扮锛氭墿灞曞瓧娈�
 -- ------------------------------------------------------------
diff --git a/src/main/java/com/ruoyi/unattended/telemetry/controller/DeviceTelemetryController.java b/src/main/java/com/ruoyi/unattended/telemetry/controller/DeviceTelemetryController.java
index 212051b..528ca7a 100644
--- a/src/main/java/com/ruoyi/unattended/telemetry/controller/DeviceTelemetryController.java
+++ b/src/main/java/com/ruoyi/unattended/telemetry/controller/DeviceTelemetryController.java
@@ -6,6 +6,9 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.http.MediaType;
+import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
+import com.ruoyi.unattended.telemetry.service.DeviceAlarmPushService;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -21,6 +24,9 @@
     @Resource
     private DeviceTelemetryService deviceTelemetryService;
 
+    @Resource
+    private DeviceAlarmPushService alarmPushService;
+
     @GetMapping("/list")
     @ApiOperation("瀹炴椂鐩戞帶鍒楄〃")
     public AjaxResult list() {
@@ -31,6 +37,16 @@
     @ApiOperation("瑙﹀彂涓�娆¢噰闆�")
     public AjaxResult collect() {
         return AjaxResult.success(deviceTelemetryService.collectOnce());
+    }
+
+    @PostMapping("/report")
+    @ApiOperation("PLC/杈圭紭缃戝叧涓婃姤閬ユ祴鏁版嵁")
+    public AjaxResult report(@RequestBody DeviceTelemetry telemetry) {
+        try {
+            return AjaxResult.success(deviceTelemetryService.report(telemetry));
+        } catch (IllegalArgumentException e) {
+            return AjaxResult.error(e.getMessage());
+        }
     }
 
     @GetMapping("/history")
@@ -47,6 +63,12 @@
         return AjaxResult.success(deviceTelemetryService.alarms());
     }
 
+    @GetMapping(value = "/alarm-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
+    @ApiOperation("璁㈤槄瀹炴椂鎶ヨ鎺ㄩ��")
+    public SseEmitter alarmStream() {
+        return alarmPushService.subscribe();
+    }
+
     @PostMapping("/control")
     @ApiOperation("杩滅▼鍚仠")
     public AjaxResult control(@RequestBody ControlRequest request) {
diff --git a/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceAlarmPushService.java b/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceAlarmPushService.java
new file mode 100644
index 0000000..9be8153
--- /dev/null
+++ b/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceAlarmPushService.java
@@ -0,0 +1,64 @@
+package com.ruoyi.unattended.telemetry.service;
+
+import com.ruoyi.unattended.telemetry.dto.DeviceMonitorVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
+
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * 璁惧鎶ヨ SSE 鎺ㄩ�佷腑蹇冦��
+ */
+@Slf4j
+@Component
+public class DeviceAlarmPushService {
+
+    private final List<SseEmitter> clients = new CopyOnWriteArrayList<>();
+
+    public SseEmitter subscribe() {
+        SseEmitter emitter = new SseEmitter(0L);
+        clients.add(emitter);
+        emitter.onCompletion(() -> clients.remove(emitter));
+        emitter.onTimeout(() -> clients.remove(emitter));
+        emitter.onError(error -> clients.remove(emitter));
+        try {
+            emitter.send(SseEmitter.event()
+                    .name("connected")
+                    .data(Collections.singletonMap("time", LocalDateTime.now().toString())));
+        } catch (IOException e) {
+            clients.remove(emitter);
+        }
+        return emitter;
+    }
+
+    public void publish(DeviceMonitorVo alarm) {
+        for (SseEmitter client : clients) {
+            try {
+                String eventId = alarm.getDeviceId() + "-" + System.currentTimeMillis();
+                client.send(SseEmitter.event().id(eventId).name("alarm").data(alarm));
+            } catch (Exception e) {
+                clients.remove(client);
+            }
+        }
+    }
+
+    /** 淇濇寔浠g悊鍜屾祻瑙堝櫒涔嬮棿鐨勯暱杩炴帴锛屽強鏃舵竻鐞嗗凡鏂紑鐨勫鎴风銆� */
+    @Scheduled(fixedRate = 25000L)
+    public void heartbeat() {
+        for (SseEmitter client : clients) {
+            try {
+                client.send(SseEmitter.event()
+                        .name("heartbeat")
+                        .data(Collections.singletonMap("time", LocalDateTime.now().toString())));
+            } catch (Exception e) {
+                clients.remove(client);
+            }
+        }
+    }
+}
diff --git a/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceTelemetryService.java b/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceTelemetryService.java
index fa045f8..1b67130 100644
--- a/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceTelemetryService.java
+++ b/src/main/java/com/ruoyi/unattended/telemetry/service/DeviceTelemetryService.java
@@ -15,6 +15,11 @@
     List<DeviceMonitorVo> collectOnce();
 
     /**
+     * 鎺ユ敹 PLC/杈圭紭缃戝叧涓婃姤鐨勭湡瀹為仴娴嬫暟鎹紝骞剁珛鍗冲仛闃堝�煎垽瀹氫笌鎶ヨ鎺ㄩ��
+     */
+    DeviceMonitorVo report(DeviceTelemetry telemetry);
+
+    /**
      * 褰撳墠鐩戞帶鎬昏
      */
     List<DeviceMonitorVo> monitorList();
diff --git a/src/main/java/com/ruoyi/unattended/telemetry/service/impl/DeviceTelemetryServiceImpl.java b/src/main/java/com/ruoyi/unattended/telemetry/service/impl/DeviceTelemetryServiceImpl.java
index d3e36cf..4b5835b 100644
--- a/src/main/java/com/ruoyi/unattended/telemetry/service/impl/DeviceTelemetryServiceImpl.java
+++ b/src/main/java/com/ruoyi/unattended/telemetry/service/impl/DeviceTelemetryServiceImpl.java
@@ -7,8 +7,16 @@
 import com.ruoyi.unattended.telemetry.dto.DeviceMonitorVo;
 import com.ruoyi.unattended.telemetry.mapper.DeviceTelemetryMapper;
 import com.ruoyi.unattended.telemetry.pojo.DeviceTelemetry;
+import com.ruoyi.unattended.telemetry.service.DeviceAlarmPushService;
 import com.ruoyi.unattended.telemetry.service.DeviceTelemetryService;
 import lombok.extern.slf4j.Slf4j;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -16,7 +24,9 @@
 import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
+import com.alibaba.fastjson2.JSON;
 
 /**
  * 璁惧閬ユ祴鏈嶅姟銆�
@@ -36,6 +46,24 @@
     @Resource
     private DeviceTelemetryMapper telemetryMapper;
 
+    @Resource
+    private DeviceAlarmPushService alarmPushService;
+
+    @Value("${unattended.device-control.gateway-url:}")
+    private String gatewayUrl;
+
+    @Value("${unattended.device-control.auth-token:}")
+    private String gatewayToken;
+
+    @Value("${unattended.telemetry.auto-collect-enabled:true}")
+    private boolean autoCollectEnabled;
+
+    private final OkHttpClient controlClient = new OkHttpClient.Builder()
+            .connectTimeout(5, TimeUnit.SECONDS)
+            .readTimeout(8, TimeUnit.SECONDS)
+            .writeTimeout(8, TimeUnit.SECONDS)
+            .build();
+
     private static final BigDecimal DEFAULT_TEMP_MIN = new BigDecimal("20");
     private static final BigDecimal DEFAULT_TEMP_MAX = new BigDecimal("80");
     private static final BigDecimal DEFAULT_PRESSURE_MIN = new BigDecimal("0.20");
@@ -53,6 +81,7 @@
         }
         LocalDateTime now = LocalDateTime.now();
         List<DeviceTelemetry> batch = new ArrayList<>();
+        Set<Long> alarmDeviceIds = new HashSet<>();
         for (DeviceLedger device : devices) {
             DeviceTelemetry last = telemetryMapper.selectOne(
                     Wrappers.<DeviceTelemetry>lambdaQuery()
@@ -65,11 +94,87 @@
             telemetry.setDeviceName(device.getDeviceName());
             judge(device, telemetry);
             batch.add(telemetry);
+            if (shouldPush(last, telemetry)) {
+                alarmDeviceIds.add(device.getId());
+            }
         }
         if (!batch.isEmpty()) {
             saveBatch(batch);
         }
-        return monitorList();
+        List<DeviceMonitorVo> result = monitorList();
+        publishAlarms(result, alarmDeviceIds);
+        return result;
+    }
+
+    /**
+     * 榛樿姣� 30 绉掗噰闆嗕竴娆°�傜幇鍦烘帴鍏ョ湡瀹炵綉鍏冲悗鍙皢 auto-collect-enabled 璁句负 false锛�
+     * 鏀圭敱 /report 鎺ュ彛鎺ユ敹 PLC/杈圭紭缃戝叧鏁版嵁銆�
+     */
+    @Scheduled(fixedDelayString = "${unattended.telemetry.collect-interval-ms:30000}",
+            initialDelayString = "${unattended.telemetry.initial-delay-ms:10000}")
+    public void scheduledCollect() {
+        if (!autoCollectEnabled) {
+            return;
+        }
+        try {
+            collectOnce();
+        } catch (Exception e) {
+            log.error("璁惧閬ユ祴瀹氭椂閲囬泦澶辫触", e);
+        }
+    }
+
+    @Override
+    public DeviceMonitorVo report(DeviceTelemetry telemetry) {
+        if (telemetry == null || telemetry.getDeviceLedgerId() == null) {
+            throw new IllegalArgumentException("璁惧id涓嶈兘涓虹┖");
+        }
+        DeviceLedger device = deviceLedgerMapper.selectById(telemetry.getDeviceLedgerId());
+        if (device == null) {
+            throw new IllegalArgumentException("璁惧涓嶅瓨鍦�");
+        }
+        DeviceTelemetry last = latestTelemetry(device.getId());
+        telemetry.setId(null);
+        telemetry.setDeviceName(device.getDeviceName());
+        if (telemetry.getCollectTime() == null) {
+            telemetry.setCollectTime(LocalDateTime.now());
+        }
+        judge(device, telemetry);
+        save(telemetry);
+        DeviceMonitorVo result = monitorList().stream()
+                .filter(item -> device.getId().equals(item.getDeviceId()))
+                .findFirst()
+                .orElseThrow(() -> new IllegalArgumentException("璁惧鐩戞帶鏁版嵁鐢熸垚澶辫触"));
+        if (shouldPush(last, telemetry)) {
+            alarmPushService.publish(result);
+        }
+        return result;
+    }
+
+    private DeviceTelemetry latestTelemetry(Long deviceId) {
+        return telemetryMapper.selectOne(
+                Wrappers.<DeviceTelemetry>lambdaQuery()
+                        .eq(DeviceTelemetry::getDeviceLedgerId, deviceId)
+                        .orderByDesc(DeviceTelemetry::getCollectTime)
+                        .last("limit 1"));
+    }
+
+    private boolean shouldPush(DeviceTelemetry previous, DeviceTelemetry current) {
+        int currentLevel = alarmLevel(current == null ? null : current.getStatus());
+        int previousLevel = alarmLevel(previous == null ? null : previous.getStatus());
+        return currentLevel > 0 && (previousLevel == 0 || currentLevel > previousLevel);
+    }
+
+    private int alarmLevel(String status) {
+        if ("alarm".equalsIgnoreCase(status)) return 2;
+        if ("warning".equalsIgnoreCase(status)) return 1;
+        return 0;
+    }
+
+    private void publishAlarms(List<DeviceMonitorVo> devices, Set<Long> alarmDeviceIds) {
+        if (alarmDeviceIds.isEmpty()) return;
+        devices.stream()
+                .filter(item -> alarmDeviceIds.contains(item.getDeviceId()))
+                .forEach(alarmPushService::publish);
     }
 
     /**
@@ -219,6 +324,7 @@
         } else {
             throw new IllegalArgumentException("涓嶆敮鎸佺殑鎿嶄綔:" + action);
         }
+        Map<String, Object> dispatch = dispatchControl(device, action);
         DeviceLedger update = new DeviceLedger();
         update.setId(deviceId);
         update.setControlStatus(status);
@@ -229,11 +335,61 @@
         result.put("deviceName", device.getDeviceName());
         result.put("controlStatus", status);
         result.put("commandTime", LocalDateTime.now().toString());
-        result.put("message", "running".equals(status) ? "鍚姩鎸囦护宸蹭笅鍙�" : "鍋滄鎸囦护宸蹭笅鍙�");
+        result.putAll(dispatch);
+        boolean localMode = "local".equals(dispatch.get("dispatchMode"));
+        if (localMode) {
+            result.put("message", "鏈湴鑱旇皟鐘舵�佸凡鏇存柊");
+        } else {
+            result.put("message", "running".equals(status) ? "璁惧鍚姩鎸囦护宸茬‘璁�" : "璁惧鍋滄鎸囦护宸茬‘璁�");
+        }
         log.info("[杩滅▼鎺у埗] deviceId={}, action={}, status={}", deviceId, action, status);
         return result;
     }
 
+    /**
+     * 璋冪敤缁熶竴璁惧鎺у埗缃戝叧銆�
+     * 鏈厤缃綉鍏虫椂浣跨敤鏈湴鑱旇皟妯″紡锛屼娇绯荤粺鍙湪纭欢鍒板満鍓嶅畬鎴愪笟鍔¢獙鏀躲��
+     */
+    private Map<String, Object> dispatchControl(DeviceLedger device, String action) {
+        String endpoint = trimToNull(gatewayUrl);
+        Map<String, Object> result = new LinkedHashMap<>();
+        if (endpoint == null) {
+            result.put("dispatchMode", "local");
+            result.put("gatewayAcknowledged", true);
+            return result;
+        }
+
+        Map<String, Object> command = new LinkedHashMap<>();
+        command.put("deviceId", device.getId());
+        command.put("deviceName", device.getDeviceName());
+        command.put("action", action.toLowerCase(Locale.ROOT));
+        command.put("commandTime", LocalDateTime.now().toString());
+        RequestBody body = RequestBody.create(JSON.toJSONString(command),
+                MediaType.parse("application/json; charset=utf-8"));
+        Request.Builder builder = new Request.Builder().url(endpoint).post(body);
+        if (trimToNull(gatewayToken) != null) {
+            builder.header("Authorization", "Bearer " + gatewayToken.trim());
+        }
+        try (Response response = controlClient.newCall(builder.build()).execute()) {
+            if (!response.isSuccessful()) {
+                throw new IllegalArgumentException("璁惧鎺у埗缃戝叧鎷掔粷鎸囦护锛岀姸鎬佺爜锛�" + response.code());
+            }
+            result.put("dispatchMode", "gateway");
+            result.put("gatewayAcknowledged", true);
+            result.put("gatewayStatus", response.code());
+            return result;
+        } catch (IllegalArgumentException e) {
+            throw e;
+        } catch (Exception e) {
+            log.error("璁惧鎺у埗缃戝叧璋冪敤澶辫触锛宒eviceId={}, endpoint={}", device.getId(), endpoint, e);
+            throw new IllegalArgumentException("璁惧鎺у埗缃戝叧杩炴帴澶辫触锛岃妫�鏌ヨ澶囩綉缁�");
+        }
+    }
+
+    private String trimToNull(String value) {
+        return value == null || value.trim().isEmpty() ? null : value.trim();
+    }
+
     @Override
     public List<DeviceMonitorVo> alarms() {
         List<DeviceMonitorVo> all = monitorList();
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..39fa44a
--- /dev/null
+++ b/src/main/resources/application-dev.yml
@@ -0,0 +1,222 @@
+# 鑺」鐩-浠撳偍鐗╂祦绯荤粺鐩稿叧閰嶇疆
+inspur:
+  appId: 1211009035159994368
+  appSecret:  QXdnMjAwMTIwMjYxNTE4MzkwNzMLgG
+ruoyi:
+  # 鍚嶇О
+  name: RuoYi
+  # 鐗堟湰
+  version: 3.8.9
+  # 鐗堟潈骞翠唤
+  copyrightYear: 2025
+  # 鏂囦欢璺緞 绀轰緥锛� Windows閰嶇疆D:/ruoyi/uploadPath锛孡inux閰嶇疆 /home/ruoyi/uploadPath锛�
+  profile: /center-lims/mis/file
+
+  # 鑾峰彇ip鍦板潃寮�鍏�
+  addressEnabled: false
+  # 楠岃瘉鐮佺被鍨� math 鏁板瓧璁$畻 char 瀛楃楠岃瘉
+  captchaType: math
+
+# 寮�鍙戠幆澧冮厤缃�
+server:
+  # 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080
+  port: 8038
+  servlet:
+    # 搴旂敤鐨勮闂矾寰�
+    context-path: /
+  tomcat:
+    # tomcat鐨刄RI缂栫爜
+    uri-encoding: UTF-8
+    # 杩炴帴鏁版弧鍚庣殑鎺掗槦鏁帮紝榛樿涓�100
+    accept-count: 1000
+    threads:
+      # tomcat鏈�澶х嚎绋嬫暟锛岄粯璁や负200
+      max: 800
+      # Tomcat鍚姩鍒濆鍖栫殑绾跨▼鏁帮紝榛樿鍊�10
+      min-spare: 100
+
+# 鏃ュ織閰嶇疆
+logging:
+  level:
+    com.ruoyi: warn
+    org.springframework: warn
+
+minio:
+  endpoint: http://114.132.189.42/
+  port: 7019
+  secure: false
+  accessKey: admin
+  secretKey: 12345678
+  preview-expiry: 24 # 棰勮鍦板潃榛樿24灏忔椂
+  default-bucket: uploadPath
+# 鐢ㄦ埛閰嶇疆
+user:
+  password:
+    # 瀵嗙爜鏈�澶ч敊璇鏁�
+    maxRetryCount: 5
+    # 瀵嗙爜閿佸畾鏃堕棿锛堥粯璁�10鍒嗛挓锛�
+    lockTime: 10
+
+# Spring閰嶇疆
+spring:
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 涓诲簱鏁版嵁婧�
+      master:
+        url: jdbc:mysql://10.136.65.135:3306/wrzsxt-ruoyi-xinlan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: zttZTT123!
+      # 浠庡簱鏁版嵁婧�
+      slave:
+        # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴
+        enabled: false
+        url:
+        username:
+        password:
+      # 鍒濆杩炴帴鏁�
+      initialSize: 5
+      # 鏈�灏忚繛鎺ユ睜鏁伴噺
+      minIdle: 10
+      # 鏈�澶ц繛鎺ユ睜鏁伴噺
+      maxActive: 20
+      # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
+      maxWait: 60000
+      # 閰嶇疆杩炴帴瓒呮椂鏃堕棿
+      connectTimeout: 30000
+      # 閰嶇疆缃戠粶瓒呮椂鏃堕棿
+      socketTimeout: 60000
+      # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
+      timeBetweenEvictionRunsMillis: 60000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      minEvictableIdleTimeMillis: 300000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      maxEvictableIdleTimeMillis: 900000
+      # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂�
+        allow:
+        url-pattern: /druid/*
+        # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮�
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 鎱QL璁板綍
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+  # 璧勬簮淇℃伅
+  messages:
+    # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
+    basename: i18n/messages
+  # 鏂囦欢涓婁紶
+  servlet:
+    multipart:
+      # 鍗曚釜鏂囦欢澶у皬
+      max-file-size: 1GB
+      # 璁剧疆鎬讳笂浼犵殑鏂囦欢澶у皬
+      max-request-size: 2GB
+  # 鏈嶅姟妯″潡
+  devtools:
+    restart:
+      # 鐑儴缃插紑鍏�
+      enabled: false
+  # redis 閰嶇疆
+  redis:
+    # 鍦板潃
+#    host: 127.0.0.1
+    host: 192.168.197.128
+    # 绔彛锛岄粯璁や负6379
+    port: 6379
+    # 鏁版嵁搴撶储寮�
+    database: 0
+    # 瀵嗙爜
+    password: zttZTT123!
+#    password: 123456
+
+    # 杩炴帴瓒呮椂鏃堕棿
+    timeout: 10s
+    lettuce:
+      pool:
+        # 杩炴帴姹犱腑鐨勬渶灏忕┖闂茶繛鎺�
+        min-idle: 0
+        # 杩炴帴姹犱腑鐨勬渶澶х┖闂茶繛鎺�
+        max-idle: 8
+        # 杩炴帴姹犵殑鏈�澶ф暟鎹簱杩炴帴鏁�
+        max-active: 8
+        # #杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級
+        max-wait: -1ms
+
+# token閰嶇疆
+token:
+  # 浠ょ墝鑷畾涔夋爣璇�
+  header: Authorization
+  # 浠ょ墝瀵嗛挜
+  secret: abcdefghijklmnopqrstuvwxyz
+  # 浠ょ墝鏈夋晥鏈燂紙榛樿30鍒嗛挓锛�
+  expireTime: 450
+  
+# MyBatis Plus閰嶇疆
+mybatis-plus:
+  # 鎼滅储鎸囧畾鍖呭埆鍚�   鏍规嵁鑷繁鐨勯」鐩潵
+  typeAliasesPackage: com.ruoyi.**.pojo
+  # 閰嶇疆mapper鐨勬壂鎻忥紝鎵惧埌鎵�鏈夌殑mapper.xml鏄犲皠鏂囦欢
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 鍔犺浇鍏ㄥ眬鐨勯厤缃枃浠�
+  configLocation: classpath:mybatis/mybatis-config.xml
+  global-config:
+    enable-sql-runner: true
+    db-config:
+      id-type: auto
+  
+# PageHelper鍒嗛〉鎻掍欢
+pagehelper:
+  helperDialect: mysql
+  supportMethodsArguments: true
+  params: count=countSql
+
+# Swagger閰嶇疆
+swagger:
+  # 鏄惁寮�鍚痵wagger
+  enabled: false
+  # 璇锋眰鍓嶇紑
+  pathMapping: /dev-api
+
+# 闃叉XSS鏀诲嚮
+xss:
+  # 杩囨护寮�鍏�
+  enabled: true
+  # 鎺掗櫎閾炬帴锛堝涓敤閫楀彿鍒嗛殧锛�
+  excludes: /system/notice
+  # 鍖归厤閾炬帴
+  urlPatterns: /system/*,/monitor/*,/tool/*
+  
+# 浠g爜鐢熸垚
+gen:
+  # 浣滆��
+  author: ruoyi
+  # 榛樿鐢熸垚鍖呰矾寰� system 闇�鏀规垚鑷繁鐨勬ā鍧楀悕绉� 濡� system monitor tool
+  packageName: com.ruoyi.project.system
+  # 鑷姩鍘婚櫎琛ㄥ墠缂�锛岄粯璁ゆ槸true
+  autoRemovePre: false
+  # 琛ㄥ墠缂�锛堢敓鎴愮被鍚嶄笉浼氬寘鍚〃鍓嶇紑锛屽涓敤閫楀彿鍒嗛殧锛�
+  tablePrefix: sys_
+  # 鏄惁鍏佽鐢熸垚鏂囦欢瑕嗙洊鍒版湰鍦帮紙鑷畾涔夎矾寰勶級锛岄粯璁や笉鍏佽
+  allowOverwrite: false
+
+file:
+  temp-dir: /center-lims/mis/file/temp/uploads
+  upload-dir: /center-lims/mis/file/prod/uploads
\ No newline at end of file
diff --git a/src/main/resources/application-tide.yml b/src/main/resources/application-tide.yml
index 0b00519..d52c2c4 100644
--- a/src/main/resources/application-tide.yml
+++ b/src/main/resources/application-tide.yml
@@ -1,7 +1,7 @@
-# 鑺-浠撳偍鐗╂祦绯荤粺椤圭洰鐩稿叧閰嶇疆
+# 鑺」鐩-浠撳偍鐗╂祦绯荤粺鐩稿叧閰嶇疆
 inspur:
-  appId: 1216088544800407552
-  appSecret: TV96MDMwMjIwMjYxNTQyNDg1NDQvSh
+  appId: 1211009035159994368
+  appSecret:  QXdnMjAwMTIwMjYxNTE4MzkwNzMLgG
 ruoyi:
   # 鍚嶇О
   name: RuoYi
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 9e740c8..0909462 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,4 +1,5 @@
 # Spring閰嶇疆
 spring:
   profiles:
-    active: tide
\ No newline at end of file
+#    active: tide
+    active: dev
\ No newline at end of file

--
Gitblit v1.9.3