From f46e6a76cee1e4f231fab74981a87947bf84677d Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期二, 15 十月 2024 11:02:47 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java
index 56a428b..60ce3cf 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java
@@ -42,8 +42,29 @@
@Override
public Boolean hasRunningMotion(String uuid, Long hostId) {
- return null != this.selectOfTop1(uuid, MotionStsType.EXECUTING.val(), hostId)
- || null != this.selectOfTop1(uuid, MotionStsType.ERROR.val(), hostId);
+ Motion executeMotion = this.selectOfTop1(uuid, MotionStsType.EXECUTING.val(), hostId);
+ Motion errorMotion = this.selectOfTop1(uuid, MotionStsType.ERROR.val(), hostId);
+ if(errorMotion != null) {
+ return true;
+ }
+
+ if(executeMotion != null) {
+ if (executeMotion.getSync() == 0) {
+ //妫�娴嬫槸鍚︽湁鍚屾鍔ㄤ綔
+ List<Motion> syncMotion = this.list(new LambdaQueryWrapper<Motion>()
+ .eq(Motion::getUuid, uuid)
+ .eq(Motion::getMotionSts, MotionStsType.EXECUTING.val())
+ .eq(Motion::getHostId, hostId)
+ .eq(Motion::getSync, 1));
+ if (!syncMotion.isEmpty()) {
+ return true;//瀛樺湪鍚屾鍔ㄤ綔
+ }
+ return false;//褰撳墠鍔ㄤ綔涓哄紓姝ユ搷浣�
+ }
+ return true;
+ }
+
+ return false;
}
@Override
@@ -77,12 +98,15 @@
}
@Override
- public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo) {
+ public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo, Long hostId) {
int i = motionList.size();
for (Motion motion : motionList) {
motion.setPriority(i);
motion.setTaskNo(taskNo);
motion.setUuid(uuid);
+ if (hostId != null) {
+ motion.setHostId(hostId);
+ }
if (!this.save(motion)) {
throw new CoolException(JSON.toJSONString(motion) + "鍔ㄤ綔淇濆瓨澶辫触");
}
@@ -90,4 +114,9 @@
}
return motionList.size();
}
+
+ @Override
+ public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo) {
+ return batchInsert(motionList, uuid, taskNo, null);
+ }
}
--
Gitblit v1.9.1