From d107c1cca034fb6cdde077656fa1776d09a4442f Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 02 四月 2025 14:24:52 +0800
Subject: [PATCH] no message
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
index cd40c71..69a060d 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -1,6 +1,7 @@
package com.vincent.rsf.server.manager.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.vincent.rsf.server.api.entity.enums.OrderType;
import com.vincent.rsf.server.api.entity.enums.TaskStsType;
import com.vincent.rsf.framework.common.R;
@@ -12,11 +13,13 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vincent.rsf.server.manager.utils.LocManageUtil;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
+import com.vincent.rsf.server.system.enums.LocStsType;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@@ -32,6 +35,9 @@
private TaskItemService taskItemService;
@Autowired
private WaitPakinItemService waitPakinItemService;
+ @Autowired
+ private LocService locService;
+
@@ -44,7 +50,8 @@
* @time 2025/3/29 15:59
*/
@Override
- public R generateTasks(List<WaitPakin> waitPakin, Long loginUserId) {
+ @Transactional(rollbackFor = Exception.class)
+ public synchronized R generateTasks(List<WaitPakin> waitPakin, Long loginUserId) {
if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -73,6 +80,11 @@
if (!this.save(task)) {
throw new CoolException("浠诲姟淇濆瓨澶辫触锛侊紒");
}
+ if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, pakin.getCode())
+ .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type).set(Loc::getBarcode, pakin.getBarcode()))) {
+ throw new CoolException("搴撲綅棰勭害澶辫触锛侊紒");
+ }
+
/**鑾峰彇缁勬嫋鏄庣粏**/
List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, pakin.getId()));
if (waitPakinItems.isEmpty()) {
@@ -93,14 +105,23 @@
if (!taskItemService.saveBatch(taskItems)) {
throw new CoolException("浠诲姟鏄庣粏淇濆瓨澶辫触锛侊紒");
}
-
-
-
});
- //TODO 浠诲姟鐢熸垚瀹屾垚闇�淇敼浠诲姟ASN璁㈠崟鐘舵�佷负鎵ц涓紝缁勬嫋鍒犻櫎闇�鍒ゆ柇鏄惁鏈夊瓙浠诲姟鍦ㄦ墽琛�
return R.ok("浠诲姟鐢熸垚瀹屾瘯锛�");
}
+ /**
+ * @author Ryan
+ * @description 瀹屾垚浠诲姟
+ * @param
+ * @return
+ * @time 2025/4/2 11:15
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public R completeTask(String id) {
+ return null;
+ }
+
}
--
Gitblit v1.9.1