From 1c7184503554a6728895489b084cc4b523f261f2 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 23 五月 2025 09:39:48 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
index 6bb75cf..238e703 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -18,9 +18,11 @@
import com.vincent.rsf.server.manager.service.TaskService;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
+import lombok.Synchronized;
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;
@@ -48,6 +50,8 @@
* @return
*/
@Override
+ @Synchronized
+ @Transactional(rollbackFor = Exception.class)
public R generateTask(Map<String, Object> map) {
if (Objects.isNull(map.get("siteNo"))) {
throw new CoolException("绔欑偣涓嶈兘涓虹┖锛�");
@@ -64,6 +68,12 @@
if (Objects.isNull(loc)) {
throw new CoolException("鏁版嵁閿欒锛氭墍閫夊簱瀛樹俊鎭笉瀛樺湪锛侊紒");
}
+ loc.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
+
+ if (!locService.updateById(loc)) {
+ throw new CoolException("搴撲綅鐘舵�佹洿鏂板け璐ワ紒锛�");
+ }
+
String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_TASK_CODE, null);
task.setOrgLoc(loc.getCode())
.setTaskCode(ruleCode)
@@ -77,10 +87,17 @@
}
Double orgQty = locItems.stream().mapToDouble(LocItem::getAnfme).sum();
+ Double workQty = locItems.stream().mapToDouble(LocItem::getWorkQty).sum();
List<LocItem> locItemList = listMap.get(key);
Double outQty = locItemList.stream().mapToDouble(LocItem::getOutQty).sum();
- if (orgQty.compareTo(outQty) > 0) {
+
+ Task serviceOne = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, loc.getBarcode()));
+ if (!Objects.isNull(serviceOne)) {
+ throw new CoolException("鎵樼洏浠诲姟鎵ц涓紝涓嶈兘閲嶅鍒涘缓锛�");
+ }
+ Double useQty = Math.round((outQty + workQty) * 10000) / 10000.0;
+ if (orgQty.compareTo(useQty) > 0) {
//鎷f枡鍑哄簱
task.setTaskType(TaskType.TASK_TYPE_PICK_AGAIN_IN.type);
} else {
--
Gitblit v1.9.1