From d91fae31f20fa81081fe1b0769437be66470175d Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期二, 03 三月 2026 14:38:25 +0800
Subject: [PATCH] lsh#
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 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 15505a1..b81ea09 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
@@ -51,6 +51,8 @@
private WaveService waveService;
@Autowired
private BasStationService basStationService;
+ @Autowired
+ private LocItemWorkingService locItemWorkingService;
/**
@@ -106,7 +108,7 @@
//绌哄鍣ㄥ嚭搴�
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
.eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
- .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_EMPTY_OUT.type));
+ .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_EMPTY_OUT.type).last("limit 1"));
if (Objects.isNull(deviceSite)) {
throw new CoolException("绔欑偣涓嶆敮鎸佺┖瀹瑰櫒鍑哄簱锛侊紒");
}
@@ -211,7 +213,7 @@
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
.eq(DeviceSite::getSite, siteNo)
.eq(!Objects.isNull(loc.getChannel()),DeviceSite::getChannel, loc.getChannel())
- .eq(DeviceSite::getType, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type));
+ .eq(DeviceSite::getType, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type).last("limit 1"),false);
if (Objects.isNull(deviceSite)) {
throw new CoolException("绔欑偣涓嶆敮鎸佹嫞鏂欏嚭搴擄紒锛�");
}
@@ -220,8 +222,8 @@
if (resouce.equals(TaskResouceType.TASK_RESOUCE_STOCK_UP.val)){
//鍏ㄦ澘鍑哄簱
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
- .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type));
-// .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
+ .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type)
+ .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel()).last("limit 1"));
if (Objects.isNull(deviceSite)) {
throw new CoolException("绔欑偣涓嶆敮鎸佽秺搴擄紒锛�");
}
@@ -229,8 +231,8 @@
} else {
//鍏ㄦ澘鍑哄簱
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
- .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type));
-// .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
+ .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type)
+ .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel()).last("limit 1"));
if (Objects.isNull(deviceSite)) {
throw new CoolException("绔欑偣涓嶆敮鎸佸叏鏉垮嚭搴擄紒锛�");
}
@@ -243,7 +245,7 @@
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
.eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel())
.eq(DeviceSite::getSite, siteNo)
- .eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type));
+ .eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type).last("limit 1"));
if (Objects.isNull(deviceSite)) {
throw new CoolException("褰撳墠绔欑偣涓嶆敮鎸佺洏鐐瑰嚭搴擄紒锛�");
}
@@ -286,6 +288,7 @@
throw new CoolException("涓讳换鍔″叧鑱斿け璐ワ紒锛�");
}
}
+ locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()));
List<TaskItem> taskItems = new ArrayList<>();
listMap.get(key).forEach(item -> {
@@ -340,6 +343,21 @@
if (!locItemService.updateById(item)) {
throw new CoolException("搴撳瓨淇℃伅淇敼澶辫触锛侊紒");
}
+
+ if (taskItem.getAnfme() > 0) {
+ LocItemWorking itemWorking = new LocItemWorking();
+ BeanUtils.copyProperties(taskItem, itemWorking);
+ itemWorking.setTaskId(task.getId())
+ .setQty(0.0)
+ .setLocId(loc.getId())
+ .setLocItemId(locItem.getId())
+ .setType("out")
+ .setLocCode(loc.getCode());
+
+ if (!locItemWorkingService.save(itemWorking)) {
+ throw new CoolException("涓存椂搴撳瓨鏇存柊澶辫触锛侊紒");
+ }
+ }
});
if (!taskItemService.saveBatch(taskItems)) {
@@ -381,7 +399,7 @@
//鐩爣搴撲綅涓虹┖锛岃嚜鍔ㄨ幏鍙栨柊搴撲綅
DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
.eq(DeviceSite::getType, TaskType.TASK_TYPE_LOC_MOVE.type)
- .eq(!Objects.isNull(orgLoc.getChannel()), DeviceSite::getChannel, orgLoc.getChannel()), false);
+ .eq(!Objects.isNull(orgLoc.getChannel()), DeviceSite::getChannel, orgLoc.getChannel()).last("limit 1"), false);
if (Objects.isNull(deviceSite)) {
throw new CoolException("绔欑偣淇℃伅涓嶅瓨鍦紒锛�");
}
--
Gitblit v1.9.1