From 2344514290d3f9bea98b1ac8dca4f02b924a865d Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期二, 06 五月 2025 15:12:22 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/enums/RgvStatusType.java                   |    6 
 src/main/java/com/zy/system/controller/LicenseCreatorController.java |    3 
 src/main/java/com/zy/core/thread/RgvThread.java                      |   17 ++-
 src/main/java/com/zy/system/entity/license/LicenseCheckListener.java |    6 +
 src/main/java/com/zy/common/web/AuthController.java                  |   12 +-
 src/main/java/com/zy/core/enums/RgvModeType.java                     |    8 
 src/main/resources/application-prod.yml                              |    2 
 pom.xml                                                              |    7 +
 src/main/java/com/zy/core/thread/SiemensDevpThread.java              |    6 
 src/main/resources/application.yml                                   |    2 
 src/main/webapp/views/deviceOperate/rgvOperate.html                  |  199 +++++++++++++++++++++++++++++++++++++++
 11 files changed, 245 insertions(+), 23 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0702162..41a06af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -211,6 +211,13 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/com/zy/common/web/AuthController.java b/src/main/java/com/zy/common/web/AuthController.java
index e616094..a6399f9 100644
--- a/src/main/java/com/zy/common/web/AuthController.java
+++ b/src/main/java/com/zy/common/web/AuthController.java
@@ -53,12 +53,12 @@
     @RequestMapping("/login.action")
     @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "鐧诲綍")
     public R loginAction(String mobile, String password){
-        //楠岃瘉璁稿彲璇佹槸鍚︽湁鏁�
-        LicenseVerify licenseVerify = new LicenseVerify();
-        boolean verify = licenseVerify.verify();
-        if (!verify) {//璁稿彲璇佸凡澶辨晥
-            return R.parse(CodeRes.SYSTEM_20001);
-        }
+//        //楠岃瘉璁稿彲璇佹槸鍚︽湁鏁�
+//        LicenseVerify licenseVerify = new LicenseVerify();
+//        boolean verify = licenseVerify.verify();
+//        if (!verify) {//璁稿彲璇佸凡澶辨晥
+//            return R.parse(CodeRes.SYSTEM_20001);
+//        }
         if (mobile.equals("super") && password.equals(Cools.md5(superPwd))) {
             Map<String, Object> res = new HashMap<>();
             res.put("username", mobile);
diff --git a/src/main/java/com/zy/core/enums/RgvModeType.java b/src/main/java/com/zy/core/enums/RgvModeType.java
index ec6fcb3..0905b52 100644
--- a/src/main/java/com/zy/core/enums/RgvModeType.java
+++ b/src/main/java/com/zy/core/enums/RgvModeType.java
@@ -3,10 +3,10 @@
 public enum RgvModeType {
 
     NONE(-1, "绂荤嚎"),
-    STOP(0, "缁翠慨"),
-    HAND(1, "鎵嬪姩"),
-    HALF_AUTO(2, "鍗婅嚜鍔�"),
-    AUTO(3, "鑷姩"),
+    STOP(1, "缁翠慨"),
+    HAND(0, "鎵嬪姩"),
+    HALF_AUTO(3, "鍗婅嚜鍔�"),
+    AUTO(2, "鑷姩"),
     OTHER(100, "鍏跺畠"),
     ;
 
diff --git a/src/main/java/com/zy/core/enums/RgvStatusType.java b/src/main/java/com/zy/core/enums/RgvStatusType.java
index a43b3cd..1196fbd 100644
--- a/src/main/java/com/zy/core/enums/RgvStatusType.java
+++ b/src/main/java/com/zy/core/enums/RgvStatusType.java
@@ -3,10 +3,10 @@
 public enum RgvStatusType {
 
     NONE(-1, "绂荤嚎"),
-    IDLE(0, "绌洪棽"),
+    IDLE(1, "绌洪棽"),
     ROAM(100000, "婕父"),
-    WORKING(1, "浣滀笟涓�"),
-    SOS(2, "鎶ヨ"),
+    WORKING(2, "浣滀笟涓�"),
+    SOS(3, "鎶ヨ"),
     FETCHING(11, "鍙栬揣涓�"),
     PUTTING(12, "鏀捐揣涓�"),
     WAITING(90, "浠诲姟瀹屾垚绛夊緟WCS纭"),
diff --git a/src/main/java/com/zy/core/thread/RgvThread.java b/src/main/java/com/zy/core/thread/RgvThread.java
index f8cc43d..5c1f010 100644
--- a/src/main/java/com/zy/core/thread/RgvThread.java
+++ b/src/main/java/com/zy/core/thread/RgvThread.java
@@ -83,7 +83,7 @@
             new Thread(this::taskWalkIssued).start();
 
             // 鍚姩浠诲姟瀹屾垚绾跨▼
-            new Thread(this::taskComplete).start();
+//            new Thread(this::taskComplete).start();
         }
     }
 
@@ -425,7 +425,7 @@
      */
     private void readStatus() {
         try {
-            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 34);
+            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 18);
             if (result.IsSuccess) {
                 // 鏋勫缓璁惧鐘舵�佸璞�
                 RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getId());
@@ -433,10 +433,15 @@
                     rgvProtocol = new RgvProtocol();
                     rgvProtocol.setRgvNo(slave.getId());
                 }
-                rgvProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 0));
-                rgvProtocol.setStatus(siemensNet.getByteTransform().TransInt16(result.Content, 2));
-                rgvProtocol.setRgvPos(siemensNet.getByteTransform().TransUInt32(result.Content, 10));
-                rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 20));
+
+                rgvProtocol.setRgvPos((long)siemensNet.getByteTransform().TransInt32(result.Content, 0));
+                rgvProtocol.setRgvPosDestination((long)siemensNet.getByteTransform().TransInt32(result.Content, 4));
+                rgvProtocol.setStatus(siemensNet.getByteTransform().TransInt16(result.Content, 8));
+                rgvProtocol.setTaskNo((long)siemensNet.getByteTransform().TransInt32(result.Content, 10));
+
+                rgvProtocol.setRgvNo((int)siemensNet.getByteTransform().TransInt16(result.Content, 14));
+                rgvProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 16));
+//                rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 20));
 //                rgvProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 28));
 //                rgvProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 40));
 //                rgvProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 48));
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 6972c16..16030f6 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -46,7 +46,9 @@
     private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
     private short heartBeatVal = 1;
     public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
-        add(100);add(101);add(102);add(103);add(104);add(105);add(106);add(107);
+        add(1000);add(1001);add(1002);add(1003);add(1004);add(1005);add(1006);add(1007);
+        add(1008);add(1009);add(1010);add(1011);add(1012);add(1013);add(1014);add(1015);
+        add(1016);add(1017);add(1018);add(1019);add(1020);add(1021);add(1022);add(1023);
     }};
 
     /**
@@ -206,7 +208,7 @@
 
         //鏉$爜
         Thread.sleep(200);
-        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840.0",(short) (barcodeSize*8));
+        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.100.0",(short) (barcodeSize*8));
         if (result2.IsSuccess) {
             for (int i = 0; i < barcodeSize; i++) {
                 String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
diff --git a/src/main/java/com/zy/system/controller/LicenseCreatorController.java b/src/main/java/com/zy/system/controller/LicenseCreatorController.java
index 0aafb3b..8b776d2 100644
--- a/src/main/java/com/zy/system/controller/LicenseCreatorController.java
+++ b/src/main/java/com/zy/system/controller/LicenseCreatorController.java
@@ -61,6 +61,9 @@
      */
     @RequestMapping(value = "/getLicenseDays")
     public R getLicenseDays() {
+        if (true){
+            return R.ok().add(9999);
+        }
         LicenseVerify licenseVerify = new LicenseVerify();
         LicenseContent verifyInfo = licenseVerify.getVerifyInfo();
         if (verifyInfo == null) {
diff --git a/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java b/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
index 1659df2..f90c043 100644
--- a/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
+++ b/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
@@ -62,6 +62,12 @@
     public boolean loadLicense() {
         if(!Cools.isEmpty(licensePath)){
             logger.info("++++++++ 寮�濮嬪姞杞借鍙瘉 ++++++++");
+            if (true){
+
+                logger.info("++++++++ 璁稿彲璇佸姞杞界粨鏉� ++++++++");
+
+                return true;
+            }
 
             try {
                 String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath();
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
index f1b84ca..f4d906c 100644
--- a/src/main/resources/application-prod.yml
+++ b/src/main/resources/application-prod.yml
@@ -49,7 +49,7 @@
   # RGV绌挎杞�1
   rgv[0]:
     id: 1
-    ip: 192.168.4.250
+    ip: 10.10.10.49
     port: 502
     rack: 0
     slot: 0
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 675568e..1fe8ce6 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -12,7 +12,7 @@
 #    username: sa
 #    password: sa@123
     driver-class-name: dm.jdbc.driver.DmDriver
-    url: jdbc:dm://127.0.0.1:5236/SOURCE
+    url: jdbc:dm://10.10.10.201:5236/SOURCE
     username: SYSDBA
     password: Zy@12345
   mvc:
diff --git a/src/main/webapp/views/deviceOperate/rgvOperate.html b/src/main/webapp/views/deviceOperate/rgvOperate.html
new file mode 100644
index 0000000..8dd7e98
--- /dev/null
+++ b/src/main/webapp/views/deviceOperate/rgvOperate.html
@@ -0,0 +1,199 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+	<meta charset="UTF-8">
+	<title>杈撻�佺珯鐐硅澶�</title>
+	<link rel="stylesheet" href="../../static/wcs/css/element.css">
+	<script type="text/javascript" src="../../static/wcs/js/jquery/jquery-3.3.1.min.js"></script>
+	<script type="text/javascript" src="../../static/wcs/js/common.js"></script>
+	<script type="text/javascript" src="../../static/wcs/js/vue.min.js"></script>
+	<script type="text/javascript" src="../../static/wcs/js/element.js"></script>
+</head>
+
+<body>
+	<div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
+		<div style="width: 100%;">
+			<el-table ref="singleTable" :data="tableData" highlight-current-row @row-click="handleRowClick"
+				max-height="450" style="width: 100%">
+				<el-table-column property="devNo" label="绔欏彿">
+				</el-table-column>
+				<el-table-column property="workNo" label="宸ヤ綔鍙�">
+				</el-table-column>
+				<el-table-column property="locType1" label="楂樹綆搴撲綅">
+				</el-table-column>
+				<el-table-column property="pakMk" label="鍏ュ簱鏍囪">
+				</el-table-column>
+			</el-table>
+		</div>
+
+		<div style="width: 100%;display: flex;justify-content: center;margin-top: 10px;">
+			<div style="width: 55%;margin-right: 10px;">
+				<el-card class="box-card">
+					<div slot="header" class="clearfix">
+						<span>璁惧璋冭瘯</span>
+					</div>
+					<div>
+						<el-form :model="formParam" label-position="top" :inline="true" class="demo-form-inline">
+							<el-form-item label="宸ヤ綔鍙�">
+								<el-input v-model="formParam.workNo" placeholder="宸ヤ綔鍙�"></el-input>
+							</el-form-item>
+							<el-form-item label="鐩爣绔�">
+								<el-input v-model="formParam.staNo" placeholder="鐩爣绔�"></el-input>
+							</el-form-item>
+							<el-form-item label="鍏ュ簱鏍囪">
+								<el-input v-model="formParam.pakMk" placeholder="鍏ュ簱鏍囪"></el-input>
+							</el-form-item>
+						</el-form>
+						<el-form label-position="top" :inline="true" class="demo-form-inline">
+							<el-form-item label="">
+								<el-checkbox v-model="formParam.inEnable">鍙叆</el-checkbox>
+							</el-form-item>
+							<el-form-item label="">
+								<el-checkbox v-model="formParam.outEnable">鍙嚭</el-checkbox>
+							</el-form-item>
+						</el-form>
+						<div>
+							<el-button @click="requestOperate('update')" type="primary">鏇存柊</el-button>
+							<el-button @click="requestOperate('out')" type="warning">鍙栬揣瀹屾垚</el-button>
+							<el-button @click="requestOperate('in')" type="warning">鏀捐揣瀹屾垚</el-button>
+						</div>
+					</div>
+				</el-card>
+			</div>
+			<div style="width: 45%;">
+				<el-card class="box-card">
+					<div slot="header" class="clearfix">
+						<span>璁惧鐘舵��</span>
+					</div>
+					<div>
+						<div v-if="currentIndex == null">
+							<el-empty description="璇烽�夋嫨璁惧"></el-empty>
+						</div>
+						<div v-else>
+							<el-descriptions :title="currentTitle" direction="vertical" :column="4" border>
+								<el-descriptions-item label="绔欑偣">{{ tableData[currentIndex].devNo }}
+								</el-descriptions-item>
+								<el-descriptions-item label="宸ヤ綔鍙�">
+									{{ tableData[currentIndex].workNo }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鑷姩">{{ tableData[currentIndex].autoing }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鏈夌墿">{{ tableData[currentIndex].loading }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鍙叆">{{ tableData[currentIndex].inEnable }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鍙嚭">{{ tableData[currentIndex].outEnable }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鍏ュ簱鏍囪">{{ tableData[currentIndex].pakMk }}
+								</el-descriptions-item>
+								<el-descriptions-item label="绌烘澘淇″彿">{{ tableData[currentIndex].emptyMk }}
+								</el-descriptions-item>
+								<el-descriptions-item label="鐩爣绔�">{{ tableData[currentIndex].staNo }}
+								</el-descriptions-item>
+								<el-descriptions-item label="楂樹綆搴撲綅">{{ tableData[currentIndex].locType1 }}
+								</el-descriptions-item>
+							</el-descriptions>
+						</div>
+					</div>
+				</el-card>
+			</div>
+		</div>
+	</div>
+	<script>
+		var app = new Vue({
+			el: '#app',
+			data: {
+				tableData: [],
+				currentRow: null,
+				currentTitle: "鏈�夋嫨璁惧",
+				currentIndex: null,
+				formParam: {
+					devNo: null,
+					workNo: null,
+					staNo: null,
+					pakMk: null,
+					inEnable: false,
+					outEnable: false
+				}
+			},
+			created() {
+				this.init()
+			},
+			watch: {
+
+			},
+			methods: {
+				init() {
+					this.getTableData()
+
+					setInterval(() => {
+						this.getTableData()
+					}, 1000)
+				},
+				handleRowClick(row, col, event) {
+					const index = this.tableData.indexOf(row)
+					this.currentRow = row;
+					this.currentIndex = index
+					this.currentTitle = row.devNo + "绔欑偣"
+					
+					this.formParam.devNo = row.devNo
+					this.formParam.workNo = row.workNo
+					this.formParam.staNo = row.staNo
+					this.formParam.pakMk = row.pakMk
+					this.formParam.inEnable = row.inEnable == "Y" ? true : false
+					this.formParam.outEnable = row.outEnable == "Y" ? true : false
+				},
+				getTableData() {
+					let that = this;
+					$.ajax({
+						url: baseUrl + "/site/list/auth",
+						headers: {
+							'token': localStorage.getItem('token')
+						},
+						data: {},
+						dataType: 'json',
+						contentType: 'application/json;charset=UTF-8',
+						method: 'GET',
+						success: function (res) {
+							that.tableData = res.data
+						}
+					});
+				},
+				requestOperate(method) {
+					let that = this
+					that.$confirm('姝ゆ搷浣滃瓨鍦ㄩ闄╋紝鏄惁缁х画','鎻愮ず',{
+						confirmButtonText: '纭畾',
+						cancelButtonText: '鍙栨秷',
+						type: 'warning'
+					}).then(()=>{
+						$.ajax({
+							url: baseUrl + "/site/detl/"+method,
+							headers: {
+								'token': localStorage.getItem('token')
+							},
+							data: this.formParam,
+							method: 'POST',
+							success: function (res) {
+								if (res.code == 200) {
+									that.$message({
+										message: res.msg,
+										type: 'success'
+									});
+								} else {
+									that.$message({
+										message: res.msg,
+										type: 'error'
+									});
+								}
+							}
+						});
+					})
+
+				}
+			}
+		})
+	</script>
+</body>
+
+</html>
\ No newline at end of file

--
Gitblit v1.9.1