From 5b6f41cd1459210faf744f7dec543c02a31a0df7 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 01 四月 2025 14:41:21 +0800
Subject: [PATCH] 任务生成问题修复 库位判断问题修复
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 40 ++++++++++++++++------------------------
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java | 1 -
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java | 2 +-
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java | 4 ++--
4 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
index ea755fb..a43f68a 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/MobileServiceImpl.java
@@ -430,7 +430,7 @@
detlsDto.setAsnCode(asnOrderItem.getAsnCode())
.setMaktx(asnOrderItem.getMaktx())
- .setBarcode(asnOrderItem.getBarcode())
+ .setBarcode(asnOrderItem.getTrackCode())
.setPoCode(asnOrderItem.getPoCode())
.setAnfme(asnOrderItem.getAnfme())
.setPurQty(asnOrderItem.getPurQty())
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java
index 01e29f1..7d2e4a6 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java
@@ -147,7 +147,6 @@
* 鏄惁鍒犻櫎 1: 鏄� 0: 鍚�
*/
@ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄� 0: 鍚� ")
- @TableLogic
private Integer deleted;
/**
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 30fee00..1d9dab4 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
@@ -55,18 +55,12 @@
if (waitPakins.isEmpty()) {
throw new CoolException("缁勬嫋淇℃伅涓嶅瓨鍦紒锛�");
}
- /**鑾峰彇缁勬嫋鏄庣粏**/
- List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().in(WaitPakinItem::getPakinId, ids));
- if (waitPakinItems.isEmpty()) {
- throw new CoolException("鏁版嵁閿欒锛氱粍鎷栨槑缁嗕笉瀛樺湪");
- }
- String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_TASK_CODE, null);
- if (StringUtils.isBlank(ruleCode)) {
- throw new CoolException("缂栫爜閿欒锛氳纭缂栫爜銆孲YS_TASK_CODE銆嶆槸鍚﹀凡鐢熸垚!!");
- }
-
- List<Task> tasks = new ArrayList<>();
waitPakins.forEach(pakin -> {
+ List<TaskItem> taskItems = new ArrayList<>();
+ String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_TASK_CODE, null);
+ if (StringUtils.isBlank(ruleCode)) {
+ throw new CoolException("缂栫爜閿欒锛氳纭缂栫爜銆孲YS_TASK_CODE銆嶆槸鍚﹀凡鐢熸垚!!");
+ }
Task task = new Task();
task.setTaskCode(ruleCode)
.setTaskStatus(TaskStsType.GENERATE_IN.id.shortValue())
@@ -74,19 +68,15 @@
.setTargLoc(LocManageUtil.getTargetLoc())
.setBarcode(pakin.getBarcode())
.setTargSite(LocManageUtil.getTargetSite());
- tasks.add(task);
- });
- if (!this.saveBatch(tasks)) {
- throw new CoolException("浠诲姟淇濆瓨澶辫触锛侊紒");
- }
- List<Long> orderIds = tasks.stream().map(Task::getId).collect(Collectors.toList());
- List<Task> taskList = this.list(new LambdaQueryWrapper<Task>().in(Task::getId, orderIds));
- if (taskList.isEmpty()) {
- throw new CoolException("鏁版嵁閿欒锛氳鍗旾D涓嶈兘涓虹┖锛侊紒");
- }
- for (Task task : taskList) {
- List<TaskItem> taskItems = new ArrayList<>();
+ if (!this.save(task)) {
+ throw new CoolException("浠诲姟淇濆瓨澶辫触锛侊紒");
+ }
+ /**鑾峰彇缁勬嫋鏄庣粏**/
+ List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, pakin.getId()));
+ if (waitPakinItems.isEmpty()) {
+ throw new CoolException("鏁版嵁閿欒锛氱粍鎷栨槑缁嗕笉瀛樺湪");
+ }
waitPakinItems.forEach(item -> {
TaskItem taskItem = new TaskItem();
BeanUtils.copyProperties(item, taskItem);
@@ -100,7 +90,9 @@
if (!taskItemService.saveBatch(taskItems)) {
throw new CoolException("浠诲姟鏄庣粏淇濆瓨澶辫触锛侊紒");
}
- }
+ });
+ //TODO 浠诲姟鐢熸垚瀹屾垚闇�淇敼浠诲姟ASN璁㈠崟鐘舵�佷负鎵ц涓紝缁勬嫋鍒犻櫎闇�鍒ゆ柇鏄惁鏈夊瓙浠诲姟鍦ㄦ墽琛�
+
return R.ok("浠诲姟鐢熸垚瀹屾瘯锛�");
}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
index 4312407..49a869f 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -27,7 +27,7 @@
Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false);
- return Objects.isNull(loc) ? loc.getCode() : null;
+ return !Objects.isNull(loc) ? loc.getCode() : null;
}
@@ -42,6 +42,6 @@
//TODO 绔欑偣绛栫暐鍚庣画鎺掓湡
DeviceSiteService deviceSite = SpringUtils.getBean(DeviceSiteService.class);
DeviceSite loc = deviceSite.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getStatus, 1), false);
- return Objects.isNull(loc) ? loc.getSite() : null;
+ return !Objects.isNull(loc) ? loc.getSite() : null;
}
}
--
Gitblit v1.9.1