From 0fc62ab3d5d038235b328d91cda0192a34617fb9 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 19 五月 2025 20:17:30 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java | 144 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 124 insertions(+), 20 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
index 313e204..2d75205 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
@@ -1,11 +1,21 @@
package com.zy.asrs.wcs.core.kernel;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.core.domain.dto.MotionDto;
+import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.entity.Motion;
+import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
import com.zy.asrs.wcs.core.service.MotionService;
import com.zy.asrs.wcs.core.utils.LiftDispatcher;
+import com.zy.asrs.wcs.core.utils.NavigateUtils;
+import com.zy.asrs.wcs.core.utils.Utils;
+import com.zy.asrs.wcs.rcs.News;
+import com.zy.asrs.wcs.rcs.entity.Device;
+import com.zy.asrs.wcs.rcs.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -22,6 +32,10 @@
private MotionService motionService;
@Autowired
private LiftDispatcher liftDispatcher;
+ @Autowired
+ private NavigateUtils navigateUtils;
+ @Autowired
+ private DeviceService deviceService;
// agv -----------------------------------------------------------------------------
@Deprecated
@@ -55,13 +69,15 @@
motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
}
motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
- }));
-// if (target.getUpdateLiftNo() != null && target.getWrkNo() != null) {
-// if (target.getUpdateLiftNo()) {
-//
-// }
-// }
+ if (target.getSync() != null) {
+ motion.setSync(target.getSync());
+ }
+
+ if (target.getReleaseLift() != null) {
+ motion.setReleaseLift(target.getReleaseLift());
+ }
+ }));
return motionList;
}
@@ -84,6 +100,18 @@
}
motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
motion.setTarDrt(target.getStaNo());//鐩爣绔�
+
+ if (target.getDevpNo() != null) {
+ motion.setDockNo(String.valueOf(target.getDevpNo()));//杈撻�佺嚎ID
+ }
+
+ if (target.getSync() != null) {
+ motion.setSync(target.getSync());
+ }
+
+ if (target.getReleaseLift() != null) {
+ motion.setReleaseLift(target.getReleaseLift());
+ }
}));
return motionList;
@@ -104,6 +132,11 @@
if (null != origin) {
motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
}
+
+ if (target.getTaskNo() != null) {
+ motion.setTaskNo(target.getTaskNo());
+ }
+
motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
}));
@@ -162,6 +195,14 @@
motion.setDeviceCtg(DeviceCtgType.LIFT.val());
motion.setDevice(String.valueOf(target.getLiftNo()));
motion.setMotionCtg(MotionCtgType.LIFT_LOCK.val());
+
+ if (target.getSync() != null) {
+ motion.setSync(target.getSync());
+ }
+
+ if (target.getReleaseLift() != null) {
+ motion.setReleaseLift(target.getReleaseLift());
+ }
}));
return motionList;
@@ -177,6 +218,14 @@
motion.setDeviceCtg(DeviceCtgType.LIFT.val());
motion.setDevice(String.valueOf(target.getLiftNo()));
motion.setMotionCtg(MotionCtgType.LIFT_UNLOCK.val());
+
+ if (target.getSync() != null) {
+ motion.setSync(target.getSync());
+ }
+
+ if (target.getReleaseLift() != null) {
+ motion.setReleaseLift(target.getReleaseLift());
+ }
}));
return motionList;
@@ -263,8 +312,35 @@
motion.setTemp(String.valueOf(origin.getLiftNo()));//淇濆瓨鎻愬崌鏈哄彿
motion.setDockNo(String.valueOf(target.getStaNo()));
break;
+ case SHUTTLE_TRANSPORT_TO_CONVEYOR://绌挎杞﹁浇璐ц繘杈撻�佺嚎
+ motion.setDockNo(String.valueOf(target.getStaNo()));
+ break;
+ case SHUTTLE_MOVE_STANDBY://绌挎杞︾Щ鍔ㄥ埌寰呮満浣�
+ motion.setTarget(null);//绛夊緟鑷姩鎼滅储
+ motion.setTemp(target.getLocNo());//鍏ㄩ儴寰呮満浣�
+ break;
default:
break;
+ }
+
+ if (target.getSync() != null) {
+ motion.setSync(target.getSync());
+ }
+
+ if (target.getReleaseShuttle() != null) {
+ motion.setReleaseShuttle(target.getReleaseShuttle());
+ }
+
+ if (target.getReleaseLift() != null) {
+ motion.setReleaseLift(target.getReleaseLift());
+ }
+
+ if (motion.getOrigin() != null && motion.getTarget() != null) {
+ List<NavigateNode> nodeList = navigateUtils.calc(motion.getOrigin(), motion.getTarget(), NavigationMapType.NONE_LOCK.id, Utils.getShuttlePoints(Integer.parseInt(target.getShuttleDevice().getDeviceNo()), Utils.getLev(motion.getTarget())));
+ if (nodeList == null) {
+ throw new CoolException(motion.getOrigin() + " dash " + motion.getTarget() + " can't find navigate path!");
+ }
+ motion.setMovePath(JSON.toJSONString(nodeList));
}
}));
@@ -327,23 +403,15 @@
case SHUTTLE_PALLET_DOWN://鎵樼洏涓嬮檷
break;
+ case SHUTTLE_CHARGE_ON://鍏呯數寮�
+
+ break;
+ case SHUTTLE_CHARGE_OFF://鍏呯數鍏�
+
+ break;
default:
break;
}
-
- }));
-
- return motionList;
- }
-
- public List<Motion> shuttleCharge(MotionDto origin, MotionDto target) {
- List<Motion> motionList = new ArrayList<>();
-
- motionList.add(Motion.build(motion -> {
- motion.setDeviceCtg(DeviceCtgType.SHUTTLE.val());
- motion.setDevice(String.valueOf(target.getShuttleNo()));
-
- motion.setMotionCtg(MotionCtgType.SHUTTLE_CHARGE_ON.val());
}));
@@ -413,4 +481,40 @@
return motionList;
}
+ // Map -----------------------------------------------------------------------------
+
+ /**
+ * 鍦板浘璺緞閿佸畾
+ */
+ public List<Motion> mapLockPath(MotionDto origin, MotionDto target) {
+ List<Motion> motionList = new ArrayList<>();
+
+ motionList.add(Motion.build(motion -> {
+ motion.setDeviceCtg(DeviceCtgType.MAP.val());
+ motion.setDevice(String.valueOf(target.getShuttleNo()));
+ motion.setMotionCtg(MotionCtgType.MAP_LOCK_PATH.val());
+
+ motion.setTarget(target.getLocNo());
+ }));
+
+ return motionList;
+ }
+
+ /**
+ * 鍦板浘璺緞瑙i攣
+ */
+ public List<Motion> mapUnlockPath(MotionDto origin, MotionDto target) {
+ List<Motion> motionList = new ArrayList<>();
+
+ motionList.add(Motion.build(motion -> {
+ motion.setDeviceCtg(DeviceCtgType.MAP.val());
+ motion.setDevice(String.valueOf(target.getShuttleNo()));
+ motion.setMotionCtg(MotionCtgType.MAP_UNLOCK_PATH.val());
+
+ motion.setTarget(target.getLocNo());
+ }));
+
+ return motionList;
+ }
+
}
--
Gitblit v1.9.1