From 4669093ba4887bed13ba741187c6f760b795461b Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期五, 12 四月 2024 12:30:26 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapUtils.java | 23 +++--
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/RedisMapDto.java | 19 ++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java | 32 +-------
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java | 5 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java | 11 +-
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java | 7 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java | 5 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java | 4
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java | 25 +-----
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java | 66 ++++++----------
10 files changed, 90 insertions(+), 107 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/RedisMapDto.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/RedisMapDto.java
new file mode 100644
index 0000000..6ad8a42
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/domain/dto/RedisMapDto.java
@@ -0,0 +1,19 @@
+package com.zy.asrs.wcs.core.domain.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class RedisMapDto {
+
+ private String data;
+
+ private Date createTime;
+
+ private Date updateTime;
+
+ private Integer lev;
+
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
index 122398a..7eef25c 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -5,6 +5,7 @@
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.core.action.LiftAction;
import com.zy.asrs.wcs.core.action.ShuttleAction;
+import com.zy.asrs.wcs.core.entity.BasShuttle;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.command.ShuttleAssignCommand;
@@ -85,6 +86,7 @@
assignCommand.setTaskNo(motion.getWrkNo());
assignCommand.setSourceLocNo(motion.getOrigin());
assignCommand.setLocNo(motion.getTarget());
+ assignCommand.setDeviceId(Integer.parseInt(motion.getDevice()));
List<ShuttleCommand> shuttleCommands = new ArrayList<>();
ShuttleTaskModeType shuttleTaskModeType = null;
@@ -332,7 +334,7 @@
public synchronized List<ShuttleCommand> shuttleAssignCommand(String startLocNo, String endLocNo, Integer mapType, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) {
//鑾峰彇灏忚溅绉诲姩閫熷害
- Integer runSpeed = Optional.ofNullable(basShuttleService.getById(assignCommand.getShuttleNo()).getRunSpeed()).orElse(1000);
+ Integer runSpeed = Optional.ofNullable(basShuttleService.getOne(new LambdaQueryWrapper<BasShuttle>().eq(BasShuttle::getDeviceId, assignCommand.getDeviceId())).getRunSpeed()).orElse(1000);
Long hostId = shuttleThread.getDevice().getHostId();
List<NavigateNode> nodeList = NavigateUtils.calc(startLocNo, endLocNo, mapType, Utils.getShuttlePoints(Integer.parseInt(shuttleThread.getDevice().getDeviceNo()), Utils.getLev(startLocNo)));
if (nodeList == null) {
@@ -349,25 +351,6 @@
//寮�濮嬭矾寰�
NavigateNode startPath = nodes.get(0);
- //涓棿璺緞
- NavigateNode middlePath = null;
- //閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
- String 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(), hostId);
- 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(), hostId);
- middleToDistDistance = NavigateUtils.getMiddleToDistDistance(nodes, middlePath);//璁$畻涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂�
- }
-
//鐩爣璺緞
NavigateNode endPath = nodes.get(nodes.size() - 1);
Integer allDistance = NavigateUtils.getCurrentPathAllDistance(nodes);//璁$畻褰撳墠璺緞琛岃蛋鎬昏窛绂�
@@ -376,7 +359,7 @@
//閫氳繃xy鍧愭爣灏忚溅浜岀淮鐮�
String distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ(), hostId);
//鑾峰彇绉诲姩鍛戒护
- ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getTaskNo().intValue(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed);
+ ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed);
command.setNodes(nodes);//灏嗚璧拌妭鐐规坊鍔犲埌姣忎竴姝ュ懡浠や腑
commands.add(command);
}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java
index 76616ea..3d6ee5b 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java
@@ -15,6 +15,11 @@
private Integer shuttleNo = 0;
/**
+ * 璁惧ID
+ */
+ private Integer deviceId;
+
+ /**
* 浠诲姟鍙�
*/
private Integer taskNo = 0;
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
index 74784be..54c4852 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SnowflakeIdWorker;
+import com.zy.asrs.wcs.core.domain.dto.RedisMapDto;
import com.zy.asrs.wcs.core.entity.*;
import com.zy.asrs.wcs.core.kernel.AnalyzeService;
import com.zy.asrs.wcs.core.model.MapNode;
@@ -174,11 +175,11 @@
Integer lev = entry.getKey();
Date now = new Date();
- HashMap<String, Object> map = new HashMap<>();
- map.put("data", JSON.toJSONString(lists));
- map.put("create_time", now);
- map.put("update_time", now);
- map.put("lev", lev);
+ RedisMapDto map = new RedisMapDto();
+ map.setData(JSON.toJSONString(lists));
+ map.setCreateTime(now);
+ map.setUpdateTime(now);
+ map.setLev(lev);
//灏嗗湴鍥炬暟鎹瓨鍏edis
redisUtil.set(DeviceRedisConstant.MAP + lev, JSON.toJSONString(map));
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
index 6244431..1868b6b 100644
--- 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
@@ -6,10 +6,13 @@
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.entity.Loc;
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.core.service.LocService;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.*;
@@ -22,6 +25,9 @@
*/
@Component
public class NavigateMapData {
+
+ @Autowired
+ private LocService locService;
private Integer lev;//鍦板浘妤煎眰
@@ -121,33 +127,16 @@
//鑾峰彇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();
+ RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
+ Object o = redisUtil.get(DeviceRedisConstant.MAP + lev);
+ if (o == null) {
+ return null;
}
- return null;
+
+ BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
+ ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
+ List<List<MapNode>> lists = filterMap(mapType, arrayList, lev, whitePoints, shuttlePoints);//杩囨护鍦板浘鏁版嵁
+ return lists;
}
/**
@@ -172,13 +161,12 @@
}
//杩囨护鏁版嵁
- 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();
+ List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>()
+ .eq(Loc::getLev, lev));
+ for (Loc loc : locs) {
+ Integer row = loc.getRow();
+ Integer bay = loc.getBay();
boolean whiteFlag = false;//榛樿涓嶅瓨鍦ㄧ櫧鍚嶅崟
if (whitePoints != null) {
@@ -203,17 +191,15 @@
} 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")
+ if (loc.getLocSts$().equals("F")
+ || loc.getLocSts$().equals("D")
+ || loc.getLocSts$().equals("X")
) {
mapNode.setValue(-1);//绂佺敤鑺傜偣
}
} else if (mapType == NavigationMapType.NORMAL.id) {
//杩囨护搴撲綅鐘舵�乆
- if (locMast.getLocSts().equals("X")) {
+ if (loc.getLocSts$().equals("X")) {
mapNode.setValue(-1);//绂佺敤鑺傜偣
}
}
@@ -267,8 +253,8 @@
}
}
- NavigateMapData mapData = new NavigateMapData(nodes.get(0).getZ());
- List<List<MapNode>> realMap = mapData.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
+ this.setLev(nodes.get(0).getZ());
+ List<List<MapNode>> realMap = this.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
for (NavigateNode node : nodes) {
if (node.getZ() != lev) {
continue;
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
index 00a447e..9e34086 100644
--- 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
@@ -1,12 +1,13 @@
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.domain.dto.RedisMapDto;
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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
@@ -15,6 +16,9 @@
@Component
public class NavigateMapUtils {
+
+ @Autowired
+ private NavigateMapData navigateMapData;
/**
* 鍐欏叆璺緞鑺傜偣鏁版嵁鍒皉edis鍦板浘涓�
@@ -27,8 +31,7 @@
return true;
}
- NavigateMapData navigateMapData = new NavigateMapData(lev);
-
+ navigateMapData.setLev(lev);
Object o = redisUtil.get(DeviceRedisConstant.MAP + lev);
if (o == null) {
return false;
@@ -37,8 +40,8 @@
//鑾峰彇灏忚溅鑺傜偣
List<int[]> shuttlePoints = Utils.getShuttlePoints(shuttleNo, lev);
- BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
- ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
+ RedisMapDto redisMap = JSON.parseObject(o.toString(), RedisMapDto.class);
+ ArrayList arrayList = JSON.parseObject(redisMap.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);//鑾峰彇鍏ㄩ儴鍦板浘鏁版嵁
@@ -58,8 +61,8 @@
}
//灏濊瘯閿佸畾/瑙i攣璺緞
- NavigateMapData mapData = new NavigateMapData(nodes.get(0).getZ());
- List<List<MapNode>> realMap = mapData.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
+ navigateMapData.setLev(nodes.get(0).getZ());
+ List<List<MapNode>> realMap = navigateMapData.getJsonData(-1, null, null);//鑾峰彇瀹屾暣鍦板浘(鍖呮嫭鍏ュ簱鍑哄簱)
for (NavigateNode node : nodes) {
if (node.getZ() != lev) {
continue;
@@ -79,10 +82,10 @@
listX.set(node.getY(), mapNode);
lists.set(node.getX(), listX);
}
- basMap.setData(JSON.toJSONString(lists));
- basMap.setUpdateTime(new Date());
+ redisMap.setData(JSON.toJSONString(lists));
+ redisMap.setUpdateTime(new Date());
//灏嗘暟鎹簱鍦板浘鏁版嵁瀛樺叆redis
- redisUtil.set(DeviceRedisConstant.MAP + lev, JSON.toJSONString(basMap));
+ redisUtil.set(DeviceRedisConstant.MAP + lev, JSON.toJSONString(redisMap));
return true;
} catch (Exception e) {
e.printStackTrace();
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java
index a44bd3d..fb6fa67 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java
@@ -12,38 +12,14 @@
public class NavigatePositionConvert {
public static String xyToPosition(int x, int y, int z, Long hostId) {
- StringBuffer sb = new StringBuffer();
- if (x < 10) {
- sb.append("0");
- }
- sb.append(x);
-
- if (y < 10) {
- sb.append("00");
- } else if (y < 100) {
- sb.append("0");
- }
- sb.append(y);
-
- if (z < 10) {
- sb.append("0");
- }
- sb.append(z);
- String position = sb.toString();//搴撲綅鍙�
+ String locNo = Utils.getLocNo(x, y, z);
//搴撲綅鍙疯浆灏忚溅浜岀淮鐮�
LocService locMastService = SpringUtils.getBean(LocService.class);
Loc locMast = locMastService.getOne(new LambdaQueryWrapper<Loc>()
- .eq(Loc::getLocNo, position)
+ .eq(Loc::getLocNo, locNo)
.eq(Loc::getHostId, hostId));
if (locMast == null) {
-// //褰撳墠搴撲綅鍙锋煡涓嶅埌锛屽彲鑳芥槸绔欑偣搴撲綅鍙�
-// BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
-// BasDevp basDevp = basDevpService.queryByLocNo(position);
-// if (basDevp == null) {
-// return null;
-// }
-// return Short.parseShort(basDevp.getQrCodeValue());
return null;
}
return locMast.getCode();
@@ -51,8 +27,8 @@
//鍧愭爣缂栧彿杞瑇y杞�
public static int[] positionToXY(String position) {
- int col = Integer.parseInt(position.substring(0, 2));
- int row = Integer.parseInt(position.substring(2, 5));
+ int col = Utils.getRow(position);
+ int row = Utils.getBay(position);
int[] newPosition = coverPosition(col,row);
//杩斿洖x鍜寉
// return new int[]{row, col};
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
index 1934fc0..571adb5 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
@@ -1,5 +1,6 @@
package com.zy.asrs.wcs.core.utils;
+import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.core.model.NavigateNode;
import java.util.ArrayList;
@@ -18,14 +19,16 @@
public NavigateSolution() {
//杞藉叆鍦板浘
- NavigateMapData mapData = new NavigateMapData();
+ NavigateMapData mapData = SpringUtils.getBean(NavigateMapData.class);
+ mapData.setLev(1);
int[][] data = mapData.getData();
this.map = data;
}
public NavigateSolution(Integer mapType, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
//杞藉叆鍦板浘鎸囧畾灞傞珮鍦板浘
- NavigateMapData mapData = new NavigateMapData(lev);
+ NavigateMapData mapData = SpringUtils.getBean(NavigateMapData.class);
+ mapData.setLev(lev);
int[][] data = mapData.getDataFromRedis(mapType, whitePoints, shuttlePoints);
if (data == null) {
data = mapData.getData(mapType, whitePoints, shuttlePoints);
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
index 1aa29cd..1f21489 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateUtils.java
@@ -1,5 +1,6 @@
package com.zy.asrs.wcs.core.utils;
+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;
@@ -168,7 +169,8 @@
//鑾峰彇浠巟鐐瑰埌涓嬩竴鐐圭殑琛岃蛋璺濈
public static Integer getXToNextDistance(NavigateNode xNode) {
- NavigateMapData mapData = new NavigateMapData();
+ NavigateMapData mapData = SpringUtils.getBean(NavigateMapData.class);
+ mapData.setLev(xNode.getZ());
List<List<MapNode>> lists = mapData.getJsonData(NavigationMapType.NONE.id, null, null);
if (lists != null) {
MapNode mapNode = lists.get(xNode.getX()).get(xNode.getY());
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 d9930f0..600cd12 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
@@ -35,6 +35,7 @@
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.concurrent.TimeUnit;
@Slf4j
@SuppressWarnings("all")
@@ -267,6 +268,7 @@
.setPath("/RDS/runRoute")
.setHeaders(headers)
.setJson(JSON.toJSONString(param))
+ .setTimeout(60, TimeUnit.SECONDS)
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
@@ -296,6 +298,7 @@
.setPath("/RDS/runOrder")
.setHeaders(headers)
.setJson(command.getBody())
+ .setTimeout(60, TimeUnit.SECONDS)
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
@@ -325,6 +328,7 @@
.setPath("/RDS/actionOrder")
.setHeaders(headers)
.setJson(command.getBody())
+ .setTimeout(60, TimeUnit.SECONDS)
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
@@ -354,6 +358,7 @@
.setPath("/RDS/actionOrder")
.setHeaders(headers)
.setJson(command.getBody())
+ .setTimeout(60, TimeUnit.SECONDS)
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
--
Gitblit v1.9.1