From 730a25580b579ab32e0eae53fa4ae8aaa15c2d14 Mon Sep 17 00:00:00 2001
From: dubin <dubin>
Date: 星期二, 19 八月 2025 16:33:41 +0800
Subject: [PATCH] 联调

---
 src/main/java/com/zy/system/entity/LicenseInfos.java                  |   56 ++++++++++++++
 src/main/resources/mapper/asrs/LicenseInfosMapper.xml                 |   18 ++++
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java           |    3 
 src/main/java/com/zy/system/service/LicenseInfosService.java          |   10 ++
 src/main/java/com/zy/system/mapper/LicenseInfosMapper.java            |   14 +++
 pom.xml                                                               |    2 
 src/main/java/com/zy/core/thread/SiemensDevpThread.java               |   30 +++---
 src/main/resources/application.yml                                    |   40 +++++-----
 src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java |   16 ++++
 9 files changed, 152 insertions(+), 37 deletions(-)

diff --git a/pom.xml b/pom.xml
index 89481ec..681c826 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
 
     <properties>
         <java.version>1.8</java.version>
-        <cool.version>3.4.5</cool.version>
+        <cool.version>3.4.0</cool.version>
         <mysql-driver.version>5.1.47</mysql-driver.version>
         <mybatis-plus.version>2.3.2</mybatis-plus.version>
         <fastjson.version>1.2.58</fastjson.version>
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 2d1f0c6..af35f34 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -194,7 +194,8 @@
                         && staProtocol.isLoading()
                         && staProtocol.isInEnable()
                         && !staProtocol.isEmptyMk()
-                        && staProtocol.isPakMk()) {
+                        && staProtocol.isPakMk()
+                        && staProtocol.getWorkNo()==9999) {
                     if (Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                         News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
 
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index e1f0dca..1e2777a 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -7,12 +7,9 @@
 import com.alibaba.fastjson.JSON;
 import com.core.common.Cools;
 import com.core.common.DateUtils;
-import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.BasDevp;
-import com.zy.asrs.entity.BasRgvMap;
 import com.zy.asrs.service.BasDevpService;
-import com.zy.asrs.service.BasRgvMapService;
 import com.zy.common.utils.News;
 import com.zy.core.DevpThread;
 import com.zy.core.cache.MessageQueue;
@@ -28,7 +25,10 @@
 import lombok.extern.slf4j.Slf4j;
 
 import java.text.MessageFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
@@ -49,10 +49,10 @@
 //    }};
     public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
         add(101);add(102);add(103);
-        add(201);add(202);add(203);
+        add(104);add(105);
     }};
 
-    public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
+    /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
         add(101);add(102);add(103);
         add(104);add(105);add(106);add(107);
         add(108);add(109);
@@ -62,7 +62,7 @@
         add(208);add(209);add(210);add(211);
 
         add(401);add(402);add(403);add(404);
-    }};
+    }};*/
 
     public static final ArrayList<Integer> BarcodeList1 = new ArrayList<Integer>() {{
         add(1); add(2);add(3);add(4);add(5);
@@ -72,14 +72,14 @@
         add(6);add(7);add(8);add(9);
         add(10); add(11); add(12); add(13);
     }};
-    public static final ArrayList<Integer> staNosErrList2 = new ArrayList<Integer>() {{
+    /*public static final ArrayList<Integer> staNosErrList2 = new ArrayList<Integer>() {{
         add(102); add(105);add(107);add(109);
         add(203);add(205);add(208);add(211);
-    }};
+    }};*/
 
     public static final ArrayList<Integer> staNosErrList1 = new ArrayList<Integer>() {{
-        add(123);
-        add(223);add(225);add(228);add(231);
+        add(101);
+        add(102);add(103);add(104);add(105);
     }};
 
     public static final ArrayList<Integer> staNoWeight1 = new ArrayList<Integer>() {{
@@ -119,8 +119,8 @@
         switch (slave.getId()) {
             case 1:
                 return staNosErrList1;
-            case 2:
-                return staNosErrList2;
+            /*case 2:
+                return staNosErrList2;*/
             default:
                 throw new CoolException("鏈嶅姟鍣ㄥ紓甯�");
         }
@@ -141,8 +141,8 @@
         switch (slave.getId()) {
             case 1:
                 return staNos1;
-            case 2:
-                return staNos2;
+            /*case 2:
+                return staNos2;*/
             default:
                 throw new CoolException("鏈嶅姟鍣ㄥ紓甯�");
         }
diff --git a/src/main/java/com/zy/system/entity/LicenseInfos.java b/src/main/java/com/zy/system/entity/LicenseInfos.java
new file mode 100644
index 0000000..dafec6d
--- /dev/null
+++ b/src/main/java/com/zy/system/entity/LicenseInfos.java
@@ -0,0 +1,56 @@
+package com.zy.system.entity;
+
+import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotations.TableField;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableName;
+import java.io.Serializable;
+
+@Data
+@TableName("sys_license_infos")
+public class LicenseInfos implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value= "")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value= "")
+    private String license;
+
+    @ApiModelProperty(value= "")
+    private String licenseTime;
+
+    @ApiModelProperty(value= "")
+    @TableField("create_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    public LicenseInfos() {}
+
+    public LicenseInfos(String license,Date createTime) {
+        this.license = license;
+        this.createTime = createTime;
+    }
+
+//    LicenseInfos licenseInfos = new LicenseInfos(
+//            null,    // 
+//            null    // 
+//    );
+
+    public String getCreateTime$(){
+        if (Cools.isEmpty(this.createTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+    }
+
+
+}
diff --git a/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java b/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java
new file mode 100644
index 0000000..2e51ff1
--- /dev/null
+++ b/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java
@@ -0,0 +1,14 @@
+package com.zy.system.mapper;
+
+import com.zy.system.entity.LicenseInfos;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface LicenseInfosMapper extends BaseMapper<LicenseInfos> {
+
+    LicenseInfos getLatestLicense();
+
+}
diff --git a/src/main/java/com/zy/system/service/LicenseInfosService.java b/src/main/java/com/zy/system/service/LicenseInfosService.java
new file mode 100644
index 0000000..dc3dc04
--- /dev/null
+++ b/src/main/java/com/zy/system/service/LicenseInfosService.java
@@ -0,0 +1,10 @@
+package com.zy.system.service;
+
+import com.zy.system.entity.LicenseInfos;
+import com.baomidou.mybatisplus.service.IService;
+
+public interface LicenseInfosService extends IService<LicenseInfos> {
+
+    LicenseInfos getLatestLicense();
+
+}
diff --git a/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java b/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java
new file mode 100644
index 0000000..2a6b9b3
--- /dev/null
+++ b/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java
@@ -0,0 +1,16 @@
+package com.zy.system.service.impl;
+
+import com.zy.system.mapper.LicenseInfosMapper;
+import com.zy.system.entity.LicenseInfos;
+import com.zy.system.service.LicenseInfosService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("licenseInfosService")
+public class LicenseInfosServiceImpl extends ServiceImpl<LicenseInfosMapper, LicenseInfos> implements LicenseInfosService {
+
+    @Override
+    public LicenseInfos getLatestLicense() {
+        return this.baseMapper.getLatestLicense();
+    }
+}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 127cb86..5930104 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -63,28 +63,28 @@
     # 鍫嗗灈鏈哄叆搴撶珯鐐�
     crnInStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 102
-      row: 1
+      staNo: 101
+      row: 2
       bay: 1
       lev: 1
     # 鍫嗗灈鏈哄嚭搴撶珯鐐�
     crnOutStn[0]:
       devpPlcId: ${wcs-slave.devp[0].id}
       staNo: 101
-      row: 1
+      row: 2
       bay: 1
       lev: 1
     # 鍫嗗灈鏈哄嚭搴撶珯鐐�
     crnOutStn[1]:
       devpPlcId: ${wcs-slave.devp[0].id}
-      staNo: 104
-      row: 1
+      staNo: 105
+      row: 3
       bay: 1
       lev: 1
   # plc
   devp[0]:
     id: 1
-    ip: 10.10.10.144
+    ip: 10.10.10.120
     port: 102
     rack: 0
     slot: 0
@@ -92,7 +92,7 @@
     inSta[0]:
       staNo: 102
       barcode: ${wcs-slave.barcode[0].id}
-      backSta: 101
+      backSta: 103
       led: ${wcs-slave.led[0].id}
 #    # 鍏ュ簱鍙�2
 #    inSta[1]:
@@ -102,10 +102,10 @@
 #      led: ${wcs-slave.led[1].id}
     # 鎷f枡鍏ュ簱鍙�1
     pickSta[0]:
-      staNo: 223
+      staNo: 105
       barcode: ${wcs-slave.barcode[0].id}
-      led: ${wcs-slave.led[0].id}
-      backSta: 222
+      led: ${wcs-slave.led[1].id}
+      backSta: 104
 #    # 鎷f枡鍏ュ簱鍙�2
 #    pickSta[1]:
 #      staNo: 225
@@ -114,19 +114,19 @@
 #      backSta: 224
     # 绌烘澘鍏ュ簱鍙�1
     emptyInSta[0]:
-      staNo: 123
+      staNo: 102
       barcode: ${wcs-slave.barcode[0].id}
-      backSta: 122
+      backSta: 103
       led: ${wcs-slave.led[0].id}
     # 绌烘澘鍏ュ簱鍙�2
-    emptyInSta[1]:
-      staNo: 223
-      barcode: ${wcs-slave.barcode[0].id}
-      backSta: 222
-      led: ${wcs-slave.led[1].id}
+    #emptyInSta[1]:
+      #staNo: 223
+      #barcode: ${wcs-slave.barcode[0].id}
+      #backSta: 222
+      #led: ${wcs-slave.led[1].id}
     # 鍑哄簱鍙�1
     outSta[0]:
-      staNo: 121
+      staNo: 104
   # 鏉$爜鎵弿浠�1
   barcode[0]:
     id: 1
@@ -138,12 +138,12 @@
     ip: 10.10.10.51
     port: 5005
     devpPlcId: ${wcs-slave.devp[0].id}
-    staArr: 121
+    staArr: 102
   # LED2
   led[1]:
     id: 123
     ip: 10.10.10.52
     port: 5005
     devpPlcId: ${wcs-slave.devp[0].id}
-    staArr: 123
+    staArr: 104
 
diff --git a/src/main/resources/mapper/asrs/LicenseInfosMapper.xml b/src/main/resources/mapper/asrs/LicenseInfosMapper.xml
new file mode 100644
index 0000000..6274069
--- /dev/null
+++ b/src/main/resources/mapper/asrs/LicenseInfosMapper.xml
@@ -0,0 +1,18 @@
+<?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.zy.system.mapper.LicenseInfosMapper">
+
+    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+    <resultMap id="BaseResultMap" type="com.zy.system.entity.LicenseInfos">
+        <id column="id" property="id" />
+        <result column="license" property="license" />
+        <result column="license_time" property="licenseTime" />
+        <result column="create_time" property="createTime" />
+
+    </resultMap>
+
+    <select id="getLatestLicense" resultMap="BaseResultMap">
+        select top 1 * from sys_license_infos order by create_time desc
+    </select>
+
+</mapper>

--
Gitblit v1.9.1