From 43efe016c156158b9fc3a8b647810f612fb126e6 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 02 九月 2025 11:39:52 +0800
Subject: [PATCH] 自动补货单新增 1.订单中只能生成两笔自动补货单 2.CTU库是否有足够的空库位,空库位数需要大于100才会生成自动补货单 3.在补货时加上订单明细的数量进行判断

---
 src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java
index 43fb249..5d142eb 100644
--- a/src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/DocTypeServiceImpl.java
@@ -1,6 +1,7 @@
 package com.zy.asrs.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.Cools;
 import com.core.exception.CoolException;
 import com.zy.asrs.mapper.DocTypeMapper;
@@ -19,7 +20,20 @@
         if (Cools.isEmpty(docName)) {
             return null;
         }
-        DocType docType = this.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
+        DocType docType = null;
+        try {
+            docType = this.selectById(docName);
+        } catch (Exception ignore) {}
+        if (docType == null) {
+            Wrapper<DocType> wrapper = new EntityWrapper<DocType>().eq("doc_name", docName);
+            if(pakin){
+                wrapper.eq("pakin",1);
+            }else {
+                wrapper.eq("pakout",1);
+            }
+            docType = this.selectOne(wrapper);
+        }
+
         if (docType == null) {
             long docId = 1L;
             DocType last = this.selectOne(new EntityWrapper<DocType>().orderBy("doc_id", false));
@@ -31,6 +45,7 @@
             docType.setDocName(docName);
             if (null != pakin) {
                 docType.setPakin(pakin ? 1 : 0);
+                docType.setPakout(pakin ? 0 : 1);
             }
             docType.setStatus(1);
             docType.setCreateTime(new Date());

--
Gitblit v1.9.1