From 5213d5c3bf7c4b60fbb308fdadfb84f6d999c38b Mon Sep 17 00:00:00 2001
From: zc <zyzc>
Date: 星期五, 14 十一月 2025 23:18:35 +0800
Subject: [PATCH] 出庫訂單完成上報功能優化
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 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 d299f77..53cc96e 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
@@ -93,6 +93,8 @@
private CheckDiffService checkDiffService;
@Autowired
private CheckDiffItemService checkDiffItemService;
+ @Autowired
+ private BasContainerService basContainerService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -305,8 +307,10 @@
throw new CoolException("璇锋鏌ョ粍鎷栫姸鎬佹槸鍚﹀畬鎴愶紒锛�");
}
waitPakins.forEach(pakin -> {
+ BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>()
+ .eq(BasContainer::getCode, pakin.getBarcode()));
/**鑾峰彇搴撲綅*/
- String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId());
+ String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), container.getContainerType());
if (Cools.isEmpty(targetLoc)) {
throw new CoolException("璇ョ珯鐐瑰搴斿簱鍖烘湭鎵惧埌搴撲綅");
}
@@ -347,6 +351,18 @@
if (!this.save(task)) {
throw new CoolException("浠诲姟淇濆瓨澶辫触锛侊紒");
}
+ BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
+ .eq(BasStation::getStationName, deviceSite.getSite()));
+ if (Objects.isNull(station) || !station.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) {
+ throw new CoolException("绔欑偣涓嶅瓨鍦ㄦ垨绔欑偣涓嶅浜庣┖搴撶姸鎬侊紒锛�");
+ }
+ station.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
+
+ if (!basStationService.updateById(station)) {
+ throw new CoolException("绔欑偣鐘舵�佹洿鏂板け璐ワ紒锛�");
+ }
+
+
if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())
.set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type).set(Loc::getBarcode, pakin.getBarcode()))) {
throw new CoolException("搴撲綅棰勭害澶辫触锛侊紒");
@@ -594,7 +610,7 @@
//鏇存柊搴撲綅鏄庣粏
saveLocItem(taskItems, task.getId(), loginUserId);
} catch (Exception e) {
- throw new CoolException("搴撲綅鏄庣粏鏇存柊澶辫触锛侊紒");
+ throw new CoolException("浠诲姟鍙凤細" + task.getTaskCode() + "搴撲綅鏄庣粏鏇存柊澶辫触锛侊紒");
}
if (!locItemService.remove(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, task.getOrgLoc()))) {
@@ -667,9 +683,9 @@
if (Objects.isNull(loc)) {
throw new CoolException("搴撳瓨涓嶅瓨鍦紒锛�");
}
- if (!loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type)) {
- throw new CoolException("褰撳墠搴撲綅鐘舵�佷笉澶勪簬S.鍏ュ簱棰勭害锛屼笉鍙墽琛屽叆搴撴搷浣滐紒");
- }
+// if (!loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type)) {
+// throw new CoolException("褰撳墠搴撲綅鐘舵�佷笉澶勪簬S.鍏ュ簱棰勭害锛屼笉鍙墽琛屽叆搴撴搷浣滐紒");
+// }
loc.setUseStatus(LocStsType.LOC_STS_TYPE_F.type)
.setBarcode(task.getBarcode())
@@ -1143,11 +1159,11 @@
if (Objects.isNull(waveItem)) {
throw new CoolException("娉㈡鏄庣粏涓嶅瓨鍦紒锛�");
}
- try {
- saveOutStockItem(maps.get(key), null, waveItem, null, loginUserId);
- } catch (Exception e) {
- throw new CoolException(e.getMessage());
- }
+// try {
+// saveOutStockItem(maps.get(key), null, waveItem, null, loginUserId);
+// } catch (Exception e) {
+// throw new CoolException(e.getMessage());
+// }
} else if (task.getResource().equals(TaskResouceType.TASK_RESOUCE_ORDER_TYPE.val)) {
WkOrderItem orderItem = asnOrderItemService.getById(key);
if (Objects.isNull(orderItem)) {
@@ -1235,6 +1251,7 @@
* @description: 鍑哄簱淇℃伅淇濆瓨鑷冲簱瀛樻槑缁嗚〃
* @version 1.0
*/
+ @Override
@Transactional(rollbackFor = Exception.class)
public void saveOutStockItem(List<TaskItem> taskItems, WkOrderItem orderItem, WaveItem waveItem, WkOrderItem diffItem, Long loginUserId) throws Exception {
Stock stock = new Stock();
--
Gitblit v1.9.1