From a53e6872c70ba7c6c870627007ece21df9bcedbc Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期一, 22 十二月 2025 13:19:33 +0800
Subject: [PATCH] 初始化
---
src/main/java/com/hk/NumericalCollection/entity/DeviceStatus.java | 142 +
src/main/resources/mapper/DeviceStatusByclMapper.xml | 8
src/main/java/com/hk/NumericalCollection/dto/BaseApiResponse.java | 19
src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusByclServiceImpl.java | 16
src/main/java/com/hk/NumericalCollection/mapper/MesOrderSelectMapper.java | 18
src/main/java/com/hk/NumericalCollection/mapper/MesOrderStaMapper.java | 18
src/main/java/com/hk/NumericalCollection/mapper/DeviceErrorMapper.java | 12
src/main/java/com/hk/NumericalCollection/config/DataAcquisitionConfiguration.java | 26
src/main/java/com/hk/NumericalCollection/dto/Params.java | 63
src/main/java/com/hk/NumericalCollection/mapper/DeviceByclMapper.java | 11
src/main/java/com/hk/NumericalCollection/entity/VOrderDetail.java | 184 +
src/main/java/com/hk/NumericalCollection/service/impl/NumericalServiceImpl.java | 902 +++++++
src/main/java/com/hk/NumericalCollection/entity/MesOrderSta.java | 77
src/main/java/com/hk/NumericalCollection/mapper/MesNumericalByclMapper.java | 11
src/main/resources/mapper/MesOrderStaMapper.xml | 7
src/main/java/com/hk/NumericalCollection/entity/MesNumericalBycl.java | 46
src/main/resources/mapper/DevicedatastandardmoditemMapper.xml | 8
src/main/resources/mapper/DeviceErrorMapper.xml | 8
src/main/java/com/hk/NumericalCollection/entity/DevMachine.java | 35
src/main/java/com/hk/NumericalCollection/service/impl/DevMachineServiceImpl.java | 22
src/main/java/com/hk/NumericalCollection/entity/Device.java | 250 ++
src/main/java/com/hk/NumericalCollection/service/ApiService.java | 107
src/main/java/com/hk/NumericalCollection/service/WomdaaService.java | 16
src/main/java/com/hk/NumericalCollection/dto/ApiDataResult.java | 25
pom.xml | 108
src/main/java/com/hk/NumericalCollection/mapper/VOrderMapper.java | 18
src/main/java/com/hk/NumericalCollection/service/impl/DevMacByclServiceImpl.java | 16
src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusMapper.java | 24
src/main/java/com/hk/NumericalCollection/service/DeviceErrorService.java | 12
src/main/java/com/hk/NumericalCollection/config/MybatisPlusConfig.java | 13
src/main/java/com/hk/NumericalCollection/service/impl/VOrderServiceImpl.java | 22
src/main/java/com/hk/NumericalCollection/task/ScheduledTasksNoOrder.java | 87
src/main/java/com/hk/NumericalCollection/dto/ApiRequestBody.java | 20
src/main/java/com/hk/NumericalCollection/service/impl/DeviceMetricsServiceImpl.java | 814 ++++++
src/main/java/com/hk/NumericalCollection/entity/DevMetricsSeq.java | 17
src/main/java/com/hk/NumericalCollection/mapper/DeviceMapper.java | 19
src/main/java/com/hk/NumericalCollection/service/impl/WomcaaServiceImpl.java | 22
src/main/resources/mapper/DevMacByclMapper.xml | 9
src/main/java/com/hk/NumericalCollection/service/impl/VOrderDetailServiceImpl.java | 21
src/main/java/com/hk/NumericalCollection/entity/MesNumerical.java | 45
src/main/java/com/hk/NumericalCollection/entity/MesOrderSelect.java | 50
src/main/java/com/hk/NumericalCollection/entity/DeviceStatusBycl.java | 143 +
src/main/java/com/hk/NumericalCollection/entity/DeviceDayCount.java | 112
src/main/java/com/hk/NumericalCollection/service/DeviceService.java | 14
src/main/java/com/hk/NumericalCollection/mapper/DevMacByclMapper.java | 11
src/main/java/com/hk/NumericalCollection/service/WomcaaService.java | 13
src/main/resources/mapper/MesOrderSelectMapper.xml | 7
src/main/java/com/hk/NumericalCollection/dto/ApiResponseCode.java | 51
src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalByclServiceImpl.java | 16
src/main/java/com/hk/NumericalCollection/entity/DevMacBycl.java | 35
src/main/java/com/hk/NumericalCollection/entity/DeviceBycl.java | 251 ++
src/main/java/com/hk/NumericalCollection/service/impl/DeviceByclServiceImpl.java | 15
src/main/resources/mapper/DeviceMetricsMapper.xml | 7
src/test/java/com/hk/NumericalCollection/DeviceReceivingApplicationTests.java | 177 +
src/main/resources/mapper/VOrderDetailMapper.xml | 7
src/main/java/com/hk/NumericalCollection/entity/Devicedatastandardmoditem.java | 120
src/main/resources/application.yml | 41
src/main/java/com/hk/NumericalCollection/entity/DeviceRealTimeData.java | 531 ++++
src/main/java/com/hk/NumericalCollection/service/DeviceMetricsService.java | 24
src/main/resources/mapper/WomdaaMapper.xml | 24
src/main/java/com/hk/NumericalCollection/entity/Womcaa.java | 321 ++
src/main/java/com/hk/NumericalCollection/service/MesNumericalByclService.java | 11
src/main/java/com/hk/NumericalCollection/config/ResultMessage.java | 39
src/main/java/com/hk/NumericalCollection/mapper/VOrderDetailMapper.java | 14
src/main/java/com/hk/NumericalCollection/entity/Womdaa.java | 331 ++
src/main/resources/mapper/DeviceStatusMapper.xml | 21
src/main/java/com/hk/NumericalCollection/dto/NumbericalDto.java | 23
src/main/resources/mapper/DeviceByclMapper.xml | 8
src/main/java/com/hk/NumericalCollection/service/DeviceByclService.java | 10
src/main/java/com/hk/NumericalCollection/service/DevMachineService.java | 13
src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusServiceImpl.java | 32
src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalServiceImpl.java | 36
src/main/java/com/hk/NumericalCollection/service/impl/MesOrderSelectServiceImpl.java | 22
src/main/resources/mapper/WomcaaMapper.xml | 8
src/main/java/com/hk/NumericalCollection/entity/VOrder.java | 185 +
src/main/resources/mapper/DeviceMapper.xml | 8
src/main/resources/mapper/VOrderMapper.xml | 8
src/main/java/com/hk/NumericalCollection/mapper/DevMachineMapper.java | 18
src/main/java/com/hk/NumericalCollection/dto/ApiResponse.java | 25
src/main/java/com/hk/NumericalCollection/service/impl/DevicedatastandardmoditemServiceImpl.java | 22
src/main/java/com/hk/NumericalCollection/service/impl/DeviceServiceImpl.java | 22
README.md | 135 +
src/main/java/com/hk/NumericalCollection/service/impl/DeviceErrorServiceImpl.java | 17
src/main/java/com/hk/NumericalCollection/service/MesOrderSelectService.java | 13
src/main/java/com/hk/NumericalCollection/mapper/WomcaaMapper.java | 18
src/main/java/com/hk/NumericalCollection/NumericalApplication.java | 19
src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusByclMapper.java | 11
src/main/java/com/hk/NumericalCollection/service/DeviceStatusService.java | 16
src/main/java/com/hk/NumericalCollection/task/ScheduledTasks.java | 124
src/main/java/com/hk/NumericalCollection/service/INumericalService.java | 48
src/main/java/com/hk/NumericalCollection/service/MesNumericalService.java | 14
src/main/java/com/hk/NumericalCollection/mapper/WomdaaMapper.java | 23
src/main/java/com/hk/NumericalCollection/entity/DeviceError.java | 132 +
src/main/java/com/hk/NumericalCollection/service/VOrderService.java | 13
src/main/java/com/hk/NumericalCollection/service/impl/NumericalNoOrderServiceImpl.java | 298 ++
src/main/java/com/hk/NumericalCollection/service/INumericalNoOrderService.java | 57
src/main/resources/mapper/MesNumericalByclMapper.xml | 8
src/main/resources/mapper/MesNumericalMapper.xml | 8
src/main/java/com/hk/NumericalCollection/dto/ErrorDetail.java | 16
src/main/java/com/hk/NumericalCollection/service/DevMacByclService.java | 11
src/main/java/com/hk/NumericalCollection/service/DeviceStatusByclService.java | 11
src/main/java/com/hk/NumericalCollection/mapper/MesNumericalMapper.java | 18
src/main/java/com/hk/NumericalCollection/service/impl/WomdaaServiceImpl.java | 29
src/main/java/com/hk/NumericalCollection/service/impl/MesOrderStaServiceImpl.java | 22
src/main/java/com/hk/NumericalCollection/service/DevicedatastandardmoditemService.java | 14
src/main/java/com/hk/NumericalCollection/entity/DeviceMetrics.java | 59
src/main/java/com/hk/NumericalCollection/controller/KMController.java | 125 +
src/main/java/com/hk/NumericalCollection/mapper/DevicedatastandardmoditemMapper.java | 18
src/main/resources/mapper/DevMachineMapper.xml | 7
src/main/java/com/hk/NumericalCollection/config/URLEncoder.java | 14
src/main/java/com/hk/NumericalCollection/mapper/DeviceMetricsMapper.java | 18
src/main/java/com/hk/NumericalCollection/service/VOrderDetailService.java | 14
src/main/java/com/hk/NumericalCollection/service/MesOrderStaService.java | 13
113 files changed, 7,465 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index a2d1ce1..66f130a 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,135 @@
-## NumericalCollection2
+# NumericalCollection
-sql server+java鐗堟湰鐨勬暟閲囧钩鍙�
+鍩轰簬 Spring Boot + MyBatis-Plus + SQL Server 鐨勫伐涓氳澶囨暟鎹噰闆嗗钩鍙般��
+## 椤圭洰绠�浠�
+
+鏈」鐩槸涓�涓� MES锛堝埗閫犳墽琛岀郴缁燂級鏁版嵁閲囬泦妯″潡锛屼富瑕佺敤浜庯細
+- 璁惧瀹炴椂鏁版嵁閲囬泦涓庡悓姝�
+- 宸ュ崟鐢熶骇鏁版嵁绠$悊
+- 璁惧鏁呴殰璁板綍涓庤拷韪�
+- 鐢熶骇鎸囨爣缁熻鍒嗘瀽
+
+## 鎶�鏈爤
+
+| 鎶�鏈� | 鐗堟湰 | 璇存槑 |
+|------|------|------|
+| Spring Boot | 2.6.13 | 鍩虹妗嗘灦 |
+| MyBatis-Plus | 3.5.4 | ORM 妗嗘灦 |
+| Druid | 1.2.16 | 鏁版嵁搴撹繛鎺ユ睜 |
+| SQL Server | - | 鏁版嵁搴� |
+| Lombok | - | 绠�鍖栦唬鐮� |
+| Hutool | 5.8.18 | 宸ュ叿绫诲簱 |
+| OkHttp | 4.9.3 | HTTP 瀹㈡埛绔� |
+| FastJson | 2.0.32 | JSON 澶勭悊 |
+| POI | 4.1.2 | Excel 澶勭悊 |
+| PDFBox | 2.0.27 | PDF 澶勭悊 |
+
+## 椤圭洰缁撴瀯
+
+```
+src/main/java/com/hk/NumericalCollection/
+鈹溾攢鈹� config/ # 閰嶇疆绫伙紙鏁版嵁婧愩�丮yBatis绛夛級
+鈹溾攢鈹� controller/ # REST 鎺ュ彛鎺у埗鍣�
+鈹溾攢鈹� dto/ # 鏁版嵁浼犺緭瀵硅薄
+鈹溾攢鈹� entity/ # 鏁版嵁搴撳疄浣撶被
+鈹溾攢鈹� mapper/ # MyBatis Mapper 鎺ュ彛
+鈹溾攢鈹� service/ # 涓氬姟閫昏緫灞�
+鈹� 鈹斺攢鈹� impl/ # 鏈嶅姟瀹炵幇绫�
+鈹斺攢鈹� task/ # 瀹氭椂浠诲姟
+
+src/main/resources/
+鈹溾攢鈹� application.yml # 搴旂敤閰嶇疆
+鈹斺攢鈹� mapper/ # MyBatis XML 鏄犲皠鏂囦欢
+
+database/ # 鏁版嵁搴撹剼鏈�
+```
+
+## 鏍稿績鍔熻兘妯″潡
+
+### 1. 璁惧绠$悊
+- `Device` / `DevMachine` - 璁惧鍩虹淇℃伅
+- `DeviceStatus` - 璁惧鐘舵�佺洃鎺�
+- `DeviceMetrics` - 璁惧鎸囨爣鏁版嵁
+- `DeviceError` - 璁惧鏁呴殰璁板綍
+
+### 2. 宸ュ崟绠$悊
+- `Womdaa` - 宸ュ崟鎸囦护琛�
+- `VOrder` / `VOrderDetail` - 璁㈠崟瑙嗗浘
+- `MesOrderSelect` - 宸ュ崟閫夋嫨璁板綍
+
+### 3. 鏁版嵁閲囬泦
+- `MesNumerical` - 閲囬泦鏁版嵁璁板綍
+- `Devicedatastandardmoditem` - 鏁版嵁鏍囧噯椤�
+
+## API 鎺ュ彛
+
+鍩虹璺緞锛歚/Numerical`
+
+| 鎺ュ彛 | 鏂规硶 | 璇存槑 |
+|------|------|------|
+| `/manualSynchronization` | POST | 鎵嬪姩鍚屾璁惧鏁版嵁 |
+| `/manualSynchronizationBycl` | POST | 鎵嬪姩鍚屾璁惧鏁版嵁(澶囩敤) |
+| `/RefreshDev` | POST | 鍒锋柊璁惧鏁版嵁 |
+| `/RefreshDevBycl` | POST | 鍒锋柊璁惧鏁版嵁(澶囩敤) |
+| `/PdfToBase64` | POST | PDF 杞� Base64 |
+| `/getDeviceErrorList` | POST | 鑾峰彇璁惧鏁呴殰鍒楄〃 |
+
+## 蹇�熷紑濮�
+
+### 鐜瑕佹眰
+- JDK 1.8+
+- Maven 3.6+
+- SQL Server 2019+
+
+### 閰嶇疆鏁版嵁搴�
+
+淇敼 `src/main/resources/application.yml` 涓殑鏁版嵁搴撹繛鎺ヤ俊鎭細
+
+```yaml
+spring:
+ datasource:
+ url: jdbc:sqlserver://[host]:[port];databaseName=[dbname];encrypt=false
+ username: [username]
+ password: [password]
+```
+
+### 鍒濆鍖栨暟鎹簱
+
+鎵ц `database/` 鐩綍涓嬬殑 SQL 鑴氭湰鍒涘缓鎵�闇�琛ㄧ粨鏋勩��
+
+### 鏋勫缓杩愯
+
+```bash
+# 缂栬瘧鎵撳寘
+mvn clean install
+
+# 鏈湴杩愯锛堢鍙� 9095锛�
+mvn spring-boot:run
+
+# 浠呯紪璇戯紙璺宠繃娴嬭瘯锛�
+mvn clean compile -DskipTests
+```
+
+### 杩愯娴嬭瘯
+
+```bash
+mvn test
+```
+
+## 瀹氭椂浠诲姟
+
+椤圭洰鍖呭惈浠ヤ笅瀹氭椂浠诲姟锛堜綅浜� `task/ScheduledTasks.java`锛夛細
+
+| 浠诲姟 | 鎵ц鍛ㄦ湡 | 璇存槑 |
+|------|----------|------|
+| 鏁版嵁娓呯悊 | 姣忓懆鏃� 0:00 | 娓呯悊涓�鍛ㄥ墠鐨勯噰闆嗘暟鎹� |
+| 宸ュ崟鍚屾 | 姣忓ぉ 1:00 | 鍚屾褰撴棩宸ュ崟鍒伴�夋嫨琛� |
+| 鏃ョ粺璁� | 姣忓ぉ 2:00 | 缁熻鍓嶄竴澶╄澶囨暟鎹� |
+| 瀹炴椂閲囬泦 | 姣� 2 鍒嗛挓 | 閲囬泦璁惧瀹炴椂鏁版嵁 |
+
+## 娉ㄦ剰浜嬮」
+
+- 鐢熶骇鐜璇烽�氳繃鐜鍙橀噺鎴� Maven Profile 閰嶇疆鏁版嵁搴撳嚟璇�
+- 鏃ュ織鍜� SQL 杈撳嚭涓渶鑴辨晱瀹㈡埛鏁忔劅淇℃伅
+- 鎻愪氦浠g爜鍓嶈鏈湴杩愯鍏ㄩ儴娴嬭瘯
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..33467d5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.6.13</version>
+ <relativePath/> <!-- lookup parent from repository -->
+ </parent>
+ <groupId>com.hk</groupId>
+ <artifactId>NumericalCollection2</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>NumericalCollection</name>
+ <description>Demo project for Spring Boot</description>
+ <properties>
+ <java.version>1.8</java.version>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>mssql-jdbc</artifactId>
+ <version>9.4.1.jre8</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>druid-spring-boot-starter</artifactId>
+ <version>1.2.16</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.squareup.okhttp3</groupId>
+ <artifactId>okhttp</artifactId>
+ <version>4.9.3</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>fastjson</artifactId>
+ <version>2.0.32</version>
+ </dependency>
+ <dependency>
+ <groupId>com.baomidou</groupId>
+ <artifactId>mybatis-plus-boot-starter</artifactId>
+ <version>3.5.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>cn.hutool</groupId>
+ <artifactId>hutool-all</artifactId>
+ <version>5.8.18</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.poi</groupId>
+ <artifactId>poi-ooxml</artifactId>
+ <version>4.1.2</version> <!-- 鎴栨洿楂樼増鏈� -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.pdfbox</groupId>
+ <artifactId>pdfbox</artifactId>
+ <version>2.0.27</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>NumericalCollection</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/main/java/com/hk/NumericalCollection/NumericalApplication.java b/src/main/java/com/hk/NumericalCollection/NumericalApplication.java
new file mode 100644
index 0000000..feb6ae1
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/NumericalApplication.java
@@ -0,0 +1,19 @@
+package com.hk.NumericalCollection;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@MapperScan(value = "com.hk.NumericalCollection.mapper")
+@EnableScheduling
+public class NumericalApplication {
+
+
+ public static void main(String[] args) {
+ SpringApplication.run(NumericalApplication.class, args);
+ }
+
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/config/DataAcquisitionConfiguration.java b/src/main/java/com/hk/NumericalCollection/config/DataAcquisitionConfiguration.java
new file mode 100644
index 0000000..8ae1139
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/config/DataAcquisitionConfiguration.java
@@ -0,0 +1,26 @@
+package com.hk.NumericalCollection.config;
+
+
+public class DataAcquisitionConfiguration {
+
+ public static final String APP_ID =
+ "96c04940-5075-4138-b7f8-2b0b286c98a8";
+
+ public static final String PUBLIC_KEY =
+ "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDtoPUNzKylb02L/0JIvCTkEJPIphT60qHsgYpA fOFZUUOFKFzKuTTUP/43K8UDSUEtHeVqVd6VTVxGwcdJf9IyQFY1mGUQ9R/CRhWvdAe8yDIZPrc3 IzX2Q9A6T9NvNbY/EH0Ju1FNTMpErMj1IOskhedtXfNh4t4jAIm8xG2cJwIDAQAB";
+
+ /**
+ * API鍩虹URL
+ */
+ public static final String API_BASE_URL = "http://172.16.2.238:8100/lantingNewB/open";
+
+ /**
+ * 鑾峰彇绛惧悕瀛楁URL
+ */
+ public static final String ASK_SIGN_URL = API_BASE_URL + "/askSignField?appId=%s&random=666666&strTime=1669012259";
+
+ /**
+ * 璇锋眰鏁版嵁URL
+ */
+ public static final String ASK_DATA_URL = API_BASE_URL + "/askData?appId=%s&random=666666&strTime=1669012259";
+}
diff --git a/src/main/java/com/hk/NumericalCollection/config/MybatisPlusConfig.java b/src/main/java/com/hk/NumericalCollection/config/MybatisPlusConfig.java
new file mode 100644
index 0000000..c80c03a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/config/MybatisPlusConfig.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.config;
+
+import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class MybatisPlusConfig {
+ @Bean
+ public OracleKeyGenerator oracleKeyGenerator() {
+ return new OracleKeyGenerator();
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/config/ResultMessage.java b/src/main/java/com/hk/NumericalCollection/config/ResultMessage.java
new file mode 100644
index 0000000..aedbcf8
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/config/ResultMessage.java
@@ -0,0 +1,39 @@
+package com.hk.NumericalCollection.config;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ResultMessage {
+
+ private static final int SUCCESS = 200;
+ private static final int ERROR = 500;
+
+ private int code;
+
+ private String message;
+
+ private int successful;
+
+ private String data;
+
+ public static ResultMessage ok() {
+ return new ResultMessage(SUCCESS, null, 0, "鎺ユ敹鎴愬姛");
+ }
+
+ public static ResultMessage ok(String data) {
+ return new ResultMessage(SUCCESS, null, 0, data);
+ }
+
+ public static ResultMessage error(Exception e) {
+ return new ResultMessage(ERROR, e.getMessage(), 1, "鎺ユ敹澶辫触");
+ }
+
+ public static ResultMessage error(String message) {
+ return new ResultMessage(ERROR, message, 1, "鎺ユ敹澶辫触");
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/config/URLEncoder.java b/src/main/java/com/hk/NumericalCollection/config/URLEncoder.java
new file mode 100644
index 0000000..369d11c
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/config/URLEncoder.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.config;
+
+public class URLEncoder {
+ public static String encode(String input) {
+ try {
+ return java.net.URLEncoder.encode(input, "UTF-8");
+ } catch (java.io.UnsupportedEncodingException e) {
+ // UTF-8 搴旇鏄彈鏀寔鐨勶紝浣嗚繖閲岃繕鏄鐞嗕竴涓嬪紓甯�
+ return "";
+ } catch (java.lang.Exception e) {
+ return "";
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/controller/KMController.java b/src/main/java/com/hk/NumericalCollection/controller/KMController.java
new file mode 100644
index 0000000..61bab7a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/controller/KMController.java
@@ -0,0 +1,125 @@
+package com.hk.NumericalCollection.controller;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.hk.NumericalCollection.config.ResultMessage;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.service.DeviceMetricsService;
+import com.hk.NumericalCollection.service.INumericalNoOrderService;
+import com.hk.NumericalCollection.service.INumericalService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("Numerical")
+@RequiredArgsConstructor
+@CrossOrigin(origins = "*") //璺ㄥ煙璇锋眰
+public class KMController {
+
+
+ private final DeviceMetricsService deviceMetricsService;
+
+ private final INumericalService numericalService;
+
+ private final INumericalNoOrderService numericalNoOrderService;
+
+ @PostMapping("/manualSynchronization")
+ public ResultMessage setCode(@RequestBody NumbericalDto barcode) {
+
+ if (barcode.getOrderId() == null) {
+ return ResultMessage.error("宸ュ崟id涓虹┖");
+ }
+
+ try {
+ if (!deviceMetricsService.manualSynchronization(barcode)) {
+ return ResultMessage.error("鍚屾澶辫触");
+ }
+ return ResultMessage.ok();
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+ @PostMapping("/manualSynchronizationBycl")
+ public ResultMessage manualSynchronizationBycl(@RequestBody NumbericalDto barcode) {
+
+ if (barcode.getOrderId() == null) {
+ return ResultMessage.error("宸ュ崟id涓虹┖");
+ }
+
+ try {
+ if (!deviceMetricsService.manualSynchronizationBycl(barcode)) {
+ return ResultMessage.error("鍚屾澶辫触");
+ }
+ return ResultMessage.ok();
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+ @PostMapping("/PdfToBase64")
+ public ResultMessage PdfToBase64(@RequestBody NumbericalDto barcode) {
+
+ try {
+ String s = deviceMetricsService.PdfToBase64(barcode);
+ if (StrUtil.isNullOrUndefined(s)) {
+ return ResultMessage.error("鍚屾澶辫触");
+ }
+ return ResultMessage.ok(s);
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+ //RefreshDev
+ @PostMapping("/RefreshDev")
+ public ResultMessage RefreshDev(@RequestBody NumbericalDto barcode) {
+
+ try {
+ if (numericalService.RefreshDev(barcode)) {
+ return ResultMessage.ok();
+ }
+ return ResultMessage.error("鍚屾澶辫触");
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+ @PostMapping("/RefreshDevBycl")
+ public ResultMessage RefreshDevBycl(@RequestBody NumbericalDto barcode) {
+
+ try {
+ if (numericalService.RefreshDevBycl(barcode)) {
+ return ResultMessage.ok();
+ }
+ return ResultMessage.error("鍚屾澶辫触");
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+ ///Numerical/getDeviceErrorList
+ @PostMapping("/getDeviceErrorList")
+ public ResultMessage getDeviceErrorList(@RequestBody NumbericalDto request) {
+
+ if (StrUtil.isNullOrUndefined(request.getUid())) {
+ return ResultMessage.error("璁惧缂栧彿涓虹┖");
+ }
+
+ if (StrUtil.isNullOrUndefined(request.getStartDate())) {
+ return ResultMessage.error("寮�濮嬫棩鏈熶负绌�");
+ }
+
+ if (StrUtil.isNullOrUndefined(request.getEndDate())) {
+ return ResultMessage.error("缁撴潫鏃ユ湡涓虹┖");
+ }
+
+ try {
+ numericalNoOrderService.getDeviceErrorList(request.getUid(), request.getStartDate(), request.getEndDate());
+ return ResultMessage.ok();
+ } catch (Exception e) {
+ return ResultMessage.error(e);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/dto/ApiDataResult.java b/src/main/java/com/hk/NumericalCollection/dto/ApiDataResult.java
new file mode 100644
index 0000000..a165134
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/ApiDataResult.java
@@ -0,0 +1,25 @@
+package com.hk.NumericalCollection.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApiDataResult<T> extends BaseApiResponse {
+
+ @JsonProperty("data")
+ private T data;
+
+ @JsonProperty("list")
+ private List<ErrorDetail> list;
+
+ @JsonProperty("total")
+ private int total;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/ApiRequestBody.java b/src/main/java/com/hk/NumericalCollection/dto/ApiRequestBody.java
new file mode 100644
index 0000000..7063c06
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/ApiRequestBody.java
@@ -0,0 +1,20 @@
+package com.hk.NumericalCollection.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApiRequestBody {
+
+ private String ext;
+ private String vistApi;
+ private String sig;
+ private String appId;
+ private String time;
+ private Params params;
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/ApiResponse.java b/src/main/java/com/hk/NumericalCollection/dto/ApiResponse.java
new file mode 100644
index 0000000..855c3ad
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/ApiResponse.java
@@ -0,0 +1,25 @@
+package com.hk.NumericalCollection.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApiResponse<T> extends BaseApiResponse {
+
+ private List<T> list;
+
+ private int total;
+
+ @JsonProperty("data") // Use this annotation if the JSON field name differs from the variable name
+ private String data; // Add this field to match the response
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/ApiResponseCode.java b/src/main/java/com/hk/NumericalCollection/dto/ApiResponseCode.java
new file mode 100644
index 0000000..0fdaf91
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/ApiResponseCode.java
@@ -0,0 +1,51 @@
+package com.hk.NumericalCollection.dto;
+
+public enum ApiResponseCode {
+ SUCCESS("408", "璇锋眰鎴愬姛", true),
+
+ INVALID_SIGNATURE("400", "绛惧悕涓嶆纭�", false),
+ TOKEN_EXPIRED("401", "token杩囨湡", false),
+ USER_NOT_FOUND("402", "鐢ㄦ埛涓嶅瓨鍦�", false),
+ REQUEST_TOO_FREQUENT("403", "璇锋眰澶绻�", false),
+ API_NOT_FOUND("404", "鎺ュ彛涓嶅瓨鍦�", false),
+ USER_EXPIRED("405", "鐢ㄦ埛鍒版湡", false),
+ USER_DISABLED("406", "鐢ㄦ埛琚鐢�", false),
+ NO_ACCESS("407", "娌℃湁鎺ュ彛璁块棶鏉冮檺", false),
+ PARAMETER_ERROR("409", "鍙傛暟鍑洪敊", false),
+ APP_ID_NOT_SENT("410", "appId鏈彂閫�", false),
+ BODY_PARAMETER_ERROR("412", "body鍙傛暟涓嶆纭�", false),
+ CUSTOM_STRING_TOO_LONG("413", "鑷畾涔夊瓧绗︿覆ext澶暱", false),
+ BUSINESS_PARAMETER_ERROR("414", "涓氬姟璇锋眰鍙傛暟鍑洪敊", false),
+ BUSINESS_DATA_NOT_FOUND("415", "璇锋眰鐨勪笟鍔℃暟鎹笉瀛樺湪", false);
+
+ private final String code;
+ private final String description;
+ private final Boolean flag;
+
+ ApiResponseCode(String code, String description, Boolean flag) {
+ this.code = code;
+ this.description = description;
+ this.flag = flag;
+ }
+
+ public static ApiResponseCode fromCode(String code) {
+ for (ApiResponseCode responseCode : values()) {
+ if (responseCode.getCode().equals(code)) {
+ return responseCode;
+ }
+ }
+ return null; // Or throw an exception if preferred
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public Boolean getFlag() {
+ return flag;
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/BaseApiResponse.java b/src/main/java/com/hk/NumericalCollection/dto/BaseApiResponse.java
new file mode 100644
index 0000000..736c5ce
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/BaseApiResponse.java
@@ -0,0 +1,19 @@
+package com.hk.NumericalCollection.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BaseApiResponse implements Serializable {
+
+ private String code;
+ private String ext;
+ private String error;
+ private String msg;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/ErrorDetail.java b/src/main/java/com/hk/NumericalCollection/dto/ErrorDetail.java
new file mode 100644
index 0000000..59b5c35
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/ErrorDetail.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ErrorDetail {
+
+ private String code;
+ private String name;
+ private int nums;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/NumbericalDto.java b/src/main/java/com/hk/NumericalCollection/dto/NumbericalDto.java
new file mode 100644
index 0000000..b4d027f
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/NumbericalDto.java
@@ -0,0 +1,23 @@
+package com.hk.NumericalCollection.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class NumbericalDto {
+ private Long orderId;
+
+ private String machineNo;
+
+ private String engineeringNo;
+
+ private String uid;
+
+ private String startDate;
+
+ private String endDate;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/dto/Params.java b/src/main/java/com/hk/NumericalCollection/dto/Params.java
new file mode 100644
index 0000000..69b5f8e
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/dto/Params.java
@@ -0,0 +1,63 @@
+package com.hk.NumericalCollection.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class Params {
+
+ /**
+ * 璧峰椤�
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private int pageNo;
+ /**
+ * 姣忛〉鏌ヨ鏁伴噺
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private int pageSize;
+ /**
+ * 璁惧鐘舵�� 0绂荤嚎锛�1鍦ㄧ嚎锛�2寰呮満,3鏁呴殰,4缁翠慨,5璋冩ā-99鍏ㄩ儴 蹇呬紶
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private int status;
+
+ /**
+ * 鏈哄櫒缂栧彿
+ * 鍜宮acNo浜岄�変竴浼犻�掍竴涓�
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private String uid;
+
+ /**
+ * 浼佷笟鑷畾涔夌殑鏈哄彴鍙�
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private String macNo;
+
+ /**
+ * 鏌ヨ鐨勬椂闂�
+ *
+ * @author tjx
+ * @date 2024/9/26 14:24
+ */
+ private String date;
+
+
+ private String startDate;
+
+ private String endDate;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DevMacBycl.java b/src/main/java/com/hk/NumericalCollection/entity/DevMacBycl.java
new file mode 100644
index 0000000..993712e
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DevMacBycl.java
@@ -0,0 +1,35 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @TableName DEV_MACHINE
+ */
+@TableName(value ="DEV_MAC_BYCL")
+@Data
+public class DevMacBycl implements Serializable {
+ /**
+ * SEQ_ORDER
+ */
+ @TableId
+ private Long id;
+
+ /**
+ * 鏈哄彴缂栧彿
+ */
+ private String machineNo;
+
+ /**
+ * 璁惧缂栧彿
+ */
+ private String devNo;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DevMachine.java b/src/main/java/com/hk/NumericalCollection/entity/DevMachine.java
new file mode 100644
index 0000000..fa6aff7
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DevMachine.java
@@ -0,0 +1,35 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ *
+ * @TableName DEV_MACHINE
+ */
+@TableName(value ="DEV_MACHINE")
+@Data
+public class DevMachine implements Serializable {
+ /**
+ * 涓婚敭鑷
+ */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 鏈哄彴缂栧彿
+ */
+ private String machineNo;
+
+ /**
+ * 璁惧缂栧彿
+ */
+ private String devNo;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DevMetricsSeq.java b/src/main/java/com/hk/NumericalCollection/entity/DevMetricsSeq.java
new file mode 100644
index 0000000..b07c2bc
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DevMetricsSeq.java
@@ -0,0 +1,17 @@
+package com.hk.NumericalCollection.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DevMetricsSeq {
+
+ private String field;
+
+ private short groupSeq;
+
+ private short seq;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/Device.java b/src/main/java/com/hk/NumericalCollection/entity/Device.java
new file mode 100644
index 0000000..69e9ee2
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/Device.java
@@ -0,0 +1,250 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 鏁伴噰璁惧
+ * @TableName DEVICE
+ */
+@TableName(value ="DEVICE")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Device implements Serializable {
+ /**
+ * 涓婚敭鑷
+ */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ /**
+ *
+ */
+ private Double onetflag;
+
+ /**
+ *
+ */
+ private Double onetDeviceId;
+
+ /**
+ * 璁惧鍚嶇О
+ */
+ private String name;
+
+ /**
+ * 璁惧绫诲瀷id
+ */
+ private Double typeId;
+
+ /**
+ * 閫氱敤璁惧绫诲瀷
+ */
+ private String type;
+
+ /**
+ * 璁惧妯″瀷id
+ */
+ private Double modId;
+
+ /**
+ * 閫氱敤璁惧妯″瀷
+ */
+ private String modName;
+
+ /**
+ * 鍏徃id
+ */
+ private Double comId;
+
+ /**
+ * 鏈哄彴鍙�
+ */
+ private String comDevNo;
+
+ /**
+ * 鐩掑瓙缂栫爜
+ */
+ private String devNo;
+
+ /**
+ * 瀛愮洅瀛�
+ */
+ private Double sNum;
+
+ /**
+ * 鍦板潃GPS
+ */
+ private String locationGps;
+
+ /**
+ * 鍦板潃
+ */
+ private String locationInfo;
+
+ /**
+ * 鐘舵��
+ */
+ private String statusInfo;
+
+ /**
+ * 鐘舵��
+ */
+ private Double status;
+
+ /**
+ * 鏈�杩戝紑鏈烘椂闂�
+ */
+ private String openTime;
+
+ /**
+ * 鐢熶骇鑺傛媿
+ */
+ private Double productionTakt;
+
+ /**
+ * 榛勫博鍖�
+ */
+ private String areaName;
+
+ /**
+ * 璁㈠崟瑙勫垯鍙�
+ */
+ private String orderRuleNo;
+
+ /**
+ * 鍦ㄧ嚎鏃堕暱
+ */
+ private Double onlineTime;
+
+ /**
+ * 宸ヤ綔鏃堕暱
+ */
+ private Double runTime;
+
+ /**
+ * 寰呮満鏃堕暱
+ */
+ private Double waitTime;
+
+ /**
+ * 浣跨敤鐜�
+ */
+ private Double userate;
+
+ /**
+ * 鐢熶骇鑺傛媿
+ */
+ private Double averageOutput;
+
+ /**
+ * oee
+ */
+ private Double oneOee;
+
+ /**
+ * 绋煎姩鐜�
+ */
+ private Double oneWork;
+
+ /**
+ * 娆″搧閲囬泦鏍囧織浣�
+ */
+ private String readDadProduct;
+
+ /**
+ * 浜ч噺閲囬泦鏍囧織浣�
+ */
+ private String readGoodProduct;
+
+ /**
+ * 璋冭瘯閲忛噰闆嗘爣蹇椾綅
+ */
+ private String readTryProduct;
+
+ /**
+ * 鍒嗙粍id
+ */
+ private Double groupId;
+
+ /**
+ * 璁㈠崟鐘舵��
+ */
+ private Double orderstatus;
+
+ /**
+ * 鏄惁鏄剧ず宸ヤ綔鏃�
+ */
+ private Double isDisplayWorkday;
+
+ /**
+ * 绋煎姩鐜囨爣鍑�
+ */
+ private Double oneWorkStandard;
+
+ /**
+ * 鏄惁璁″叆鏁呴殰
+ */
+ private Double isCountFault;
+
+ /**
+ * 鏄惁mqtt璁惧
+ */
+ private String isMqttDev;
+
+ /**
+ * mqtt璁㈤槄鍙�
+ */
+ private String mqttTopic;
+
+ /**
+ * 鑷畾涔夊瓧娈祅
+ */
+ private Double n;
+
+ /**
+ * 鑷畾涔夊瓧娈礱
+ */
+ private Double a;
+
+ /**
+ * 鑷畾涔夊瓧娈礲
+ */
+ private Double b;
+
+ /**
+ * 涓氬姟鐘舵��1璋冩満2妫�淇�
+ */
+ private Double bsta;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ private String dateCreater;
+
+ /**
+ * 浣滆�匢D
+ */
+ private Double authorId;
+
+ /**
+ * 浣滆��
+ */
+ private String author;
+
+ /**
+ * 鏈�杩戠紪杈戞椂闂�
+ */
+ private String lastEditDate;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceBycl.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceBycl.java
new file mode 100644
index 0000000..2af4157
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceBycl.java
@@ -0,0 +1,251 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 鏁伴噰璁惧
+ * @TableName DEVICE
+ */
+@TableName(value ="DEVICE_BYCL")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@KeySequence(value = "SEQ_Device", dbType = DbType.ORACLE)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DeviceBycl implements Serializable {
+ /**
+ * SEQ_Device
+ */
+ @TableId
+ private Long id;
+
+ /**
+ *
+ */
+ private Double onetflag;
+
+ /**
+ *
+ */
+ private Double onetDeviceId;
+
+ /**
+ * 璁惧鍚嶇О
+ */
+ private String name;
+
+ /**
+ * 璁惧绫诲瀷id
+ */
+ private Double typeId;
+
+ /**
+ * 閫氱敤璁惧绫诲瀷
+ */
+ private String type;
+
+ /**
+ * 璁惧妯″瀷id
+ */
+ private Double modId;
+
+ /**
+ * 閫氱敤璁惧妯″瀷
+ */
+ private String modName;
+
+ /**
+ * 鍏徃id
+ */
+ private Double comId;
+
+ /**
+ * 鏈哄彴鍙�
+ */
+ private String comDevNo;
+
+ /**
+ * 鐩掑瓙缂栫爜
+ */
+ private String devNo;
+
+ /**
+ * 瀛愮洅瀛�
+ */
+ private Double sNum;
+
+ /**
+ * 鍦板潃GPS
+ */
+ private String locationGps;
+
+ /**
+ * 鍦板潃
+ */
+ private String locationInfo;
+
+ /**
+ * 鐘舵��
+ */
+ private String statusInfo;
+
+ /**
+ * 鐘舵��
+ */
+ private Double status;
+
+ /**
+ * 鏈�杩戝紑鏈烘椂闂�
+ */
+ private String openTime;
+
+ /**
+ * 鐢熶骇鑺傛媿
+ */
+ private Double productionTakt;
+
+ /**
+ * 榛勫博鍖�
+ */
+ private String areaName;
+
+ /**
+ * 璁㈠崟瑙勫垯鍙�
+ */
+ private String orderRuleNo;
+
+ /**
+ * 鍦ㄧ嚎鏃堕暱
+ */
+ private Double onlineTime;
+
+ /**
+ * 宸ヤ綔鏃堕暱
+ */
+ private Double runTime;
+
+ /**
+ * 寰呮満鏃堕暱
+ */
+ private Double waitTime;
+
+ /**
+ * 浣跨敤鐜�
+ */
+ private Double userate;
+
+ /**
+ * 鐢熶骇鑺傛媿
+ */
+ private Double averageOutput;
+
+ /**
+ * oee
+ */
+ private Double oneOee;
+
+ /**
+ * 绋煎姩鐜�
+ */
+ private Double oneWork;
+
+ /**
+ * 娆″搧閲囬泦鏍囧織浣�
+ */
+ private String readDadProduct;
+
+ /**
+ * 浜ч噺閲囬泦鏍囧織浣�
+ */
+ private String readGoodProduct;
+
+ /**
+ * 璋冭瘯閲忛噰闆嗘爣蹇椾綅
+ */
+ private String readTryProduct;
+
+ /**
+ * 鍒嗙粍id
+ */
+ private Double groupId;
+
+ /**
+ * 璁㈠崟鐘舵��
+ */
+ private Double orderstatus;
+
+ /**
+ * 鏄惁鏄剧ず宸ヤ綔鏃�
+ */
+ private Double isDisplayWorkday;
+
+ /**
+ * 绋煎姩鐜囨爣鍑�
+ */
+ private Double oneWorkStandard;
+
+ /**
+ * 鏄惁璁″叆鏁呴殰
+ */
+ private Double isCountFault;
+
+ /**
+ * 鏄惁mqtt璁惧
+ */
+ private String isMqttDev;
+
+ /**
+ * mqtt璁㈤槄鍙�
+ */
+ private String mqttTopic;
+
+ /**
+ * 鑷畾涔夊瓧娈祅
+ */
+ private Double n;
+
+ /**
+ * 鑷畾涔夊瓧娈礱
+ */
+ private Double a;
+
+ /**
+ * 鑷畾涔夊瓧娈礲
+ */
+ private Double b;
+
+ /**
+ * 涓氬姟鐘舵��1璋冩満2妫�淇�
+ */
+ private Double bsta;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ private String dateCreater;
+
+ /**
+ * 浣滆�匢D
+ */
+ private Double authorId;
+
+ /**
+ * 浣滆��
+ */
+ private String author;
+
+ /**
+ * 鏈�杩戠紪杈戞椂闂�
+ */
+ private String lastEditDate;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceDayCount.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceDayCount.java
new file mode 100644
index 0000000..dc76f3d
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceDayCount.java
@@ -0,0 +1,112 @@
+package com.hk.NumericalCollection.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DeviceDayCount implements Serializable {
+ @JsonProperty("dev_num")
+ private Integer devNum;
+
+ @JsonProperty("dev_status")
+ private Integer devStatus;
+
+ @JsonProperty("is_update")
+ private Integer isUpdate;
+
+ /* 鍏宠仈ID缁� */
+ @JsonProperty("comId")
+ private Integer comId;
+
+ @JsonProperty("comMakeId")
+ private Integer comMakeId;
+
+ @JsonProperty("comCheckId")
+ private Integer comCheckId;
+
+ @JsonProperty("devId")
+ private Integer devId;
+
+ /* 鏍稿績鎸囨爣锛堟椂闂寸淮搴︼級 */
+ @JsonProperty("usetime")
+ private Double useTime;
+
+ @JsonProperty("average_usetime")
+ private Double averageUsetime;
+
+ @JsonProperty("onlinetime")
+ private Double onlineTime;
+
+ /* 鎬ц兘鎸囨爣 */
+ @JsonProperty("average_onlinetime")
+ private Double averageOnlinetime;
+
+ @JsonProperty("wait_time")
+ private Double waitTime;
+
+ @JsonProperty("average_wait_time")
+ private Double averageWaitTime;
+
+ /* 鐢熶骇鏁版嵁 */
+ @JsonProperty("average_hands_time")
+ private Double averageHandsTime;
+
+ @JsonProperty("today_output") // 鐗规畩娉ㄨВ瀛楁
+ private Double averageOutput;
+
+ @JsonProperty("fault_time")
+ private Double faultTime;
+
+ /* 璐ㄩ噺鎸囨爣 */
+ @JsonProperty("average_fault_time")
+ private Double averageFaultTime;
+
+ @JsonProperty("useRate")
+ private String useRate;
+
+ @JsonProperty("d1")
+ private Double d1;
+
+ /* 璁惧鐘舵�� */
+ @JsonProperty("average_d1")
+ private Double averageD1;
+
+ @JsonProperty("d6")
+ private Double d6;
+
+ @JsonProperty("average_d6")
+ private Double averageD6;
+
+ /* OEE鐩稿叧 */
+ @JsonProperty("oee")
+ private String oee;
+
+ @JsonProperty("worknum")
+ private String workNum;
+
+ /* 鏃ユ姤鏁版嵁 */
+ @JsonProperty("dayopen")
+ private Double dayOpen;
+
+ @JsonProperty("daywork")
+ private Double dayWork;
+
+ @JsonProperty("dayfault")
+ private Double dayFault;
+
+ @JsonProperty("daywait")
+ private Double dayWait;
+
+ /* 鍏冩暟鎹� */
+ @JsonProperty("id")
+ private Integer id;
+
+
+ @JsonProperty("authorId")
+ private Integer authorId;
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceError.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceError.java
new file mode 100644
index 0000000..fdc2cbe
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceError.java
@@ -0,0 +1,132 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("device_error")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DeviceError implements Serializable {
+
+ /**
+ * 涓婚敭鑷
+ */
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 璁惧id
+ */
+ private Integer deviceId;
+
+ /**
+ * 璁惧鍚嶇О
+ */
+ private String deviceName;
+
+ /**
+ * 鐩掑瓙缂栧彿
+ */
+ private String deviceNo;
+
+ /**
+ * 浣跨敤浜篿d
+ */
+ private Integer optUserId;
+
+ /**
+ * 鎵嬪姩璋冭瘯浜篿d
+ */
+ private Integer handleUserId;
+
+ /**
+ * 寮�濮嬫椂闂�
+ */
+ private String startdate;
+
+ /**
+ * 鏁呴殰鐘舵�� 0鏈慨澶� 1宸蹭慨澶�
+ */
+ private Integer status;
+
+ /**
+ * 鏁呴殰澶╂暟
+ */
+ private Integer daynum;
+
+ /**
+ * 鏁呴殰
+ */
+ private String deverr;
+
+ /**
+ * 鏁呴殰id
+ */
+ private Integer deverrid;
+
+ /**
+ * 鏁呴殰绉掓暟
+ */
+ private Integer errorSeconds;
+
+ /**
+ * 棰勮缁翠慨鏃堕棿
+ */
+ private Double maintainPlan;
+
+ /**
+ * 鏁呴殰鏃堕暱
+ */
+ private String longtime;
+
+ /**
+ * 鍒楄〃鍒嗛挓鏄剧ず
+ */
+ private Integer mintime;
+
+ /**
+ * 妫�淇〃澶栭敭id
+ */
+ private Integer errorcheckid;
+
+ /**
+ * 鏄惁浜哄伐淇敼 0榛樿 1淇敼
+ */
+ private Integer usertype;
+
+ /**
+ * 鏁呴殰缂栧彿
+ */
+ private String code;
+
+ /**
+ * 鎿嶄綔绫诲埆
+ */
+ private String worktype;
+
+ /**
+ * 鍏徃id
+ */
+ private Integer comId;
+
+ /**
+ * 宸插垱寤烘満鍒� 0=娌℃湁,1=鏈�
+ */
+ private Integer hasMethod;
+
+ /**
+ * 鏁呴殰鍒涘缓鏃堕棿
+ */
+ private String dateCreater;
+
+ /**
+ * 鐢ㄦ埛id
+ */
+ private Integer authorId;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceMetrics.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceMetrics.java
new file mode 100644
index 0000000..675ebe7
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceMetrics.java
@@ -0,0 +1,59 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @TableName 宸ヨ壓鍙傛暟琛�
+ */
+@TableName(value = "DEVICE_METRICS")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@KeySequence(value = "SEQ_Metrics", dbType = DbType.ORACLE)
+public class DeviceMetrics implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * SEQ_Metrics
+ */
+ @TableId
+ private Long id;
+ /**
+ * 鍥惧彿
+ */
+ private String itemNo;
+ /**
+ * 璁惧缂栧彿
+ */
+ private String devNo;
+ /**
+ * 鏃堕棿
+ */
+ private String dayDate;
+ /**
+ * 鍙傛暟鍚�
+ */
+ private String field;
+ /**
+ * 鍙傛暟鍊�
+ */
+ private String value;
+ /**
+ * 榛樿鍊间负0 鎵嬪姩瀵煎叆
+ * 1涓烘暟閲囧啓鍏�
+ */
+ private short type;
+
+ private short groupSeq;
+
+ private short seq;
+
+ private String billNo;
+
+ private String machineNo;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceRealTimeData.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceRealTimeData.java
new file mode 100644
index 0000000..b04733f
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceRealTimeData.java
@@ -0,0 +1,531 @@
+package com.hk.NumericalCollection.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class DeviceRealTimeData implements Serializable {
+
+ /**
+ * 璁惧缂栫爜
+ */
+ @JsonProperty("devNo")
+ private String devNo;
+
+ /**
+ * 璁惧瀹炴椂鐘舵��
+ */
+ @JsonProperty("status")
+ private double status;
+
+ /**
+ * 璁惧绱鎬讳骇閲�
+ */
+ @JsonProperty("output")
+ private double output;
+
+ /**
+ * 鏃ヤ骇閲忕粺璁�
+ */
+ @JsonProperty("today_output")
+ private double todayOutput;
+
+ /**
+ * 鎬诲湪绾挎椂闀匡紝鍗曚綅绉�
+ */
+ @JsonProperty("onlinetime")
+ private double onlineTime;
+
+
+ /**
+ * 鎬昏兘鑰楃粺璁�
+ */
+ @JsonProperty("power")
+ private double power;
+
+ /**
+ * 浠婃棩鑳借��
+ */
+ @JsonProperty("today_power")
+ private double todayPower;
+
+ /**
+ * 鎬绘姤璀︽暟
+ */
+ @JsonProperty("faultnum")
+ private double faultNum;
+
+ /**
+ * 鐝寮�濮嬫椂闂�
+ */
+ private String workstartDate;
+
+ /**
+ * 鐝缁撴潫鏃堕棿
+ */
+ private String workendDate;
+
+ /**
+ * 鐝id 1涓虹櫧鐝� 2涓烘櫄鐝�
+ */
+ private String deviceTypeClassItemId;
+
+ /**
+ * 鐝浜ч噺
+ */
+ @JsonProperty("work_output")
+ private String workOutPut;
+
+ /**
+ * 灏忔椂浜ч噺
+ */
+ @JsonProperty("hour_output")
+ private String hourOutPut;
+
+ /**
+ * 娆″搧鏁伴噺
+ */
+ @JsonProperty("badoutput")
+ private String badoutput;
+
+ /**
+ * 褰撳ぉ娆″搧鏁伴噺
+ */
+ @JsonProperty("today_badoutput")
+ private String todayBadoutput;
+
+ /**
+ * 鐝娆″搧鏁伴噺
+ */
+ @JsonProperty("work_badoutput")
+ private String workBadoutput;
+
+ /**
+ * 灏忔椂娆″搧鏁伴噺
+ */
+ @JsonProperty("hour_badoutput")
+ private String hourBadoutput;
+
+ /**
+ * 鐝
+ */
+ private String deviceTypeClassItemName;
+
+ /**
+ * 褰撳ぉ浣跨敤鏃堕棿
+ * 绋煎姩鐜囪绠� today_runtime/today_onlinetime
+ */
+ @JsonProperty("today_runtime")
+ private String todayRuntime;
+
+
+ /**
+ * 褰撳ぉ杩愯鏃堕棿
+ * 绋煎姩鐜囪绠� today_runtime/today_onlinetime
+ */
+ @JsonProperty("today_onlinetime")
+ private double todayOnlineTime;
+
+ /**
+ * 浠婃棩鎶ヨ鏁�
+ */
+ @JsonProperty("today_faultnum")
+ private double todayFaultNum;
+
+ private String lastEditDate;
+
+ // d绯诲垪瀛楁
+ private String d0;
+ private String d1;
+ private String d2;
+ private String d3;
+ private String d4;
+ private String d11;
+ private String d14;
+ private String d15;
+ private String d17;
+
+ private String d21;
+ private String d22;
+ private String d23;
+ private String d24;
+ private String d25;
+ private String d26;
+ private String d27;
+ private String d28;
+ private String d29;
+ private String d30;
+ private String d31;
+ private String d32;
+ private String d33;
+ private String d34;
+ private String d35;
+ private String d36;
+ private String d37;
+ private String d38;
+ private String d39;
+ private String d40;
+ private String d41;
+ private String d42;
+ private String d43;
+ private String d44;
+ private String d45;
+ private String d46;
+ private String d47;
+ private String d48;
+ private String d49;
+ private String d50;
+ private String d51;
+ private String d52;
+ private String d53;
+ private String d54;
+ private String d55;
+ private String d56;
+ private String d57;
+ private String d58;
+ private String d59;
+ private String d60;
+ private String d61;
+ private String d62;
+ private String d63;
+ private String d64;
+ private String d65;
+ private String d66;
+ private String d67;
+ private String d68;
+ private String d69;
+ private String d70;
+ private String d71;
+ private String d72;
+ private String d73;
+ private String d74;
+ private String d75;
+ private String d76;
+ private String d77;
+ private String d78;
+ private String d79;
+ private String d80;
+ private String d81;
+ private String d82;
+ private String d83;
+ private String d84;
+ private String d85;
+ private String d86;
+ private String d87;
+ private String d88;
+ private String d89;
+ private String d90;
+ private String d91;
+ private String d92;
+ private String d93;
+ private String d94;
+ private String d95;
+ private String d96;
+ private String d97;
+ private String d98;
+ private String d99;
+ private String d100;
+ private String d101;
+ private String d102;
+ private String d103;
+ private String d104;
+ private String d105;
+ private String d106;
+ private String d107;
+ private String d108;
+ private String d109;
+ private String d110;
+ private String d111;
+ private String d112;
+ private String d113;
+ private String d114;
+ private String d115;
+ private String d116;
+ private String d117;
+ private String d118;
+ private String d119;
+ private String d120;
+ private String d121;
+ private String d122;
+ private String d123;
+ private String d124;
+ private String d125;
+ private String d126;
+ private String d127;
+ private String d128;
+ private String d129;
+ private String d130;
+ private String d131;
+ private String d132;
+ private String d133;
+ private String d134;
+ private String d135;
+ private String d136;
+ private String d137;
+ private String d138;
+ private String d139;
+ private String d140;
+ private String d141;
+ private String d142;
+ private String d143;
+ private String d144;
+ private String d145;
+ private String d146;
+ private String d147;
+ private String d148;
+ private String d149;
+ private String d150;
+ private String d151;
+ private String d152;
+ private String d153;
+ private String d154;
+ private String d155;
+ private String d156;
+ private String d157;
+ private String d158;
+ private String d159;
+ private String d160;
+ private String d161;
+ private String d162;
+ private String d163;
+ private String d164;
+ private String d165;
+ private String d166;
+ private String d167;
+ private String d168;
+ private String d169;
+ private String d170;
+ private String d171;
+ private String d172;
+ private String d173;
+ private String d174;
+ private String d175;
+ private String d176;
+ private String d177;
+ private String d178;
+ private String d179;
+ private String d180;
+ private String d181;
+ private String d182;
+ private String d183;
+ private String d184;
+ private String d185;
+ private String d186;
+ private String d187;
+ private String d188;
+ private String d189;
+ private String d190;
+ private String d191;
+ private String d192;
+ private String d193;
+ private String d194;
+ private String d195;
+ private String d196;
+ private String d197;
+ private String d198;
+ private String d199;
+ private String d200;
+ private String d201;
+ private String d202;
+ private String d203;
+ private String d204;
+ private String d205;
+ private String d206;
+ private String d207;
+ private String d208;
+ private String d209;
+ private String d210;
+ private String d211;
+ private String d212;
+ private String d213;
+ private String d214;
+ private String d215;
+ private String d216;
+ private String d217;
+ private String d218;
+ private String d219;
+ private String d220;
+ private String d221;
+ private String d222;
+ private String d223;
+ private String d224;
+ private String d225;
+ private String d226;
+ private String d227;
+ private String d228;
+ private String d229;
+ private String d230;
+ private String d231;
+ private String d232;
+ private String d233;
+ private String d234;
+ private String d235;
+ private String d236;
+ private String d237;
+ private String d238;
+ private String d239;
+ private String d240;
+ private String d241;
+ private String d242;
+ private String d243;
+ private String d244;
+ private String d245;
+ private String d246;
+ private String d247;
+ private String d248;
+ private String d249;
+ private String d250;
+ private String d251;
+ private String d252;
+ private String d253;
+ private String d254;
+ private String d255;
+ private String d256;
+ private String d257;
+ private String d258;
+ private String d259;
+ private String d260;
+ private String d261;
+ private String d262;
+ private String d263;
+ private String d264;
+ private String d265;
+ private String d266;
+ private String d267;
+ private String d268;
+ private String d269;
+ private String d270;
+ private String d271;
+ private String d272;
+ private String d273;
+ private String d274;
+ private String d275;
+ private String d276;
+ private String d277;
+ private String d278;
+ private String d279;
+ private String d280;
+ private String d281;
+ private String d282;
+ private String d283;
+ private String d284;
+ private String d285;
+ private String d286;
+ private String d287;
+ private String d288;
+ private String d289;
+ private String d290;
+ private String d291;
+ private String d292;
+ private String d293;
+ private String d294;
+ private String d295;
+ private String d296;
+ private String d297;
+ private String d298;
+ private String d299;
+ private String d300;
+ private String d301;
+ private String d302;
+ private String d303;
+ private String d304;
+ private String d305;
+ private String d306;
+ private String d307;
+ private String d308;
+ private String d309;
+ private String d310;
+ private String d311;
+ private String d312;
+ private String d313;
+ private String d314;
+ private String d315;
+ private String d316;
+ private String d317;
+ private String d318;
+ private String d319;
+ private String d320;
+ private String d321;
+ private String d322;
+ private String d323;
+ private String d324;
+ private String d325;
+ private String d326;
+ private String d327;
+ private String d328;
+ private String d329;
+ private String d330;
+ private String d331;
+ private String d332;
+ private String d333;
+ private String d334;
+ private String d335;
+ private String d336;
+ private String d337;
+ private String d338;
+ private String d339;
+ private String d340;
+ private String d341;
+ private String d342;
+ private String d343;
+ private String d344;
+ private String d345;
+ private String d346;
+ private String d347;
+ private String d348;
+ private String d349;
+ private String d350;
+ private String d351;
+ private String d352;
+ private String d353;
+ private String d354;
+ private String d355;
+ private String d356;
+ private String d357;
+ private String d358;
+ private String d359;
+ private String d360;
+ private String d361;
+ private String d362;
+ private String d363;
+ private String d364;
+ private String d365;
+ private String d366;
+ private String d367;
+ private String d368;
+ private String d369;
+ private String d370;
+ private String d371;
+ private String d372;
+ private String d373;
+ private String d374;
+ private String d375;
+ private String d376;
+ private String d377;
+ private String d378;
+ private String d379;
+ private String d380;
+ private String d381;
+ private String d382;
+ private String d383;
+ private String d384;
+ private String d385;
+ private String d386;
+ private String d387;
+ private String d388;
+ private String d389;
+ private String d390;
+ private String d391;
+ private String d392;
+ private String d393;
+ private String d394;
+ private String d395;
+ private String d396;
+ private String d397;
+ private String d398;
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceStatus.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceStatus.java
new file mode 100644
index 0000000..72aaf32
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceStatus.java
@@ -0,0 +1,142 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 璁惧鐘舵�佽〃
+ *
+ * @TableName DEVICE_STATUS
+ */
+@TableName(value = "DEVICE_STATUS")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeviceStatus implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * 涓婚敭鑷
+ */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 妫�楠屽崟鍙�
+ */
+ private String orderNo;
+
+ /**
+ * 璁惧缂栫爜
+ */
+ private String devNo;
+
+ /**
+ * 璁惧瀹炴椂鐘舵��
+ */
+ private double status;
+
+ /**
+ * 璁惧绱鎬讳骇閲�
+ */
+ private double output;
+
+ /**
+ * 鏃ヤ骇閲忕粺璁�
+ */
+ private double todayOutput;
+
+ /**
+ * 鎬诲湪绾挎椂闀匡紝鍗曚綅绉�
+ */
+ private double onlineTime;
+
+ /**
+ * 褰撳ぉ杩愯鏃堕棿
+ */
+ private double todayOnlineTime;
+
+ /**
+ * 鎬昏兘鑰楃粺璁�
+ */
+ private double power;
+
+ /**
+ * 浠婃棩鑳借��
+ */
+ private double todayPower;
+
+ /**
+ * 鎬绘姤璀︽暟
+ */
+ private double faultNum;
+
+ /**
+ * 浠婃棩鎶ヨ鏁�
+ */
+ private double todayFaultNum;
+
+ /**
+ * 缂栬緫鏃ユ湡
+ */
+ private String editDate;
+
+ /**
+ * 鐝寮�濮嬫椂闂�
+ */
+ private String workStartDate;
+
+ /**
+ * 鐝缁撴潫鏃堕棿
+ */
+ private String workEndDate;
+
+ /**
+ * 鐝id 1涓虹櫧鐝� 2涓烘櫄鐝�
+ */
+ private String deviceTypeClassItemId;
+
+ /**
+ * 鐝浜ч噺
+ */
+ private double workOutput;
+
+ /**
+ * 灏忔椂浜ч噺
+ */
+ private double hourOutput;
+
+ /**
+ * 娆″搧鏁伴噺
+ */
+ private double badoutput;
+
+ /**
+ * 褰撳ぉ娆″搧鏁伴噺
+ */
+ private double todayBadoutput;
+
+ /**
+ * 鐝娆″搧鏁伴噺
+ */
+ private double workBadoutput;
+
+ /**
+ * 灏忔椂娆″搧鏁伴噺
+ */
+ private double hourBadoutput;
+
+ /**
+ * 鐝
+ */
+ private String deviceTypeClassItemName;
+
+ /**
+ * 褰撳ぉ浣跨敤鏃堕棿
+ */
+ private double todayRunTime;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/DeviceStatusBycl.java b/src/main/java/com/hk/NumericalCollection/entity/DeviceStatusBycl.java
new file mode 100644
index 0000000..a7804b2
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/DeviceStatusBycl.java
@@ -0,0 +1,143 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 璁惧鐘舵�佽〃
+ *
+ * @TableName DEVICE_STATUS
+ */
+@TableName(value = "DEVICE_STATUS_BYCL")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@KeySequence(value = "SEQ_Metrics", dbType = DbType.ORACLE)
+public class DeviceStatusBycl implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * SEQ_Metrics
+ */
+ @TableId
+ private Long id;
+
+ /**
+ * 妫�楠屽崟鍙�
+ */
+ private String orderNo;
+
+ /**
+ * 璁惧缂栫爜
+ */
+ private String devNo;
+
+ /**
+ * 璁惧瀹炴椂鐘舵��
+ */
+ private double status;
+
+ /**
+ * 璁惧绱鎬讳骇閲�
+ */
+ private double output;
+
+ /**
+ * 鏃ヤ骇閲忕粺璁�
+ */
+ private double todayOutput;
+
+ /**
+ * 鎬诲湪绾挎椂闀匡紝鍗曚綅绉�
+ */
+ private double onlineTime;
+
+ /**
+ * 褰撳ぉ杩愯鏃堕棿
+ */
+ private double todayOnlineTime;
+
+ /**
+ * 鎬昏兘鑰楃粺璁�
+ */
+ private double power;
+
+ /**
+ * 浠婃棩鑳借��
+ */
+ private double todayPower;
+
+ /**
+ * 鎬绘姤璀︽暟
+ */
+ private double faultNum;
+
+ /**
+ * 浠婃棩鎶ヨ鏁�
+ */
+ private double todayFaultNum;
+
+ /**
+ * 缂栬緫鏃ユ湡
+ */
+ private String editDate;
+
+ /**
+ * 鐝寮�濮嬫椂闂�
+ */
+ private String workStartDate;
+
+ /**
+ * 鐝缁撴潫鏃堕棿
+ */
+ private String workEndDate;
+
+ /**
+ * 鐝id 1涓虹櫧鐝� 2涓烘櫄鐝�
+ */
+ private String deviceTypeClassItemId;
+
+ /**
+ * 鐝浜ч噺
+ */
+ private double workOutput;
+
+ /**
+ * 灏忔椂浜ч噺
+ */
+ private double hourOutput;
+
+ /**
+ * 娆″搧鏁伴噺
+ */
+ private double badoutput;
+
+ /**
+ * 褰撳ぉ娆″搧鏁伴噺
+ */
+ private double todayBadoutput;
+
+ /**
+ * 鐝娆″搧鏁伴噺
+ */
+ private double workBadoutput;
+
+ /**
+ * 灏忔椂娆″搧鏁伴噺
+ */
+ private double hourBadoutput;
+
+ /**
+ * 鐝
+ */
+ private String deviceTypeClassItemName;
+
+ /**
+ * 褰撳ぉ浣跨敤鏃堕棿
+ */
+ private double todayRunTime;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/Devicedatastandardmoditem.java b/src/main/java/com/hk/NumericalCollection/entity/Devicedatastandardmoditem.java
new file mode 100644
index 0000000..8312f9d
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/Devicedatastandardmoditem.java
@@ -0,0 +1,120 @@
+package com.hk.NumericalCollection.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @TableName DEVICEDATASTANDARDMODITEM
+ */
+@TableName(value = "DEVICEDATASTANDARDMODITEM")
+@Data
+public class Devicedatastandardmoditem implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ *
+ */
+ @TableId
+ private Long id;
+ /**
+ *
+ */
+ private Integer type;
+ /**
+ *
+ */
+ private String keyshort;
+ /**
+ *
+ */
+ private String keyname;
+ /**
+ *
+ */
+ private Integer islinear;
+ /**
+ *
+ */
+ private BigDecimal a;
+ /**
+ *
+ */
+ private BigDecimal b;
+ /**
+ *
+ */
+ private String datainfo;
+ /**
+ *
+ */
+ private String dataunit;
+ /**
+ *
+ */
+ private Long modid;
+ /**
+ *
+ */
+ private String modname;
+ /**
+ *
+ */
+ private String modno;
+ /**
+ *
+ */
+ private String ecdescribe;
+ /**
+ *
+ */
+ private String color;
+ /**
+ *
+ */
+ private Integer infront;
+ /**
+ *
+ */
+ private Integer divtype;
+ /**
+ *
+ */
+ private String img;
+ /**
+ *
+ */
+ private Date datecreater;
+ /**
+ *
+ */
+ private Long authorid;
+ /**
+ *
+ */
+ private String author;
+ /**
+ *
+ */
+ private Date lasteditdate;
+ /**
+ *
+ */
+ private String formula;
+ /**
+ *
+ */
+ private String pushkey;
+ /**
+ *
+ */
+ private Integer isShow;
+ private Integer groupSeq;
+ private Integer seq;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/MesNumerical.java b/src/main/java/com/hk/NumericalCollection/entity/MesNumerical.java
new file mode 100644
index 0000000..6c5c1b2
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/MesNumerical.java
@@ -0,0 +1,45 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @TableName MES_NUMERICAL
+ */
+@TableName(value = "MES_NUMERICAL")
+@Data
+public class MesNumerical implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * 涓婚敭鑷
+ */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+ /**
+ * 宸ュ崟id
+ */
+ private Long orderId;
+ /**
+ * 宸ュ崟缂栧彿
+ */
+ private String orderNo;
+ /**
+ * 鏃ユ湡
+ */
+ private String editDate;
+ /**
+ * 鏈哄彴
+ */
+ private String machineNo;
+ /**
+ * 閲囬泦鏁伴噺
+ */
+ private Integer cjNum;
+ /**
+ * 閲囬泦鏃堕棿
+ */
+ private String cjTiem;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/MesNumericalBycl.java b/src/main/java/com/hk/NumericalCollection/entity/MesNumericalBycl.java
new file mode 100644
index 0000000..da1e727
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/MesNumericalBycl.java
@@ -0,0 +1,46 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @TableName MES_NUMERICAL
+ */
+@TableName(value = "MES_NUMERICAL_BYCL")
+@Data
+@KeySequence(value = "ORDER_SELECT", dbType = DbType.ORACLE)
+public class MesNumericalBycl implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * ORDER_SELECT
+ */
+ @TableId
+ private Long id;
+ /**
+ * 宸ュ崟id
+ */
+ private Long orderId;
+ /**
+ * 宸ュ崟缂栧彿
+ */
+ private String orderNo;
+ /**
+ * 鏃ユ湡
+ */
+ private String editDate;
+ /**
+ * 鏈哄彴
+ */
+ private String machineNo;
+ /**
+ * 閲囬泦鏁伴噺
+ */
+ private Integer cjNum;
+ /**
+ * 閲囬泦鏃堕棿
+ */
+ private String cjTiem;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/MesOrderSelect.java b/src/main/java/com/hk/NumericalCollection/entity/MesOrderSelect.java
new file mode 100644
index 0000000..1334866
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/MesOrderSelect.java
@@ -0,0 +1,50 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @TableName MES_ORDER_SELECT
+ */
+@TableName(value = "MES_ORDER_SELECT")
+@Data
+public class MesOrderSelect implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * ORDER_SELECT
+ */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+ /**
+ * 宸ュ崟id
+ */
+ private Long orderId;
+ /**
+ * 宸ュ崟缂栧彿
+ */
+ private String orderNo;
+ /**
+ * 鏃ユ湡
+ */
+ private String editDate;
+ /**
+ * 鏈哄彴
+ */
+ private String machineNo;
+ /**
+ * 鍋滄満娆℃暟
+ */
+ private Integer tjCount;
+ /**
+ * 鍋滄満鏃堕棿(灏忔椂)
+ */
+ private Double tjTime;
+
+ /**
+ * 鏄惁瀹屽伐 1涓哄畬宸ワ紝0涓烘湭瀹屽伐
+ */
+ private Integer isShow;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/MesOrderSta.java b/src/main/java/com/hk/NumericalCollection/entity/MesOrderSta.java
new file mode 100644
index 0000000..29bde1e
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/MesOrderSta.java
@@ -0,0 +1,77 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 宸ュ崟鏃堕棿璁板綍琛�
+ *
+ * @TableName MES_ORDER_STA
+ */
+@TableName(value = "MES_ORDER_STA")
+@Data
+public class MesOrderSta implements Serializable {
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+ /**
+ * SEQ_ORDER
+ */
+ @TableId
+ private Long id;
+ /**
+ * 宸ュ崟id
+ */
+ private Long orderId;
+ /**
+ * 宸ュ崟鍙�
+ */
+ private String orderNo;
+ /**
+ * 寮�宸ユ椂闂�
+ */
+ private String startTime;
+ /**
+ * 瀹屽伐鏃堕棿
+ */
+ private String endTime;
+ /**
+ * 鏆傚仠鏃堕棿
+ */
+ private String suspendTime;
+ /**
+ * 鍙嶅畬宸ユ椂闂�
+ */
+ private String reverseTime;
+ /**
+ * 鎹㈡ā寮�濮嬫椂闂�
+ */
+ private String changeMoldStartTime;
+ /**
+ * 鎹㈡ā缁撴潫鏃堕棿
+ */
+ private String changeMoldEndTime;
+ /**
+ * 閫佹鍛煎彨鏃堕棿
+ */
+ private String maShoutTime;
+ /**
+ * 璋冩満寮�濮嬫椂闂�
+ */
+ private String maStartTime;
+ /**
+ * 璋冩満瀹屾垚鏃堕棿
+ */
+ private String maEndTime;
+ /**
+ * 涓嶈壇璁板綍id
+ */
+ private String ngId;
+
+ private String machineNo;
+
+ private short isShow;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/VOrder.java b/src/main/java/com/hk/NumericalCollection/entity/VOrder.java
new file mode 100644
index 0000000..9864ffa
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/VOrder.java
@@ -0,0 +1,185 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import lombok.Data;
+
+/**
+ *
+ * @TableName V_ORDER
+ */
+@TableName(value ="V_ORDER")
+@Data
+public class VOrder implements Serializable {
+ /**
+ *
+ */
+ private Long id;
+
+ /**
+ *
+ */
+ private String daa001;
+
+ /**
+ *
+ */
+ private String machineNo;
+
+ /**
+ *
+ */
+ private String daa014;
+
+ /**
+ *
+ */
+ private String daa003;
+
+ /**
+ *
+ */
+ private String daa002;
+
+ /**
+ *
+ */
+ private String daa004;
+
+ /**
+ *
+ */
+ private Long daa008;
+
+ /**
+ *
+ */
+ private Long daa011;
+
+ /**
+ *
+ */
+ private String addressCode;
+
+ /**
+ *
+ */
+ private Long bgqty;
+
+ /**
+ *
+ */
+ private Long yjqty;
+
+ /**
+ *
+ */
+ private Long daa012;
+
+ /**
+ *
+ */
+ private String engineeringNo;
+
+ /**
+ *
+ */
+ private String colorName;
+
+ /**
+ *
+ */
+ private String material;
+
+ /**
+ *
+ */
+ private String moldId;
+
+ /**
+ *
+ */
+ private String moldName;
+
+ /**
+ *
+ */
+ private String moldModel;
+
+ /**
+ *
+ */
+ private String daa018;
+
+ /**
+ *
+ */
+ private Long modlLifeWorning;
+
+ /**
+ *
+ */
+ private Long moldInseptionQty;
+
+ /**
+ *
+ */
+ private BigDecimal todayFaultNum;
+
+ /**
+ *
+ */
+ private BigDecimal todayOnlineTime;
+
+ /**
+ *
+ */
+ private Integer todayOutput;
+
+ /**
+ *
+ */
+ private String workStartDate;
+
+ /**
+ *
+ */
+ private String workEndDate;
+
+ /**
+ *
+ */
+ private BigDecimal todayRunTime;
+
+ /**
+ *
+ */
+ private Long moldingCyc;
+
+ /**
+ *
+ */
+ private String outItemNum;
+
+ /**
+ *
+ */
+ private String editDate;
+
+ /**
+ *
+ */
+ private Long jdl;
+
+ /**
+ *
+ */
+ private Long blQty;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/VOrderDetail.java b/src/main/java/com/hk/NumericalCollection/entity/VOrderDetail.java
new file mode 100644
index 0000000..92df9a8
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/VOrderDetail.java
@@ -0,0 +1,184 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 璁㈠崟璇︾粏淇℃伅瑙嗗浘瀹炰綋绫�
+ * @TableName V_ORDER_DETAIL
+ */
+@TableName(value = "V_ORDER_BYCL")
+@Data
+public class VOrderDetail implements Serializable {
+ /**
+ * 涓婚敭ID
+ */
+ private Long id;
+
+ /**
+ * 宸ュ崟鍙�
+ */
+ private String daa001;
+
+ /**
+ * 鏈哄彴鍙�
+ */
+ private String machineNo;
+
+ /**
+ * 宸ュ崟鏃ユ湡
+ */
+ private String daa014;
+
+ /**
+ * 瀹㈡埛浠g爜
+ */
+ private String daa003;
+
+ /**
+ * 鐗╂枡缂栫爜
+ */
+ private String daa002;
+
+ /**
+ * 瑙勬牸鍨嬪彿
+ */
+ private String daa004;
+
+ /**
+ * 璁″垝鏁伴噺
+ */
+ private Long daa008;
+
+ /**
+ * 宸插畬鎴愭暟閲�
+ */
+ private Long daa011;
+
+ /**
+ * 鍦板潃浠g爜
+ */
+ private String addressCode;
+
+ /**
+ * 闇�姹傛暟閲�
+ */
+ private Long daa012;
+
+ /**
+ * 澶囨敞
+ */
+ private String daa018;
+
+ /**
+ * 鎶ュ伐鏁伴噺
+ */
+ private Long blQty;
+
+ /**
+ * 鍛樺伐濮撳悕
+ */
+ private String staffName;
+
+ /**
+ * 鎶ュ伐鏃ユ湡
+ */
+ private String bgDate;
+
+ /**
+ * 宸ュ簭鍚嶇О
+ */
+ private String procName;
+
+ /**
+ * 缂栬緫鏃ユ湡
+ */
+ private String editDate;
+
+ /**
+ * 宸ヤ綔寮�濮嬫棩鏈�
+ */
+ private String workStartDate;
+
+ /**
+ * 宸ヤ綔缁撴潫鏃ユ湡
+ */
+ private String workEndDate;
+
+ /**
+ * 杩涘害鐜�
+ */
+ private Long jdl;
+
+ /**
+ * 浠婃棩杩愯鏃堕棿
+ */
+ private BigDecimal todayRunTime;
+
+ /**
+ * 浠婃棩鏁呴殰娆℃暟
+ */
+ private BigDecimal todayFaultNum;
+
+ /**
+ * 浠婃棩鍦ㄧ嚎鏃堕棿
+ */
+ private BigDecimal todayOnlineTime;
+
+ /**
+ * 浠婃棩浜ч噺
+ */
+ private Integer todayOutput;
+
+ /**
+ * 鎶ュ伐鏁伴噺姹囨��
+ */
+ private Long bgqty;
+
+ /**
+ * 宸蹭氦鏁伴噺
+ */
+ private Long yjqty;
+
+ /**
+ * 鍒�鍏风紪鍙�
+ */
+ private String cutterId;
+
+ /**
+ * 鍒�鍏峰悕绉�
+ */
+ private String cutterName;
+
+ /**
+ * 鍒�鍏峰瀷鍙�
+ */
+ private String cutterModel;
+
+ /**
+ * 鍒�鍏峰鍛介璀�
+ */
+ private Long modlLifeWorning;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ private Long produceNum;
+
+ /**
+ * 鍒囧墛鍛ㄦ湡
+ */
+ private Long cutteringCyc;
+
+ /**
+ * 鐗╂枡缂栧彿
+ */
+ private String itemNo;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/entity/Womcaa.java b/src/main/java/com/hk/NumericalCollection/entity/Womcaa.java
new file mode 100644
index 0000000..8ee2aed
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/Womcaa.java
@@ -0,0 +1,321 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 宸ュ崟琛�
+ * @TableName WOMCAA
+ */
+@TableName(value ="WOMCAA")
+@Data
+public class Womcaa implements Serializable {
+ /**
+ * 鑷鍒�
+ */
+ @TableId
+ private Long id;
+
+ /**
+ * ERPID
+ */
+ private Long erpid;
+
+ /**
+ * 鍗曞彿
+ */
+ private String caa001;
+
+ /**
+ * ERP宸ュ崟鎵规
+ */
+ private String caa002;
+
+ /**
+ * 瀹㈡埛缂栧彿
+ */
+ private String caa003;
+
+ /**
+ * 寮�鍗曟棩鏈�
+ */
+ private String caa005;
+
+ /**
+ * 浜у搧缂栫爜
+ */
+ private String caa006;
+
+ /**
+ * 浜у搧鍚嶇О
+ */
+ private String caa007;
+
+ /**
+ * 浜у搧瑙勬牸
+ */
+ private String caa008;
+
+ /**
+ * 鍗曚綅
+ */
+ private String caa009;
+
+ /**
+ * 棰勮寮�宸ユ椂闂�
+ */
+ private Date caa010;
+
+ /**
+ * 棰勮瀹屽伐鏃堕棿
+ */
+ private Date caa011;
+
+ /**
+ * 鏁伴噺
+ */
+ private Long caa012;
+
+ /**
+ * BOM鐗堟
+ */
+ private String caa013;
+
+ /**
+ * 瀹㈡埛璁㈠崟鍙�
+ */
+ private String caa014;
+
+ /**
+ * 閿�鍞鍗曞彿
+ */
+ private String caa015;
+
+ /**
+ * 澶囨敞
+ */
+ private String caa016;
+
+ /**
+ * 宸叉帓鏁伴噺
+ */
+ private Long caa017;
+
+ /**
+ * ERP鏉ユ簮ID
+ */
+ private Long caa018;
+
+ /**
+ * ERP鏉ユ簮鍗曡鍙�
+ */
+ private Long caa019;
+
+ /**
+ * ERP鏉ユ簮鍗曞彿(浠诲姟鍗曞彿)
+ */
+ private String caa020;
+
+ /**
+ * T100姣嶅伐鍗�
+ */
+ private String caa021;
+
+ /**
+ * 瀹℃牳鐮�
+ */
+ private Long fstatus;
+
+ /**
+ * 瀹℃牳鏃ユ湡
+ */
+ private Date checkDate;
+
+ /**
+ * 瀹℃牳浜�
+ */
+ private String checkUser;
+
+ /**
+ * 鏈帓鏁伴噺
+ */
+ private Long caa022;
+
+ /**
+ * 鐘舵�� 瀹屽伐锛屾湭瀹屽伐
+ */
+ private String caa023;
+
+ /**
+ * 宸插叆搴撴暟閲�
+ */
+ private Long caa024;
+
+ /**
+ * 鏁版嵁瀹℃牳鏃�
+ */
+ private String caa025;
+
+ /**
+ * 璧勬枡鍒涘缓鏃�
+ */
+ private String caa026;
+
+ /**
+ * 璧勬枡褰曞叆鑰�
+ */
+ private String caa027;
+
+ /**
+ * 鏈�杩戞洿鏀规棩
+ */
+ private String caa028;
+
+ /**
+ * 璧勬枡鏇存敼鑰�
+ */
+ private String caa029;
+
+ /**
+ * 鐘舵�佺爜锛圕:缁撴F:宸插彂鍑篨:浣滃簾锛�
+ */
+ private String state;
+
+ /**
+ * 閮ㄩ棬渚涘簲鍟�
+ */
+ private String suppNo;
+
+ /**
+ * 杞伐搴忎汉
+ */
+ private String caa031;
+
+ /**
+ * 杞伐搴忔椂闂�
+ */
+ private Date caa032;
+
+ /**
+ * 鎷嗗崟鏁�
+ */
+ private Long split;
+
+ /**
+ * 鏈哄彴缂栧彿
+ */
+ private String machineNo;
+
+ /**
+ * 鏄惁鎺掍骇
+ */
+ private Long isPc;
+
+ /**
+ * 鎹偣
+ */
+ private String addressCode;
+
+ /**
+ * 鏈�鍚庢帓浜т汉
+ */
+ private String pcUser;
+
+ /**
+ * 鏈�鍚庢帓浜ф椂闂�
+ */
+ private Date pcDate;
+
+ /**
+ * 鏄惁杞伐搴忓伐鍗�
+ */
+ private Long isGx;
+
+ /**
+ * 宸ヨ壓缂栧彿
+ */
+ private String caa030;
+
+ /**
+ * 鏄惁鏄伐鑹哄伐鍗�
+ */
+ private Long isGy;
+
+ /**
+ * 宸ュ簭缂栧彿
+ */
+ private String procNo;
+
+ /**
+ * 宸ュ簭搴忓彿
+ */
+ private String procNum;
+
+ /**
+ * 閮ㄩ棬
+ */
+ private String departmentNo;
+
+ /**
+ * 鏉ユ簮鍗曞彿
+ */
+ private String sourceNo;
+
+ /**
+ * 鏉ユ簮鍗曡鍙�
+ */
+ private Long slineNo;
+
+ /**
+ * 鏄惁蹇帓
+ */
+ private Long isKp;
+
+ /**
+ * 鍒涘缓浜�
+ */
+ private String createBy;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ private Date createDate;
+
+ /**
+ * 鏄惁濮斿
+ */
+ private Long caa004;
+
+ /**
+ * 鎵瑰彿
+ */
+ private String lotNo;
+
+ /**
+ * 宸ュ崟鏄惁鍙樻洿
+ */
+ private Long isChange;
+
+ /**
+ * 鏄惁鎶芥牱
+ */
+ private Long isSample;
+
+ /**
+ * 鎶芥牱涓暟
+ */
+ private Long sampleNum;
+
+ /**
+ * 椁愭宸ヨ祫鍨嬪彿
+ */
+ private String cyModel;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/entity/Womdaa.java b/src/main/java/com/hk/NumericalCollection/entity/Womdaa.java
new file mode 100644
index 0000000..df78750
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/entity/Womdaa.java
@@ -0,0 +1,331 @@
+package com.hk.NumericalCollection.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 宸ュ崟鎸囦护琛�
+ * @TableName WOMDAA
+ */
+@TableName(value ="WOMDAA")
+@Data
+public class Womdaa implements Serializable {
+ /**
+ * 鑷鍒�
+ */
+ @TableId
+ private Long id;
+
+ /**
+ * PID
+ */
+ private Long pid;
+
+ /**
+ * 瀛愬伐鍗曞崟鍙�
+ */
+ private String daa001;
+
+ /**
+ * 浜у搧缂栫爜
+ */
+ private String daa002;
+
+ /**
+ * 浜у搧鍚嶇О
+ */
+ private String daa003;
+
+ /**
+ * 浜у搧瑙勬牸
+ */
+ private String daa004;
+
+ /**
+ * 鍗曚綅
+ */
+ private String daa005;
+
+ /**
+ * 棰勮寮�宸ユ椂闂�
+ */
+ private Date daa006;
+
+ /**
+ * 棰勮瀹屽伐鏃堕棿
+ */
+ private Date daa007;
+
+ /**
+ * 宸ュ崟鏁伴噺
+ */
+ private Long daa008;
+
+ /**
+ * 澶囨敞
+ */
+ private String daa009;
+
+ /**
+ * 鍏ュ簱鏁伴噺
+ */
+ private Long daa010;
+
+ /**
+ * 宸茬敓浜ч噺
+ */
+ private Long daa011;
+
+ /**
+ * 鎶ュ簾鏁伴噺
+ */
+ private Long daa012;
+
+ /**
+ * 瀹㈡埛璁㈣喘鍗曞彿
+ */
+ private String daa013;
+
+ /**
+ * 鎶曟枡鍗曞崟鍙�
+ */
+ private String daa014;
+
+ /**
+ * 鐢熶骇绾垮埆
+ */
+ private String daa015;
+
+ /**
+ * 瀹為檯寮�宸ユ棩
+ */
+ private Date daa016;
+
+ /**
+ * 瀹為檯瀹屽伐鏃�
+ */
+ private Date daa017;
+
+ /**
+ * 宸ュ崟鐘舵��
+ */
+ private String daa018;
+
+ /**
+ * 榻愬鐘舵��
+ */
+ private Long daa019;
+
+ /**
+ * 瀹℃牳鐮�
+ */
+ private Long fstatus;
+
+ /**
+ * 瀹℃牳鏃ユ湡
+ */
+ private Date checkDate;
+
+ /**
+ * 瀹℃牳浜�
+ */
+ private String checkUser;
+
+ /**
+ * 绾垮埆缂栫爜
+ */
+ private String daa020;
+
+ /**
+ * 浠诲姟鍗曞崟鍙�
+ */
+ private String daa021;
+
+ /**
+ * 閫氱煡澶囨枡锛�0-鏈�氱煡锛�1-閫氱煡
+ */
+ private Long daa022;
+
+ /**
+ * 鏄惁榻愬
+ */
+ private Long daa023;
+
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ private String daa024;
+
+ /**
+ * 棣栦欢鏄惁妫�楠�1-妫�楠岋紝0鏈楠�
+ */
+ private String daa025;
+
+ /**
+ * 棣栦欢妫�楠岀粨鏋�
+ */
+ private String daa026;
+
+ /**
+ * 宸叉姤妫�锛�0-鏈姤妫�锛�1-宸叉姤妫�
+ */
+ private Long isReportcheck;
+
+ /**
+ * 鎶ユ浜�
+ */
+ private String usname;
+
+ /**
+ * 鎶ユ鏃堕棿
+ */
+ private Date reporttime;
+
+ /**
+ * 鏈哄彴缂栧彿
+ */
+ private String machineNo;
+
+ /**
+ * 澶囨枡瀹屾垚1-瀹屾垚锛�0鏈畬鎴�
+ */
+ private Long daa027;
+
+ /**
+ * 澶囨枡瀹屾垚鏃堕棿
+ */
+ private String daa028;
+
+ /**
+ * 鎹偣
+ */
+ private String addressCode;
+
+ /**
+ * 姣嶅伐鍗曞崟鍙�
+ */
+ private String daa029;
+
+ /**
+ * 宸ヨ壓缂栧彿
+ */
+ private String daa030;
+
+ /**
+ * 宸ュ簭缂栧彿
+ */
+ private String procNo;
+
+ /**
+ * 宸ュ簭搴忓彿
+ */
+ private String procNum;
+
+ /**
+ * 閮ㄩ棬
+ */
+ private String departmentNo;
+
+ /**
+ * 鏉ユ簮鍗曞彿
+ */
+ private String sourceNo;
+
+ /**
+ * 鏉ユ簮鍗曡鍙�
+ */
+ private Long slineNo;
+
+ /**
+ * 鏈哄彴寮�宸ヤ汉
+ */
+ private String daa031;
+
+ /**
+ * 鏈哄彴寮�宸ユ椂闂�
+ */
+ private Date daa032;
+
+ /**
+ * 鍗曟嵁绫诲瀷
+ */
+ private Long fType;
+
+ /**
+ * 鏆傚仠浜�
+ */
+ private String daa033;
+
+ /**
+ * 鏆傚仠鏃堕棿
+ */
+ private Date daa034;
+
+ /**
+ * 鎿嶄綔浜�
+ */
+ private String daa035;
+
+ /**
+ * 鎿嶄綔鏃堕棿
+ */
+ private Date daa036;
+
+ /**
+ * 鎵瑰彿
+ */
+ private String lotNo;
+
+ /**
+ * 鏄惁瀛樺湪鎹㈡ā璁板綍,0-涓嶅瓨鍦�,1-瀛樺湪
+ */
+ private Long ismoldLog;
+
+ /**
+ * 鐘舵�佺爜锛圕:缁撴F:宸插彂鍑篨:浣滃簾锛�
+ */
+ private String state;
+
+ /**
+ * 鏄惁鎶芥牱
+ */
+ private Long isSample;
+
+ /**
+ * 鎶芥牱涓暟
+ */
+ private Long sampleNum;
+
+ /**
+ * 宸ヨ壓缂栧彿
+ */
+ private String processNo;
+
+ /**
+ * 澶囨枡瀹屾垚鏃堕棿
+ */
+ private Date daa037;
+
+ /**
+ * T100姣嶅伐鍗�
+ */
+ private String daa038;
+
+ /**
+ * 娉ㄥ鍐荤粨鎵规
+ */
+ private Long filed1;
+
+ /**
+ * 椁愭宸ヨ祫鍨嬪彿
+ */
+ private String filed2;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DevMacByclMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DevMacByclMapper.java
new file mode 100644
index 0000000..399feab
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DevMacByclMapper.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.DevMacBycl;
+
+/**
+ * 閽堝琛ㄣ�怐EV_MAC_BYCYL銆戠殑鏁版嵁搴撴搷浣淢apper
+ */
+public interface DevMacByclMapper extends BaseMapper<DevMacBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DevMachineMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DevMachineMapper.java
new file mode 100644
index 0000000..4375b9b
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DevMachineMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EV_MACHINE銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-10-15 09:22:38
+* @Entity com.hk.NumericalCollection.entity.DevMachine
+*/
+public interface DevMachineMapper extends BaseMapper<DevMachine> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceByclMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceByclMapper.java
new file mode 100644
index 0000000..c2933bf
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceByclMapper.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.DeviceBycl;
+
+/**
+ * 閽堝琛ㄣ�怐EVICE_BYCL銆戠殑鏁版嵁搴撴搷浣淢apper
+ */
+public interface DeviceByclMapper extends BaseMapper<DeviceBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceErrorMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceErrorMapper.java
new file mode 100644
index 0000000..f476a36
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceErrorMapper.java
@@ -0,0 +1,12 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.DeviceError;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_ERROR(璁惧鏁呴殰)銆戠殑鏁版嵁搴撴搷浣淢apper
+ */
+public interface DeviceErrorMapper extends BaseMapper<DeviceError> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceMapper.java
new file mode 100644
index 0000000..3cf7075
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceMapper.java
@@ -0,0 +1,19 @@
+package com.hk.NumericalCollection.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.Device;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICE(鏁伴噰璁惧)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-09-27 09:56:10
+* @Entity generator.domain.Device
+*/
+public interface DeviceMapper extends BaseMapper<Device> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceMetricsMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceMetricsMapper.java
new file mode 100644
index 0000000..873b70e
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceMetricsMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.DeviceMetrics;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICE_METRICS銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-10-14 17:04:36
+* @Entity com.hk.NumericalCollection.entity.DeviceMetrics
+*/
+public interface DeviceMetricsMapper extends BaseMapper<DeviceMetrics> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusByclMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusByclMapper.java
new file mode 100644
index 0000000..4f7b8e4
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusByclMapper.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.DeviceStatusBycl;
+
+/**
+ * 閽堝琛ㄣ�怐EVICE_STATUS_BYCL銆戠殑鏁版嵁搴撴搷浣淢apper
+ */
+public interface DeviceStatusByclMapper extends BaseMapper<DeviceStatusBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusMapper.java
new file mode 100644
index 0000000..cb10942
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DeviceStatusMapper.java
@@ -0,0 +1,24 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.DeviceStatus;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_STATUS(璁惧鐘舵�佽〃)銆戠殑鏁版嵁搴撴搷浣淢apper
+ * @createDate 2024-10-15 10:57:38
+ * @Entity com.hk.NumericalCollection.entity.DeviceStatus
+ */
+public interface DeviceStatusMapper extends BaseMapper<DeviceStatus> {
+
+ int selectSumToDayOutPutByOrder(@Param("devNo") String devNo, @Param("editDate") String editDate, @Param("orderNo") String orderNo);
+
+ int updateTodayOutput(@Param("increment") int increment,
+ @Param("editDate") String editDate,
+ @Param("orderNo") String orderNo);
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/DevicedatastandardmoditemMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/DevicedatastandardmoditemMapper.java
new file mode 100644
index 0000000..91b0a35
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/DevicedatastandardmoditemMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.Devicedatastandardmoditem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICEDATASTANDARDMODITEM銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2025-02-06 14:05:55
+* @Entity com.hk.NumericalCollection.entity.Devicedatastandardmoditem
+*/
+public interface DevicedatastandardmoditemMapper extends BaseMapper<Devicedatastandardmoditem> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalByclMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalByclMapper.java
new file mode 100644
index 0000000..14fa0f2
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalByclMapper.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.MesNumericalBycl;
+
+/**
+ * 閽堝琛ㄣ�怣ES_NUMERICAL_BYCL銆戠殑鏁版嵁搴撴搷浣淢apper
+ */
+public interface MesNumericalByclMapper extends BaseMapper<MesNumericalBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalMapper.java
new file mode 100644
index 0000000..a90e0fd
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/MesNumericalMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.MesNumerical;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怣ES_NUMERICAL銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-11-06 14:54:47
+* @Entity com.hk.NumericalCollection.entity.MesNumerical
+*/
+public interface MesNumericalMapper extends BaseMapper<MesNumerical> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/MesOrderSelectMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/MesOrderSelectMapper.java
new file mode 100644
index 0000000..cd033e7
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/MesOrderSelectMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.MesOrderSelect;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怣ES_ORDER_SELECT銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-11-06 14:54:17
+* @Entity com.hk.NumericalCollection.entity.MesOrderSelect
+*/
+public interface MesOrderSelectMapper extends BaseMapper<MesOrderSelect> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/MesOrderStaMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/MesOrderStaMapper.java
new file mode 100644
index 0000000..ec90c8c
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/MesOrderStaMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.MesOrderSta;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怣ES_ORDER_STA(宸ュ崟鏃堕棿璁板綍琛�)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-10-15 08:46:23
+* @Entity com.hk.NumericalCollection.entity.MesOrderSta
+*/
+public interface MesOrderStaMapper extends BaseMapper<MesOrderSta> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/VOrderDetailMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/VOrderDetailMapper.java
new file mode 100644
index 0000000..bba8e02
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/VOrderDetailMapper.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.VOrderDetail;
+
+/**
+ * 璁㈠崟璇︾粏淇℃伅瑙嗗浘 Mapper 鎺ュ彛
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怴_ORDER_BYCL銆戠殑鏁版嵁搴撴搷浣淢apper
+ * @createDate 2025-01-04
+ */
+public interface VOrderDetailMapper extends BaseMapper<VOrderDetail> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/VOrderMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/VOrderMapper.java
new file mode 100644
index 0000000..65e579d
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/VOrderMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.VOrder;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怴_ORDER銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-10-22 08:18:10
+* @Entity com.hk.NumericalCollection.entity.VOrder
+*/
+public interface VOrderMapper extends BaseMapper<VOrder> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/WomcaaMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/WomcaaMapper.java
new file mode 100644
index 0000000..45114ac
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/WomcaaMapper.java
@@ -0,0 +1,18 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hk.NumericalCollection.entity.Womcaa;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMCAA(宸ュ崟琛�)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-09-27 21:41:27
+* @Entity com.hk.NumericalCollection.entity.Womcaa
+*/
+public interface WomcaaMapper extends BaseMapper<Womcaa> {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/mapper/WomdaaMapper.java b/src/main/java/com/hk/NumericalCollection/mapper/WomdaaMapper.java
new file mode 100644
index 0000000..72861ee
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/mapper/WomdaaMapper.java
@@ -0,0 +1,23 @@
+package com.hk.NumericalCollection.mapper;
+
+import com.hk.NumericalCollection.entity.Womdaa;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMDAA(宸ュ崟鎸囦护琛�)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-10-17 08:18:29
+* @Entity com.hk.NumericalCollection.entity.Womdaa
+*/
+public interface WomdaaMapper extends BaseMapper<Womdaa> {
+
+
+ List<Womdaa> getMinusDaa001(@Param("editDate") String editDate);
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/ApiService.java b/src/main/java/com/hk/NumericalCollection/service/ApiService.java
new file mode 100644
index 0000000..6e73823
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/ApiService.java
@@ -0,0 +1,107 @@
+package com.hk.NumericalCollection.service;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.hk.NumericalCollection.config.DataAcquisitionConfiguration;
+import com.hk.NumericalCollection.dto.ApiDataResult;
+import com.hk.NumericalCollection.dto.ApiRequestBody;
+import com.hk.NumericalCollection.dto.ApiResponse;
+import okhttp3.*;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+@Service
+public class ApiService {
+ private final OkHttpClient client;
+ private final ObjectMapper objectMapper;
+
+ public ApiService() {
+ this.client = new OkHttpClient.Builder()
+ .connectTimeout(90, TimeUnit.SECONDS) // Set connection timeout
+ .readTimeout(90, TimeUnit.SECONDS) // Set read timeout
+ .build();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ public ApiResponse<?> getSig(String publicKey, String appId) throws IOException {
+ MediaType mediaType = MediaType.parse("text/plain");
+ RequestBody body = RequestBody.create(mediaType, "{\"publicKey\":\"" + publicKey + "\"}");
+
+ Request request = new Request.Builder()
+ .url(String.format(DataAcquisitionConfiguration.ASK_SIGN_URL, appId))
+ .post(body)
+ .addHeader("Content-Type", "text/plain")
+ .addHeader("Accept", "*/*")
+ .addHeader("Connection", "keep-alive")
+ .build();
+
+ try (Response response = client.newCall(request).execute()) {
+ if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
+ return objectMapper.readValue(response.body().string(), ApiResponse.class);
+ }
+ }
+
+ public <T> ApiResponse<T> sendListRequest(ApiRequestBody requestBody, Class<T> responseType) throws IOException {
+ MediaType mediaType = MediaType.parse("application/json");
+ String jsonBody = objectMapper.writeValueAsString(requestBody);
+ RequestBody body = RequestBody.create(mediaType, jsonBody);
+
+ Request request = new Request.Builder()
+ .url(String.format(DataAcquisitionConfiguration.ASK_DATA_URL, requestBody.getAppId()))
+ .method("POST", body)
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "*/*")
+ .addHeader("Connection", "keep-alive")
+ .build();
+
+ try (Response response = client.newCall(request).execute()) {
+ if (response.isSuccessful()) {
+ return objectMapper.readValue(
+ response.body().string(),
+ objectMapper.getTypeFactory().constructParametricType(ApiResponse.class, responseType)
+ );
+ } else {
+ return handleErrorResponse(response);
+ }
+ }
+ }
+
+ private <T> ApiResponse<T> handleErrorResponse(Response response) throws IOException {
+ ApiResponse<T> errorResponse = new ApiResponse<>();
+ errorResponse.setCode(String.valueOf(response.code()));
+ errorResponse.setError(response.message());
+ // Optionally set other fields like list or total
+ return errorResponse;
+ }
+
+ public <T> ApiDataResult<T> sendDataRequest(ApiRequestBody requestBody, Class<T> responseType) throws IOException {
+ MediaType mediaType = MediaType.parse("application/json");
+ String jsonBody = objectMapper.writeValueAsString(requestBody);
+ RequestBody body = RequestBody.create(mediaType, jsonBody);
+
+ Request request = new Request.Builder()
+ .url(String.format(DataAcquisitionConfiguration.ASK_DATA_URL, requestBody.getAppId()))
+ .method("POST", body)
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "*/*")
+ .addHeader("Connection", "keep-alive")
+ .build();
+
+ try (Response response = client.newCall(request).execute()) {
+ if (response.isSuccessful()) {
+ return objectMapper.readValue(response.body().string(), objectMapper.getTypeFactory().constructParametricType(ApiDataResult.class, responseType));
+ } else {
+ return handleErrorDataResponse(response);
+ }
+ }
+ }
+
+ private <T> ApiDataResult<T> handleErrorDataResponse(Response response) throws IOException {
+ ApiDataResult<T> errorResponse = new ApiDataResult<>();
+ errorResponse.setCode(String.valueOf(response.code()));
+ errorResponse.setError(response.message());
+ // Optionally set other fields like list or total
+ return errorResponse;
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DevMacByclService.java b/src/main/java/com/hk/NumericalCollection/service/DevMacByclService.java
new file mode 100644
index 0000000..267d1f0
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DevMacByclService.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.DevMacBycl;
+
+/**
+ * 閽堝琛ㄣ�怐EV_MAC_BYCYL銆戠殑鏁版嵁搴撴搷浣淪ervice
+ */
+public interface DevMacByclService extends IService<DevMacBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/DevMachineService.java b/src/main/java/com/hk/NumericalCollection/service/DevMachineService.java
new file mode 100644
index 0000000..2a7b9e6
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DevMachineService.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EV_MACHINE銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-10-15 09:22:38
+*/
+public interface DevMachineService extends IService<DevMachine> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceByclService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceByclService.java
new file mode 100644
index 0000000..ede993a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceByclService.java
@@ -0,0 +1,10 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.DeviceBycl;
+
+/**
+ *
+ */
+public interface DeviceByclService extends IService<DeviceBycl> {
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceErrorService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceErrorService.java
new file mode 100644
index 0000000..bdf7380
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceErrorService.java
@@ -0,0 +1,12 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.DeviceError;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_ERROR(璁惧鏁呴殰)銆戠殑鏁版嵁搴撴搷浣淪ervice
+ */
+public interface DeviceErrorService extends IService<DeviceError> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceMetricsService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceMetricsService.java
new file mode 100644
index 0000000..fb5da8a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceMetricsService.java
@@ -0,0 +1,24 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.entity.DeviceMetrics;
+import com.hk.NumericalCollection.entity.DeviceRealTimeData;
+
+import java.io.IOException;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_METRICS銆戠殑鏁版嵁搴撴搷浣淪ervice
+ * @createDate 2024-10-14 17:04:36
+ */
+public interface DeviceMetricsService extends IService<DeviceMetrics> {
+
+ boolean manualSynchronization(NumbericalDto barcode) throws Exception;
+
+ boolean manualSynchronizationBycl(NumbericalDto barcode) throws Exception;
+
+ boolean saveDeviceMetrics(DeviceRealTimeData data, String engineeringNo);
+
+ String PdfToBase64(NumbericalDto barcode) throws Exception;
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceService.java
new file mode 100644
index 0000000..2431b40
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceService.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.Device;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICE(鏁伴噰璁惧)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-09-27 09:56:10
+*/
+public interface DeviceService extends IService<Device> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceStatusByclService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceStatusByclService.java
new file mode 100644
index 0000000..bf43f12
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceStatusByclService.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.DeviceStatusBycl;
+
+/**
+ * 閽堝琛ㄣ�怐EVICE_STATUS_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice
+ */
+public interface DeviceStatusByclService extends IService<DeviceStatusBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/DeviceStatusService.java b/src/main/java/com/hk/NumericalCollection/service/DeviceStatusService.java
new file mode 100644
index 0000000..aa67b9b
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DeviceStatusService.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.DeviceStatus;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_STATUS(璁惧鐘舵�佽〃)銆戠殑鏁版嵁搴撴搷浣淪ervice
+ * @createDate 2024-10-15 10:57:38
+ */
+public interface DeviceStatusService extends IService<DeviceStatus> {
+
+ int getSumToDayOutPut(String devNo, String formattedDate, String orderNo);
+
+ int updateTodayOutput(int increment, String editDate, String orderNo);
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/DevicedatastandardmoditemService.java b/src/main/java/com/hk/NumericalCollection/service/DevicedatastandardmoditemService.java
new file mode 100644
index 0000000..ca3b797
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/DevicedatastandardmoditemService.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.Devicedatastandardmoditem;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICEDATASTANDARDMODITEM銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2025-02-06 14:05:55
+*/
+public interface DevicedatastandardmoditemService extends IService<Devicedatastandardmoditem> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/INumericalNoOrderService.java b/src/main/java/com/hk/NumericalCollection/service/INumericalNoOrderService.java
new file mode 100644
index 0000000..2fd74ed
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/INumericalNoOrderService.java
@@ -0,0 +1,57 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.dto.ApiDataResult;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.entity.DeviceRealTimeData;
+
+import java.io.IOException;
+
+public interface INumericalNoOrderService {
+
+
+ /**
+ * 鑾峰彇鎵�浠ョ殑璁惧鍒楄〃
+ *
+ * @return void
+ * @author tjx
+ * @date 2024/9/26 20:38
+ */
+ boolean SoDeviceList() throws Exception;
+
+ /**
+ * 鏍规嵁璁惧缂栧彿鑾峰彇璁惧鐨勬渶杩戜竴鏉℃暟鎹俊鎭�
+ *
+ * @return void
+ * @author tjx
+ * @description TODO
+ * @date 2024/9/26 20:41
+ */
+ void getDeviceRealTimeData(String uid) throws Exception;
+
+ /**
+ * 鑾峰彇璁惧涓�涓嚜鐒舵棩鐨勮繍琛屾儏鍐�
+ *
+ * @return void
+ * @author tjx
+ * @description TODO
+ * @date 2024/9/26 20:41
+ */
+ void getDeviceDayCount(String uid, String date) throws IOException;
+
+ ApiDataResult<DeviceRealTimeData> getDeviceRealTimeDataApiDataResult(String uid) throws Exception;
+
+ boolean RefreshDev(NumbericalDto barcode);
+
+ /**
+ * 鑾峰彇璁惧鏁呴殰鍒楄〃
+ *
+ * @param uid 璁惧缂栧彿
+ * @param startDate 寮�濮嬫棩鏈�
+ * @param endDate 缁撴潫鏃ユ湡
+ * @return void
+ * @author tjx
+ * @date 2024/12/17
+ */
+ void getDeviceErrorList(String uid, String startDate, String endDate) throws Exception;
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/INumericalService.java b/src/main/java/com/hk/NumericalCollection/service/INumericalService.java
new file mode 100644
index 0000000..4ca86af
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/INumericalService.java
@@ -0,0 +1,48 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.dto.ApiDataResult;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.entity.DeviceRealTimeData;
+
+import java.io.IOException;
+
+public interface INumericalService {
+
+
+ /**
+ * 鑾峰彇鎵�浠ョ殑璁惧鍒楄〃
+ *
+ * @return void
+ * @author tjx
+ * @date 2024/9/26 20:38
+ */
+ boolean SoDeviceList() throws Exception;
+
+ /**
+ * 鏍规嵁璁惧缂栧彿鑾峰彇璁惧鐨勬渶杩戜竴鏉℃暟鎹俊鎭�
+ *
+ * @return void
+ * @author tjx
+ * @description TODO
+ * @date 2024/9/26 20:41
+ */
+ void getDeviceRealTimeData(String uid) throws Exception;
+
+ void getDeviceRealTimeDataBycl(String uid) throws Exception;
+
+ /**
+ * 鑾峰彇璁惧涓�涓嚜鐒舵棩鐨勮繍琛屾儏鍐�
+ *
+ * @return void
+ * @author tjx
+ * @description TODO
+ * @date 2024/9/26 20:41
+ */
+ void getDeviceDayCount(String uid, String date) throws IOException;
+
+ ApiDataResult<DeviceRealTimeData> getDeviceRealTimeDataApiDataResult(String uid) throws Exception;
+
+ boolean RefreshDev(NumbericalDto barcode);
+
+ boolean RefreshDevBycl(NumbericalDto barcode);
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/MesNumericalByclService.java b/src/main/java/com/hk/NumericalCollection/service/MesNumericalByclService.java
new file mode 100644
index 0000000..a510a90
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/MesNumericalByclService.java
@@ -0,0 +1,11 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.MesNumericalBycl;
+
+/**
+ * 閽堝琛ㄣ�怣ES_NUMERICAL_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice
+ */
+public interface MesNumericalByclService extends IService<MesNumericalBycl> {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/MesNumericalService.java b/src/main/java/com/hk/NumericalCollection/service/MesNumericalService.java
new file mode 100644
index 0000000..33284e8
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/MesNumericalService.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.MesNumerical;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怣ES_NUMERICAL銆戠殑鏁版嵁搴撴搷浣淪ervice
+ * @createDate 2024-11-06 14:54:47
+ */
+public interface MesNumericalService extends IService<MesNumerical> {
+
+ void cleanWeekAgoData();
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/MesOrderSelectService.java b/src/main/java/com/hk/NumericalCollection/service/MesOrderSelectService.java
new file mode 100644
index 0000000..4243419
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/MesOrderSelectService.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.entity.MesOrderSelect;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怣ES_ORDER_SELECT銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-11-06 14:54:17
+*/
+public interface MesOrderSelectService extends IService<MesOrderSelect> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/MesOrderStaService.java b/src/main/java/com/hk/NumericalCollection/service/MesOrderStaService.java
new file mode 100644
index 0000000..58436c4
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/MesOrderStaService.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.MesOrderSta;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怣ES_ORDER_STA(宸ュ崟鏃堕棿璁板綍琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice
+ * @createDate 2024-10-15 08:46:23
+ */
+public interface MesOrderStaService extends IService<MesOrderSta> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/VOrderDetailService.java b/src/main/java/com/hk/NumericalCollection/service/VOrderDetailService.java
new file mode 100644
index 0000000..eb50985
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/VOrderDetailService.java
@@ -0,0 +1,14 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.VOrderDetail;
+
+/**
+ * 璁㈠崟璇︾粏淇℃伅瑙嗗浘 Service 鎺ュ彛
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怴_ORDER_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice
+ * @createDate 2025-01-04
+ */
+public interface VOrderDetailService extends IService<VOrderDetail> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/VOrderService.java b/src/main/java/com/hk/NumericalCollection/service/VOrderService.java
new file mode 100644
index 0000000..b369970
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/VOrderService.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.entity.VOrder;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怴_ORDER銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-10-22 08:18:10
+*/
+public interface VOrderService extends IService<VOrder> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/WomcaaService.java b/src/main/java/com/hk/NumericalCollection/service/WomcaaService.java
new file mode 100644
index 0000000..d59cf7b
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/WomcaaService.java
@@ -0,0 +1,13 @@
+package com.hk.NumericalCollection.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hk.NumericalCollection.entity.Womcaa;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMCAA(宸ュ崟琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-09-27 21:41:27
+*/
+public interface WomcaaService extends IService<Womcaa> {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/WomdaaService.java b/src/main/java/com/hk/NumericalCollection/service/WomdaaService.java
new file mode 100644
index 0000000..ad46d23
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/WomdaaService.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.service;
+
+import com.hk.NumericalCollection.entity.Womdaa;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMDAA(宸ュ崟鎸囦护琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-10-17 08:18:29
+*/
+public interface WomdaaService extends IService<Womdaa> {
+
+ List<Womdaa> getMinusDaa001(String editDate);
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DevMacByclServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DevMacByclServiceImpl.java
new file mode 100644
index 0000000..8041b79
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DevMacByclServiceImpl.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DevMacBycl;
+import com.hk.NumericalCollection.mapper.DevMacByclMapper;
+import com.hk.NumericalCollection.service.DevMacByclService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 閽堝琛ㄣ�怐EV_MAC_BYCYL銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ */
+@Service
+public class DevMacByclServiceImpl extends ServiceImpl<DevMacByclMapper, DevMacBycl>
+ implements DevMacByclService {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DevMachineServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DevMachineServiceImpl.java
new file mode 100644
index 0000000..38053b6
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DevMachineServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.hk.NumericalCollection.service.DevMachineService;
+import com.hk.NumericalCollection.mapper.DevMachineMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EV_MACHINE銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-10-15 09:22:38
+*/
+@Service
+public class DevMachineServiceImpl extends ServiceImpl<DevMachineMapper, DevMachine>
+ implements DevMachineService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceByclServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceByclServiceImpl.java
new file mode 100644
index 0000000..c307654
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceByclServiceImpl.java
@@ -0,0 +1,15 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DeviceBycl;
+import com.hk.NumericalCollection.mapper.DeviceByclMapper;
+import com.hk.NumericalCollection.service.DeviceByclService;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ */
+@Service
+public class DeviceByclServiceImpl extends ServiceImpl<DeviceByclMapper, DeviceBycl>
+ implements DeviceByclService {
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceErrorServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceErrorServiceImpl.java
new file mode 100644
index 0000000..150b241
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceErrorServiceImpl.java
@@ -0,0 +1,17 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DeviceError;
+import com.hk.NumericalCollection.mapper.DeviceErrorMapper;
+import com.hk.NumericalCollection.service.DeviceErrorService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_ERROR(璁惧鏁呴殰)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ */
+@Service
+public class DeviceErrorServiceImpl extends ServiceImpl<DeviceErrorMapper, DeviceError>
+ implements DeviceErrorService {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceMetricsServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceMetricsServiceImpl.java
new file mode 100644
index 0000000..10f6651
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceMetricsServiceImpl.java
@@ -0,0 +1,814 @@
+package com.hk.NumericalCollection.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.ExcelWriter;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.dto.ApiDataResult;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.entity.*;
+import com.hk.NumericalCollection.mapper.DeviceMetricsMapper;
+import com.hk.NumericalCollection.service.*;
+import lombok.RequiredArgsConstructor;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.rendering.PDFRenderer;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.lang.reflect.Field;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_METRICS銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2024-10-14 17:04:36
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+@RequiredArgsConstructor
+public class DeviceMetricsServiceImpl extends ServiceImpl<DeviceMetricsMapper, DeviceMetrics> implements DeviceMetricsService {
+
+
+ // 闇�瑕佷箻浠� 0.1 鐨勫瓧娈靛垪琛�
+ private static final List<String> FIELDS_TO_SCALE = Arrays.asList("d23", "d53", "d55", "d57", "d59", "d61", "d63", "d65", "d67", "d69", "d71", "d73", "d76", "d79", "d82", "d85", "d88", "d91", "d94", "d97", "d100", "d103", "d106", "d112", "d115", "d118", "d121", "d126", "d131", "d136", "d141", "d146", "d151", "d156", "d161", "d166", "d170", "d174", "d178", "d182", "d186");
+
+ // private final WomdaaService womdaaService;
+ private final INumericalService numericalService;
+ private final VOrderService vOrderService;
+ private final VOrderDetailService vOrderDetailService;
+ private final DevMachineService devMachineService;
+ private final DevMacByclService devMacByclService;
+ private final DeviceService deviceService;
+ private final DeviceByclService deviceByclService;
+ private final DevicedatastandardmoditemService devicedatastandardmoditemService;
+
+ @Override
+ public boolean manualSynchronization(NumbericalDto barcode) throws Exception {
+ LambdaQueryWrapper<VOrder> query = new LambdaQueryWrapper<>();
+ query.eq(VOrder::getId, barcode.getOrderId());
+ VOrder womdaa = vOrderService.getOne(query, false);
+
+ if (womdaa == null) {
+ return false;
+ }
+
+ LambdaQueryWrapper<DevMachine> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(DevMachine::getMachineNo, barcode.getMachineNo());
+
+ DevMachine one = devMachineService.getOne(queryWrapper);
+
+ if (one == null) {
+ return false;
+ }
+
+ //if ("862858071070278_1".equals(one.getDevNo())) {
+ List<Boolean> list = new ArrayList<Boolean>();
+
+ //鏍规嵁宸ュ崟鍜屾満鍙版煡鏄惁鏈夊伐鑹哄弬鏁扮殑璁板綍
+ LambdaUpdateWrapper<DeviceMetrics> queryWrapper1 = new LambdaUpdateWrapper<>();
+ queryWrapper1.eq(DeviceMetrics::getDevNo, one.getDevNo())
+// .eq(DeviceMetrics::getItemNo, womdaa.getEngineeringNo())
+ .eq(DeviceMetrics::getItemNo, womdaa.getDaa002())
+ .eq(DeviceMetrics::getType, 1);
+
+ remove(queryWrapper1);
+
+ String dev = one.getDevNo().substring(0, 15);
+
+ LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>();
+ wrapper.like(Device::getDevNo, dev);
+ List<Device> list1 = deviceService.list(wrapper);
+
+
+ int machineNo = Integer.parseInt(barcode.getMachineNo());
+
+ list1.forEach(s -> {
+ ApiDataResult<DeviceRealTimeData> result = null;
+ try {
+ result = numericalService.getDeviceRealTimeDataApiDataResult(s.getDevNo());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ DeviceRealTimeData data = result.getData();
+// boolean b = saveDeviceMetrics(data, womdaa.getEngineeringNo(), s.getDevNo());
+ boolean b = saveDeviceMetrics(data, womdaa.getDaa002(), s.getDevNo(), womdaa.getDaa001(), machineNo);
+ list.add(b);
+ });
+ return list.stream().allMatch(Boolean::booleanValue);
+ //}
+
+// ApiDataResult<DeviceRealTimeData> result = numericalService.getDeviceRealTimeDataApiDataResult(one.getDevNo());
+//
+// DeviceRealTimeData data = result.getData();
+// return saveDeviceMetrics(data, womdaa.getEngineeringNo());
+ }
+
+ @Override
+ public boolean manualSynchronizationBycl(NumbericalDto barcode) throws Exception {
+ LambdaQueryWrapper<VOrderDetail> query = new LambdaQueryWrapper<>();
+ query.eq(VOrderDetail::getId, barcode.getOrderId());
+ VOrderDetail womdaa = vOrderDetailService.getOne(query, false);
+
+ if (womdaa == null) {
+ return false;
+ }
+
+ LambdaQueryWrapper<DevMacBycl> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(DevMacBycl::getMachineNo, barcode.getMachineNo());
+
+ DevMacBycl one = devMacByclService.getOne(queryWrapper);
+
+ if (one == null) {
+ return false;
+ }
+
+ //if ("862858071070278_1".equals(one.getDevNo())) {
+ List<Boolean> list = new ArrayList<Boolean>();
+
+ //鏍规嵁宸ュ崟鍜屾満鍙版煡鏄惁鏈夊伐鑹哄弬鏁扮殑璁板綍
+ LambdaUpdateWrapper<DeviceMetrics> queryWrapper1 = new LambdaUpdateWrapper<>();
+ queryWrapper1.eq(DeviceMetrics::getDevNo, one.getDevNo())
+// .eq(DeviceMetrics::getItemNo, womdaa.getEngineeringNo())
+ .eq(DeviceMetrics::getItemNo, womdaa.getDaa002())
+ .eq(DeviceMetrics::getType, 1);
+
+ remove(queryWrapper1);
+
+ String dev = one.getDevNo().substring(0, 15);
+
+ LambdaQueryWrapper<DeviceBycl> wrapper = new LambdaQueryWrapper<>();
+ wrapper.like(DeviceBycl::getDevNo, dev);
+ List<DeviceBycl> list1 = deviceByclService.list(wrapper);
+
+ list1.forEach(s -> {
+ ApiDataResult<DeviceRealTimeData> result = null;
+ try {
+ result = numericalService.getDeviceRealTimeDataApiDataResult(s.getDevNo());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ DeviceRealTimeData data = result.getData();
+// boolean b = saveDeviceMetrics(data, womdaa.getEngineeringNo(), s.getDevNo());
+ boolean b = saveDeviceMetricsBycl(data, womdaa.getDaa002(), s.getDevNo(), womdaa.getDaa001(), barcode.getMachineNo());
+ list.add(b);
+ });
+ return list.stream().allMatch(Boolean::booleanValue);
+ }
+
+ private boolean saveDeviceMetricsBycl(DeviceRealTimeData data, String engineeringNo, String devNo, String daa001, String machineNo) {
+
+ if (StrUtil.isNullOrUndefined(devNo)) {
+ return false;
+ }
+
+ List<DeviceMetrics> list = new ArrayList<>();
+
+ // 鏍规嵁 machineNo 閫夋嫨瀛楁鏄犲皠
+ Map<String, DevMetricsSeq> fieldMap = createFieldMappingForBycl(machineNo);
+
+ String formattedDate = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss");
+
+ for (Map.Entry<String, DevMetricsSeq> entry : fieldMap.entrySet()) {
+ String fieldKey = entry.getKey();
+ DevMetricsSeq value = entry.getValue();
+
+ // 浣跨敤鍙嶅皠浠� DeviceRealTimeData 涓幏鍙栧搴斿瓧娈电殑鍊�
+ String fieldValue = getFieldValue1(data, fieldKey);
+
+ // 濡傛灉瀛楁鍊间笉涓虹┖锛屾彃鍏ュ埌鏁版嵁搴�
+ if (fieldValue != null) {
+ DeviceMetrics entity = new DeviceMetrics();
+ entity.setField(value.getField());
+ entity.setGroupSeq(value.getGroupSeq());
+ entity.setSeq(value.getSeq());
+ entity.setValue(fieldValue);
+ entity.setDevNo(devNo);
+ entity.setDayDate(formattedDate);
+ entity.setItemNo(engineeringNo);
+ entity.setType((short) 1);
+ entity.setBillNo(daa001);
+ entity.setMachineNo(machineNo);
+ list.add(entity);
+ }
+ }
+
+ //瀵煎嚭鍒癳xcel
+ //exportDeviceMetricsToExcel(list);
+
+ return saveBatch(list);
+ }
+
+ private boolean saveDeviceMetrics(DeviceRealTimeData data, String engineeringNo, String devNo, String daa001, int machineNo) {
+
+ if (StrUtil.isNullOrUndefined(devNo)) {
+ return false;
+ }
+
+ List<DeviceMetrics> list = new ArrayList<>();
+
+ String seq = devNo.substring(16);
+
+ LambdaQueryWrapper<Devicedatastandardmoditem> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(Devicedatastandardmoditem::getModname, "UA娉ㄥ鏈�")
+ .eq(Devicedatastandardmoditem::getIsShow, 1)
+ .eq(Devicedatastandardmoditem::getDatainfo, seq);
+
+ List<Devicedatastandardmoditem> deviceList = devicedatastandardmoditemService.list(wrapper);
+
+ Map<String, DevMetricsSeq> fieldMap = new HashMap<>();
+ deviceList.forEach(s -> {
+ DevMetricsSeq devMetricsSeq = new DevMetricsSeq();
+ devMetricsSeq.setField(s.getKeyname());
+ devMetricsSeq.setGroupSeq(s.getGroupSeq().shortValue());
+ devMetricsSeq.setSeq(s.getSeq().shortValue());
+ fieldMap.put(s.getKeyshort(), devMetricsSeq);
+ });
+
+ //String formattedDate = data.getLastEditDate();
+ String formattedDate = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss");
+
+ for (Map.Entry<String, DevMetricsSeq> entry : fieldMap.entrySet()) {
+ String fieldKey = entry.getKey();
+ DevMetricsSeq value = entry.getValue();
+
+ // 浣跨敤鍙嶅皠浠� DeviceRealTimeData 涓幏鍙栧搴斿瓧娈电殑鍊�
+ String fieldValue = getFieldValue1(data, fieldKey);
+
+ // 濡傛灉瀛楁鍊间笉涓虹┖锛屾彃鍏ュ埌鏁版嵁搴�
+ if (fieldValue != null) {
+ String dev = devNo.substring(0, 15);
+ DeviceMetrics entity = new DeviceMetrics();
+ entity.setField(value.getField());
+ entity.setGroupSeq(value.getGroupSeq());
+ entity.setSeq(value.getSeq());
+ entity.setValue(fieldValue);
+ entity.setDevNo(dev + "_1");
+ entity.setDayDate(formattedDate);
+ entity.setItemNo(engineeringNo);
+ entity.setType((short) 1);
+ entity.setBillNo(daa001);
+ entity.setMachineNo(String.valueOf(machineNo));
+ list.add(entity);
+ }
+ }
+
+ //瀵煎嚭鍒癳xcel
+ //exportDeviceMetricsToExcel(list);
+
+ return saveBatch(list);
+ }
+
+ private String getFieldValue1(DeviceRealTimeData data, String fieldName) {
+ try {
+ Field field = DeviceRealTimeData.class.getDeclaredField(fieldName);
+ field.setAccessible(true); // 鍏佽璁块棶绉佹湁瀛楁
+ String fieldValue = (String) field.get(data);
+
+ // 濡傛灉瀛楁闇�瑕佷箻浠� 0.1锛屽垯杩涜杞崲
+// if (fieldValue != null && FIELDS_TO_SCALE.contains(fieldName)) {
+ if (fieldValue != null) {
+ double scaledValue = Double.parseDouble(fieldValue);
+// fieldValue = String.valueOf(scaledValue);
+ // 淇濈暀涓�浣嶅皬鏁�
+ fieldValue = String.format("%.1f", scaledValue);
+
+ double v = Double.parseDouble(fieldValue);
+ if (v <= 0) {
+ fieldValue = "/";
+ } else {
+ fieldValue = String.format("%.1f", v);
+ }
+ } else {
+ fieldValue = "/";
+ }
+// if (fieldValue != null) {
+// double v = Double.parseDouble(fieldValue);
+// if (v < 0) {
+// fieldValue = "/";
+// } else {
+// fieldValue = String.format("%.1f", v);
+// }
+// } else {
+// fieldValue = "/";
+// }
+
+ return fieldValue;
+ } catch (NoSuchFieldException | IllegalAccessException | NumberFormatException e) {
+ // 蹇界暐娌℃湁鐨勫瓧娈垫垨鏃犳硶璁块棶鐨勫瓧娈�
+ System.out.println("瀛楁涓嶅瓨鍦ㄦ垨鏃犳硶璁块棶: " + fieldName);
+ return null;
+ }
+ }
+
+ // 鍒涘缓瀛楁涓庝腑鏂囨弿杩扮殑鏄犲皠
+ private Map<String, DevMetricsSeq> createFieldMapping() {
+ Map<String, DevMetricsSeq> fieldMap = new HashMap<>(180);
+
+// fieldMap.put("d15", "寮�妯℃�绘暟");
+// fieldMap.put("d3", "鍛婅淇℃伅");
+ fieldMap.put("d21", new DevMetricsSeq("鎵樻ā浣嶇疆", (short) 1, (short) 46));
+// fieldMap.put("d22", "杈撳嚭鍘嬪姏");
+// fieldMap.put("d23", "杈撳嚭閫熷害");
+// fieldMap.put("d24", "杈撳嚭鑳屽帇");
+ fieldMap.put("d25", new DevMetricsSeq("灏勫嚭浣嶇疆", (short) 2, (short) 19));
+ fieldMap.put("d26", new DevMetricsSeq("娓╀竴瀹為檯", (short) 3, (short) 132));
+ fieldMap.put("d27", new DevMetricsSeq("娓╀簩瀹為檯", (short) 3, (short) 133));
+ fieldMap.put("d28", new DevMetricsSeq("娓╀笁瀹為檯", (short) 3, (short) 134));
+ fieldMap.put("d29", new DevMetricsSeq("娓╁洓瀹為檯", (short) 3, (short) 135));
+ fieldMap.put("d30", new DevMetricsSeq("娓╀簲瀹為檯", (short) 3, (short) 136));
+ fieldMap.put("d31", new DevMetricsSeq("娓╁叚瀹為檯", (short) 3, (short) 137));
+ fieldMap.put("d32", new DevMetricsSeq("娓╀竷瀹為檯", (short) 3, (short) 138));
+// fieldMap.put("d33", "涓婃ā寰幆鏃堕棿");
+// fieldMap.put("d34", "涓婃ā灏勫嚭鏃堕棿");
+// fieldMap.put("d35", "涓婃ā杞繚鏃堕棿");
+// fieldMap.put("d36", "涓婃ā鍌ㄦ枡鏃堕棿");
+// fieldMap.put("d37", "涓婃ā鍏虫ā璁℃椂");
+// fieldMap.put("d38", "涓婃ā浣庡帇璁℃椂");
+// fieldMap.put("d39", "涓婃ā楂樺帇璁℃椂");
+// fieldMap.put("d40", "涓婃ā鎺ㄥ姏搴т綅缃�");
+// fieldMap.put("d41", "涓婃ā寮�妯¤鏃�");
+// fieldMap.put("d42", "涓婃ā杞繚鍘嬪姏");
+// fieldMap.put("d43", "涓婃ā灏勫嚭璧风偣");
+// fieldMap.put("d44", "涓婃ā淇濆帇璧风偣");
+// fieldMap.put("d45", "涓婃ā灏勫嚭缁堢偣浣嶇疆");
+// fieldMap.put("d46", "涓婃ā灏勫嚭鐩戞帶浣嶇疆");
+// fieldMap.put("d47", "涓婃ā灏勫嚭灏栧帇");
+// fieldMap.put("d48", "涓婃ā鍌ㄦ枡灏栧帇");
+// fieldMap.put("d49", "涓婃ā鏈�澶у皠閫�");
+// fieldMap.put("d50", "涓婃ā鍙栦欢鏃堕棿");
+ fieldMap.put("d51", new DevMetricsSeq("寮�妯¤绋�", (short) 1, (short) 1));
+ fieldMap.put("d52", new DevMetricsSeq("鍏虫ā涓�娈靛帇鍔�", (short) 1, (short) 17));
+ fieldMap.put("d53", new DevMetricsSeq("鍏虫ā涓�娈甸�熷害", (short) 1, (short) 18));
+ fieldMap.put("d54", new DevMetricsSeq("鍏虫ā浜屾鍘嬪姏", (short) 1, (short) 20));
+ fieldMap.put("d55", new DevMetricsSeq("鍏虫ā浜屾閫熷害", (short) 1, (short) 21));
+ fieldMap.put("d56", new DevMetricsSeq("鍏虫ā涓夋鍘嬪姏", (short) 1, (short) 23));
+ fieldMap.put("d57", new DevMetricsSeq("鍏虫ā涓夋閫熷害", (short) 1, (short) 24));
+ fieldMap.put("d58", new DevMetricsSeq("鍏虫ā浣庡帇鍘嬪姏", (short) 1, (short) 26));
+ fieldMap.put("d59", new DevMetricsSeq("鍏虫ā浣庡帇閫熷害", (short) 1, (short) 27));
+ fieldMap.put("d60", new DevMetricsSeq("鍏虫ā楂樺帇鍘嬪姏", (short) 1, (short) 29));
+ fieldMap.put("d61", new DevMetricsSeq("鍏虫ā楂樺帇閫熷害", (short) 1, (short) 30));
+ fieldMap.put("d62", new DevMetricsSeq("寮�妯′竴娈靛帇鍔�", (short) 1, (short) 2));
+ fieldMap.put("d63", new DevMetricsSeq("寮�妯′竴娈甸�熷害", (short) 1, (short) 3));
+ fieldMap.put("d64", new DevMetricsSeq("寮�妯′簩娈靛帇鍔�", (short) 1, (short) 5));
+ fieldMap.put("d65", new DevMetricsSeq("寮�妯′簩娈甸�熷害", (short) 1, (short) 6));
+ fieldMap.put("d66", new DevMetricsSeq("寮�妯′笁娈靛帇鍔�", (short) 1, (short) 8));
+ fieldMap.put("d67", new DevMetricsSeq("寮�妯′笁娈甸�熷害", (short) 1, (short) 9));
+ fieldMap.put("d68", new DevMetricsSeq("寮�妯″洓娈靛帇鍔�", (short) 1, (short) 11));
+ fieldMap.put("d69", new DevMetricsSeq("寮�妯″洓娈甸�熷害", (short) 1, (short) 12));
+ fieldMap.put("d70", new DevMetricsSeq("寮�妯′簲娈靛帇鍔�", (short) 1, (short) 14));
+ fieldMap.put("d71", new DevMetricsSeq("寮�妯′簲娈甸�熷害", (short) 1, (short) 15));
+ fieldMap.put("d72", new DevMetricsSeq("灏勫嚭涓�娈靛帇鍔�", (short) 2, (short) 1));
+ fieldMap.put("d73", new DevMetricsSeq("灏勫嚭涓�娈甸�熷害", (short) 2, (short) 2));
+ fieldMap.put("d74", new DevMetricsSeq("灏勫嚭涓�娈典綅缃�", (short) 2, (short) 3));
+ fieldMap.put("d75", new DevMetricsSeq("灏勫嚭浜屾鍘嬪姏", (short) 2, (short) 4));
+ fieldMap.put("d76", new DevMetricsSeq("灏勫嚭浜屾閫熷害", (short) 2, (short) 5));
+ fieldMap.put("d77", new DevMetricsSeq("灏勫嚭浜屾浣嶇疆", (short) 2, (short) 6));
+ fieldMap.put("d78", new DevMetricsSeq("灏勫嚭涓夋鍘嬪姏", (short) 2, (short) 7));
+ fieldMap.put("d79", new DevMetricsSeq("灏勫嚭涓夋閫熷害", (short) 2, (short) 8));
+ fieldMap.put("d80", new DevMetricsSeq("灏勫嚭涓夋浣嶇疆", (short) 2, (short) 9));
+ fieldMap.put("d81", new DevMetricsSeq("灏勫嚭鍥涙鍘嬪姏", (short) 2, (short) 10));
+ fieldMap.put("d82", new DevMetricsSeq("灏勫嚭鍥涙閫熷害", (short) 2, (short) 11));
+ fieldMap.put("d83", new DevMetricsSeq("灏勫嚭鍥涙浣嶇疆", (short) 2, (short) 12));
+ fieldMap.put("d84", new DevMetricsSeq("灏勫嚭浜旀鍘嬪姏", (short) 2, (short) 13));
+ fieldMap.put("d85", new DevMetricsSeq("灏勫嚭浜旀閫熷害", (short) 2, (short) 14));
+ fieldMap.put("d86", new DevMetricsSeq("灏勫嚭浜旀浣嶇疆", (short) 2, (short) 15));
+ fieldMap.put("d87", new DevMetricsSeq("灏勫嚭鍏鍘嬪姏", (short) 2, (short) 16));
+ fieldMap.put("d88", new DevMetricsSeq("灏勫嚭鍏閫熷害", (short) 2, (short) 17));
+ fieldMap.put("d89", new DevMetricsSeq("灏勫嚭鍏浣嶇疆", (short) 2, (short) 18));
+ fieldMap.put("d90", new DevMetricsSeq("淇濆帇涓�娈靛帇鍔�", (short) 2, (short) 24));
+ fieldMap.put("d91", new DevMetricsSeq("淇濆帇涓�娈甸�熷害", (short) 2, (short) 25));
+ fieldMap.put("d92", new DevMetricsSeq("淇濆帇涓�娈垫椂闂�", (short) 2, (short) 26));
+ fieldMap.put("d93", new DevMetricsSeq("淇濆帇浜屾鍘嬪姏", (short) 2, (short) 27));
+ fieldMap.put("d94", new DevMetricsSeq("淇濆帇浜屾閫熷害", (short) 2, (short) 28));
+ fieldMap.put("d95", new DevMetricsSeq("淇濆帇浜屾鏃堕棿", (short) 2, (short) 29));
+ fieldMap.put("d96", new DevMetricsSeq("淇濆帇涓夋鍘嬪姏", (short) 2, (short) 30));
+ fieldMap.put("d97", new DevMetricsSeq("淇濆帇涓夋閫熷害", (short) 2, (short) 31));
+ fieldMap.put("d98", new DevMetricsSeq("淇濆帇涓夋鏃堕棿", (short) 2, (short) 32));
+ fieldMap.put("d99", new DevMetricsSeq("淇濆帇鍥涙鍘嬪姏", (short) 2, (short) 33));
+ fieldMap.put("d100", new DevMetricsSeq("淇濆帇鍥涙閫熷害", (short) 2, (short) 34));
+ fieldMap.put("d101", new DevMetricsSeq("淇濆帇鍥涙鏃堕棿", (short) 2, (short) 35));
+ fieldMap.put("d102", new DevMetricsSeq("淇濆帇浜旀鍘嬪姏", (short) 2, (short) 36));
+ fieldMap.put("d103", new DevMetricsSeq("淇濆帇浜旀閫熷害", (short) 2, (short) 37));
+ fieldMap.put("d104", new DevMetricsSeq("淇濆帇浜旀鏃堕棿", (short) 2, (short) 38));
+ fieldMap.put("d105", new DevMetricsSeq("淇濆帇鍏鍘嬪姏", (short) 2, (short) 39));
+ fieldMap.put("d106", new DevMetricsSeq("淇濆帇鍏閫熷害", (short) 2, (short) 40));
+ fieldMap.put("d107", new DevMetricsSeq("淇濆帇鍏鏃堕棿", (short) 2, (short) 41));
+ fieldMap.put("d108", new DevMetricsSeq("杞繚鍘嬩綅缃瀹�", (short) 2, (short) 23));
+ fieldMap.put("d109", new DevMetricsSeq("杞繚鍘嬫椂闂磋瀹�", (short) 2, (short) 22));
+ fieldMap.put("d110", new DevMetricsSeq("杞繚鍘嬮�夋嫨", (short) 2, (short) 20));
+ fieldMap.put("d111", new DevMetricsSeq("鎵樻ā杩涗竴娈靛帇鍔�", (short) 1, (short) 32));
+ fieldMap.put("d112", new DevMetricsSeq("鎵樻ā杩涗竴娈甸�熷害", (short) 1, (short) 33));
+ fieldMap.put("d113", new DevMetricsSeq("鎵樻ā杩涗竴娈典綅缃�", (short) 1, (short) 34));
+ fieldMap.put("d114", new DevMetricsSeq("鎵樻ā杩涗簩娈靛帇鍔�", (short) 1, (short) 36));
+ fieldMap.put("d115", new DevMetricsSeq("鎵樻ā杩涗簩娈甸�熷害", (short) 1, (short) 35));
+ fieldMap.put("d116", new DevMetricsSeq("鎵樻ā杩涗簩娈典綅缃�", (short) 1, (short) 37));
+ fieldMap.put("d117", new DevMetricsSeq("鎵樻ā閫�涓�娈靛帇鍔�", (short) 1, (short) 39));
+ fieldMap.put("d118", new DevMetricsSeq("鎵樻ā閫�涓�娈甸�熷害", (short) 1, (short) 40));
+ fieldMap.put("d119", new DevMetricsSeq("鎵樻ā閫�涓�娈典綅缃�", (short) 1, (short) 41));
+ fieldMap.put("d120", new DevMetricsSeq("鎵樻ā閫�浜屾鍘嬪姏", (short) 1, (short) 43));
+ fieldMap.put("d121", new DevMetricsSeq("鎵樻ā閫�浜屾閫熷害", (short) 1, (short) 42));
+ fieldMap.put("d122", new DevMetricsSeq("鎵樻ā閫�浜屾浣嶇疆", (short) 1, (short) 44));
+ fieldMap.put("d123", new DevMetricsSeq("鎵樻ā杩涘欢鏃舵椂闂�", (short) 1, (short) 38));
+ fieldMap.put("d124", new DevMetricsSeq("鎵樻ā閫�寤舵椂鏃堕棿", (short) 1, (short) 45));
+
+ fieldMap.put("d209", new DevMetricsSeq("涓瓙 A 閫夋嫨", (short) 4, (short) 1));
+ fieldMap.put("d210", new DevMetricsSeq("涓瓙 B 閫夋嫨", (short) 4, (short) 11));
+ fieldMap.put("d137", new DevMetricsSeq("涓瓙 B 杩涘姩浣滀綅缃�", (short) 4, (short) 17));
+ fieldMap.put("d211", new DevMetricsSeq("涓瓙 C 閫夋嫨", (short) 4, (short) 23));
+ fieldMap.put("d212", new DevMetricsSeq("涓瓙 D 閫夋嫨", (short) 4, (short) 34));
+
+ fieldMap.put("d125", new DevMetricsSeq("涓瓙 A 杩涘帇鍔�", (short) 4, (short) 2));
+ fieldMap.put("d126", new DevMetricsSeq("涓瓙 A 杩涢�熷害", (short) 4, (short) 3));
+// fieldMap.put("d127", "涓瓙 A 杩涘姩浣滀綅缃�");
+ fieldMap.put("d128", new DevMetricsSeq("涓瓙 A 杩涘姩浣滄椂闂�", (short) 4, (short) 5));
+ fieldMap.put("d129", new DevMetricsSeq("涓瓙 A 杩涚粸鐗欒鏁�", (short) 4, (short) 4));
+ fieldMap.put("d130", new DevMetricsSeq("涓瓙 A 閫�鍘嬪姏", (short) 4, (short) 6));
+ fieldMap.put("d131", new DevMetricsSeq("涓瓙 A 閫�閫熷害", (short) 4, (short) 7));
+ fieldMap.put("d132", new DevMetricsSeq("涓瓙 A 閫�鍔ㄤ綔鏃堕棿", (short) 4, (short) 9));
+ fieldMap.put("d133", new DevMetricsSeq("涓瓙 A 閫�鍔ㄤ綔浣嶇疆", (short) 4, (short) 10));
+ fieldMap.put("d134", new DevMetricsSeq("涓瓙 A 閫�缁炵墮璁℃暟", (short) 4, (short) 8));
+ fieldMap.put("d135", new DevMetricsSeq("涓瓙 B 杩涘帇鍔�", (short) 4, (short) 12));
+ fieldMap.put("d136", new DevMetricsSeq("涓瓙 B 杩涢�熷害", (short) 4, (short) 13));
+ fieldMap.put("d138", new DevMetricsSeq("涓瓙 B 杩涘姩浣滄椂闂�", (short) 4, (short) 14));
+// fieldMap.put("d138", "涓瓙 B 杩涘姩浣滄椂闂�");
+ fieldMap.put("d139", new DevMetricsSeq("涓瓙 B 杩涚粸鐗欒鏁�", (short) 4, (short) 15));
+ fieldMap.put("d140", new DevMetricsSeq("涓瓙 B 閫�鍘嬪姏", (short) 4, (short) 18));
+ fieldMap.put("d141", new DevMetricsSeq("涓瓙 B 閫�閫熷害", (short) 4, (short) 19));
+ fieldMap.put("d142", new DevMetricsSeq("涓瓙 B 閫�鍔ㄤ綔浣嶇疆", (short) 4, (short) 22));
+ fieldMap.put("d143", new DevMetricsSeq("涓瓙 B 閫�鍔ㄤ綔鏃堕棿", (short) 4, (short) 21));
+ fieldMap.put("d144", new DevMetricsSeq("涓瓙 B 閫�缁炵墮璁℃暟", (short) 4, (short) 20));
+ fieldMap.put("d145", new DevMetricsSeq("涓瓙 C 杩涘帇鍔�", (short) 4, (short) 24));
+ fieldMap.put("d146", new DevMetricsSeq("涓瓙 C 杩涢�熷害", (short) 4, (short) 25));
+ fieldMap.put("d147", new DevMetricsSeq("涓瓙 C 杩涘姩浣滀綅缃�", (short) 4, (short) 28));
+ fieldMap.put("d148", new DevMetricsSeq("涓瓙 C 杩涘姩浣滄椂闂�", (short) 4, (short) 27));
+// fieldMap.put("d148", "涓瓙 C 杩涘姩浣滄椂闂�");
+ fieldMap.put("d149", new DevMetricsSeq("涓瓙 C 杩涚粸鐗欒鏁�", (short) 4, (short) 26));
+ fieldMap.put("d150", new DevMetricsSeq("涓瓙 C 閫�鍘嬪姏", (short) 4, (short) 29));
+ fieldMap.put("d151", new DevMetricsSeq("涓瓙 C 閫�閫熷害", (short) 4, (short) 30));
+ fieldMap.put("d152", new DevMetricsSeq("涓瓙 C 閫�鍔ㄤ綔浣嶇疆", (short) 4, (short) 33));
+ fieldMap.put("d153", new DevMetricsSeq("涓瓙 C 閫�鍔ㄤ綔鏃堕棿", (short) 4, (short) 32));
+ fieldMap.put("d154", new DevMetricsSeq("涓瓙 C 閫�缁炵墮璁℃暟", (short) 4, (short) 31));
+ fieldMap.put("d155", new DevMetricsSeq("涓瓙 D 杩涘帇鍔�", (short) 4, (short) 35));
+ fieldMap.put("d156", new DevMetricsSeq("涓瓙 D 杩涢�熷害", (short) 4, (short) 36));
+ fieldMap.put("d158", new DevMetricsSeq("涓瓙 D 杩涘姩浣滄椂闂�", (short) 4, (short) 38));
+ fieldMap.put("d157", new DevMetricsSeq("涓瓙 D 杩涘姩浣滀綅缃�", (short) 4, (short) 39));
+// fieldMap.put("d158", "涓瓙 D 杩涘姩浣滄椂闂�");
+ fieldMap.put("d159", new DevMetricsSeq("涓瓙 D 杩涚粸鐗欒鏁�", (short) 4, (short) 37));
+ fieldMap.put("d160", new DevMetricsSeq("涓瓙 D 閫�鍘嬪姏", (short) 4, (short) 40));
+ fieldMap.put("d161", new DevMetricsSeq("涓瓙 D 閫�閫熷害", (short) 4, (short) 41));
+ fieldMap.put("d162", new DevMetricsSeq("涓瓙 D 閫�鍔ㄤ綔浣嶇疆", (short) 4, (short) 44));
+ fieldMap.put("d163", new DevMetricsSeq("涓瓙 D 閫�鍔ㄤ綔鏃堕棿", (short) 4, (short) 43));
+ fieldMap.put("d164", new DevMetricsSeq("涓瓙 D 閫�缁炵墮璁℃暟", (short) 4, (short) 42));
+ fieldMap.put("d165", new DevMetricsSeq("鍌ㄦ枡涓�娈靛帇鍔�", (short) 3, (short) 9));
+ fieldMap.put("d166", new DevMetricsSeq("鍌ㄦ枡涓�娈甸�熷害", (short) 3, (short) 10));
+ fieldMap.put("d167", new DevMetricsSeq("鍌ㄦ枡涓�娈佃儗鍘�", (short) 3, (short) 8));
+ fieldMap.put("d168", new DevMetricsSeq("鍌ㄦ枡涓�娈典綅缃�", (short) 3, (short) 11));
+ fieldMap.put("d169", new DevMetricsSeq("鍌ㄦ枡浜屾鍘嬪姏", (short) 3, (short) 13));
+ fieldMap.put("d170", new DevMetricsSeq("鍌ㄦ枡浜屾閫熷害", (short) 3, (short) 14));
+ fieldMap.put("d171", new DevMetricsSeq("鍌ㄦ枡浜屾鑳屽帇", (short) 3, (short) 12));
+ fieldMap.put("d172", new DevMetricsSeq("鍌ㄦ枡浜屾浣嶇疆", (short) 3, (short) 15));
+ fieldMap.put("d173", new DevMetricsSeq("鍌ㄦ枡涓夋鍘嬪姏", (short) 3, (short) 17));
+ fieldMap.put("d174", new DevMetricsSeq("鍌ㄦ枡涓夋閫熷害", (short) 3, (short) 18));
+ fieldMap.put("d175", new DevMetricsSeq("鍌ㄦ枡涓夋鑳屽帇", (short) 3, (short) 16));
+ fieldMap.put("d176", new DevMetricsSeq("鍌ㄦ枡涓夋浣嶇疆", (short) 3, (short) 19));
+ fieldMap.put("d177", new DevMetricsSeq("鍌ㄦ枡鍥涙鍘嬪姏", (short) 3, (short) 21));
+ fieldMap.put("d178", new DevMetricsSeq("鍌ㄦ枡鍥涙閫熷害", (short) 3, (short) 22));
+ fieldMap.put("d179", new DevMetricsSeq("鍌ㄦ枡鍥涙鑳屽帇", (short) 3, (short) 20));
+ fieldMap.put("d180", new DevMetricsSeq("鍌ㄦ枡鍥涙浣嶇疆", (short) 3, (short) 23));
+ fieldMap.put("d181", new DevMetricsSeq("鍌ㄦ枡浜旀鍘嬪姏", (short) 3, (short) 25));
+ fieldMap.put("d182", new DevMetricsSeq("鍌ㄦ枡浜旀閫熷害", (short) 3, (short) 26));
+ fieldMap.put("d183", new DevMetricsSeq("鍌ㄦ枡浜旀鑳屽帇", (short) 3, (short) 24));
+ fieldMap.put("d184", new DevMetricsSeq("鍌ㄦ枡浜旀浣嶇疆", (short) 3, (short) 27));
+ fieldMap.put("d185", new DevMetricsSeq("灏勯��鍘嬪姏", (short) 3, (short) 1));
+ fieldMap.put("d186", new DevMetricsSeq("灏勯��閫熷害", (short) 3, (short) 2));
+ fieldMap.put("d187", new DevMetricsSeq("灏勯��璺濈", (short) 3, (short) 29));
+ fieldMap.put("d188", new DevMetricsSeq("鍌ㄥ墠灏勯��璺濈", (short) 3, (short) 3));
+ fieldMap.put("d189", new DevMetricsSeq("灏勯��妯″紡", (short) 3, (short) 28));
+ fieldMap.put("d190", new DevMetricsSeq("鍌ㄥ墠鍐峰嵈", (short) 3, (short) 31));
+ fieldMap.put("d191", new DevMetricsSeq("娓╀竴璁惧畾", (short) 3, (short) 32));
+ fieldMap.put("d192", new DevMetricsSeq("娓╀簩璁惧畾", (short) 3, (short) 33));
+ fieldMap.put("d193", new DevMetricsSeq("娓╀笁璁惧畾", (short) 3, (short) 34));
+ fieldMap.put("d194", new DevMetricsSeq("娓╁洓璁惧畾", (short) 3, (short) 35));
+ fieldMap.put("d195", new DevMetricsSeq("娓╀簲璁惧畾", (short) 3, (short) 36));
+ fieldMap.put("d196", new DevMetricsSeq("娓╁叚璁惧畾", (short) 3, (short) 37));
+ fieldMap.put("d197", new DevMetricsSeq("娓╀竷璁惧畾", (short) 3, (short) 38));
+ fieldMap.put("d198", new DevMetricsSeq("杞繚鍘嬩綅缃瀹�", (short) 2, (short) 21));
+
+// fieldMap.put("d204", new DevMetricsSeq("寮�妯′竴娈典綅缃�", (short) 1, (short) 4));
+ fieldMap.put("d205", new DevMetricsSeq("寮�妯′竴娈典綅缃�", (short) 1, (short) 7));
+ fieldMap.put("d206", new DevMetricsSeq("寮�妯′簩娈典綅缃�", (short) 1, (short) 10));
+ fieldMap.put("d207", new DevMetricsSeq("寮�妯′笁娈典綅缃�", (short) 1, (short) 13));
+ fieldMap.put("d208", new DevMetricsSeq("寮�妯″洓娈典綅缃�", (short) 1, (short) 16));
+ fieldMap.put("d199", new DevMetricsSeq("鍏虫ā涓�娈典綅缃�", (short) 1, (short) 19));
+ fieldMap.put("d200", new DevMetricsSeq("鍏虫ā浜屾浣嶇疆", (short) 1, (short) 22));
+ fieldMap.put("d201", new DevMetricsSeq("鍏虫ā涓夋浣嶇疆", (short) 1, (short) 25));
+ fieldMap.put("d202", new DevMetricsSeq("鍏虫ā浣庡帇浣嶇疆", (short) 1, (short) 28));
+ fieldMap.put("d203", new DevMetricsSeq("鍏虫ā楂樺帇浣嶇疆", (short) 1, (short) 31));
+
+ return fieldMap;
+ }
+
+ /**
+ * 鏍规嵁 machineNo 鍒涘缓 BYCL 璁惧鐨勫瓧娈垫槧灏�
+ * @param machineNo 鏈哄彴鍙�
+ * @return 瀛楁鏄犲皠 Map
+ */
+ private Map<String, DevMetricsSeq> createFieldMappingForBycl(String machineNo) {
+ // 瀹氫箟鐗规畩鏈哄彴鍙峰垪琛�
+ List<String> cncMachineNos = Arrays.asList("A04", "A05", "A06", "A07", "A08", "A09", "A20", "A21");
+
+ // 鏍规嵁 machineNo 鍒ゆ柇浣跨敤鍝鏄犲皠
+ if (cncMachineNos.contains(machineNo)) {
+ return createCncFieldMapping();
+ } else {
+ return createGeneralFieldMapping();
+ }
+ }
+
+ /**
+ * 鍒涘缓 CNC 鏈哄簥鐨勫瓧娈垫槧灏� (machineNo 涓� A04, A05, A06, A07, A08, A09, A20, A21)
+ */
+ private Map<String, DevMetricsSeq> createCncFieldMapping() {
+ Map<String, DevMetricsSeq> fieldMap = new HashMap<>();
+
+ // CNC 鏈哄簥涓撶敤瀛楁鏄犲皠
+ fieldMap.put("d26", new DevMetricsSeq("宸ヤ綔妯″紡", (short) 1, (short) 1));
+ fieldMap.put("d27", new DevMetricsSeq("杩愯鐘舵��", (short) 1, (short) 2));
+ fieldMap.put("d28", new DevMetricsSeq("鏄惁鎶ヨ", (short) 1, (short) 3));
+ fieldMap.put("d40", new DevMetricsSeq("寮�鏈烘椂闂�", (short) 1, (short) 4));
+ fieldMap.put("d41", new DevMetricsSeq("鍒囧墛鏃堕棿", (short) 1, (short) 5));
+ fieldMap.put("d42", new DevMetricsSeq("寰幆鏃堕棿/鍗曚欢璁℃椂", (short) 1, (short) 6));
+ fieldMap.put("d43", new DevMetricsSeq("绱鍔犲伐鏃堕棿", (short) 1, (short) 7));
+ fieldMap.put("d1", new DevMetricsSeq("宸ヤ欢鏁�", (short) 1, (short) 8));
+ fieldMap.put("d44", new DevMetricsSeq("闇�姹傚伐浠舵暟", (short) 1, (short) 9));
+ fieldMap.put("d45", new DevMetricsSeq("鎬诲伐浠舵暟", (short) 1, (short) 10));
+ fieldMap.put("d46", new DevMetricsSeq("宸ヤ綔绗旀暟", (short) 1, (short) 11));
+ fieldMap.put("d3", new DevMetricsSeq("鎶ヨ淇℃伅", (short) 1, (short) 12));
+
+ return fieldMap;
+ }
+
+ /**
+ * 鍒涘缓閫氱敤璁惧鐨勫瓧娈垫槧灏� (鍏朵粬 machineNo)
+ */
+ private Map<String, DevMetricsSeq> createGeneralFieldMapping() {
+ Map<String, DevMetricsSeq> fieldMap = new HashMap<>();
+
+ // 閫氱敤璁惧瀛楁鏄犲皠
+ fieldMap.put("d21", new DevMetricsSeq("褰撳墠鍒�鍏峰彿", (short) 1, (short) 1));
+ fieldMap.put("d22", new DevMetricsSeq("褰撳墠鍒�鍋忓彿", (short) 1, (short) 2));
+ fieldMap.put("d29", new DevMetricsSeq("鍔犲伐浠舵暟", (short) 1, (short) 3));
+ fieldMap.put("d23", new DevMetricsSeq("杩愯鏃堕棿-鏃�", (short) 2, (short) 1));
+ fieldMap.put("d24", new DevMetricsSeq("杩愯鏃堕棿-绉�", (short) 2, (short) 2));
+ fieldMap.put("d25", new DevMetricsSeq("鍒囧墛鏃堕棿-鏃�", (short) 2, (short) 3));
+ fieldMap.put("d26", new DevMetricsSeq("鍒囧墛鏃堕棿-绉�", (short) 2, (short) 4));
+ fieldMap.put("d34", new DevMetricsSeq("杩涚粰缂栫▼閫熷害", (short) 3, (short) 1));
+ fieldMap.put("d35", new DevMetricsSeq("杩涚粰瀹為檯閫熷害", (short) 3, (short) 2));
+ fieldMap.put("d36", new DevMetricsSeq("杩涚粰鍊嶇巼", (short) 3, (short) 3));
+ fieldMap.put("d37", new DevMetricsSeq("涓昏酱缂栫▼閫熷害", (short) 3, (short) 4));
+ fieldMap.put("d38", new DevMetricsSeq("涓昏酱瀹為檯閫熷害", (short) 3, (short) 5));
+ fieldMap.put("d39", new DevMetricsSeq("涓昏酱鍊嶇巼", (short) 3, (short) 6));
+ fieldMap.put("d40", new DevMetricsSeq("蹇�熷�嶇巼", (short) 3, (short) 7));
+ fieldMap.put("d41", new DevMetricsSeq("鎵嬪姩鍊嶇巼", (short) 3, (short) 8));
+ fieldMap.put("d42", new DevMetricsSeq("鎵嬭疆鍊嶇巼", (short) 3, (short) 9));
+ fieldMap.put("d30", new DevMetricsSeq("CNC宸ヤ綔鏂瑰紡", (short) 4, (short) 1));
+ fieldMap.put("d31", new DevMetricsSeq("褰撳墠杩愯鐨勭▼搴忓彿", (short) 4, (short) 2));
+ fieldMap.put("d32", new DevMetricsSeq("褰撳墠绋嬪簭娈靛彿", (short) 4, (short) 3));
+ fieldMap.put("d43", new DevMetricsSeq("鎵嬪姩閫熷害", (short) 4, (short) 4));
+ fieldMap.put("d27", new DevMetricsSeq("鎬绘姤璀︽暟", (short) 5, (short) 1));
+ fieldMap.put("d28", new DevMetricsSeq("PLC鎶ヨ鏁�", (short) 5, (short) 2));
+ fieldMap.put("d33", new DevMetricsSeq("鏈�鍚庝竴鏉℃姤璀﹀彿", (short) 5, (short) 3));
+
+ return fieldMap;
+ }
+
+ // 浣跨敤鍙嶅皠鑾峰彇瀹炰綋绫讳腑d绯诲垪瀛楁鐨勫��
+ // 浣跨敤鍙嶅皠鑾峰彇瀹炰綋绫讳腑 d 绯诲垪瀛楁鐨勫�硷紝濡傛灉瀛楁涓嶅瓨鍦ㄥ垯蹇界暐
+ private String getFieldValue(DeviceRealTimeData data, String fieldName) {
+ try {
+ Field field = DeviceRealTimeData.class.getDeclaredField(fieldName);
+ field.setAccessible(true); // 鍏佽璁块棶绉佹湁瀛楁
+ String fieldValue = (String) field.get(data);
+
+ // 濡傛灉瀛楁闇�瑕佷箻浠� 0.1锛屽垯杩涜杞崲
+ if (fieldValue != null && FIELDS_TO_SCALE.contains(fieldName)) {
+ double scaledValue = Double.parseDouble(fieldValue) * 0.1;
+// fieldValue = String.valueOf(scaledValue);
+ // 淇濈暀涓�浣嶅皬鏁�
+ fieldValue = String.format("%.1f", scaledValue);
+ }
+
+ if (fieldValue != null) {
+ double v = Double.parseDouble(fieldValue);
+ if (v < 0) {
+ fieldValue = "/";
+ } else {
+ fieldValue = String.format("%.1f", v);
+ }
+ } else {
+ fieldValue = "/";
+ }
+
+ return fieldValue;
+ } catch (NoSuchFieldException | IllegalAccessException | NumberFormatException e) {
+ // 蹇界暐娌℃湁鐨勫瓧娈垫垨鏃犳硶璁块棶鐨勫瓧娈�
+ System.out.println("瀛楁涓嶅瓨鍦ㄦ垨鏃犳硶璁块棶: " + fieldName);
+ return null;
+ }
+ }
+
+ // 灏嗗疄浣撶被瀛楁鎻掑叆鍒版暟鎹簱
+ @Override
+ public boolean saveDeviceMetrics(DeviceRealTimeData data, String engineeringNo) {
+
+ List<DeviceMetrics> list = new ArrayList<>();
+
+ Map<String, DevMetricsSeq> fieldMap = createFieldMapping();
+
+ //String formattedDate = data.getLastEditDate();
+ String formattedDate = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss");
+
+ //鏍规嵁宸ュ崟鍜屾満鍙版煡鏄惁鏈夊伐鑹哄弬鏁扮殑璁板綍
+ LambdaUpdateWrapper<DeviceMetrics> queryWrapper = new LambdaUpdateWrapper<>();
+ queryWrapper.eq(DeviceMetrics::getDevNo, data.getDevNo()).eq(DeviceMetrics::getItemNo, engineeringNo).eq(DeviceMetrics::getType, 1);
+
+ remove(queryWrapper);
+
+ for (Map.Entry<String, DevMetricsSeq> entry : fieldMap.entrySet()) {
+ String fieldKey = entry.getKey();
+ DevMetricsSeq value = entry.getValue();
+
+ // 浣跨敤鍙嶅皠浠� DeviceRealTimeData 涓幏鍙栧搴斿瓧娈电殑鍊�
+ String fieldValue = getFieldValue(data, fieldKey);
+
+ // 濡傛灉瀛楁鍊间笉涓虹┖锛屾彃鍏ュ埌鏁版嵁搴�
+ if (fieldValue != null) {
+ DeviceMetrics entity = new DeviceMetrics();
+ entity.setField(value.getField());
+ entity.setGroupSeq(value.getGroupSeq());
+ entity.setSeq(value.getSeq());
+ entity.setValue(fieldValue);
+ entity.setDevNo(data.getDevNo());
+ entity.setDayDate(formattedDate);
+ entity.setItemNo(engineeringNo);
+ entity.setType((short) 1);
+ list.add(entity);
+ }
+ }
+
+ //瀵煎嚭鍒癳xcel
+ //exportDeviceMetricsToExcel(list);
+
+ return saveBatch(list);
+ }
+
+ @Override
+ public String PdfToBase64(NumbericalDto barcode) throws Exception {
+
+ String PDF_URL = "http://121.37.180.207/api/IMWeb/getSOP?gcth=" + barcode.getEngineeringNo();
+
+ // 鑾峰彇 PDF URL
+ String pdfUrl = fetchPdfUrl(PDF_URL, barcode.getEngineeringNo());
+ if (pdfUrl != null && !pdfUrl.isEmpty()) {
+ // 淇 PDF URL 鏍煎紡
+ String correctedUrl = correctUrl(pdfUrl);
+
+ // 鎵撳嵃淇鍚庣殑 URL
+ System.out.println("Corrected PDF URL: " + correctedUrl);
+
+ // 涓嬭浇 PDF 骞惰浆鎹负鍥剧墖鍚庤浆涓� Base64
+ String base64Image = downloadPdfAndConvertToImageBase64(correctedUrl);
+
+ // 鎵撳嵃 Base64 瀛楃涓�
+ System.out.println("Base64 Encoded Image: " + base64Image);
+ return base64Image;
+ } else {
+ throw new Exception(barcode.getEngineeringNo() + " 鍥惧彿涓嶅瓨鍦ㄥ浘绾�");
+ }
+ }
+
+ // 鑾峰彇 PDF URL
+ private String fetchPdfUrl(String urlstr, String engineeringNo) throws IOException {
+ URL url = new URL(urlstr);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("GET");
+ connection.setConnectTimeout(5000);
+ connection.setReadTimeout(5000);
+
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
+ StringBuilder response = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ response.append(line);
+ }
+
+ // 浣跨敤 FastJSON 瑙f瀽 JSON 鏁版嵁
+ JSONArray jsonResponse = JSONArray.parseArray(response.toString());
+ if (!jsonResponse.isEmpty()) {
+ JSONObject firstItem = jsonResponse.getJSONObject(0);
+ if (firstItem.containsKey(engineeringNo)) {
+ return firstItem.getString(engineeringNo);
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌 PDF URL锛岃繑鍥� null
+ }
+
+ // 淇 PDF URL 鏍煎紡
+ private String correctUrl(String url) {
+ // Step 1: 鍘婚櫎澶氫綑鐨勬枩鏉�
+ url = url.replaceFirst("http:////", "http://");
+ return url;
+ }
+
+ // 涓嬭浇 PDF 骞惰浆鎹负鍥剧墖鍚庤浆涓� Base64
+ private String downloadPdfAndConvertToImageBase64(String pdfUrl) throws IOException {
+ URL url = new URL(pdfUrl);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("GET");
+ connection.setConnectTimeout(5000);
+ connection.setReadTimeout(5000);
+
+ try (InputStream inputStream = connection.getInputStream()) {
+ // Load the PDF document using PDFBox
+ PDDocument document = PDDocument.load(inputStream);
+
+ // Create a PDFRenderer to render the PDF to images
+ PDFRenderer pdfRenderer = new PDFRenderer(document);
+
+ // Render the first page of the PDF as an image
+ BufferedImage bufferedImage = pdfRenderer.renderImageWithDPI(0, 300); // First page at 300 DPI
+
+ // Convert the image to Base64
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ ImageIO.write(bufferedImage, "PNG", byteArrayOutputStream);
+ byte[] imageData = byteArrayOutputStream.toByteArray();
+ return Base64.getEncoder().encodeToString(imageData);
+ }
+ }
+
+ /**
+ * 瀵煎嚭璁惧鎸囨爣鍒� Excel 骞朵繚瀛樺埌鎸囧畾浣嶇疆
+ *
+ * @param metricsList 闇�瑕佸鍑虹殑璁惧鎸囨爣鍒楄〃
+ */
+ public void exportDeviceMetricsToExcel(List<DeviceMetrics> metricsList) {
+ // 瀹氫箟鐩爣鏂囦欢澶硅矾寰�
+ String folderPath = "C:\\out";
+
+ // 濡傛灉鐩爣鏂囦欢澶逛笉瀛樺湪锛屽垯鍒涘缓
+ File folder = new File(folderPath);
+ if (!folder.exists()) {
+ FileUtil.mkdir(folderPath);
+ }
+
+ // 鑾峰彇绗竴涓伐鍗曞彿浣滀负鏂囦欢鍚嶇殑涓�閮ㄥ垎
+ String orderNo = metricsList.isEmpty() ? "default" : metricsList.get(0).getItemNo();
+
+ // 浣跨敤 Hutool 鑾峰彇褰撳墠鏃堕棿锛屾牸寮忎负 24 灏忔椂鍒剁簿纭埌绉�
+ String timestamp = DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss");
+
+ // 鐢熸垚鏂囦欢鍚嶏細宸ュ崟鍙� + 鏃堕棿鎴�
+ String fileName = orderNo + "_" + timestamp + ".xlsx";
+ String filePath = folderPath + File.separator + fileName;
+
+ // 鍒涘缓 ExcelWriter锛屽啓鍏ュ埌鎸囧畾鏂囦欢
+ try (ExcelWriter writer = ExcelUtil.getWriter(filePath)) {
+ // 瀹氫箟琛ㄥご锛屼娇鐢ㄥ瓧娈电殑娉ㄩ噴浣滀负琛ㄥご鍐呭
+ Map<String, String> headerAlias = new HashMap<>();
+ headerAlias.put("itemNo", "鐗╂枡缂栫爜"); // 鐗╂枡缂栫爜
+ headerAlias.put("devNo", "璁惧缂栧彿"); // 璁惧缂栧彿
+ headerAlias.put("dayDate", "鏃堕棿"); // 鏃堕棿
+ headerAlias.put("field", "鍙傛暟鍚�"); // 鍙傛暟鍚�
+ headerAlias.put("value", "鍙傛暟鍊�"); // 鍙傛暟鍊�
+
+ // 璁剧疆琛ㄥご鍒悕
+ writer.setHeaderAlias(headerAlias);
+
+ // 鍐欏叆鏁版嵁骞惰嚜鍔ㄧ敓鎴愯〃澶�
+ writer.write(metricsList, true);
+ }
+ // 鍏抽棴鍐欏叆鍣紝閲婃斁鍐呭瓨
+ //writer.close();
+ //浣跨敤浜唗ry鐨勫彟澶栦竴绉嶈娉曪紝 瀹冧細鑷繁鍦╢inally璋冪敤close鏂规硶
+
+ System.out.println("Excel 瀵煎嚭鎴愬姛锛屾枃浠惰矾寰勶細" + filePath);
+ }
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceServiceImpl.java
new file mode 100644
index 0000000..3b36916
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.Device;
+import com.hk.NumericalCollection.mapper.DeviceMapper;
+import com.hk.NumericalCollection.service.DeviceService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICE(鏁伴噰璁惧)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-09-27 09:56:10
+*/
+@Service
+public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device>
+ implements DeviceService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusByclServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusByclServiceImpl.java
new file mode 100644
index 0000000..4f9dd1a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusByclServiceImpl.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DeviceStatusBycl;
+import com.hk.NumericalCollection.mapper.DeviceStatusByclMapper;
+import com.hk.NumericalCollection.service.DeviceStatusByclService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 閽堝琛ㄣ�怐EVICE_STATUS_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ */
+@Service
+public class DeviceStatusByclServiceImpl extends ServiceImpl<DeviceStatusByclMapper, DeviceStatusBycl>
+ implements DeviceStatusByclService {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusServiceImpl.java
new file mode 100644
index 0000000..c82b5ad
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DeviceStatusServiceImpl.java
@@ -0,0 +1,32 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.DeviceStatus;
+import com.hk.NumericalCollection.mapper.DeviceStatusMapper;
+import com.hk.NumericalCollection.service.DeviceStatusService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怐EVICE_STATUS(璁惧鐘舵�佽〃)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2024-10-15 10:57:38
+ */
+@Service
+public class DeviceStatusServiceImpl extends ServiceImpl<DeviceStatusMapper, DeviceStatus>
+ implements DeviceStatusService {
+
+
+ @Override
+ public int getSumToDayOutPut(String devNo, String formattedDate, String orderNo) {
+ return super.baseMapper.selectSumToDayOutPutByOrder(devNo, formattedDate, orderNo);
+ }
+
+ @Override
+ public int updateTodayOutput(int increment, String editDate, String orderNo) {
+ return super.baseMapper.updateTodayOutput(increment, editDate, orderNo);
+ }
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/DevicedatastandardmoditemServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/DevicedatastandardmoditemServiceImpl.java
new file mode 100644
index 0000000..163bafd
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/DevicedatastandardmoditemServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.Devicedatastandardmoditem;
+import com.hk.NumericalCollection.service.DevicedatastandardmoditemService;
+import com.hk.NumericalCollection.mapper.DevicedatastandardmoditemMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怐EVICEDATASTANDARDMODITEM銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2025-02-06 14:05:55
+*/
+@Service
+public class DevicedatastandardmoditemServiceImpl extends ServiceImpl<DevicedatastandardmoditemMapper, Devicedatastandardmoditem>
+ implements DevicedatastandardmoditemService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalByclServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalByclServiceImpl.java
new file mode 100644
index 0000000..cb05707
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalByclServiceImpl.java
@@ -0,0 +1,16 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.MesNumericalBycl;
+import com.hk.NumericalCollection.mapper.MesNumericalByclMapper;
+import com.hk.NumericalCollection.service.MesNumericalByclService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 閽堝琛ㄣ�怣ES_NUMERICAL_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ */
+@Service
+public class MesNumericalByclServiceImpl extends ServiceImpl<MesNumericalByclMapper, MesNumericalBycl>
+ implements MesNumericalByclService {
+}
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalServiceImpl.java
new file mode 100644
index 0000000..b856f4f
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/MesNumericalServiceImpl.java
@@ -0,0 +1,36 @@
+package com.hk.NumericalCollection.service.impl;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.MesNumerical;
+import com.hk.NumericalCollection.mapper.MesNumericalMapper;
+import com.hk.NumericalCollection.service.MesNumericalService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怣ES_NUMERICAL銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2024-11-06 14:54:47
+ */
+@Service
+public class MesNumericalServiceImpl extends ServiceImpl<MesNumericalMapper, MesNumerical>
+ implements MesNumericalService {
+
+
+ @Override
+ public void cleanWeekAgoData() {
+ DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -7);
+ String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd");
+
+ LambdaUpdateWrapper<MesNumerical> wrapper = new LambdaUpdateWrapper<>();
+ wrapper.eq(MesNumerical::getEditDate, format);
+
+ remove(wrapper);
+ }
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderSelectServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderSelectServiceImpl.java
new file mode 100644
index 0000000..1506dd7
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderSelectServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.MesOrderSelect;
+import com.hk.NumericalCollection.service.MesOrderSelectService;
+import com.hk.NumericalCollection.mapper.MesOrderSelectMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怣ES_ORDER_SELECT銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-11-06 14:54:17
+*/
+@Service
+public class MesOrderSelectServiceImpl extends ServiceImpl<MesOrderSelectMapper, MesOrderSelect>
+ implements MesOrderSelectService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderStaServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderStaServiceImpl.java
new file mode 100644
index 0000000..44d13ac
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/MesOrderStaServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.MesOrderSta;
+import com.hk.NumericalCollection.mapper.MesOrderStaMapper;
+import com.hk.NumericalCollection.service.MesOrderStaService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怣ES_ORDER_STA(宸ュ崟鏃堕棿璁板綍琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2024-10-15 08:46:23
+ */
+@Service
+public class MesOrderStaServiceImpl extends ServiceImpl<MesOrderStaMapper, MesOrderSta>
+ implements MesOrderStaService {
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/NumericalNoOrderServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/NumericalNoOrderServiceImpl.java
new file mode 100644
index 0000000..31c187a
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/NumericalNoOrderServiceImpl.java
@@ -0,0 +1,298 @@
+package com.hk.NumericalCollection.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.hk.NumericalCollection.config.DataAcquisitionConfiguration;
+import com.hk.NumericalCollection.dto.*;
+import com.hk.NumericalCollection.entity.*;
+import com.hk.NumericalCollection.service.*;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+@RequiredArgsConstructor
+public class NumericalNoOrderServiceImpl implements INumericalNoOrderService {
+
+
+ private final ApiService apiService;
+
+ private final DeviceService deviceService;
+
+ private final DevMachineService devMachineService;
+
+ private final DeviceStatusService deviceStatusService;
+
+ private final MesOrderSelectService orderSelectService;
+
+ private final MesNumericalService mesNumericalServicen;
+
+ private final DeviceErrorService deviceErrorService;
+
+ @Override
+ public boolean SoDeviceList() throws Exception {
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (!apiResponseCode.getFlag().booleanValue())
+ return false;
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("soDeviceList");
+ requestBody.setSig(sig.getData());
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1671418916");
+ Params params = new Params();
+ params.setPageNo(1);
+ params.setPageSize(999);
+ params.setStatus(-99);
+ requestBody.setParams(params);
+ ApiResponse<Device> response = this.apiService.sendListRequest(requestBody, Device.class);
+ ApiResponseCode isTrue = ApiResponseCode.fromCode(response.getCode());
+
+ if (!isTrue.getFlag()) {
+ throw new Exception("鍦ㄨ姹傛暟閲囨帴鍙f椂鍑虹幇锛�" + isTrue.getDescription());
+ }
+
+ List<Device> deviceList = response.getList();
+
+ List<String> uidList = deviceList.stream().map(Device::getDevNo).collect(Collectors.toList());
+
+ LambdaUpdateWrapper<Device> wrapper = new LambdaUpdateWrapper<>();
+ wrapper.in(Device::getDevNo, uidList);
+ deviceService.remove(wrapper);
+ return deviceService.saveOrUpdateBatch(deviceList);
+ }
+
+ @Override
+ public void getDeviceRealTimeData(String uid) throws Exception {
+ ApiDataResult<DeviceRealTimeData> response = getDeviceRealTimeDataApiDataResult(uid);
+ if (response == null)
+ return;
+ DeviceRealTimeData data = (DeviceRealTimeData) response.getData();
+ setMesOrderSta(data);
+ }
+
+ @Override
+ public void getDeviceDayCount(String uid, String date) throws IOException {
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (apiResponseCode != null && !apiResponseCode.getFlag()) {
+ return; // 濡傛灉鍝嶅簲涓嶆垚鍔熷垯閫�鍑�
+ }
+
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("getDeviceDayCount");
+ requestBody.setSig(sig.getData());
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1671418916");
+
+ Params params = new Params();
+ params.setUid(uid);
+ params.setDate(date);
+
+ requestBody.setParams(params);
+
+ ApiDataResult<DeviceDayCount> response = this.apiService.sendDataRequest(requestBody, DeviceDayCount.class);
+
+ apiResponseCode = ApiResponseCode.fromCode(response.getCode());
+
+ if (apiResponseCode == null || !apiResponseCode.getFlag()) {
+ return;
+ }
+
+ DeviceDayCount data = response.getData();
+
+ if (data.getFaultTime() == null && data.getWaitTime() == null) {
+ return;
+ }
+
+ LambdaQueryWrapper<DevMachine> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(DevMachine::getDevNo, uid);
+
+ DevMachine devMachine = devMachineService.getOne(wrapper);
+ if (devMachine == null) {
+ return;
+ }
+
+ double v = (data.getFaultTime() + data.getWaitTime()) * 60;
+
+ if (v <= 0) {
+ return;
+ }
+
+ LambdaQueryWrapper<MesOrderSelect> lambdaUpdateWrapper1 = new LambdaQueryWrapper<>();
+
+ lambdaUpdateWrapper1.eq(MesOrderSelect::getEditDate, date)
+ .eq(MesOrderSelect::getMachineNo, devMachine.getMachineNo());
+
+ long count = orderSelectService.count(lambdaUpdateWrapper1);
+
+ if (count <= 0L)
+ return;
+
+ LambdaUpdateWrapper<MesOrderSelect> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+
+ v = Math.round(v / count * 100.0D) / 100.0D;
+
+ lambdaUpdateWrapper
+ .set(MesOrderSelect::getTjCount, 1)
+ .set(MesOrderSelect::getTjTime, v)
+ .eq(MesOrderSelect::getEditDate, date)
+ .eq(MesOrderSelect::getMachineNo, devMachine.getMachineNo());
+
+ orderSelectService.update(lambdaUpdateWrapper);
+ }
+
+ @Override
+ public ApiDataResult<DeviceRealTimeData> getDeviceRealTimeDataApiDataResult(String uid) throws Exception {
+ // 鑾峰彇sig
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (apiResponseCode == null || !apiResponseCode.getFlag().booleanValue())
+ return null;
+
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("getDeviceRealTimeData");
+ requestBody.setSig(sig.getData());
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1671418916");
+
+ Params params = new Params();
+ params.setUid(uid);
+
+ requestBody.setParams(params);
+
+ ApiDataResult<DeviceRealTimeData> response = this.apiService.sendDataRequest(requestBody, DeviceRealTimeData.class);
+
+ ApiResponseCode isTrue = ApiResponseCode.fromCode(response.getCode());
+ if (isTrue != null && !isTrue.getFlag().booleanValue())
+ throw new Exception("鍦ㄨ姹傛暟閲囨帴鍙f椂鍑虹幇锛�" + isTrue.getDescription());
+
+ return response;
+ }
+
+ @Override
+ public boolean RefreshDev(NumbericalDto barcode) {
+ if (StrUtil.isNullOrUndefined(barcode.getMachineNo()))
+ return false;
+ try {
+
+ LambdaQueryWrapper<DevMachine> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(DevMachine::getMachineNo, barcode.getMachineNo());
+
+ DevMachine one = devMachineService.getOne(queryWrapper, false);
+
+ if (one == null)
+ return false;
+
+ getDeviceRealTimeData(one.getDevNo());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ private void setMesOrderSta(DeviceRealTimeData data) {
+ LambdaQueryWrapper<DevMachine> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(DevMachine::getDevNo, data.getDevNo());
+
+ DevMachine one = devMachineService.getOne(wrapper, false);
+
+ if (one == null) {
+ System.out.println("寮傚父1锛氬綋鍓嶆満鍣ㄦ病鏈夌粦瀹氭満鍙�");
+ return;
+ }
+
+ String formattedDate = data.getLastEditDate().substring(0, 10);
+
+ setOrder(data, formattedDate, one);
+ }
+
+ @Override
+ public void getDeviceErrorList(String uid, String startDate, String endDate) throws Exception {
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (apiResponseCode == null || !apiResponseCode.getFlag()) {
+ return;
+ }
+
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("getDeviceErrorList");
+ requestBody.setSig(sig.getData());
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1671418916");
+
+ Params params = new Params();
+ params.setUid(uid);
+ params.setStartDate(startDate);
+ params.setEndDate(endDate);
+
+ requestBody.setParams(params);
+
+ ApiResponse<DeviceError> response = this.apiService.sendListRequest(requestBody, DeviceError.class);
+
+ apiResponseCode = ApiResponseCode.fromCode(response.getCode());
+ if (apiResponseCode == null || !apiResponseCode.getFlag()) {
+ throw new Exception("鍦ㄨ姹傛暟閲囨帴鍙f椂鍑虹幇:" + apiResponseCode.getDescription());
+ }
+
+ List<DeviceError> errorList = response.getList();
+ if (errorList != null && !errorList.isEmpty()) {
+ List<Integer> ids = errorList.stream().map(DeviceError::getId).collect(Collectors.toList());
+ deviceErrorService.removeByIds(ids);
+ deviceErrorService.saveBatch(errorList);
+ }
+ }
+
+ private void setOrder(DeviceRealTimeData data, String formattedDate, DevMachine one) {
+ int outItemNum = 1;
+ DeviceStatus status = new DeviceStatus();
+ status.setDevNo(data.getDevNo());
+ status.setStatus(data.getStatus());
+ status.setOutput(data.getOutput());
+ status.setOnlineTime(data.getOnlineTime());
+ status.setTodayOnlineTime(data.getTodayOnlineTime());
+ status.setPower(data.getTodayPower());
+ status.setTodayPower(data.getTodayPower());
+ status.setFaultNum(data.getFaultNum());
+ status.setTodayFaultNum(data.getTodayFaultNum());
+ status.setEditDate(formattedDate);
+ String d15 = data.getD15();
+ if (StrUtil.isEmpty(d15))
+ d15 = "0";
+ status.setTodayOutput(Double.parseDouble(d15) * outItemNum);
+ status.setWorkStartDate(data.getWorkstartDate());
+ status.setWorkEndDate(data.getWorkendDate());
+ status.setDeviceTypeClassItemId(data.getDeviceTypeClassItemId());
+ status.setWorkOutput(Double.parseDouble(data.getWorkOutPut()));
+ status.setHourOutput(Double.parseDouble(data.getHourOutPut()));
+ status.setBadoutput(Double.parseDouble(data.getBadoutput()));
+ status.setTodayBadoutput(Double.parseDouble(data.getTodayBadoutput()));
+ status.setWorkBadoutput(Double.parseDouble(data.getWorkBadoutput()));
+ status.setHourBadoutput(Double.parseDouble(data.getHourBadoutput()));
+ boolean nullOrUndefined = StrUtil.isNullOrUndefined(data.getTodayRuntime());
+ if (!nullOrUndefined)
+ status.setTodayRunTime(Double.parseDouble(data.getTodayRuntime()));
+ deviceStatusService.save(status);
+ MesNumerical numerical = new MesNumerical();
+ numerical.setEditDate(formattedDate);
+ numerical.setMachineNo(one.getMachineNo());
+ numerical.setCjNum(Integer.valueOf(Integer.parseInt(d15) * outItemNum));
+ numerical.setCjTiem(data.getLastEditDate());
+ mesNumericalServicen.save(numerical);
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/NumericalServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/NumericalServiceImpl.java
new file mode 100644
index 0000000..b47612c
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/NumericalServiceImpl.java
@@ -0,0 +1,902 @@
+package com.hk.NumericalCollection.service.impl;
+
+
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.hk.NumericalCollection.config.DataAcquisitionConfiguration;
+import com.hk.NumericalCollection.dto.*;
+import com.hk.NumericalCollection.entity.*;
+import com.hk.NumericalCollection.service.*;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+@RequiredArgsConstructor
+public class NumericalServiceImpl implements INumericalService {
+
+ private final ApiService apiService;
+
+ private final DeviceService deviceService;
+
+ private final DevMachineService devMachineService;
+ private final DevMacByclService devMacByclService;
+
+ private final MesOrderStaService mesOrderStaService;
+ private final DeviceStatusService deviceStatusService;
+ private final DeviceStatusByclService deviceStatusByclService;
+ private final MesOrderSelectService orderSelectService;
+ private final MesNumericalService mesNumericalServicen;
+ private final MesNumericalByclService mesNumericalByclService;
+
+ private final VOrderService vOrderService;
+
+ @Override
+ public boolean SoDeviceList() throws Exception {
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ // Check if the response code indicates success
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (!apiResponseCode.getFlag()) {
+ return false; // Exit if the response is not successful
+ }
+
+ // Prepare the request body
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("soDeviceList");
+ requestBody.setSig(sig.getData()); // Convert data to String if needed
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1683531129071");
+
+ // Set parameters for the request
+ Params params = new Params();
+ params.setPageNo(1);
+ params.setPageSize(999);
+ params.setStatus(-99);
+ requestBody.setParams(params);
+
+ // Send the data request and receive response
+ ApiResponse<Device> response = apiService.sendListRequest(requestBody, Device.class);
+
+ ApiResponseCode isTrue = ApiResponseCode.fromCode(response.getCode());
+
+ if (!isTrue.getFlag()) {
+ throw new Exception("鍦ㄨ姹傛暟閲囨帴鍙f椂鍑虹幇锛�" + isTrue.getDescription());
+ }
+
+ List<Device> deviceList = response.getList();
+
+ List<String> uidList = deviceList.stream().map(Device::getDevNo).collect(Collectors.toList());
+
+ LambdaUpdateWrapper<Device> wrapper = new LambdaUpdateWrapper<>();
+ wrapper.in(Device::getDevNo, uidList);
+ deviceService.remove(wrapper);
+ return deviceService.saveOrUpdateBatch(deviceList);
+ }
+
+ //涓烘垜澶嶅埗涓�浠借繖涓柟娉曞嚭鏉ワ紝鎶婄敤鍒扮殑DEVICE_STATUS瀹炰綋绫绘敼涓篋EVICE_STATUS_BYCL锛孧ES_NUMERICAL瀹炰綋鏀逛负MES_NUMERICAL_BYCL锛屽叾浠栫殑閫昏緫涓嶅彉骞剁粰鎴戞敞閲�
+ @Override
+ public void getDeviceRealTimeData(String uid) throws Exception {
+
+ ApiDataResult<DeviceRealTimeData> response = getDeviceRealTimeDataApiDataResult(uid);
+ if (response == null) return; // Exit if the response is not successful
+
+ DeviceRealTimeData data = response.getData();
+
+ setMesOrderSta(data);
+
+ //宸ヨ壓鍙傛暟
+ //deviceMetricsService.saveDeviceMetrics(data, orderSta.getOrderNo());
+ }
+
+ @Override
+ public void getDeviceRealTimeDataBycl(String uid) throws Exception {
+ ApiDataResult<DeviceRealTimeData> response = getDeviceRealTimeDataApiDataResult(uid);
+ if (response == null) {
+ return;
+ }
+
+ DeviceRealTimeData data = response.getData();
+ setMesOrderStaBycl(data);
+ }
+
+ @Override
+ public void getDeviceDayCount(String uid, String date) throws IOException {
+
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (apiResponseCode != null && !apiResponseCode.getFlag()) {
+ return; // 濡傛灉鍝嶅簲涓嶆垚鍔熷垯閫�鍑�
+ }
+
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("getDeviceDayCount");
+ requestBody.setSig(sig.getData()); // Ensure data is in string format
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1683531129071");
+
+ Params params = new Params();
+ params.setUid(uid);
+ params.setDate(date);
+ requestBody.setParams(params);
+
+ ApiDataResult<DeviceDayCount> response = apiService.sendDataRequest(requestBody, DeviceDayCount.class);
+
+ apiResponseCode = ApiResponseCode.fromCode(response.getCode());
+ if (apiResponseCode == null || !apiResponseCode.getFlag()) {
+ return;
+ }
+ DeviceDayCount data = response.getData();
+
+ if (data.getFaultTime() == null && data.getWaitTime() == null) {
+ return;
+ }
+
+ LambdaQueryWrapper<DevMachine> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(DevMachine::getDevNo, uid);
+ DevMachine devMachine = devMachineService.getOne(wrapper);
+ if (devMachine == null) {
+ return;
+ }
+
+ double v = (data.getFaultTime() + data.getWaitTime()) * 60;
+
+ if (v <= 0) {
+ return;
+ }
+
+ LambdaQueryWrapper<MesOrderSelect> lambdaUpdateWrapper1 = new LambdaQueryWrapper<>();
+
+ lambdaUpdateWrapper1.eq(MesOrderSelect::getEditDate, date)
+ .eq(MesOrderSelect::getMachineNo, devMachine.getMachineNo());
+
+ long count = orderSelectService.count(lambdaUpdateWrapper1);
+
+ if (count <= 0) {
+ return;
+ }
+
+ LambdaUpdateWrapper<MesOrderSelect> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+
+ v = (double) Math.round(v / count * 100) / 100;
+
+ lambdaUpdateWrapper
+ .set(MesOrderSelect::getTjCount, 1)
+ .set(MesOrderSelect::getTjTime, v)
+ .eq(MesOrderSelect::getEditDate, date)
+ .eq(MesOrderSelect::getMachineNo, devMachine.getMachineNo());
+
+ orderSelectService.update(lambdaUpdateWrapper);
+ }
+
+ @Override
+ public ApiDataResult<DeviceRealTimeData> getDeviceRealTimeDataApiDataResult(String uid) throws Exception {
+ // 鑾峰彇sig
+ ApiResponse<?> sig = apiService.getSig(DataAcquisitionConfiguration.PUBLIC_KEY, DataAcquisitionConfiguration.APP_ID);
+
+ // 妫�鏌ュ搷搴斾唬鐮佹槸鍚︽垚鍔�
+ ApiResponseCode apiResponseCode = ApiResponseCode.fromCode(sig.getCode());
+ if (apiResponseCode == null || !apiResponseCode.getFlag()) {
+ return null;
+ }
+
+ // 鍑嗗璇锋眰姝f枃
+ ApiRequestBody requestBody = new ApiRequestBody();
+ requestBody.setExt("");
+ requestBody.setVistApi("getDeviceRealTimeData");
+ requestBody.setSig(sig.getData()); // Ensure data is in string format
+ requestBody.setAppId(DataAcquisitionConfiguration.APP_ID);
+ requestBody.setTime("1683531129071");
+
+ // 璁剧疆璇锋眰鐨勫弬鏁�
+ Params params = new Params();
+ params.setUid(uid);
+ requestBody.setParams(params);
+
+ // 鍙戦�佹暟鎹姹傚苟鎺ユ敹鍝嶅簲
+ ApiDataResult<DeviceRealTimeData> response = apiService.sendDataRequest(requestBody, DeviceRealTimeData.class);
+
+ ApiResponseCode isTrue = ApiResponseCode.fromCode(response.getCode());
+
+ if (isTrue != null && !isTrue.getFlag()) {
+ throw new Exception("鍦ㄨ姹傛暟閲囨帴鍙f椂鍑虹幇锛�" + isTrue.getDescription());
+ }
+ return response;
+ }
+
+ @Override
+ public boolean RefreshDev(NumbericalDto barcode) {
+
+ if (StrUtil.isNullOrUndefined(barcode.getMachineNo())) {
+ return false;
+ }
+
+ try {
+ LambdaQueryWrapper<DevMachine> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(DevMachine::getMachineNo, barcode.getMachineNo());
+ DevMachine one = devMachineService.getOne(queryWrapper, false);
+
+ if (one == null) {
+ return false;
+ }
+
+ getDeviceRealTimeData(one.getDevNo());
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean RefreshDevBycl(NumbericalDto barcode) {
+ if (StrUtil.isNullOrUndefined(barcode.getMachineNo())) {
+ return false;
+ }
+
+ try {
+ LambdaQueryWrapper<DevMacBycl> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(DevMacBycl::getMachineNo, barcode.getMachineNo());
+ DevMacBycl one = devMacByclService.getOne(queryWrapper, false);
+
+ if (one == null) {
+ return false;
+ }
+
+ getDeviceRealTimeDataBycl(one.getDevNo());
+
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ private void setMesOrderSta(DeviceRealTimeData data) {
+ LambdaQueryWrapper<DevMachine> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(DevMachine::getDevNo, data.getDevNo());
+
+ DevMachine one = devMachineService.getOne(wrapper, false);
+
+ if (one == null) {
+ System.out.println("寮傚父1锛氬綋鍓嶆満鍣ㄦ病鏈夌粦瀹氭満鍙�");
+ return;
+ }
+
+ //mesOrderStaService
+// LambdaQueryWrapper<MesOrderSta> queryWrapper = new LambdaQueryWrapper<>();
+// queryWrapper.eq(MesOrderSta::getMachineNo, one.getMachineNo())
+// .eq(MesOrderSta::getIsShow, 1);
+//
+// MesOrderSta orderSta = mesOrderStaService.getOne(queryWrapper, false);
+//
+// if (orderSta == null) {
+// System.out.println("寮傚父2锛氬綋鍓嶄骇绾挎病鏈夊彲浠ョ粦瀹氱殑宸ュ崟");
+// return;
+// }
+
+ //鏁伴噰璁板綍
+ String formattedDate = data.getLastEditDate().substring(0, 10);
+
+
+// LambdaQueryWrapper<MesOrderSelect> queryWrapper1 = new LambdaQueryWrapper<>();
+// queryWrapper1.eq(MesOrderSelect::getIsShow, 0)
+// .eq(MesOrderSelect::getMachineNo, orderSta.getMachineNo());
+//
+// List<MesOrderSelect> list = orderSelectService.list(queryWrapper1);
+//
+// list.forEach(s -> {
+// setOrder(data, s.getOrderNo(), formattedDate);
+// });
+ setOrder(data, formattedDate, one);
+ }
+
+ private void setMesOrderStaBycl(DeviceRealTimeData data) {
+ LambdaQueryWrapper<DevMacBycl> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(DevMacBycl::getDevNo, data.getDevNo());
+
+ DevMacBycl one = devMacByclService.getOne(wrapper, false);
+
+ if (one == null) {
+ System.out.println("WARN: current device is not bound to a machine");
+ return;
+ }
+
+ String formattedDate = data.getLastEditDate().substring(0, 10);
+ setOrderBycl(data, formattedDate, one);
+ }
+
+ private void setOrder(DeviceRealTimeData data, String formattedDate, DevMachine one) {
+
+ LambdaQueryWrapper<MesOrderSta> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(MesOrderSta::getMachineNo, one.getMachineNo())
+ .eq(MesOrderSta::getIsShow, 1);
+
+ MesOrderSta orderSta = mesOrderStaService.getOne(queryWrapper, false);
+
+ if (orderSta == null) {
+ queryWrapper.clear();
+ queryWrapper.eq(MesOrderSta::getMachineNo, one.getMachineNo())
+ .orderByDesc(MesOrderSta::getId);
+
+ orderSta = mesOrderStaService.getOne(queryWrapper, false);
+ }
+
+ String orderNo = "";
+ Long orderId = null;
+
+ if (orderSta != null) {
+ orderNo = orderSta.getOrderNo();
+ orderId = orderSta.getOrderId();
+ }
+
+ LambdaQueryWrapper<VOrder> queryWrapper2 = new LambdaQueryWrapper<>();
+ queryWrapper2.eq(VOrder::getId, orderId);
+ VOrder one1 = vOrderService.getOne(queryWrapper2, false);
+
+ int outItemNum = 1;
+
+ if (one1 != null) {
+
+ try {
+ outItemNum = Integer.parseInt(one1.getOutItemNum());
+ } catch (Exception e) {
+ outItemNum = 1;
+ }
+ }
+
+ DeviceStatus status = new DeviceStatus();
+ status.setDevNo(data.getDevNo());
+ status.setStatus(data.getStatus());
+ status.setOutput(data.getOutput());
+ status.setOnlineTime(data.getOnlineTime());
+ status.setTodayOnlineTime(data.getTodayOnlineTime());
+ status.setPower(data.getTodayPower());
+ status.setTodayPower(data.getTodayPower());
+ status.setFaultNum(data.getFaultNum());
+ status.setTodayFaultNum(data.getTodayFaultNum());
+ status.setOrderNo(orderNo);
+ status.setEditDate(formattedDate);
+// status.setTodayOutput(data.getTodayOutput());
+ String d15 = data.getD15();
+
+ if (StrUtil.isEmpty(d15)) {
+ d15 = "0";
+ }
+
+ status.setTodayOutput(Double.parseDouble(d15) * outItemNum);
+
+ status.setWorkStartDate(data.getWorkstartDate());
+ status.setWorkEndDate(data.getWorkendDate());
+ status.setDeviceTypeClassItemId(data.getDeviceTypeClassItemId());
+// status.setDeviceTypeClassItemName(data.getDeviceTypeClassItemName());
+ status.setWorkOutput(Double.parseDouble(data.getWorkOutPut()));
+ status.setHourOutput(Double.parseDouble(data.getHourOutPut()));
+ status.setBadoutput(Double.parseDouble(data.getBadoutput()));
+ status.setTodayBadoutput(Double.parseDouble(data.getTodayBadoutput()));
+ status.setWorkBadoutput(Double.parseDouble(data.getWorkBadoutput()));
+ status.setHourBadoutput(Double.parseDouble(data.getHourBadoutput()));
+
+
+ boolean nullOrUndefined = StrUtil.isNullOrUndefined(data.getTodayRuntime());
+ if (!nullOrUndefined) {
+ status.setTodayRunTime(Double.parseDouble(data.getTodayRuntime()));
+ }
+
+ deviceStatusService.save(status);
+
+ MesNumerical numerical = new MesNumerical();
+ numerical.setOrderId(orderId);
+ numerical.setOrderNo(orderNo);
+ numerical.setEditDate(formattedDate);
+ numerical.setMachineNo(one.getMachineNo());
+// numerical.setCjNum((int) data.getTodayOutput());
+ numerical.setCjNum(Integer.parseInt(d15) * outItemNum);
+ numerical.setCjTiem(data.getLastEditDate());
+ mesNumericalServicen.save(numerical);
+ }
+
+ private void setNumericalBycl(DeviceRealTimeData data, String formattedDate, MesOrderSta orderSta) {
+ MesNumericalBycl numerical = new MesNumericalBycl();
+ numerical.setOrderId(orderSta.getOrderId());
+ numerical.setOrderNo(orderSta.getOrderNo());
+ numerical.setEditDate(formattedDate);
+ numerical.setMachineNo(orderSta.getMachineNo());
+ numerical.setCjNum(parseBigDecimal(resolveByclProductionValue(data)).intValue());
+ numerical.setCjTiem(data.getLastEditDate());
+ mesNumericalByclService.save(numerical);
+ }
+
+ /**
+ * BYCL琛ㄥ悓姝ラ�昏緫锛氬鍒秙etOrder鍐欏叆DEVICE_STATUS_BYCL鍜孧ES_NUMERICAL_BYCL銆�
+ */
+ private void setOrderBycl(DeviceRealTimeData data, String formattedDate, DevMacBycl one) {
+
+ LambdaQueryWrapper<MesOrderSta> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(MesOrderSta::getMachineNo, one.getMachineNo())
+ .eq(MesOrderSta::getIsShow, 1);
+
+ MesOrderSta orderSta = mesOrderStaService.getOne(queryWrapper, false);
+
+ if (orderSta == null) {
+ queryWrapper.clear();
+ queryWrapper.eq(MesOrderSta::getMachineNo, one.getMachineNo())
+ .orderByDesc(MesOrderSta::getId);
+
+ orderSta = mesOrderStaService.getOne(queryWrapper, false);
+ }
+
+ String orderNo = "";
+ Long orderId = null;
+
+ if (orderSta != null) {
+ orderNo = orderSta.getOrderNo();
+ orderId = orderSta.getOrderId();
+ }
+
+ LambdaQueryWrapper<VOrder> queryWrapper2 = new LambdaQueryWrapper<>();
+ queryWrapper2.eq(VOrder::getId, orderId);
+ VOrder one1 = vOrderService.getOne(queryWrapper2, false);
+
+ int outItemNum = 1;
+
+ if (one1 != null) {
+
+ try {
+ outItemNum = Integer.parseInt(one1.getOutItemNum());
+ } catch (Exception e) {
+ outItemNum = 1;
+ }
+ }
+
+ DeviceStatusBycl status = new DeviceStatusBycl();
+ status.setDevNo(data.getDevNo());
+ status.setStatus(data.getStatus());
+ status.setOutput(data.getOutput());
+ status.setOnlineTime(data.getOnlineTime());
+ status.setTodayOnlineTime(data.getTodayOnlineTime());
+ status.setPower(data.getTodayPower());
+ status.setTodayPower(data.getTodayPower());
+ status.setFaultNum(data.getFaultNum());
+ status.setTodayFaultNum(data.getTodayFaultNum());
+ status.setOrderNo(orderNo);
+ status.setEditDate(formattedDate);
+
+ // Determine production count (d15 variable name must stay the same)
+ String d15 = resolveByclProductionValue(data);
+ BigDecimal production = parseBigDecimal(d15);
+ BigDecimal todayOutput = production.multiply(BigDecimal.valueOf(outItemNum));
+ status.setTodayOutput(todayOutput.doubleValue());
+
+ status.setWorkStartDate(data.getWorkstartDate());
+ status.setWorkEndDate(data.getWorkendDate());
+ status.setDeviceTypeClassItemId(data.getDeviceTypeClassItemId());
+ status.setWorkOutput(Double.parseDouble(data.getWorkOutPut()));
+ status.setHourOutput(Double.parseDouble(data.getHourOutPut()));
+ status.setBadoutput(Double.parseDouble(data.getBadoutput()));
+ status.setTodayBadoutput(Double.parseDouble(data.getTodayBadoutput()));
+ status.setWorkBadoutput(Double.parseDouble(data.getWorkBadoutput()));
+ status.setHourBadoutput(Double.parseDouble(data.getHourBadoutput()));
+
+ boolean nullOrUndefined = StrUtil.isNullOrUndefined(data.getTodayRuntime());
+ if (!nullOrUndefined) {
+ status.setTodayRunTime(Double.parseDouble(data.getTodayRuntime()));
+ }
+
+ deviceStatusByclService.save(status);
+
+ MesNumericalBycl numerical = new MesNumericalBycl();
+ numerical.setOrderId(orderId);
+ numerical.setOrderNo(orderNo);
+ numerical.setEditDate(formattedDate);
+ numerical.setMachineNo(one.getMachineNo());
+ numerical.setCjNum(todayOutput.intValue());
+ numerical.setCjTiem(data.getLastEditDate());
+ mesNumericalByclService.save(numerical);
+ }
+
+ private void setOrder(DeviceRealTimeData data, String orderNo, String formattedDate) {
+
+ LambdaQueryWrapper<MesOrderSta> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(MesOrderSta::getOrderNo, orderNo);
+
+ MesOrderSta orderSta = mesOrderStaService.getOne(queryWrapper, false);
+
+ LambdaQueryWrapper<DeviceStatus> queryWrapper2 = new LambdaQueryWrapper<>();
+ queryWrapper2.eq(DeviceStatus::getOrderNo, orderSta.getOrderNo())
+ .eq(DeviceStatus::getEditDate, formattedDate);
+
+ long count = deviceStatusService.count(queryWrapper2);
+
+ if (count == 0) {
+
+ //鍐欏叆鏁伴噰璁板綍
+ DeviceStatus status = new DeviceStatus();
+ status.setDevNo(data.getDevNo());
+ status.setStatus(data.getStatus());
+ status.setOutput(data.getOutput());
+ status.setOnlineTime(data.getOnlineTime());
+ status.setTodayOnlineTime(data.getTodayOnlineTime());
+ status.setPower(data.getTodayPower());
+ status.setTodayPower(data.getTodayPower());
+ status.setFaultNum(data.getFaultNum());
+ status.setTodayFaultNum(data.getTodayFaultNum());
+ status.setOrderNo(orderSta.getOrderNo());
+ status.setEditDate(formattedDate);
+// status.setTodayOutput(data.getTodayOutput());
+ status.setTodayOutput(Double.parseDouble(data.getD15()));
+
+ status.setWorkStartDate(data.getWorkstartDate());
+ status.setWorkEndDate(data.getWorkendDate());
+ status.setDeviceTypeClassItemId(data.getDeviceTypeClassItemId());
+// status.setDeviceTypeClassItemName(data.getDeviceTypeClassItemName());
+ status.setWorkOutput(Double.parseDouble(data.getWorkOutPut()));
+ status.setHourOutput(Double.parseDouble(data.getHourOutPut()));
+ status.setBadoutput(Double.parseDouble(data.getBadoutput()));
+ status.setTodayBadoutput(Double.parseDouble(data.getTodayBadoutput()));
+ status.setWorkBadoutput(Double.parseDouble(data.getWorkBadoutput()));
+ status.setHourBadoutput(Double.parseDouble(data.getHourBadoutput()));
+ status.setTodayRunTime(Double.parseDouble(data.getTodayRuntime()));
+
+ deviceStatusService.save(status);
+
+ //鍐欏叆MesOrderSelect 鍋滄満璁板綍鏁�
+ MesOrderSelect select = new MesOrderSelect();
+ select.setOrderId(orderSta.getOrderId());
+ select.setOrderNo(orderSta.getOrderNo());
+ select.setEditDate(formattedDate);
+ select.setMachineNo(orderSta.getMachineNo());
+ select.setTjCount(0);
+ select.setTjTime(0.0);
+ orderSelectService.save(select);
+
+ //鍐欏叆MesNumerical 鏁伴噰璁板綍
+ setNumerical(data, formattedDate, orderSta);
+
+ } else if (count > 0) {
+
+ LambdaUpdateWrapper<DeviceStatus> wrapper1 = new LambdaUpdateWrapper<>();
+
+ wrapper1.set(DeviceStatus::getWorkOutput, data.getWorkOutPut())
+ .set(DeviceStatus::getHourOutput, data.getHourOutPut())
+// .set(DeviceStatus::getTodayOutput, data.getTodayOutput())
+ .set(DeviceStatus::getTodayOutput, Double.parseDouble(data.getD15()))
+ .set(DeviceStatus::getBadoutput, data.getBadoutput())
+ .set(DeviceStatus::getTodayBadoutput, data.getTodayBadoutput())
+ .set(DeviceStatus::getWorkBadoutput, data.getWorkBadoutput())
+ .set(DeviceStatus::getHourBadoutput, data.getHourBadoutput())
+ .eq(DeviceStatus::getOrderNo, orderSta.getOrderNo())
+ .eq(DeviceStatus::getEditDate, formattedDate);
+
+ deviceStatusService.update(wrapper1);
+
+ LambdaUpdateWrapper<MesNumerical> wrapper2 = new LambdaUpdateWrapper<>();
+ wrapper2.eq(MesNumerical::getOrderNo, orderSta.getOrderNo())
+ .eq(MesNumerical::getEditDate, formattedDate)
+ .orderByDesc(MesNumerical::getCjTiem);
+
+// MesNumerical numerical = mesNumericalServicen.getOne(wrapper2, false);
+ List<MesNumerical> list = mesNumericalServicen.list(wrapper2);
+
+ if (list.isEmpty()) {
+ setNumerical(data, formattedDate, orderSta);
+ } else if (list.size() == 1) {
+ MesNumerical numerical = list.get(0);
+// if (numerical.getCjNum() == (int) data.getTodayOutput()) {
+ if (numerical.getCjNum() == (int) Double.parseDouble(data.getD15())) {
+ //setOrderSelect(data, formattedDate, numerical, orderSta);
+
+ //鍐欏叆MesNumerical 鏁伴噰璁板綍
+ setNumerical(data, formattedDate, orderSta);
+ } else {
+ mesNumericalServicen.removeById(numerical.getId());
+ //濡傛灉鏁伴噰鏁版嵁涓庢渶鏂扮殑涓�鏉℃暟鎹笉鐩哥瓑,琛ㄧず娌℃湁鍋滄満,鏇挎崲
+ setNumerical(data, formattedDate, orderSta);
+ }
+ } else {
+ MesNumerical numerical = list.get(0);
+ MesNumerical numerical1 = list.get(1);
+
+ //濡傛灉鏁伴噰鏁版嵁涓庢渶鏂扮殑涓�鏉℃暟鎹浉绛夊氨缁х画姣旇緝鍊掓暟绗簩鏉�
+// if (numerical.getCjNum() == (int) data.getTodayOutput()) {
+ if (numerical.getCjNum() == (int) Double.parseDouble(data.getD15())) {
+ //濡傛灉鏁伴噰鏁版嵁涓庢渶鏂扮殑涓ゆ璁板綍鐩哥瓑,灏辫〃绀鸿繕鏄浜庡仠鏈虹姸鎬�,缁х画璁板綍
+// if (numerical1.getCjNum() == (int) data.getTodayOutput()) {
+ if (numerical1.getCjNum() == (int) Double.parseDouble(data.getD15())) {
+ setNumerical(data, formattedDate, orderSta);
+
+ //setOrderSelect(data, formattedDate, numerical, orderSta);
+ }
+ } else {
+ mesNumericalServicen.removeById(numerical.getId());
+ //濡傛灉鏁伴噰鏁版嵁涓庢渶鏂扮殑涓�鏉℃暟鎹笉鐩哥瓑,琛ㄧず娌℃湁鍋滄満,鏇挎崲
+ setNumerical(data, formattedDate, orderSta);
+ }
+ }
+
+ setOrderSelect(data, formattedDate, orderSta);
+ }
+ }
+
+ /**
+ * BYCL琛ㄧ増鏈殑setOrder锛屼繚鎸侀�昏緫涓�鑷翠粎鏇挎崲鎸佷箙鍖栧疄浣撱��
+ */
+ private void setOrderBycl(DeviceRealTimeData data, String orderNo, String formattedDate) {
+
+ LambdaQueryWrapper<MesOrderSta> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(MesOrderSta::getOrderNo, orderNo);
+
+ MesOrderSta orderSta = mesOrderStaService.getOne(queryWrapper, false);
+
+ LambdaQueryWrapper<DeviceStatusBycl> queryWrapper2 = new LambdaQueryWrapper<>();
+ queryWrapper2.eq(DeviceStatusBycl::getOrderNo, orderSta.getOrderNo())
+ .eq(DeviceStatusBycl::getEditDate, formattedDate);
+
+ long count = deviceStatusByclService.count(queryWrapper2);
+ String d15 = resolveByclProductionValue(data);
+ BigDecimal production = parseBigDecimal(d15);
+ int productionInt = production.intValue();
+ double productionDouble = production.doubleValue();
+
+ if (count == 0) {
+
+ DeviceStatusBycl status = new DeviceStatusBycl();
+ status.setDevNo(data.getDevNo());
+ status.setStatus(data.getStatus());
+ status.setOutput(data.getOutput());
+ status.setOnlineTime(data.getOnlineTime());
+ status.setTodayOnlineTime(data.getTodayOnlineTime());
+ status.setPower(data.getTodayPower());
+ status.setTodayPower(data.getTodayPower());
+ status.setFaultNum(data.getFaultNum());
+ status.setTodayFaultNum(data.getTodayFaultNum());
+ status.setOrderNo(orderSta.getOrderNo());
+ status.setEditDate(formattedDate);
+ status.setTodayOutput(productionDouble);
+
+ status.setWorkStartDate(data.getWorkstartDate());
+ status.setWorkEndDate(data.getWorkendDate());
+ status.setDeviceTypeClassItemId(data.getDeviceTypeClassItemId());
+ status.setWorkOutput(Double.parseDouble(data.getWorkOutPut()));
+ status.setHourOutput(Double.parseDouble(data.getHourOutPut()));
+ status.setBadoutput(Double.parseDouble(data.getBadoutput()));
+ status.setTodayBadoutput(Double.parseDouble(data.getTodayBadoutput()));
+ status.setWorkBadoutput(Double.parseDouble(data.getWorkBadoutput()));
+ status.setHourBadoutput(Double.parseDouble(data.getHourBadoutput()));
+ status.setTodayRunTime(Double.parseDouble(data.getTodayRuntime()));
+
+ deviceStatusByclService.save(status);
+
+ MesOrderSelect select = new MesOrderSelect();
+ select.setOrderId(orderSta.getOrderId());
+ select.setOrderNo(orderSta.getOrderNo());
+ select.setEditDate(formattedDate);
+ select.setMachineNo(orderSta.getMachineNo());
+ select.setTjCount(0);
+ select.setTjTime(0.0);
+ orderSelectService.save(select);
+
+ setNumericalBycl(data, formattedDate, orderSta);
+
+ } else if (count > 0) {
+
+ LambdaUpdateWrapper<DeviceStatusBycl> wrapper1 = new LambdaUpdateWrapper<>();
+
+ wrapper1.set(DeviceStatusBycl::getWorkOutput, data.getWorkOutPut())
+ .set(DeviceStatusBycl::getHourOutput, data.getHourOutPut())
+ .set(DeviceStatusBycl::getTodayOutput, productionDouble)
+ .set(DeviceStatusBycl::getBadoutput, data.getBadoutput())
+ .set(DeviceStatusBycl::getTodayBadoutput, data.getTodayBadoutput())
+ .set(DeviceStatusBycl::getWorkBadoutput, data.getWorkBadoutput())
+ .set(DeviceStatusBycl::getHourBadoutput, data.getHourBadoutput())
+ .eq(DeviceStatusBycl::getOrderNo, orderSta.getOrderNo())
+ .eq(DeviceStatusBycl::getEditDate, formattedDate);
+
+ deviceStatusByclService.update(wrapper1);
+
+ LambdaUpdateWrapper<MesNumericalBycl> wrapper2 = new LambdaUpdateWrapper<>();
+ wrapper2.eq(MesNumericalBycl::getOrderNo, orderSta.getOrderNo())
+ .eq(MesNumericalBycl::getEditDate, formattedDate)
+ .orderByDesc(MesNumericalBycl::getCjTiem);
+
+ List<MesNumericalBycl> list = mesNumericalByclService.list(wrapper2);
+
+ if (list.isEmpty()) {
+ setNumericalBycl(data, formattedDate, orderSta);
+ } else if (list.size() == 1) {
+ MesNumericalBycl numerical = list.get(0);
+ if (numerical.getCjNum() == productionInt) {
+ setNumericalBycl(data, formattedDate, orderSta);
+ } else {
+ mesNumericalByclService.removeById(numerical.getId());
+ setNumericalBycl(data, formattedDate, orderSta);
+ }
+ } else {
+ MesNumericalBycl numerical = list.get(0);
+ MesNumericalBycl numerical1 = list.get(1);
+
+ if (numerical.getCjNum() == productionInt) {
+ if (numerical1.getCjNum() == productionInt) {
+ setNumericalBycl(data, formattedDate, orderSta);
+ }
+ } else {
+ mesNumericalByclService.removeById(numerical.getId());
+ setNumericalBycl(data, formattedDate, orderSta);
+ }
+ }
+
+ setOrderSelectBycl(data, formattedDate, orderSta);
+ }
+ }
+
+ private void setNumerical(DeviceRealTimeData data, String formattedDate, MesOrderSta orderSta) {
+ MesNumerical numerical = new MesNumerical();
+ numerical.setOrderId(orderSta.getOrderId());
+ numerical.setOrderNo(orderSta.getOrderNo());
+ numerical.setEditDate(formattedDate);
+ numerical.setMachineNo(orderSta.getMachineNo());
+// numerical.setCjNum((int) data.getTodayOutput());
+ numerical.setCjNum(Integer.parseInt(data.getD15()));
+ numerical.setCjTiem(data.getLastEditDate());
+ mesNumericalServicen.save(numerical);
+ }
+
+ private void setOrderSelect(DeviceRealTimeData data, String formattedDate, MesOrderSta orderSta) {
+
+ LambdaQueryWrapper<MesNumerical> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(MesNumerical::getEditDate, formattedDate);
+
+ List<MesNumerical> orders = mesNumericalServicen.list(wrapper);
+
+ List<MesNumerical> mesNumericals = new ArrayList<>(orders.stream()
+ .collect(Collectors.toMap(
+ order -> order.getOrderId() + "_" + order.getCjTiem(), // 鐢∣RDER_ID+ORDER_NO杩涜鍞竴鏍囪瘑
+ Function.identity(), // 淇濈暀Order瀵硅薄鏈韩
+ (existing, replacement) -> existing)) // 濡傛灉鏈夐噸澶嶇殑锛屼繚鐣欑涓�涓�
+ .values());
+
+ // 鏃堕棿瑙f瀽鍣�
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+ Map<String, List<MesNumerical>> groupedOrders = mesNumericals.stream()
+ .collect(Collectors.groupingBy(order -> order.getOrderId() + "-" + order.getCjNum()));
+
+ // 璁$畻姣忕粍鐨勬椂闂村樊
+ groupedOrders.forEach((key, orderList) -> {
+ if (orderList.size() > 1) {
+ // 鑾峰彇鏈�鏃╃殑鍜屾渶鏅氱殑鏃堕棿
+ LocalDateTime minTime = orderList.stream()
+ .map(order -> LocalDateTime.parse(order.getCjTiem(), formatter))
+ .min(LocalDateTime::compareTo)
+ .orElseThrow(() -> new NoSuchElementException("No min time found in group " + key)); // 濡傛灉娌℃湁璁板綍浼氭姏鍑哄紓甯革紝杩欓噷鍋囪鑷冲皯鏈変竴涓椂闂�
+
+ LocalDateTime maxTime = orderList.stream()
+ .map(order -> LocalDateTime.parse(order.getCjTiem(), formatter))
+ .max(LocalDateTime::compareTo)
+ .orElseThrow(() -> new NoSuchElementException("No min time found in group " + key)); // 鍚岀悊
+
+ // 璁$畻鏃堕棿宸紙鍗曚綅涓虹锛�
+ long timeDifferenceInSeconds = Duration.between(minTime, maxTime).getSeconds();
+
+
+ long time = timeDifferenceInSeconds / 60;
+ //鏇存柊MesOrderSelect 鍋滄満璁板綍鏁�
+ LambdaUpdateWrapper<MesOrderSelect> wrapper3 = new LambdaUpdateWrapper<>();
+ wrapper3
+ .set(MesOrderSelect::getTjCount, orderList.size() - 1)
+ .set(MesOrderSelect::getTjTime, time)
+ .eq(MesOrderSelect::getMachineNo, orderSta.getMachineNo())
+ .eq(MesOrderSelect::getEditDate, formattedDate)
+ .eq(MesOrderSelect::getIsShow, 0)
+ .eq(MesOrderSelect::getOrderNo, orderSta.getOrderNo());
+ orderSelectService.update(wrapper3);
+
+ }
+ });
+ }
+
+ private void setOrderSelectBycl(DeviceRealTimeData data, String formattedDate, MesOrderSta orderSta) {
+
+ LambdaQueryWrapper<MesNumericalBycl> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(MesNumericalBycl::getEditDate, formattedDate);
+
+ List<MesNumericalBycl> orders = mesNumericalByclService.list(wrapper);
+
+ List<MesNumericalBycl> mesNumericals = new ArrayList<>(orders.stream()
+ .collect(Collectors.toMap(
+ order -> order.getOrderId() + "_" + order.getCjTiem(),
+ Function.identity(),
+ (existing, replacement) -> existing))
+ .values());
+
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+ Map<String, List<MesNumericalBycl>> groupedOrders = mesNumericals.stream()
+ .collect(Collectors.groupingBy(order -> order.getOrderId() + "-" + order.getCjNum()));
+
+ groupedOrders.forEach((key, orderList) -> {
+ if (orderList.size() > 1) {
+ LocalDateTime minTime = orderList.stream()
+ .map(order -> LocalDateTime.parse(order.getCjTiem(), formatter))
+ .min(LocalDateTime::compareTo)
+ .orElseThrow(() -> new NoSuchElementException("No min time found in group " + key));
+
+ LocalDateTime maxTime = orderList.stream()
+ .map(order -> LocalDateTime.parse(order.getCjTiem(), formatter))
+ .max(LocalDateTime::compareTo)
+ .orElseThrow(() -> new NoSuchElementException("No min time found in group " + key));
+
+ long timeDifferenceInSeconds = Duration.between(minTime, maxTime).getSeconds();
+
+ long time = timeDifferenceInSeconds / 60;
+ LambdaUpdateWrapper<MesOrderSelect> wrapper3 = new LambdaUpdateWrapper<>();
+ wrapper3
+ .set(MesOrderSelect::getTjCount, orderList.size() - 1)
+ .set(MesOrderSelect::getTjTime, time)
+ .eq(MesOrderSelect::getMachineNo, orderSta.getMachineNo())
+ .eq(MesOrderSelect::getEditDate, formattedDate)
+ .eq(MesOrderSelect::getIsShow, 0)
+ .eq(MesOrderSelect::getOrderNo, orderSta.getOrderNo());
+ orderSelectService.update(wrapper3);
+
+ }
+ });
+ }
+
+ private String resolveByclProductionValue(DeviceRealTimeData data) {
+ String d15 = normalizeNumeric(data.getD1());
+ if (d15 != null) {
+ return d15;
+ }
+
+ String latheCount = normalizeNumeric(data.getD29());
+ if (latheCount != null) {
+ return latheCount;
+ }
+
+// String hobbingCount = normalizeNumeric(data.getD45());
+// if (hobbingCount != null) {
+// return hobbingCount;
+// }
+
+// double todayOutput = data.getTodayOutput();
+// if (todayOutput > 0) {
+// return BigDecimal.valueOf(todayOutput).stripTrailingZeros().toPlainString();
+// }
+
+ return "0";
+ }
+
+ private String normalizeNumeric(String raw) {
+ if (StrUtil.isBlank(raw)) {
+ return null;
+ }
+ String trimmed = raw.trim();
+ return NumberUtil.isNumber(trimmed) ? trimmed : null;
+ }
+
+ private BigDecimal parseBigDecimal(String value) {
+ try {
+ return new BigDecimal(value);
+ } catch (NumberFormatException e) {
+ return BigDecimal.ZERO;
+ }
+ }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/VOrderDetailServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/VOrderDetailServiceImpl.java
new file mode 100644
index 0000000..5cc9eb3
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/VOrderDetailServiceImpl.java
@@ -0,0 +1,21 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.VOrderDetail;
+import com.hk.NumericalCollection.mapper.VOrderDetailMapper;
+import com.hk.NumericalCollection.service.VOrderDetailService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 璁㈠崟璇︾粏淇℃伅瑙嗗浘 Service 瀹炵幇绫�
+ * @author Administrator
+ * @description 閽堝琛ㄣ�怴_ORDER_BYCL銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2025-01-04
+ */
+@Service
+@RequiredArgsConstructor
+public class VOrderDetailServiceImpl extends ServiceImpl<VOrderDetailMapper, VOrderDetail>
+ implements VOrderDetailService {
+
+}
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/VOrderServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/VOrderServiceImpl.java
new file mode 100644
index 0000000..302e649
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/VOrderServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.VOrder;
+import com.hk.NumericalCollection.service.VOrderService;
+import com.hk.NumericalCollection.mapper.VOrderMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怴_ORDER銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-10-22 08:18:10
+*/
+@Service
+public class VOrderServiceImpl extends ServiceImpl<VOrderMapper, VOrder>
+ implements VOrderService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/WomcaaServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/WomcaaServiceImpl.java
new file mode 100644
index 0000000..f3ceec5
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/WomcaaServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.Womcaa;
+import com.hk.NumericalCollection.mapper.WomcaaMapper;
+import com.hk.NumericalCollection.service.WomcaaService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMCAA(宸ュ崟琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-09-27 21:41:27
+*/
+@Service
+public class WomcaaServiceImpl extends ServiceImpl<WomcaaMapper, Womcaa>
+ implements WomcaaService{
+
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/service/impl/WomdaaServiceImpl.java b/src/main/java/com/hk/NumericalCollection/service/impl/WomdaaServiceImpl.java
new file mode 100644
index 0000000..4477dd6
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/service/impl/WomdaaServiceImpl.java
@@ -0,0 +1,29 @@
+package com.hk.NumericalCollection.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hk.NumericalCollection.entity.Womdaa;
+import com.hk.NumericalCollection.service.WomdaaService;
+import com.hk.NumericalCollection.mapper.WomdaaMapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 閽堝琛ㄣ�怶OMDAA(宸ュ崟鎸囦护琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-10-17 08:18:29
+*/
+@Service
+public class WomdaaServiceImpl extends ServiceImpl<WomdaaMapper, Womdaa>
+ implements WomdaaService{
+
+
+ @Override
+ public List<Womdaa> getMinusDaa001(String editDate) {
+ return baseMapper.getMinusDaa001(editDate);
+ }
+}
+
+
+
+
diff --git a/src/main/java/com/hk/NumericalCollection/task/ScheduledTasks.java b/src/main/java/com/hk/NumericalCollection/task/ScheduledTasks.java
new file mode 100644
index 0000000..5d1edfb
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/task/ScheduledTasks.java
@@ -0,0 +1,124 @@
+package com.hk.NumericalCollection.task;
+
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.hk.NumericalCollection.entity.DevMacBycl;
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.hk.NumericalCollection.entity.MesOrderSelect;
+import com.hk.NumericalCollection.entity.Womdaa;
+import com.hk.NumericalCollection.service.*;
+import lombok.RequiredArgsConstructor;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+@RequiredArgsConstructor
+public class ScheduledTasks {
+
+// private final INumericalService numericalService;
+//
+// private final DevMachineService devMachineService;
+//
+// private final DevMacByclService devMacByclService;
+//
+// private final WomdaaService womdaaService;
+//
+// private final MesOrderSelectService orderSelectService;
+//
+// private final MesNumericalService mesNumericalService;
+//
+//
+// /**
+// * 姣忓ぉ0鐐规墽琛屼竴娆�
+// * 鍚屾璁惧淇℃伅
+// *
+// * @return void
+// * @author tjx
+// * @description TODO
+// * @date 2024/9/27 21:48
+// */
+// @Scheduled(cron = "0 0 0 * * SUN")
+// public void SoDeviceList() {
+// mesNumericalService.cleanWeekAgoData();
+// }
+//
+// //0 0 1 * * ? *
+// @Scheduled(cron = "0 0 1 1/1 * ?")
+// public void GetMinusDaa001() {
+// String format = DateUtil.format(new Date(), "yyyy-MM-dd");
+// List<Womdaa> minusDaa001 = womdaaService.getMinusDaa001(format);
+// List<MesOrderSelect> list = new ArrayList<>();
+//
+// minusDaa001.forEach(womdaa -> {
+// MesOrderSelect womdaaSelect = new MesOrderSelect();
+// womdaaSelect.setOrderId(womdaa.getId());
+// womdaaSelect.setOrderNo(womdaa.getDaa001());
+// womdaaSelect.setEditDate(format);
+// womdaaSelect.setMachineNo(womdaa.getMachineNo());
+// womdaaSelect.setIsShow(0);
+// womdaaSelect.setTjCount(0);
+// womdaaSelect.setTjTime(0.0);
+// list.add(womdaaSelect);
+// });
+//
+// orderSelectService.saveBatch(list);
+// }
+//
+// @Scheduled(cron = "0 0 2 1/1 * ?")
+// public void getDeviceDayCount() {
+// DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -1);
+// String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd");
+// try {
+// List<DevMachine> list = devMachineService.list();
+// for (DevMachine s : list) {
+// numericalService.getDeviceDayCount(s.getDevNo(), format);
+// }
+// } catch (IOException e) {
+// throw new RuntimeException(e);
+// }
+// }
+//
+//
+// /**
+// * 姣忎簲鍒嗛挓鎵ц涓�娆�
+// * 鑾峰彇璁惧鏈�杩戠殑涓�鏉¤褰�
+// *
+// * @return void
+// * @author tjx
+// * @description TODO
+// * @date 2024/9/27 21:48
+// */
+// @Scheduled(cron = "0 0/2 * * * ?")
+// public void getDeviceRealTimeData() {
+// List<DevMachine> list = devMachineService.list();
+// list.forEach(s -> {
+// try {
+// numericalService.getDeviceRealTimeData(s.getDevNo());
+// } catch (Exception e) {
+// throw new RuntimeException(e);
+// }
+// });
+// }
+//
+// /**
+// * 姣忎簲鍒嗛挓鎵ц涓�娆★紙涓庝富浠诲姟閿欏紑涓�鍒嗛挓锛�
+// * 鑾峰彇璁惧鏈�杩戠殑涓�鏉¤褰曞啓鍏YCL琛�
+// */
+// @Scheduled(cron = "30 0/2 * * * ?")
+// public void getDeviceRealTimeDataBycl() {
+// List<DevMacBycl> list = devMacByclService.list();
+// list.forEach(s -> {
+// try {
+// numericalService.getDeviceRealTimeDataBycl(s.getDevNo());
+// } catch (Exception e) {
+// throw new RuntimeException(e);
+// }
+// });
+// }
+}
diff --git a/src/main/java/com/hk/NumericalCollection/task/ScheduledTasksNoOrder.java b/src/main/java/com/hk/NumericalCollection/task/ScheduledTasksNoOrder.java
new file mode 100644
index 0000000..f43df1f
--- /dev/null
+++ b/src/main/java/com/hk/NumericalCollection/task/ScheduledTasksNoOrder.java
@@ -0,0 +1,87 @@
+package com.hk.NumericalCollection.task;
+
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.hk.NumericalCollection.service.*;
+import lombok.RequiredArgsConstructor;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@RequiredArgsConstructor
+public class ScheduledTasksNoOrder {
+
+ private final INumericalNoOrderService numericalNoOrderService;
+
+ private final DevMachineService devMachineService;
+
+ private final INumericalService numericalService;
+
+
+ /**
+ * 鑾峰彇鎵�鏈夋満鍙扮殑鍩虹鏁版嵁
+ *
+ * @return void
+ * @author tjx
+ * @date 2024/9/27 21:48
+ */
+ @Scheduled(cron = "0 0 7 * * ?")
+ public void SoDeviceList() throws Exception {
+ numericalService.SoDeviceList();
+ }
+
+ /**
+ * 姣忎簲鍒嗛挓鎵ц涓�娆�
+ * 鑾峰彇璁惧鏈�杩戠殑涓�鏉¤褰�
+ *
+ * @return void
+ * @author tjx
+ * @description TODO
+ * @date 2024/9/27 21:48
+ */
+ @Scheduled(cron = "0 0/2 * * * ?")
+ public void getDeviceRealTimeData() {
+ List<DevMachine> list = devMachineService.list();
+ list.forEach(s -> {
+ try {
+ numericalNoOrderService.getDeviceRealTimeData(s.getDevNo());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+ }
+
+ /**
+ * 姣忓ぉ鏃╀笂7:35鎵ц涓�娆�
+ * 鑾峰彇鎵�鏈夎澶囩殑鏁呴殰鍒楄〃锛堟槰澶�7:30鍒颁粖澶�7:30锛�
+ *
+ * @return void
+ * @author tjx
+ * @date 2024/12/17
+ */
+ @Scheduled(cron = "0 35 7 * * ?")
+ public void GetAllDeviceErrorList() throws Exception {
+ DateTime yesterday = DateUtil.yesterday();
+ DateTime startDateTime = DateUtil.parse(DateUtil.format(yesterday, "yyyy-MM-dd") + " 07:30:00");
+ DateTime endDateTime = DateUtil.parse(DateUtil.format(DateUtil.date(), "yyyy-MM-dd") + " 07:30:00");
+
+ String startDate = DateUtil.format(startDateTime, "yyyy-MM-dd HH:mm:ss");
+ String endDate = DateUtil.format(endDateTime, "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ List<DevMachine> list = devMachineService.list();
+ for (DevMachine machine : list) {
+ numericalNoOrderService.getDeviceErrorList(machine.getDevNo(), startDate, endDate);
+ System.out.println("璁惧 " + machine.getDevNo() + " 鏁呴殰鍒楄〃鑾峰彇鎴愬姛");
+ }
+ } catch (Exception e) {
+ System.err.println("鎵归噺鑾峰彇璁惧鏁呴殰鍒楄〃澶辫触: " + e.getMessage());
+ throw e;
+ }
+ }
+
+}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
new file mode 100644
index 0000000..bbba288
--- /dev/null
+++ b/src/main/resources/application.yml
@@ -0,0 +1,41 @@
+server:
+ port: 9095
+
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+ url: jdbc:sqlserver://172.16.2.238:12468;databaseName=TEST_MES;encrypt=false;trustServerCertificate=true
+ username: sa
+ password: FuDa@2025
+ druid:
+ initialSize: 5
+ minIdle: 5
+ maxActive: 30
+ maxWait: 60000
+ timeBetweenEvictionRunsMillis: 60000
+ minEvictableIdleTimeMillis: 300000
+ test-while-idle: true
+ test-on-borrow: false
+ test-on-return: false
+ poolPreparedStatements: true
+ keepAlive: true
+ maxPoolPreparedStatementPerConnectionSize: 20
+ useGlobalDataSourceStat: true
+ connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
+ filter:
+ wall:
+ config:
+ multi-statement-allow: true
+
+# mybatis-plus閰嶇疆
+mybatis-plus:
+ global-config:
+ db-config:
+ id-type: INPUT
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ map-underscore-to-camel-case: true
+ jdbc-type-for-null: 'null'
+ type-aliases-package: com.hk.DeviceReceiving.entity.*
+ mapper-locations: classpath:mapper/*.xml
\ No newline at end of file
diff --git a/src/main/resources/mapper/DevMacByclMapper.xml b/src/main/resources/mapper/DevMacByclMapper.xml
new file mode 100644
index 0000000..d258c39
--- /dev/null
+++ b/src/main/resources/mapper/DevMacByclMapper.xml
@@ -0,0 +1,9 @@
+<?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.hk.NumericalCollection.mapper.DevMacByclMapper">
+
+
+</mapper>
+
diff --git a/src/main/resources/mapper/DevMachineMapper.xml b/src/main/resources/mapper/DevMachineMapper.xml
new file mode 100644
index 0000000..bf0565e
--- /dev/null
+++ b/src/main/resources/mapper/DevMachineMapper.xml
@@ -0,0 +1,7 @@
+<?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.hk.NumericalCollection.mapper.DevMachineMapper">
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceByclMapper.xml b/src/main/resources/mapper/DeviceByclMapper.xml
new file mode 100644
index 0000000..fc39719
--- /dev/null
+++ b/src/main/resources/mapper/DeviceByclMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.DeviceByclMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceErrorMapper.xml b/src/main/resources/mapper/DeviceErrorMapper.xml
new file mode 100644
index 0000000..68b002e
--- /dev/null
+++ b/src/main/resources/mapper/DeviceErrorMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.DeviceErrorMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceMapper.xml b/src/main/resources/mapper/DeviceMapper.xml
new file mode 100644
index 0000000..2df6400
--- /dev/null
+++ b/src/main/resources/mapper/DeviceMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.DeviceMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceMetricsMapper.xml b/src/main/resources/mapper/DeviceMetricsMapper.xml
new file mode 100644
index 0000000..7fe546d
--- /dev/null
+++ b/src/main/resources/mapper/DeviceMetricsMapper.xml
@@ -0,0 +1,7 @@
+<?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.hk.NumericalCollection.mapper.DeviceMetricsMapper">
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceStatusByclMapper.xml b/src/main/resources/mapper/DeviceStatusByclMapper.xml
new file mode 100644
index 0000000..11958b4
--- /dev/null
+++ b/src/main/resources/mapper/DeviceStatusByclMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.DeviceStatusByclMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/DeviceStatusMapper.xml b/src/main/resources/mapper/DeviceStatusMapper.xml
new file mode 100644
index 0000000..9d7b2a1
--- /dev/null
+++ b/src/main/resources/mapper/DeviceStatusMapper.xml
@@ -0,0 +1,21 @@
+<?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.hk.NumericalCollection.mapper.DeviceStatusMapper">
+
+ <select id="selectSumToDayOutPutByOrder" resultType="java.lang.Integer">
+ select count(1)
+ from device_status
+ where EDIT_DATE = #{editDate}
+ and DEV_NO = #{devNo}
+ and ORDER_NO = #{orderNo}
+ </select>
+
+ <update id="updateTodayOutput">
+ update device_status
+ set TODAY_OUTPUT = TODAY_OUTPUT + #{increment}
+ where EDIT_DATE = #{editDate}
+ and ORDER_NO = #{orderNo}
+ </update>
+</mapper>
diff --git a/src/main/resources/mapper/DevicedatastandardmoditemMapper.xml b/src/main/resources/mapper/DevicedatastandardmoditemMapper.xml
new file mode 100644
index 0000000..ea31e10
--- /dev/null
+++ b/src/main/resources/mapper/DevicedatastandardmoditemMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.DevicedatastandardmoditemMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/MesNumericalByclMapper.xml b/src/main/resources/mapper/MesNumericalByclMapper.xml
new file mode 100644
index 0000000..0950ebb
--- /dev/null
+++ b/src/main/resources/mapper/MesNumericalByclMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.MesNumericalByclMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/MesNumericalMapper.xml b/src/main/resources/mapper/MesNumericalMapper.xml
new file mode 100644
index 0000000..5cc65a0
--- /dev/null
+++ b/src/main/resources/mapper/MesNumericalMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.MesNumericalMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/MesOrderSelectMapper.xml b/src/main/resources/mapper/MesOrderSelectMapper.xml
new file mode 100644
index 0000000..48f4bbf
--- /dev/null
+++ b/src/main/resources/mapper/MesOrderSelectMapper.xml
@@ -0,0 +1,7 @@
+<?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.hk.NumericalCollection.mapper.MesOrderSelectMapper">
+
+</mapper>
diff --git a/src/main/resources/mapper/MesOrderStaMapper.xml b/src/main/resources/mapper/MesOrderStaMapper.xml
new file mode 100644
index 0000000..491a5e8
--- /dev/null
+++ b/src/main/resources/mapper/MesOrderStaMapper.xml
@@ -0,0 +1,7 @@
+<?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.hk.NumericalCollection.mapper.MesOrderStaMapper">
+
+</mapper>
diff --git a/src/main/resources/mapper/VOrderDetailMapper.xml b/src/main/resources/mapper/VOrderDetailMapper.xml
new file mode 100644
index 0000000..0c283b4
--- /dev/null
+++ b/src/main/resources/mapper/VOrderDetailMapper.xml
@@ -0,0 +1,7 @@
+<?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.hk.NumericalCollection.mapper.VOrderDetailMapper">
+
+</mapper>
diff --git a/src/main/resources/mapper/VOrderMapper.xml b/src/main/resources/mapper/VOrderMapper.xml
new file mode 100644
index 0000000..ea67ece
--- /dev/null
+++ b/src/main/resources/mapper/VOrderMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.VOrderMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/WomcaaMapper.xml b/src/main/resources/mapper/WomcaaMapper.xml
new file mode 100644
index 0000000..9a30c72
--- /dev/null
+++ b/src/main/resources/mapper/WomcaaMapper.xml
@@ -0,0 +1,8 @@
+<?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.hk.NumericalCollection.mapper.WomcaaMapper">
+
+
+</mapper>
diff --git a/src/main/resources/mapper/WomdaaMapper.xml b/src/main/resources/mapper/WomdaaMapper.xml
new file mode 100644
index 0000000..e889960
--- /dev/null
+++ b/src/main/resources/mapper/WomdaaMapper.xml
@@ -0,0 +1,24 @@
+<?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.hk.NumericalCollection.mapper.WomdaaMapper">
+
+
+ <select id="getMinusDaa001" resultType="com.hk.NumericalCollection.entity.Womdaa">
+ select *
+ from WOMDAA
+ where id in (select id
+ from WOMDAA
+ where address_code = 'XF'
+ and DAA018 = '寮�宸�'
+ and DAA008 != DAA011
+ and DAA019 = 1
+ and to_date(daa024, 'yyyy-mm-dd hh24:mi:ss') > sysdate - 180
+ and to_number(MACHINE_NO) <= 23
+ minus
+ select ORDER_ID
+ from MES_ORDER_SELECT
+ where EDIT_DATE = #{editDate})
+ </select>
+</mapper>
diff --git a/src/test/java/com/hk/NumericalCollection/DeviceReceivingApplicationTests.java b/src/test/java/com/hk/NumericalCollection/DeviceReceivingApplicationTests.java
new file mode 100644
index 0000000..a1c7395
--- /dev/null
+++ b/src/test/java/com/hk/NumericalCollection/DeviceReceivingApplicationTests.java
@@ -0,0 +1,177 @@
+package com.hk.NumericalCollection;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.hk.NumericalCollection.config.DataAcquisitionConfiguration;
+import com.hk.NumericalCollection.dto.NumbericalDto;
+import com.hk.NumericalCollection.entity.DevMacBycl;
+import com.hk.NumericalCollection.entity.DevMachine;
+import com.hk.NumericalCollection.service.*;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+
+@SpringBootTest
+class DeviceReceivingApplicationTests {
+
+ @Autowired
+ private ApiService apiService;
+ @Autowired
+ private INumericalService numericalService;
+ @Autowired
+ private DeviceMetricsService deviceMetricsService;
+ @Autowired
+ private MesNumericalService mesNumericalServicen;
+ @Autowired
+ private MesOrderSelectService orderSelectService;
+ @Autowired
+ private DevMachineService devMachineService;
+ @Autowired
+ private DevMacByclService devMacByclService;
+ @Autowired
+ private MesNumericalService mesNumericalService;
+
+ @Autowired
+ private WomdaaService womdaaService;
+
+ @Autowired
+ private INumericalNoOrderService numericalNoOrderService;
+
+ @Test
+ void contextLoads() {
+ //FFFFFFFE
+ long decimal = Long.parseLong("FFFFFFFE", 16); // 灏�16杩涘埗瀛楃涓茶浆鎹负long绫诲瀷鐨�10杩涘埗鏁�
+ BigDecimal a = new BigDecimal(String.valueOf((int) decimal));
+ BigDecimal b = new BigDecimal("1000");
+ BigDecimal c = a.divide(b, 3, RoundingMode.HALF_UP);
+ System.out.println(c);
+ }
+
+ @Test
+ void getDeviceDayCount() throws IOException {
+ DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -1);
+ String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd");
+ try {
+ List<DevMachine> list = devMachineService.list();
+ for (DevMachine s : list) {
+ numericalService.getDeviceDayCount(s.getDevNo(), format);
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ //
+ //numericalService.getDeviceDayCount("862858070704174_1", "2025-04-22");
+ }
+
+ @Test
+ void getMesNumerical() throws IOException {
+ DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -7);
+ String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd");
+ System.out.println(format);
+ }
+
+ @Test
+ public void getDeviceRealTimeData() throws Exception {
+// List<DevMachine> list = devMachineService.list();
+// list.forEach(s -> {
+// try {
+// numericalService.getDeviceRealTimeData(s.getDevNo());
+// } catch (Exception e) {
+// throw new RuntimeException(e);
+// }
+// });
+
+// numericalService.getDeviceRealTimeData("868371072149251_1");
+
+
+// numericalService.getDeviceRealTimeDataBycl("866042075016340");
+ List<DevMacBycl> list = devMacByclService.list();
+ list.forEach(s -> {
+ try {
+ numericalService.getDeviceRealTimeDataBycl(s.getDevNo());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+ }
+
+ //deviceMetricsService.manualSynchronizationBycl(barcode)
+ @Test
+ public void get1() throws Exception {
+ NumbericalDto barcode = new NumbericalDto();
+ barcode.setMachineNo("C05");
+ barcode.setOrderId(7890268L);
+ deviceMetricsService.manualSynchronizationBycl(barcode);
+ }
+
+ @Test
+ public void SoDeviceList() {
+ try {
+ boolean b = numericalService.SoDeviceList();
+ if (b) {
+ System.out.println("璁惧鍩虹淇℃伅鑾峰彇鎴愬姛");
+ } else {
+ System.out.println("璁惧鍩虹淇℃伅鑾峰彇澶辫触");
+ }
+ } catch (IOException e) {
+ // Handle the exception
+ e.printStackTrace();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * 娴嬭瘯鑾峰彇璁惧鏁呴殰鍒楄〃
+ */
+ @Test
+ public void testGetDeviceErrorList() throws Exception {
+ // 璁剧疆娴嬭瘯鍙傛暟
+ String uid = "864606067274372"; // 璁惧缂栧彿
+ String startDate = "2024-01-01"; // 寮�濮嬫棩鏈�
+ String endDate = "2024-12-31"; // 缁撴潫鏃ユ湡
+
+ try {
+ // 璋冪敤鏂规硶鑾峰彇璁惧鏁呴殰鍒楄〃
+ numericalNoOrderService.getDeviceErrorList(uid, startDate, endDate);
+ System.out.println("璁惧鏁呴殰鍒楄〃鑾峰彇鎴愬姛");
+ } catch (Exception e) {
+ System.err.println("璁惧鏁呴殰鍒楄〃鑾峰彇澶辫触: " + e.getMessage());
+ throw e;
+ }
+ }
+
+ /**
+ * 娴嬭瘯鎵归噺鑾峰彇鎵�鏈夎澶囩殑鏁呴殰鍒楄〃
+ */
+ @Test
+ public void testGetAllDeviceErrorList() throws Exception {
+ DateTime yesterday = DateUtil.yesterday();
+ DateTime startDateTime = DateUtil.parse(DateUtil.format(yesterday, "yyyy-MM-dd") + " 07:30:00");
+ DateTime endDateTime = DateUtil.parse(DateUtil.format(DateUtil.date(), "yyyy-MM-dd") + " 07:30:00");
+
+ String startDate = DateUtil.format(startDateTime, "yyyy-MM-dd HH:mm:ss");
+ String endDate = DateUtil.format(endDateTime, "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ List<DevMachine> list = devMachineService.list();
+ for (DevMachine machine : list) {
+ numericalNoOrderService.getDeviceErrorList(machine.getDevNo(), startDate, endDate);
+ System.out.println("璁惧 " + machine.getDevNo() + " 鏁呴殰鍒楄〃鑾峰彇鎴愬姛");
+ }
+ } catch (Exception e) {
+ System.err.println("鎵归噺鑾峰彇璁惧鏁呴殰鍒楄〃澶辫触: " + e.getMessage());
+ throw e;
+ }
+ }
+
+ @Test
+ public void tt(){
+ System.out.println(String.format(DataAcquisitionConfiguration.ASK_DATA_URL, DataAcquisitionConfiguration.APP_ID));
+ }
+}
--
Gitblit v1.9.3