From 6224ea5b671d17dbc666f9f6566f4a7cd51d72a7 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期四, 18 四月 2024 08:11:11 +0800
Subject: [PATCH] 增加测试类,增加实体类和mapper

---
 hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml                        |   24 ++
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/mapper/UpWorkstationMapper.xml               |   23 +
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/JsonFile/PlcLoadGlass.json         |  414 ++++++++++++++++++++++++++++++++++
 hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java       |   39 +++
 hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java |  131 ++++++++++
 hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/entity/UpPattenUsage.java              |   66 +++++
 6 files changed, 697 insertions(+), 0 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/entity/UpPattenUsage.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/entity/UpPattenUsage.java
new file mode 100644
index 0000000..5c94c1e
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/uppattenusage/entity/UpPattenUsage.java
@@ -0,0 +1,66 @@
+package com.mes.uppattenusage.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-04-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class UpPattenUsage implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 鍘熺墖浣跨敤鎯呭喌琛╥d
+     */
+      @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 宸ョ▼鍙�
+     */
+    private Integer engineeringId;
+
+    /**
+     * 鑶滅郴id
+     */
+    private Integer filmsId;
+
+    /**
+     * 瀹�
+     */
+    private Double width;
+
+    /**
+     * 楂�
+     */
+    private Double height;
+
+    /**
+     * 鍘氬害
+     */
+    private Double thickness;
+
+    /**
+     * 鍘熺墖鐗堝浘鐗囧簭
+     */
+    private Integer layoutSequence;
+
+    /**
+     * 鐘舵��
+     */
+    private Integer state;
+
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml
new file mode 100644
index 0000000..decf51f
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.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.mes.pp.mapper.OptimizeProjectMapper">
+
+    <resultMap id="sequenceMap" type="com.mes.uppattenusage.entity.UpPattenUsage">
+        <result property="engineeringId" column="project_no"/>
+        <result property="filmsId" column="glass_type"/>
+        <result property="width" column="width"/>
+        <result property="height" column="height"/>
+        <result property="thickness" column="glass_thickness"/>
+        <result property="layoutSequence" column="heat_layout_sort"/>
+        <result property="state" column="state"/>
+
+    </resultMap>
+
+    <select id="saveProject" parameterType="com.mes.pp.entity.request.OptimizeRequest" resultMap="sequenceMap">
+        select a.project_no, b.glass_type, a.width, a.height, b.glass_thickness, a.heat_layout_sort, 0 as state
+        from optimize_detail a
+                 left join optimize_project b on a.project_no = b.project_no
+        where a.project_no = #{projectNo,jdbcType=VARCHAR}
+    </select>
+
+
+</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/JsonFile/PlcLoadGlass.json b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/JsonFile/PlcLoadGlass.json
new file mode 100644
index 0000000..eed5688
--- /dev/null
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/JsonFile/PlcLoadGlass.json
@@ -0,0 +1,414 @@
+{
+   "plcAddressBegin":"DB14.0",
+   "plcAddressLenght":"208",
+   "dataType":"word",
+   "parameteInfor":[
+      {
+         "codeId": "PLCToMES",  
+         "addressIndex":"0",
+         "addressLenght":"2", 
+         "ratio":"1", 
+         "unit":"m/min"    
+      },
+      {
+          "codeId": "IDStatus1",
+          "addressIndex":"2",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"m/min"      
+       },
+       {
+          "codeId": "IDStatus2",
+          "addressIndex":"4",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"m/min"
+       },
+       {
+          "codeId": "IDStatus3",
+          "addressIndex":"6",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "IDStatus4",
+          "addressIndex":"8",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "IDStatus5",
+          "addressIndex":"10",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "IDStatus6",
+          "addressIndex":"12",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "StautsID1",
+          "addressIndex":"14",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "StautsID2",
+          "addressIndex":"16",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "StautsID3",
+          "addressIndex":"18",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "StautsID4",
+          "addressIndex":"20",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "StautsID5",
+          "addressIndex":"22",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "StautsID6",
+          "addressIndex":"24",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "GaToMES",
+          "addressIndex":"26",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "Height",
+          "addressIndex":"28",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "width",
+          "addressIndex":"30",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "ExportTOMES1",
+          "addressIndex":"32",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       }
+       ,
+       {
+          "codeId": "ExportToMES2",
+          "addressIndex":"34",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       } ,
+       {
+          "codeId": "MESToPLC",
+          "addressIndex":"36",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       } ,
+       {
+          "codeId": "MESID1",
+          "addressIndex":"38",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       } ,
+       {
+          "codeId": "MESID2",
+          "addressIndex":"54",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "MESID3",
+          "addressIndex":"70",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "MESID4",
+          "addressIndex":"86",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "MESID5",
+          "addressIndex":"102",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "MESID6",
+          "addressIndex":"118",
+          "addressLenght":"14",
+          "ratio":"1",
+          "unit":"mm/S"
+       },
+       {
+          "codeId": "MESToPLCStart1",
+          "addressIndex":"134",
+          "addressLenght":"2",
+          "ratio":"1",
+          "unit":"mm/S"
+       },{
+         "codeId": "MESToPLCStart2",
+         "addressIndex":"136",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStart3",
+         "addressIndex":"138",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      }
+      ,{
+         "codeId": "MESToPLCStart4",
+         "addressIndex":"140",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      }
+      ,{
+         "codeId": "MESToPLCStart5",
+         "addressIndex":"142",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      }
+      ,{
+         "codeId": "MESToPLCStart6",
+         "addressIndex":"144",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget1",
+         "addressIndex":"146",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget2",
+         "addressIndex":"148",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget3",
+         "addressIndex":"150",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget4",
+         "addressIndex":"152",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget5",
+         "addressIndex":"154",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCTarget6",
+         "addressIndex":"156",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus1",
+         "addressIndex":"158",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus2",
+         "addressIndex":"160",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus3",
+         "addressIndex":"162",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus4",
+         "addressIndex":"164",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus5",
+         "addressIndex":"166",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToPLCStatus6",
+         "addressIndex":"168",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "MESToGaStatus",
+         "addressIndex":"170",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "A01Err",
+         "addressIndex":"172",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "A02Err",
+         "addressIndex":"174",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "B01Err",
+         "addressIndex":"176",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C01Err",
+         "addressIndex":"178",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C02Err",
+         "addressIndex":"180",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "ErrSpace1",
+         "addressIndex":"182",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "ErrSpace2",
+         "addressIndex":"184",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "ErrSpace3",
+         "addressIndex":"186",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "B01Position",
+         "addressIndex":"188",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C01Position",
+         "addressIndex":"190",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C02Position",
+         "addressIndex":"192",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "DeviceState",
+         "addressIndex":"194",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "AllFVRun",
+         "addressIndex":"196",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "A01State",
+         "addressIndex":"198",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "A02State",
+         "addressIndex":"200",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "B01State",
+         "addressIndex":"202",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C01State",
+         "addressIndex":"204",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      },{
+         "codeId": "C02State",
+         "addressIndex":"206",
+         "addressLenght":"2",
+         "ratio":"1",
+         "unit":"mm/S"
+      }
+   ]
+}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/mapper/UpWorkstationMapper.xml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/mapper/UpWorkstationMapper.xml
new file mode 100644
index 0000000..2dce130
--- /dev/null
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/mapper/UpWorkstationMapper.xml
@@ -0,0 +1,23 @@
+<?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.mes.workstation.mapper.UpWorkstationMapper">
+
+    <resultMap id="sequenceMap" type="com.mes.workstation.entity.UpWorkSequence">
+        <id property="sequence" column="layout_sequence"/>
+        <result property="number" column="number"/>
+    </resultMap>
+
+    <select id="selectPriority" resultMap="sequenceMap">
+        SELECT
+            b.layout_sequence,a."number"
+        FROM
+            up_workstation a
+                LEFT JOIN up_patten_usage b ON a.pattern_width = b.width
+                AND a.pattern_heigth = b.width
+                AND a.pattern_thickness = b.thickness
+        WHERE
+            a.workstation_id = #{id}
+    </select>
+
+
+</mapper>
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
new file mode 100644
index 0000000..5ebb233
--- /dev/null
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
@@ -0,0 +1,39 @@
+package com.mes;
+
+import com.mes.pp.entity.OptimizeProject;
+import com.mes.pp.mapper.OptimizeProjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/3/27 16:37
+ * @Description:
+ */
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = LoadGlassModuleApplication.class)
+public class LoadGlassModuleApplicationTest {
+
+    @Resource
+    private OptimizeProjectMapper optimizeProjectMapper;
+
+    @Test
+    public void test() {
+//        List<OptimizeProject> list = optimizeProjectMapper.saveProject("P24032204");
+//        log.info("list:{}", list);
+
+    }
+
+    @Test
+    public void testFindPath() {
+        log.info("瀹屾暣璺緞锛歿}", Arrays.asList("123"));
+    }
+}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java
new file mode 100644
index 0000000..a748ee8
--- /dev/null
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/entity/GlassInfo.java
@@ -0,0 +1,131 @@
+package com.mes.temperingglass.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-04-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class GlassInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 鐜荤拑淇℃伅琛╥d
+     */
+      @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 娴佺▼鍗�
+     */
+    private String flowcardId;
+
+    /**
+     * 娴佺▼鍗$幓鐠冪被鍨�
+     */
+    private Integer glassType;
+
+    /**
+     * 瀹�
+     */
+    private Double width;
+
+    /**
+     * 楂�
+     */
+    private Double height;
+
+    /**
+     * 鍘氬害
+     */
+    private Double thickness;
+
+    /**
+     * 鑶滅郴
+     */
+    private Integer filmsid;
+
+    /**
+     * 纾ㄥ墠瀹�
+     */
+    private Double edgWidth;
+
+    /**
+     * 纾ㄥ墠楂�
+     */
+    private Double edgHeight;
+
+    /**
+     * 鏄惁閰嶇墖
+     */
+    private Integer ismultiple;
+
+    /**
+     * 閰嶇墖鏈�澶у
+     */
+    private Double maxWidth;
+
+    /**
+     * 閰嶇墖鏈�澶ч珮
+     */
+    private Double maxHeight;
+
+    /**
+     * 閽㈠寲鏄惁鎺ュ彈妯斁
+     */
+    private Integer ishorizontal;
+
+    /**
+     * 鍘熺墖椤哄簭
+     */
+    private Integer patternSequence;
+
+    /**
+     * 閽㈠寲鐗堝浘id
+     */
+    private Integer temperingLayoutId;
+
+    /**
+     * 閽㈠寲鐗堝浘鐗囧簭
+     */
+    private Integer temperingFeedSequence;
+
+    /**
+     * x鍧愭爣
+     */
+    private Integer xCoordinate;
+
+    /**
+     * y鍧愭爣
+     */
+    private Integer yCoordinate;
+
+    /**
+     * 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
+     */
+    private Integer angle;
+
+    /**
+     * 宸ョ▼鍙�
+     */
+    private Integer engineerId;
+
+    /**
+     * 鐢熶骇瑙勫垯id
+     */
+    private Integer ruleId;
+
+
+}

--
Gitblit v1.8.0