From d1be26f8d8196716257de0d3b09daa83a62bfffe Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 04 十一月 2025 13:43:51 +0800
Subject: [PATCH] #1
---
src/main/java/com/zy/asrs/controller/OrderController.java | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index 4d22e9c..539ee9e 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -42,6 +42,8 @@
private WrkMastService wrkMastService;
@Autowired
private WrkMastLogService wrkMastLogService;
+ @Autowired
+ private LocOwnerService locOwnerService;
@RequestMapping(value = "/order/nav/list/auth")
@ManagerAuth
@@ -98,14 +100,28 @@
@ManagerAuth(memo = "鎵嬪姩娣诲姞璁㈠崟")
@Transactional
public R formAdd(@RequestBody OrderDomainParam param){
+ int status = 0;
if(Cools.isEmpty(param.getOrderNo())){
String prefix = "";
DocType docType = docTypeService.selectById(param.getDocType());
if(!Cools.isEmpty(docType)){
prefix = docType.getPakin() == 1 ? "RK" : "CK";
+ status = (prefix.equals("RK") ? 1 : (prefix.equals("CK") ? 2 : 0));
}
param.setOrderNo(prefix + snowflakeIdWorker.nextId());
+ } else {
+ DocType docType = docTypeService.selectById(param.getDocType());
+ if(!Cools.isEmpty(docType)){
+ status = (docType.getPakin() == 1 ? 1 : 2 );
+ }
}
+ LocOwner locOwner = null;
+ if (!Cools.isEmpty(param.getOwnerId())) {
+ locOwner = locOwnerService.selectById(param.getOwnerId());
+ } else {
+ locOwner = locOwnerService.selectById(1);
+ }
+
Order order = orderService.selectByNo(param.getOrderNo());
if (order != null) {
return R.error("鍗曟嵁缂栧彿宸插瓨鍦�");
@@ -117,12 +133,12 @@
DateUtils.convert(now), // 鍗曟嵁鏃ユ湡
param.getDocType(), // 鍗曟嵁绫诲瀷
null, // 椤圭洰缂栧彿
- null, //
+ param.getStandby1(), //椤圭洰鍚嶇О 瀹㈡埛PO鍙�
null, // 璋冩嫧椤圭洰缂栧彿
null, // 鍒濆绁ㄦ嵁鍙�
null, // 绁ㄦ嵁鍙�
- null, // 瀹㈡埛缂栧彿
- null, // 瀹㈡埛
+ locOwner.getOwnerUuid(), // 瀹㈡埛缂栧彿
+ locOwner.getOwner(), // 瀹㈡埛
null, // 鑱旂郴鏂瑰紡
null, // 鎿嶄綔浜哄憳
null, // 鍚堣閲戦
@@ -145,7 +161,8 @@
now, // 娣诲姞鏃堕棿
getUserId(), // 淇敼浜哄憳
now, // 淇敼鏃堕棿
- null // 澶囨敞
+ null, // 澶囨敞
+ status
);
if (!orderService.insert(order)) {
throw new CoolException("淇濆瓨璁㈠崟涓绘。澶辫触");
@@ -172,6 +189,11 @@
orderDetl.setUpdateTime(now);
orderDetl.setStatus(1);
orderDetl.setQty(0.0D);
+ orderDetl.setStandby1(param.getStandby1().toString());//po
+ orderDetl.setBoxType1(locOwner.getId().toString());//璐т富ID
+ orderDetl.setBoxType2(locOwner.getOwnerUuid().toString());//璐т富UUID
+ orderDetl.setBoxType3(locOwner.getOwner());//璐т富
+ orderDetl.setPakinPakoutStatus(status);
if (!orderDetlService.insert(orderDetl)) {
throw new CoolException("淇濆瓨璁㈠崟鏄庣粏妗eけ璐�");
}
@@ -254,19 +276,21 @@
totalQty = totalQty + orderDetl.getAnfme();
wrkQty = wrkQty + orderDetl.getWorkQty();
endQty = endQty + orderDetl.getQty();
- double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
- if (issued > 0.0) {
- List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null);
- for (LocDetl locDetl : locDetls) {
- if (issued > 0) {
- issued = issued - locDetl.getAnfme();
- } else {
- break;
+ if (!Cools.isEmpty(order.getPakinPakoutStatus$()) && order.getPakinPakoutStatus$().equals("N")){
+ double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
+ if (issued > 0.0) {
+ List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null);
+ for (LocDetl locDetl : locDetls) {
+ if (issued > 0) {
+ issued = issued - locDetl.getAnfme();
+ } else {
+ break;
+ }
}
}
- }
- if (issued > 0.0) {
- lackQty = lackQty + issued;
+ if (issued > 0.0) {
+ lackQty = lackQty + issued;
+ }
}
}
// 浠诲姟杩芥函
--
Gitblit v1.9.1