From 517f36f9f4e36432f073196e84986532fc6c5926 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 26 三月 2024 11:10:43 +0800
Subject: [PATCH] Merge branch 'Four-Way-Rack' of http://47.97.1.152:5880/r/zy-asrs-master into Four-Way-Rack
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapUtils.java | 93 +++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java | 511 +++++++++++++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/MapNode.java | 32 +
zy-asrs-wcs/src/main/java/motionCtg.sql | 9
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionCtg.java | 224 +++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java | 8
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionCtgService.java | 8
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionStsController.java | 101 +++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionCtgMapper.java | 12
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionSts.java | 206 ++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java | 14
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionCtgController.java | 101 +++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java | 12
zy-asrs-wcs/src/main/resources/mapper/rcs/MotionCtgMapper.xml | 5
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionStsMapper.java | 12
zy-asrs-wcs/src/main/java/motionSts.sql | 9
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/NavigationMapType.java | 42 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java | 6
zy-asrs-wcs/src/main/resources/mapper/rcs/MotionStsMapper.xml | 5
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/NavigateNode.java | 49 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java | 298 +++++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionCtgServiceImpl.java | 12
22 files changed, 1,769 insertions(+), 0 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/MapNode.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/MapNode.java
new file mode 100644
index 0000000..9cbc7cb
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/MapNode.java
@@ -0,0 +1,32 @@
+package com.zy.asrs.wcs.core.model;
+
+import lombok.Data;
+
+/**
+ * 鍦板浘鏁版嵁鑺傜偣
+ */
+@Data
+public class MapNode {
+
+ /**
+ * -1 绂佺敤
+ * 0 瀛愯建閬�
+ * 3 姣嶈建閬�
+ * 4 鍏呯數妗�
+ * 5 鍏呯數妗�
+ * 66 绌挎杞﹀潗鏍�
+ * -999 閿佸畾鑺傜偣
+ */
+ private Integer value;
+
+ private String data;
+
+ private Integer top;
+
+ private Integer bottom;
+
+ private Integer left;
+
+ private Integer right;
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/NavigateNode.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/NavigateNode.java
new file mode 100644
index 0000000..266287b
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/NavigateNode.java
@@ -0,0 +1,49 @@
+package com.zy.asrs.wcs.core.model;
+
+import lombok.Data;
+
+/**
+ * A*瀵昏矾绠楁硶Node鑺傜偣
+ */
+@Data
+public class NavigateNode implements Comparable<NavigateNode>{
+
+ private int x;//鍧愭爣x
+ private int y;//鍧愭爣y
+ private int z;//鍧愭爣z(楂樺害)
+ private int F;//缁煎悎鑺辫垂鐨勬鏁�
+ private int G;//宸茬粡鑺辫垂鐨勬鏁�
+ private int H;//灏嗚鑺辫垂鐨勬鏁�
+ private NavigateNode Father;//鐖惰妭鐐�
+ private Boolean isInflectionPoint;//鏄惁涓烘嫄鐐�
+ private String direction;//琛岃蛋鏂瑰悜
+ private Integer moveDistance;//琛岃蛋璺濈
+
+ public NavigateNode(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ //閫氳繃缁撶偣鐨勫潗鏍囧拰鐩爣缁撶偣鐨勫潗鏍囧彲浠ヨ绠楀嚭F锛� G锛� H涓変釜灞炴��
+ //闇�瑕佷紶鍏ヨ繖涓妭鐐圭殑涓婁竴涓妭鐐瑰拰鏈�缁堢殑缁撶偣
+ public void init_node(NavigateNode father, NavigateNode end) {
+ this.Father = father;
+ if (this.Father != null) {
+ //璧拌繃鐨勬鏁扮瓑浜庣埗鑺傜偣璧拌繃鐨勬鏁板姞涓�
+ this.G = father.G + 1;
+ } else { //鐖惰妭鐐逛负绌轰唬琛ㄥ畠鏄涓�涓粨鐐�
+ this.G = 0;
+ }
+
+ //浠ヤ笅璁$畻鏂规涓虹畻娉曞師濮嬫柟妗堬紝娌℃湁鍘绘嫄鐐规柟妗堛�傚凡琚玈olution璁$畻鏃惰嚜鍔ㄨ鐩栥��
+ //璁$畻閫氳繃鐜板湪鐨勭粨鐐圭殑浣嶇疆鍜屾渶缁堢粨鐐圭殑浣嶇疆璁$畻H鍊�(鏇煎搱椤挎硶锛氬潗鏍囧垎鍒彇宸�肩浉鍔�)
+ this.H = Math.abs(this.x - end.x) + Math.abs(this.y - end.y);
+ this.F = this.G + this.H;
+ }
+
+ @Override
+ public int compareTo(NavigateNode o) {
+ return Integer.compare(this.F, o.F);
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/NavigationMapType.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/NavigationMapType.java
new file mode 100644
index 0000000..352cb92
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/NavigationMapType.java
@@ -0,0 +1,42 @@
+package com.zy.asrs.wcs.core.model.enums;
+
+public enum NavigationMapType {
+
+ NONE(-1, "鏃犺繃婊�"),
+ DFX(1, "杩囨护搴撲綅鐘舵�丏FX"), // 甯﹁揣璧拌
+ NORMAL(2, "杩囨护搴撲綅鐘舵�乆"), // 鏃犺揣璧拌
+ ;
+
+ public Integer id;
+ public String desc;
+
+ NavigationMapType(Integer id, String desc) {
+ this.id = id;
+ this.desc = desc;
+ }
+
+ public static NavigationMapType get(Short id) {
+ if (null == id) {
+ return null;
+ }
+ for (NavigationMapType type : NavigationMapType.values()) {
+ if (type.id.equals(id.intValue())) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+ public static NavigationMapType get(NavigationMapType type) {
+ if (null == type) {
+ return null;
+ }
+ for (NavigationMapType type1 : NavigationMapType.values()) {
+ if (type1 == type) {
+ return type1;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java
new file mode 100644
index 0000000..6244431
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java
@@ -0,0 +1,298 @@
+package com.zy.asrs.wcs.core.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.zy.asrs.common.wms.entity.BasMap;
+import com.zy.asrs.common.wms.entity.LocMast;
+import com.zy.asrs.common.wms.service.LocMastService;
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.wcs.core.model.MapNode;
+import com.zy.asrs.wcs.core.model.NavigateNode;
+import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
+import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
+import org.springframework.stereotype.Component;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * A*绠楁硶鍦板浘鑾峰彇绫�
+ */
+@Component
+public class NavigateMapData {
+
+ private Integer lev;//鍦板浘妤煎眰
+
+ public NavigateMapData() {
+ this.lev = 1;
+ }
+
+ public NavigateMapData(Integer lev) {
+ this.lev = lev;
+ }
+
+ public void setLev(Integer lev) {
+ this.lev = lev;
+ }
+
+ public int[][] getData() {
+ return getData(NavigationMapType.NONE.id, null, null);//榛樿璇诲彇鏃犺繃婊ょ殑鍏ㄩ儴鍦板浘鏁版嵁
+ }
+
+ public int[][] getData(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
+ try {
+ String mapFilename = "map_" + lev + ".json";
+
+ String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//鑾峰彇鏂囦欢璺緞
+ File file = new File(fileName);
+ StringBuffer stringBuffer = new StringBuffer();
+ if (file.isFile() && file.exists()) {
+ InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
+ BufferedReader br = new BufferedReader(isr);
+ String lineTxt = null;
+ while ((lineTxt = br.readLine()) != null) {
+ stringBuffer.append(lineTxt);
+ }
+ br.close();
+
+ //瑙f瀽json鍦板浘鏁版嵁
+ ArrayList arrayList = JSON.parseObject(stringBuffer.toString(), ArrayList.class);
+ List<List<MapNode>> lists = filterMap(mapType, arrayList, lev, whitePoints, shuttlePoints);//杩囨护鍦板浘鏁版嵁
+ int[][] map = new int[lists.size()][];
+ int j = 0;
+ for (List<MapNode> list : lists) {
+ int[] tmp = new int[list.size()];
+ int i = 0;
+ for (MapNode mapNode : list) {
+ //灏嗘暟鎹坊鍔犺繘浜岀淮鏁扮粍
+ tmp[i++] = mapNode.getValue();
+ }
+ //鏁版嵁娣诲姞杩涗竴缁存暟缁�
+ map[j++] = tmp;
+ }
+
+ return map;
+ } else {
+ System.out.println("鏂囦欢涓嶅瓨鍦�!");
+ }
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * 灏濊瘯浠巖edis鑾峰彇鏁版嵁
+ */
+ public int[][] getDataFromRedis(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
+ RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+ Object o = redisUtil.get(DeviceRedisConstant.MAP + lev);
+ if (o == null) {
+ return null;
+ }
+
+ BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
+ return this.getDataFormString(basMap.getData(), mapType, whitePoints, shuttlePoints);
+ }
+
+ /**
+ * 浠嶭ist鏁版嵁涓幏鍙栧湴鍥�
+ */
+ public int[][] getDataFormString(String data, Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
+ ArrayList arrayList = JSON.parseObject(data, ArrayList.class);
+ List<List<MapNode>> lists = filterMap(mapType, arrayList, lev, whitePoints, shuttlePoints);//杩囨护鍦板浘鏁版嵁
+ int[][] map = new int[lists.size()][];
+ int j = 0;
+ for (List<MapNode> list : lists) {
+ int[] tmp = new int[list.size()];
+ int i = 0;
+ for (MapNode mapNode : list) {
+ //灏嗘暟鎹坊鍔犺繘浜岀淮鏁扮粍
+ tmp[i++] = mapNode.getValue();
+ }
+ //鏁版嵁娣诲姞杩涗竴缁存暟缁�
+ map[j++] = tmp;
+ }
+
+ return map;
+ }
+
+ //鑾峰彇JSON鏍煎紡鏁版嵁
+ public List<List<MapNode>> getJsonData(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
+ try {
+ String mapFilename = "map_" + lev + ".json";
+
+ String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//鑾峰彇鏂囦欢璺緞
+ File file = new File(fileName);
+ StringBuffer stringBuffer = new StringBuffer();
+ if (file.isFile() && file.exists()) {
+ InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
+ BufferedReader br = new BufferedReader(isr);
+ String lineTxt = null;
+ while ((lineTxt = br.readLine()) != null) {
+ stringBuffer.append(lineTxt);
+ }
+ br.close();
+
+ //瑙f瀽json鍦板浘鏁版嵁
+ ArrayList arrayList = JSON.parseObject(stringBuffer.toString(), ArrayList.class);
+ List<List<MapNode>> lists = filterMap(mapType, arrayList, lev, whitePoints, shuttlePoints);//杩囨护鍦板浘鏁版嵁
+
+ return lists;
+ } else {
+ System.out.println("鏂囦欢涓嶅瓨鍦�!");
+ }
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * 杩囨护鍦板浘鏁版嵁
+ * mapType -1=>鏃犺繃婊わ紝1=銆嬭繃婊ゅ簱浣嶇姸鎬丏FX锛�2=銆嬭繃婊ゅ簱浣嶇姸鎬乆
+ *
+ * @param whitePoints 鐧藉悕鍗曡妭鐐癸紝涓嶉渶瑕佽杩囨护
+ * @param shuttlePoints 绌挎杞﹁妭鐐癸紝闇�瑕佸姞杞借繘鍦板浘
+ */
+ public List<List<MapNode>> filterMap(Integer mapType, List arrayList, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
+ List<List<MapNode>> lists = new ArrayList<>();
+
+ //閲嶅缓鏁版嵁鏍煎紡
+ for (int i = 0; i < arrayList.size(); i++) {
+ Object obj = arrayList.get(i);
+ List<MapNode> list = JSON.parseArray(obj.toString(), MapNode.class);
+ for (int j = 0; j < list.size(); j++) {
+ MapNode mapNode = list.get(j);
+ list.set(j, mapNode);
+ }
+ lists.add(list);
+ }
+
+ //杩囨护鏁版嵁
+ LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
+ //鑾峰彇褰撳墠妤煎眰搴撲綅鏁版嵁
+ List<LocMast> locMasts = locMastService.list(new LambdaQueryWrapper<LocMast>()
+ .eq(LocMast::getLev1, lev));
+ for (LocMast locMast : locMasts) {
+ Integer row = locMast.getRow1();
+ Integer bay = locMast.getBay1();
+
+ boolean whiteFlag = false;//榛樿涓嶅瓨鍦ㄧ櫧鍚嶅崟
+ if (whitePoints != null) {
+ for (int[] whitePoint : whitePoints) {
+ if (whitePoint[0] == row && whitePoint[1] == bay) {
+ //瀛樺湪鐧藉悕鍗�
+ whiteFlag = true;
+ break;
+ }
+ }
+ }
+ if (whiteFlag) {
+ continue;//瀛樺湪鐧藉悕鍗曪紝涓嶆墽琛屼笅鍒楄繃婊ゆ柟妗�
+ }
+
+
+ List<MapNode> list = lists.get(row);
+ MapNode mapNode = list.get(bay);
+
+ if (mapType == NavigationMapType.NONE.id) {
+ //涓嶈繃婊や换浣曟暟鎹�
+ } else if (mapType == NavigationMapType.DFX.id) {
+ //杞﹁締鏈夎揣
+ //璇诲彇瀵瑰簲搴撲綅鏁版嵁锛屽皢DFX搴撲綅鐘舵�佺殑鑺傜偣缃负-1(闅滅鐗�)
+ if (locMast.getLocSts().equals("F")
+ || locMast.getLocSts().equals("D")
+ || locMast.getLocSts().equals("X")
+ || locMast.getLocSts().equals("R")
+ || locMast.getLocSts().equals("P")
+ ) {
+ mapNode.setValue(-1);//绂佺敤鑺傜偣
+ }
+ } else if (mapType == NavigationMapType.NORMAL.id) {
+ //杩囨护搴撲綅鐘舵�乆
+ if (locMast.getLocSts().equals("X")) {
+ mapNode.setValue(-1);//绂佺敤鑺傜偣
+ }
+ }
+
+ //鏇存柊list
+ list.set(bay, mapNode);
+ lists.set(row, list);
+ }
+
+ //鍔犺浇杞﹁締鍧愭爣鍒板湴鍥句腑
+ if (shuttlePoints != null) {
+ for (int[] points : shuttlePoints) {
+ int x = points[0];
+ int y = points[1];
+ List<MapNode> list = lists.get(x);
+ MapNode mapNode = list.get(y);
+ mapNode.setValue(66);//璁剧疆涓鸿溅杈嗕唬鐮�66
+ //鏇存柊list
+ list.set(y, mapNode);
+ lists.set(x, list);
+ }
+ }
+
+ return lists;
+ }
+
+ /**
+ * 閿�/瑙i攣 璺緞鑺傜偣
+ * 鍐欏叆璺緞鑺傜偣鏁版嵁鍒皉edis鍦板浘涓�
+ * lock涓簍rue 绂佺敤搴撲綅锛宭ock涓篺alse鎭㈠搴撲綅
+ */
+ public synchronized boolean writeNavigateNodeToRedisMap(List<NavigateNode> nodes, boolean lock) {
+ RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+ Object o = redisUtil.get("realtimeBasMap_" + lev);
+ if (o == null) {
+ return false;
+ }
+
+ BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
+ ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
+ List<List<MapNode>> lists = filterMap(NavigationMapType.NONE.id, arrayList, lev, null, null);//鑾峰彇鍏ㄩ儴鍦板浘鏁版嵁
+
+ // 闃叉閲嶅閿佽矾寰�
+ if (lock) {
+ for (NavigateNode node : nodes) {
+ List<MapNode> listX = lists.get(node.getX());
+ MapNode mapNode = listX.get(node.getY());
+ if (mapNode.getValue() == -999) {
+ return false;
+ }
+ }
+ }
+
+ NavigateMapData mapData = new NavigateMapData(nodes.get(0).getZ());
+ List<List<MapNode>> realMap = mapData.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
+ for (NavigateNode node : nodes) {
+ if (node.getZ() != lev) {
+ continue;
+ }
+
+ List<MapNode> listX = lists.get(node.getX());
+ MapNode mapNode = listX.get(node.getY());
+ if (lock) {
+ mapNode.setValue(-999);//绂佺敤搴撲綅
+ }else {
+ //鑾峰彇鍘熷鑺傜偣鏁版嵁
+ List<MapNode> rows = realMap.get(node.getX());
+ MapNode col = rows.get(node.getY());
+ mapNode.setValue(col.getValue());//鎭㈠搴撲綅
+ }
+
+ listX.set(node.getY(), mapNode);
+ lists.set(node.getX(), listX);
+ }
+ basMap.setData(JSON.toJSONString(lists));
+ basMap.setUpdateTime(new Date());
+ //灏嗘暟鎹簱鍦板浘鏁版嵁瀛樺叆redis
+ redisUtil.set("realtimeBasMap_" + lev, JSON.toJSONString(basMap));
+ return true;
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapUtils.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapUtils.java
new file mode 100644
index 0000000..396260b
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapUtils.java
@@ -0,0 +1,93 @@
+//package com.zy.asrs.wcs.core.utils;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.zy.asrs.common.wms.entity.BasMap;
+//import com.zy.asrs.framework.common.SpringUtils;
+//import com.zy.asrs.wcs.core.model.MapNode;
+//import com.zy.asrs.wcs.core.model.NavigateNode;
+//import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
+//import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.ArrayList;
+//import java.util.Date;
+//import java.util.List;
+//
+//@Component
+//public class NavigateMapUtils {
+//
+// /**
+// * 鍐欏叆璺緞鑺傜偣鏁版嵁鍒皉edis鍦板浘涓�
+// * lock涓簍rue 绂佺敤搴撲綅锛宭ock涓篺alse鎭㈠搴撲綅
+// */
+// public synchronized boolean writeNavigateNodeToRedisMap(Integer lev, Integer shuttleNo, List<NavigateNode> nodes, boolean lock) {
+// RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+// try {
+// if (nodes.isEmpty()) {
+// return true;
+// }
+//
+// NavigateMapData navigateMapData = new NavigateMapData(lev);
+//
+// Object o = redisUtil.get(DeviceRedisConstant.MAP + lev);
+// if (o == null) {
+// return false;
+// }
+//
+// //鑾峰彇灏忚溅鑺傜偣
+// List<int[]> shuttlePoints = Utils.getShuttlePoints(shuttleNo, lev);
+//
+// BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
+// ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
+// //甯﹀皬杞﹀湴鍥�
+// List<List<MapNode>> listsHasShuttle = navigateMapData.filterMap(NavigationMapType.NONE.id, arrayList, lev, null, shuttlePoints);//鑾峰彇甯﹀皬杞﹀湴鍥炬暟鎹�
+// List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.NONE.id, arrayList, lev, null, null);//鑾峰彇鍏ㄩ儴鍦板浘鏁版嵁
+//
+// //妫�娴嬭矾寰勬槸鍚﹁閿佸畾
+// if (lock) {
+// for (NavigateNode node : nodes) {
+// List<MapNode> listX = listsHasShuttle.get(node.getX());
+// MapNode mapNode = listX.get(node.getY());
+// if (mapNode.getValue() == -999) {
+// return false;//璺緞琚攣瀹氳繃锛岀姝㈠啀娆¢攣瀹�
+// }
+// if (mapNode.getValue() == 66) {
+// return false;//璺緞瀛樺湪灏忚溅锛岀姝㈤攣瀹�
+// }
+// }
+// }
+//
+// //灏濊瘯閿佸畾/瑙i攣璺緞
+// NavigateMapData mapData = new NavigateMapData(nodes.get(0).getZ());
+// List<List<MapNode>> realMap = mapData.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
+// for (NavigateNode node : nodes) {
+// if (node.getZ() != lev) {
+// continue;
+// }
+//
+// List<MapNode> listX = lists.get(node.getX());
+// MapNode mapNode = listX.get(node.getY());
+// if (lock) {
+// mapNode.setValue(-999);//绂佺敤搴撲綅
+// } else {
+// //鑾峰彇鍘熷鑺傜偣鏁版嵁
+// List<MapNode> rows = realMap.get(node.getX());
+// MapNode col = rows.get(node.getY());
+// mapNode.setValue(col.getValue());//鎭㈠搴撲綅
+// }
+//
+// listX.set(node.getY(), mapNode);
+// lists.set(node.getX(), listX);
+// }
+// basMap.setData(JSON.toJSONString(lists));
+// basMap.setUpdateTime(new Date());
+// //灏嗘暟鎹簱鍦板浘鏁版嵁瀛樺叆redis
+// redisUtil.set(DeviceRedisConstant.MAP + lev, JSON.toJSONString(basMap));
+// return true;
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// return false;
+// }
+//
+//}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionCtgController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionCtgController.java
new file mode 100644
index 0000000..afd4cdf
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionCtgController.java
@@ -0,0 +1,101 @@
+package com.zy.asrs.wcs.system.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zy.asrs.framework.common.Cools;
+import com.zy.asrs.framework.common.R;
+import com.zy.asrs.wcs.common.annotation.OperationLog;
+import com.zy.asrs.wcs.common.domain.BaseParam;
+import com.zy.asrs.wcs.common.domain.KeyValVo;
+import com.zy.asrs.wcs.common.domain.PageParam;
+import com.zy.asrs.wcs.rcs.entity.MotionCtg;
+import com.zy.asrs.wcs.rcs.service.MotionCtgService;
+import com.zy.asrs.wcs.utils.ExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/api")
+public class MotionCtgController extends BaseController {
+
+ @Autowired
+ private MotionCtgService motionCtgService;
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:list')")
+ @PostMapping("/motionCtg/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<MotionCtg, BaseParam> pageParam = new PageParam<>(baseParam, MotionCtg.class);
+ return R.ok().add(motionCtgService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:list')")
+ @PostMapping("/motionCtg/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(motionCtgService.list());
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:list')")
+ @GetMapping("/motionCtg/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(motionCtgService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:save')")
+ @OperationLog("娣诲姞Motion鏍囪")
+ @PostMapping("/motionCtg/save")
+ public R save(@RequestBody MotionCtg motionCtg) {
+ if (!motionCtgService.save(motionCtg)) {
+ return R.error("娣诲姞澶辫触");
+ }
+ return R.ok("娣诲姞鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:update')")
+ @OperationLog("淇敼Motion鏍囪")
+ @PostMapping("/motionCtg/update")
+ public R update(@RequestBody MotionCtg motionCtg) {
+ if (!motionCtgService.updateById(motionCtg)) {
+ return R.error("淇敼澶辫触");
+ }
+ return R.ok("淇敼鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:remove')")
+ @OperationLog("鍒犻櫎Motion鏍囪")
+ @PostMapping("/motionCtg/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!motionCtgService.removeByIds(Arrays.asList(ids))) {
+ return R.error("鍒犻櫎澶辫触");
+ }
+ return R.ok("鍒犻櫎鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:list')")
+ @PostMapping("/motionCtg/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<MotionCtg> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(MotionCtg::getName, condition);
+ }
+ motionCtgService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getName()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionCtg:list')")
+ @PostMapping("/motionCtg/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(motionCtgService.list(), MotionCtg.class), response);
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionStsController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionStsController.java
new file mode 100644
index 0000000..28d1711
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/controller/MotionStsController.java
@@ -0,0 +1,101 @@
+package com.zy.asrs.wcs.system.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zy.asrs.framework.common.Cools;
+import com.zy.asrs.framework.common.R;
+import com.zy.asrs.wcs.common.annotation.OperationLog;
+import com.zy.asrs.wcs.common.domain.BaseParam;
+import com.zy.asrs.wcs.common.domain.KeyValVo;
+import com.zy.asrs.wcs.common.domain.PageParam;
+import com.zy.asrs.wcs.rcs.entity.MotionSts;
+import com.zy.asrs.wcs.rcs.service.MotionStsService;
+import com.zy.asrs.wcs.utils.ExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/api")
+public class MotionStsController extends BaseController {
+
+ @Autowired
+ private MotionStsService motionStsService;
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:list')")
+ @PostMapping("/motionSts/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<MotionSts, BaseParam> pageParam = new PageParam<>(baseParam, MotionSts.class);
+ return R.ok().add(motionStsService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:list')")
+ @PostMapping("/motionSts/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(motionStsService.list());
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:list')")
+ @GetMapping("/motionSts/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(motionStsService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:save')")
+ @OperationLog("娣诲姞Motion鐘舵��")
+ @PostMapping("/motionSts/save")
+ public R save(@RequestBody MotionSts motionSts) {
+ if (!motionStsService.save(motionSts)) {
+ return R.error("娣诲姞澶辫触");
+ }
+ return R.ok("娣诲姞鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:update')")
+ @OperationLog("淇敼Motion鐘舵��")
+ @PostMapping("/motionSts/update")
+ public R update(@RequestBody MotionSts motionSts) {
+ if (!motionStsService.updateById(motionSts)) {
+ return R.error("淇敼澶辫触");
+ }
+ return R.ok("淇敼鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:remove')")
+ @OperationLog("鍒犻櫎Motion鐘舵��")
+ @PostMapping("/motionSts/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!motionStsService.removeByIds(Arrays.asList(ids))) {
+ return R.error("鍒犻櫎澶辫触");
+ }
+ return R.ok("鍒犻櫎鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:list')")
+ @PostMapping("/motionSts/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<MotionSts> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(MotionSts::getName, condition);
+ }
+ motionStsService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getName()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('rcs:motionSts:list')")
+ @PostMapping("/motionSts/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(motionStsService.list(), MotionSts.class), response);
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionCtg.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionCtg.java
new file mode 100644
index 0000000..2ce6eca
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionCtg.java
@@ -0,0 +1,224 @@
+package com.zy.asrs.wcs.rcs.entity;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.zy.asrs.wcs.rcs.service.DeviceTypeService;
+import com.zy.asrs.wcs.system.entity.Host;
+import com.zy.asrs.wcs.system.entity.User;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.zy.asrs.framework.common.Cools;
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.wcs.system.service.UserService;
+import com.zy.asrs.wcs.system.service.HostService;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("rcs_motion_ctg")
+public class MotionCtg implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 璁惧绫诲瀷
+ */
+ @ApiModelProperty(value= "璁惧绫诲瀷")
+ private Long deviceType;
+
+ /**
+ * 缂栧彿
+ */
+ @ApiModelProperty(value= "缂栧彿")
+ private String uuid;
+
+ /**
+ * 鍚嶇О
+ */
+ @ApiModelProperty(value= "鍚嶇О")
+ private String name;
+
+ /**
+ * 鏍囪瘑
+ */
+ @ApiModelProperty(value= "鏍囪瘑")
+ private String flag;
+
+ /**
+ * 鐘舵�� 1: 姝e父 0: 绂佺敤
+ */
+ @ApiModelProperty(value= "鐘舵�� 1: 姝e父 0: 绂佺敤 ")
+ private Integer status;
+
+ /**
+ * 娣诲姞浜哄憳
+ */
+ @ApiModelProperty(value= "娣诲姞浜哄憳")
+ private Long createBy;
+
+ /**
+ * 娣诲姞鏃堕棿
+ */
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /**
+ * 淇敼浜哄憳
+ */
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ private Long updateBy;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ /**
+ * 鏄惁鍒犻櫎 1: 鏄� 0: 鍚�
+ */
+ @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄� 0: 鍚� ")
+ @TableLogic
+ private Integer deleted;
+
+ /**
+ * 鎵�灞炴満鏋�
+ */
+ @ApiModelProperty(value= "鎵�灞炴満鏋�")
+ private Long hostId;
+
+ public MotionCtg() {}
+
+ public MotionCtg(Long deviceType,String uuid,String name,String flag,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
+ this.deviceType = deviceType;
+ this.uuid = uuid;
+ this.name = name;
+ this.flag = flag;
+ this.status = status;
+ this.createBy = createBy;
+ this.createTime = createTime;
+ this.updateBy = updateBy;
+ this.updateTime = updateTime;
+ this.memo = memo;
+ this.deleted = deleted;
+ this.hostId = hostId;
+ }
+
+// MotionCtg motionCtg = new MotionCtg(
+// null, // 璁惧绫诲瀷
+// null, // 缂栧彿
+// null, // 鍚嶇О[闈炵┖]
+// null, // 鏍囪瘑
+// null, // 鐘舵��
+// null, // 娣诲姞浜哄憳
+// null, // 娣诲姞鏃堕棿
+// null, // 淇敼浜哄憳
+// null, // 淇敼鏃堕棿
+// null, // 澶囨敞
+// null, // 鏄惁鍒犻櫎
+// null // 鎵�灞炴満鏋�
+// );
+
+ public String getDeviceType$(){
+ DeviceTypeService service = SpringUtils.getBean(DeviceTypeService.class);
+ DeviceType deviceType = service.getById(this.deviceType);
+ if (!Cools.isEmpty(deviceType)){
+ return String.valueOf(deviceType.getId());
+ }
+ return null;
+ }
+
+ public String getStatus$(){
+ if (null == this.status){ return null; }
+ switch (this.status){
+ case 1:
+ return "姝e父";
+ case 0:
+ return "绂佺敤";
+ default:
+ return String.valueOf(this.status);
+ }
+ }
+
+ public String getCreateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.getById(this.createBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getCreateTime$(){
+ if (Cools.isEmpty(this.createTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+ }
+
+ public String getUpdateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.getById(this.updateBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getUpdateTime$(){
+ if (Cools.isEmpty(this.updateTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+ }
+
+ public String getDeleted$(){
+ if (null == this.deleted){ return null; }
+ switch (this.deleted){
+ case 1:
+ return "鏄�";
+ case 0:
+ return "鍚�";
+ default:
+ return String.valueOf(this.deleted);
+ }
+ }
+
+ public String getHostId$(){
+ HostService service = SpringUtils.getBean(HostService.class);
+ Host host = service.getById(this.hostId);
+ if (!Cools.isEmpty(host)){
+ return String.valueOf(host.getName());
+ }
+ return null;
+ }
+
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionSts.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionSts.java
new file mode 100644
index 0000000..0b970a9
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/MotionSts.java
@@ -0,0 +1,206 @@
+package com.zy.asrs.wcs.rcs.entity;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.zy.asrs.wcs.system.entity.Host;
+import com.zy.asrs.wcs.system.entity.User;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.zy.asrs.framework.common.Cools;
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.wcs.system.service.UserService;
+import com.zy.asrs.wcs.system.service.HostService;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("rcs_motion_sts")
+public class MotionSts implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 缂栧彿
+ */
+ @ApiModelProperty(value= "缂栧彿")
+ private String uuid;
+
+ /**
+ * 鍚嶇О
+ */
+ @ApiModelProperty(value= "鍚嶇О")
+ private String name;
+
+ /**
+ * 鏍囪瘑
+ */
+ @ApiModelProperty(value= "鏍囪瘑")
+ private String flag;
+
+ /**
+ * 鐘舵�� 1: 姝e父 0: 绂佺敤
+ */
+ @ApiModelProperty(value= "鐘舵�� 1: 姝e父 0: 绂佺敤 ")
+ private Integer status;
+
+ /**
+ * 娣诲姞浜哄憳
+ */
+ @ApiModelProperty(value= "娣诲姞浜哄憳")
+ private Long createBy;
+
+ /**
+ * 娣诲姞鏃堕棿
+ */
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /**
+ * 淇敼浜哄憳
+ */
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ private Long updateBy;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ /**
+ * 鏄惁鍒犻櫎 1: 鏄� 0: 鍚�
+ */
+ @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄� 0: 鍚� ")
+ @TableLogic
+ private Integer deleted;
+
+ /**
+ * 鎵�灞炴満鏋�
+ */
+ @ApiModelProperty(value= "鎵�灞炴満鏋�")
+ private Long hostId;
+
+ public MotionSts() {}
+
+ public MotionSts(String uuid,String name,String flag,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
+ this.uuid = uuid;
+ this.name = name;
+ this.flag = flag;
+ this.status = status;
+ this.createBy = createBy;
+ this.createTime = createTime;
+ this.updateBy = updateBy;
+ this.updateTime = updateTime;
+ this.memo = memo;
+ this.deleted = deleted;
+ this.hostId = hostId;
+ }
+
+// MotionSts motionSts = new MotionSts(
+// null, // 缂栧彿
+// null, // 鍚嶇О[闈炵┖]
+// null, // 鏍囪瘑
+// null, // 鐘舵��
+// null, // 娣诲姞浜哄憳
+// null, // 娣诲姞鏃堕棿
+// null, // 淇敼浜哄憳
+// null, // 淇敼鏃堕棿
+// null, // 澶囨敞
+// null, // 鏄惁鍒犻櫎
+// null // 鎵�灞炴満鏋�
+// );
+
+ public String getStatus$(){
+ if (null == this.status){ return null; }
+ switch (this.status){
+ case 1:
+ return "姝e父";
+ case 0:
+ return "绂佺敤";
+ default:
+ return String.valueOf(this.status);
+ }
+ }
+
+ public String getCreateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.getById(this.createBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getCreateTime$(){
+ if (Cools.isEmpty(this.createTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+ }
+
+ public String getUpdateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.getById(this.updateBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getUpdateTime$(){
+ if (Cools.isEmpty(this.updateTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+ }
+
+ public String getDeleted$(){
+ if (null == this.deleted){ return null; }
+ switch (this.deleted){
+ case 1:
+ return "鏄�";
+ case 0:
+ return "鍚�";
+ default:
+ return String.valueOf(this.deleted);
+ }
+ }
+
+ public String getHostId$(){
+ HostService service = SpringUtils.getBean(HostService.class);
+ Host host = service.getById(this.hostId);
+ if (!Cools.isEmpty(host)){
+ return String.valueOf(host.getName());
+ }
+ return null;
+ }
+
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java
new file mode 100644
index 0000000..29dc778
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java
@@ -0,0 +1,511 @@
+//package com.zy.asrs.wcs.rcs.kernel.command;
+//
+//import com.zy.asrs.common.wms.mapper.WrkMastMapper;
+//import com.zy.asrs.common.wms.service.LocMastService;
+//import com.zy.asrs.wcs.core.utils.NavigateMapUtils;
+//import com.zy.asrs.wcs.core.utils.RedisUtil;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import java.util.ArrayList;
+//import java.util.Objects;
+//import java.util.Optional;
+//
+///**
+// * Created by vincent on 2023/10/23
+// */
+//@Slf4j
+//@Service
+//public class ShuttleCommandService {
+//
+// public static final Integer SHUTTLE_ADDITION_COMMAND_SPEED = 500;
+//
+// @Autowired
+// private RedisUtil redisUtil;
+// @Autowired
+// private MotionService motionService;
+// @Autowired
+// private WrkMastMapper wrkMastMapper;
+// @Autowired
+// private BasShuttleService basShuttleService;
+// @Autowired
+// private LocMastService locMastService;
+// @Autowired
+// private NavigateMapUtils navigateMapUtils;
+//
+// // 璁$畻
+// public Boolean accept(Motion motion) {
+// Integer deviceNo = Integer.parseInt(motion.getDevice());
+// ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, deviceNo);
+// ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+// if (null == shuttleProtocol) {
+// return false;
+// }
+// if (shuttleProtocol.getBusyStatus().intValue() == ShuttleStatusType.BUSY.id
+// || !shuttleProtocol.isIdle()) {
+// return false;
+// }
+// if (!shuttleProtocol.getPakMk()) {
+// return false;
+// }
+// if (motionService.selectCount(new EntityWrapper<Motion>()
+// .eq("device_ctg", DeviceCtgType.SHUTTLE.val())
+// .eq("device", motion.getDevice())
+// .eq("motion_sts", MotionStsType.EXECUTING.val())) > 0) {
+// return false;
+// }
+//
+// ShuttleAssignCommand assignCommand = new ShuttleAssignCommand();
+// assignCommand.setShuttleNo(deviceNo.shortValue());
+// assignCommand.setTaskNo(motion.getWrkNo().shortValue());
+// assignCommand.setSourceLocNo(motion.getOrigin());
+// assignCommand.setLocNo(motion.getTarget());
+//
+// List<ShuttleCommand> shuttleCommands = new ArrayList<>();
+// ShuttleTaskModeType shuttleTaskModeType = null;
+//
+// SiemensLiftThread liftThread = null;
+// LiftProtocol liftProtocol = null;
+//
+// //鍒ゆ柇灏忚溅鐘舵��
+// if (shuttleProtocol.getBusyStatusType().equals(ShuttleStatusType.IDLE)
+// && shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.IDLE)
+// && shuttleProtocol.getTaskNo().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// switch (Objects.requireNonNull(MotionCtgType.get(motion.getMotionCtgEl()))){
+// case SHUTTLE_MOVE:
+// // 濡傛灉宸茬粡鍦ㄥ綋鍓嶆潯鐮佸垯杩囨护
+// if (String.valueOf(shuttleProtocol.getCurrentCode()).equals(locMastService.selectById(motion.getTarget()).getQrCodeValue())) {
+// return true;
+// }
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_MOVE_LIFT_PALLET://绌挎杞﹂《鍗囧苟绉诲姩
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+// break;
+// case SHUTTLE_MOVE_DOWN_PALLET://绌挎杞︾Щ鍔ㄥ苟鎵樼洏涓嬮檷
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_MOVE_FROM_LIFT://鍑烘彁鍗囨満
+// // 鍒ゆ柇鎻愬崌鏈虹姸鎬�
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+// // 鍒ゆ柇鎻愬崌鏈烘槸鍚﹁嚜鍔ㄣ�佺┖闂层�佸噯澶囧氨缁�侀摼鏉℃病鏈夎浆鍔ㄣ�佹病鏈夋湭灏辩华鎶ラ敊
+// if (!liftProtocol.getMode()
+// || liftProtocol.getRunning()
+// || !liftProtocol.getReady()
+// || liftProtocol.getForwardRotationFeedback()
+// || liftProtocol.getReverseFeedback()
+// || liftProtocol.getNotReady().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// if (liftProtocol.getLev().intValue() != Utils.getLev(motion.getTarget())) {//鍒ゆ柇鎻愬崌鏈烘槸鍚﹁揪鍒扮洰鏍囧眰
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (!liftProtocol.getLiftLock()) {
+// //閿佸畾鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(true);//鑾峰彇鎻愬崌鏈洪攣瀹氬懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;//绛夊緟涓嬩竴娆¤疆璇�
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_MOVE_TO_LIFT://杩涙彁鍗囨満
+// // 鍒ゆ柇鎻愬崌鏈虹姸鎬�
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+// // 鍒ゆ柇鎻愬崌鏈烘槸鍚﹁嚜鍔ㄣ�佺┖闂层�佸噯澶囧氨缁�侀摼鏉℃病鏈夎浆鍔ㄣ�佹病鏈夋湭灏辩华鎶ラ敊
+// if (!liftProtocol.getMode()
+// || liftProtocol.getRunning()
+// || !liftProtocol.getReady()
+// || liftProtocol.getForwardRotationFeedback()
+// || liftProtocol.getReverseFeedback()
+// || liftProtocol.getNotReady().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// if (liftProtocol.getLev().intValue() != Utils.getLev(motion.getTarget())) {//鍒ゆ柇鎻愬崌鏈烘槸鍚﹁揪鍒扮洰鏍囧眰
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (!liftProtocol.getLiftLock()) {
+// //閿佸畾鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(true);//鑾峰彇鎻愬崌鏈洪攣瀹氬懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;//绛夊緟涓嬩竴娆¤疆璇�
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_MOVE_FROM_CONVEYOR:
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_MOVE_TO_CONVEYOR:
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_MOVE_FROM_LIFT_TO_CONVEYOR://绌挎杞﹀嚭鎻愬崌鏈哄幓杈撻�佺嚎
+// // 鍒ゆ柇鎻愬崌鏈虹姸鎬�
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+// // 鍒ゆ柇鎻愬崌鏈烘槸鍚﹁嚜鍔ㄣ�佺┖闂层�佸噯澶囧氨缁�侀摼鏉℃病鏈夎浆鍔ㄣ�佹病鏈夋湭灏辩华鎶ラ敊
+// if (!liftProtocol.getMode()
+// || liftProtocol.getRunning()
+// || !liftProtocol.getReady()
+// || liftProtocol.getForwardRotationFeedback()
+// || liftProtocol.getReverseFeedback()
+// || liftProtocol.getNotReady().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// if (liftProtocol.getLev().intValue() != Utils.getLev(motion.getTarget())) {//鍒ゆ柇鎻愬崌鏈烘槸鍚﹁揪鍒扮洰鏍囧眰
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (!liftProtocol.getLiftLock()) {
+// //閿佸畾鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(true);//鑾峰彇鎻愬崌鏈洪攣瀹氬懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;//绛夊緟涓嬩竴娆¤疆璇�
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
+// break;
+// case SHUTTLE_TRANSPORT:
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+//
+// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_TRANSPORT_FROM_LIFT://绌挎杞﹁浇璐у嚭鎻愬崌鏈�
+// // 鍒ゆ柇鎻愬崌鏈虹姸鎬�
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+// // 鍒ゆ柇鎻愬崌鏈烘槸鍚﹁嚜鍔ㄣ�佺┖闂层�佸噯澶囧氨缁�侀摼鏉℃病鏈夎浆鍔ㄣ�佹病鏈夋湭灏辩华鎶ラ敊
+// if (!liftProtocol.getMode()
+// || liftProtocol.getRunning()
+// || !liftProtocol.getReady()
+// || liftProtocol.getForwardRotationFeedback()
+// || liftProtocol.getReverseFeedback()
+// || liftProtocol.getNotReady().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// if (liftProtocol.getLev().intValue() != Utils.getLev(motion.getTarget())) {//鍒ゆ柇鎻愬崌鏈烘槸鍚﹁揪鍒扮洰鏍囧眰
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (!liftProtocol.getLiftLock()) {
+// //閿佸畾鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(true);//鑾峰彇鎻愬崌鏈洪攣瀹氬懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;//绛夊緟涓嬩竴娆¤疆璇�
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+//// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_TRANSPORT_TO_LIFT://绌挎杞﹁浇璐ц繘鎻愬崌鏈�
+// // 鍒ゆ柇鎻愬崌鏈虹姸鎬�
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+// // 鍒ゆ柇鎻愬崌鏈烘槸鍚﹁嚜鍔ㄣ�佺┖闂层�佸噯澶囧氨缁�侀摼鏉℃病鏈夎浆鍔ㄣ�佹病鏈夋湭灏辩华鎶ラ敊
+// if (!liftProtocol.getMode()
+// || liftProtocol.getRunning()
+// || !liftProtocol.getReady()
+// || liftProtocol.getForwardRotationFeedback()
+// || liftProtocol.getReverseFeedback()
+// || liftProtocol.getNotReady().intValue() != 0
+// ) {
+// return false;
+// }
+//
+// if (liftProtocol.getLev().intValue() != Utils.getLev(motion.getTarget())) {//鍒ゆ柇鎻愬崌鏈烘槸鍚﹁揪鍒扮洰鏍囧眰
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (!liftProtocol.getLiftLock()) {
+// //閿佸畾鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(true);//鑾峰彇鎻愬崌鏈洪攣瀹氬懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;//绛夊緟涓嬩竴娆¤疆璇�
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+//// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_TRANSPORT_FROM_CONVEYOR:
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+//
+// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_TRANSPORT_TO_CONVEYOR:
+// shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), motion.getTarget(), NavigationMapType.DFX.id, assignCommand, shuttleThread);
+// shuttleTaskModeType = ShuttleTaskModeType.PAK_IN;
+//
+// shuttleCommands.add(0, shuttleThread.getPalletCommand((short) 1));
+// shuttleCommands.add(shuttleCommands.size(), shuttleThread.getPalletCommand((short) 2));
+// break;
+// case SHUTTLE_CHARGE_ON:
+// shuttleTaskModeType = ShuttleTaskModeType.CHARGE;
+// shuttleCommands.add(shuttleThread.getChargeSwitchCommand((short) 1));
+// assignCommand.setCharge(Boolean.TRUE);
+// break;
+// default:
+// throw new CoolException(motion.getMotionCtgEl() + "娌℃湁鎸囧畾浠诲姟浣滀笟娴佺▼锛侊紒锛�");
+// }
+//
+// if (Cools.isEmpty(shuttleCommands)) {
+// return false;
+// }
+//
+// assert null != shuttleTaskModeType;
+// assignCommand.setTaskMode(shuttleTaskModeType.id.shortValue());//鍏ュ嚭搴撴ā寮�
+// assignCommand.setCommands(shuttleCommands);
+//
+// if (motion.getOrigin() != null && motion.getTarget() != null) {
+// //鎵�浣跨敤鐨勮矾寰勮繘琛岄攣瀹氱鐢�
+// boolean lockResult = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(motion.getTarget()), shuttleProtocol.getShuttleNo().intValue(), assignCommand.getNodes(), true);//鎵�浣跨敤鐨勮矾寰勮繘琛岄攣瀹氱鐢�
+// if (!lockResult) {
+// return false;//閿佸畾澶辫触
+// }
+// shuttleThread.assignWork(assignCommand);
+// }else {
+// shuttleThread.assignWork(assignCommand);
+// }
+//
+// return Boolean.TRUE;
+// }
+//
+// public Boolean finish(Motion motion) {
+// Integer deviceNo = Integer.parseInt(motion.getDevice());
+// ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, deviceNo);
+// ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+// if (null == shuttleProtocol) {
+// return false;
+// }
+//
+// if (shuttleProtocol.getTaskNo() != 0 && shuttleProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// //鍏呯數浠诲姟
+// if (Objects.requireNonNull(MotionCtgType.get(motion.getMotionCtgEl())).equals(MotionCtgType.SHUTTLE_CHARGE_ON)) {
+// // 澶嶄綅绌挎杞�
+// shuttleProtocol.setTaskNo((short) 0);
+// shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
+// shuttleProtocol.setPakMk(true);
+// return true;
+// }
+//
+// if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING)
+// && !shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING)
+// ) {
+// return false;
+// }
+//
+// if (shuttleProtocol.getBusyStatusType().equals(ShuttleStatusType.BUSY)) {
+// return false;
+// }
+//
+// SiemensLiftThread liftThread = null;
+// LiftProtocol liftProtocol = null;
+//
+// switch (Objects.requireNonNull(MotionCtgType.get(motion.getMotionCtgEl()))){
+// case SHUTTLE_MOVE:
+// case SHUTTLE_MOVE_LIFT_PALLET:
+// case SHUTTLE_MOVE_DOWN_PALLET:
+// case SHUTTLE_MOVE_TO_CONVEYOR:
+// case SHUTTLE_MOVE_FROM_CONVEYOR:
+// if (!shuttleProtocol.getCurrentLocNo().equals(motion.getTarget())) {
+// return false;
+// }
+// break;
+// case SHUTTLE_MOVE_TO_LIFT:
+// case SHUTTLE_MOVE_FROM_LIFT:
+// case SHUTTLE_TRANSPORT_FROM_LIFT:
+// case SHUTTLE_TRANSPORT_TO_LIFT:
+// case SHUTTLE_MOVE_FROM_LIFT_TO_CONVEYOR:
+// liftThread = (SiemensLiftThread) SlaveConnection.get(SlaveType.Lift, Integer.parseInt(motion.getTemp()));
+// if (liftThread == null) {
+// return false;
+// }
+// liftProtocol = liftThread.getLiftProtocol();
+//
+// if (!shuttleProtocol.getCurrentLocNo().equals(motion.getTarget())) {
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈烘槸鍚﹁閿佸畾
+// if (liftProtocol.getLiftLock()) {
+// //瑙i攣鎻愬崌鏈�
+// LiftCommand lockCommand = liftThread.getLockCommand(false);//鑾峰彇鎻愬崌鏈鸿В閿佸懡浠�
+// lockCommand.setLiftNo(liftProtocol.getLiftNo());
+// lockCommand.setTaskNo(motion.getWrkNo().shortValue());//鑾峰彇浠诲姟鍙�
+// liftThread.assignWork(lockCommand);
+// return false;
+// }
+//
+// //鍒ゆ柇鎻愬崌鏈哄伐浣滃彿鏄惁鍜屽綋鍓嶄换鍔$浉鍚�
+// if (liftProtocol.getTaskNo().intValue() != motion.getWrkNo()) {
+// return false;
+// }
+//
+// if (liftProtocol.getTaskNo().intValue() != 0) {
+// //娓呯┖鎻愬崌鏈哄彿
+// liftThread.setTaskNo(0);
+// }
+//
+// break;
+// default:
+// break;
+// }
+//
+// // 澶嶄綅绌挎杞�
+// shuttleProtocol.setTaskNo((short) 0);
+// shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
+// shuttleProtocol.setPakMk(true);
+//
+// return true;
+// }
+//
+// public synchronized List<ShuttleCommand> shuttleAssignCommand(String startLocNo, String endLocNo, Integer mapType, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) {
+// //鑾峰彇灏忚溅绉诲姩閫熷害
+// Integer runSpeed = Optional.ofNullable(basShuttleService.selectById(assignCommand.getShuttleNo()).getRunSpeed()).orElse(1000);
+//
+// List<NavigateNode> nodeList = NavigateUtils.calc(startLocNo, endLocNo, mapType, Utils.getShuttlePoints(shuttleThread.getSlave().getId(), Utils.getLev(startLocNo)));
+// if (nodeList == null) {
+// News.error("{} dash {} can't find navigate path!", startLocNo, endLocNo);
+// return null;
+// }
+// List<NavigateNode> allNode = new ArrayList<>(nodeList);
+//
+// List<ShuttleCommand> commands = new ArrayList<>();
+// //鑾峰彇鍒嗘璺緞
+// ArrayList<ArrayList<NavigateNode>> data = NavigateUtils.getSectionPath(nodeList);
+// //灏嗘瘡涓�娈佃矾寰勫垎鎴恈ommand鎸囦护
+// for (ArrayList<NavigateNode> nodes : data) {
+// //寮�濮嬭矾寰�
+// NavigateNode startPath = nodes.get(0);
+//
+// //涓棿璺緞
+// NavigateNode middlePath = null;
+// //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+// Short middleCodeNum = null;
+// Integer middleToDistDistance = null;//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+// if (nodes.size() > 10) {//涓鐮佷紶鍊掓暟绗笁涓�
+// //涓棿璺緞
+// middlePath = nodes.get(nodes.size() - 3);
+// //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+// middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ());
+// middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes, middlePath);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+// } else if (nodes.size() > 5) {//涓鐮佷紶鍊掓暟绗簩涓�
+// //涓棿璺緞
+// middlePath = nodes.get(nodes.size() - 2);
+// //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+// middleCodeNum = NavigatePositionConvert.xyToPosition(middlePath.getX(), middlePath.getY(), middlePath.getZ());
+// middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes, middlePath);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
+// }
+//
+// //鐩爣璺緞
+// NavigateNode endPath = nodes.get(nodes.size() - 1);
+// Integer allDistance = NavigateUtils.getCurrentPathAllDistance(nodes);//璁$畻褰撳墠璺緞琛岃蛋鎬昏窛绂�
+// //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+// Short startCodeNum = NavigatePositionConvert.xyToPosition(startPath.getX(), startPath.getY(), startPath.getZ());
+// //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
+// Short distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ());
+// //鑾峰彇绉诲姩鍛戒护
+// ShuttleCommand command = shuttleThread.getMoveCommand(startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id, middleCodeNum, middleToDistDistance, runSpeed);
+// command.setNodes(nodes);//灏嗚璧拌妭鐐规坊鍔犲埌姣忎竴姝ュ懡浠や腑
+// commands.add(command);
+// }
+//
+// assignCommand.setNodes(allNode);//褰撳墠浠诲姟鎵�鍗犵敤鐨勮妭鐐筶ist
+//
+// return commands;
+// }
+//
+//
+//}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionCtgMapper.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionCtgMapper.java
new file mode 100644
index 0000000..bd7c363
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionCtgMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wcs.rcs.mapper;
+
+import com.zy.asrs.wcs.rcs.entity.MotionCtg;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface MotionCtgMapper extends BaseMapper<MotionCtg> {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionStsMapper.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionStsMapper.java
new file mode 100644
index 0000000..28a82a9
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/mapper/MotionStsMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wcs.rcs.mapper;
+
+import com.zy.asrs.wcs.rcs.entity.MotionSts;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface MotionStsMapper extends BaseMapper<MotionSts> {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionCtgService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionCtgService.java
new file mode 100644
index 0000000..cb44786
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionCtgService.java
@@ -0,0 +1,8 @@
+package com.zy.asrs.wcs.rcs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zy.asrs.wcs.rcs.entity.MotionCtg;
+
+public interface MotionCtgService extends IService<MotionCtg> {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java
new file mode 100644
index 0000000..7c1bfa5
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java
@@ -0,0 +1,8 @@
+package com.zy.asrs.wcs.rcs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zy.asrs.wcs.rcs.entity.MotionSts;
+
+public interface MotionStsService extends IService<MotionSts> {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionCtgServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionCtgServiceImpl.java
new file mode 100644
index 0000000..037d573
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionCtgServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wcs.rcs.service.impl;
+
+import com.zy.asrs.wcs.rcs.mapper.MotionCtgMapper;
+import com.zy.asrs.wcs.rcs.entity.MotionCtg;
+import com.zy.asrs.wcs.rcs.service.MotionCtgService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("motionCtgService")
+public class MotionCtgServiceImpl extends ServiceImpl<MotionCtgMapper, MotionCtg> implements MotionCtgService {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java
new file mode 100644
index 0000000..1b1dfa6
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wcs.rcs.service.impl;
+
+import com.zy.asrs.wcs.rcs.mapper.MotionStsMapper;
+import com.zy.asrs.wcs.rcs.entity.MotionSts;
+import com.zy.asrs.wcs.rcs.service.MotionStsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("motionStsService")
+public class MotionStsServiceImpl extends ServiceImpl<MotionStsMapper, MotionSts> implements MotionStsService {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
index c5e096b..6dc13a8 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -6,4 +6,10 @@
ShuttleProtocol getStatus();//鑾峰彇鍥涘悜绌挎杞︾姸鎬�
+ boolean movePath();//璺緞涓嬪彂
+
+ boolean move();//绉诲姩
+
+ boolean lift();//椤跺崌
+
}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
index 6c46a09..f2a3918 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -147,6 +147,20 @@
return this.shuttleProtocol;
}
+ @Override
+ public synchronized boolean movePath() {
+ return false;
+ }
+
+ @Override
+ public synchronized boolean move() {
+ return false;
+ }
+
+ @Override
+ public synchronized boolean lift() {
+ return false;
+ }
//***************璁惧灞傞�氳-涓嶅悓鍘傚晢璁惧閫氳鏂规涓嶄竴鑷�***************
diff --git a/zy-asrs-wcs/src/main/java/motionCtg.sql b/zy-asrs-wcs/src/main/java/motionCtg.sql
new file mode 100644
index 0000000..2911274
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/motionCtg.sql
@@ -0,0 +1,9 @@
+-- save motionCtg record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( 'Motion鏍囪绠$悊', '0', '/rcs/motionCtg', '/rcs/motionCtg', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨMotion鏍囪', '', '1', 'rcs:motionCtg:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞Motion鏍囪', '', '1', 'rcs:motionCtg:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼Motion鏍囪', '', '1', 'rcs:motionCtg:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎Motion鏍囪', '', '1', 'rcs:motionCtg:remove', '3', '1', '1');
+
diff --git a/zy-asrs-wcs/src/main/java/motionSts.sql b/zy-asrs-wcs/src/main/java/motionSts.sql
new file mode 100644
index 0000000..bbaf6f5
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/motionSts.sql
@@ -0,0 +1,9 @@
+-- save motionSts record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( 'Motion鐘舵�佺鐞�', '0', '/rcs/motionSts', '/rcs/motionSts', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨMotion鐘舵��', '', '1', 'rcs:motionSts:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞Motion鐘舵��', '', '1', 'rcs:motionSts:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼Motion鐘舵��', '', '1', 'rcs:motionSts:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎Motion鐘舵��', '', '1', 'rcs:motionSts:remove', '3', '1', '1');
+
diff --git a/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionCtgMapper.xml b/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionCtgMapper.xml
new file mode 100644
index 0000000..8f1dc40
--- /dev/null
+++ b/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionCtgMapper.xml
@@ -0,0 +1,5 @@
+<?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.asrs.wcs.rcs.mapper.MotionCtgMapper">
+
+</mapper>
diff --git a/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionStsMapper.xml b/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionStsMapper.xml
new file mode 100644
index 0000000..ae52319
--- /dev/null
+++ b/zy-asrs-wcs/src/main/resources/mapper/rcs/MotionStsMapper.xml
@@ -0,0 +1,5 @@
+<?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.asrs.wcs.rcs.mapper.MotionStsMapper">
+
+</mapper>
--
Gitblit v1.9.1