From 939f5e7b56eb28d2630e2791860612819be73c45 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 13 十二月 2024 14:46:25 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java |   49 +++++++++++++++++++++----------------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index f3b6c85..d007728 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -14,16 +14,12 @@
 import com.zy.asrs.utils.MatUtils;
 import com.zy.asrs.utils.OrderInAndOutUtil;
 import com.zy.common.model.DetlDto;
-import com.zy.common.model.enumUtils.OrderEnumVo;
-import com.zy.common.model.enumUtils.OrderInAndOutType;
-import com.zy.common.model.enumUtils.OrderMethodVo;
 import com.zy.common.utils.NodeUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -58,11 +54,7 @@
     @Transactional
     public void pakinOrderCreate(OpenOrderPakinParam param) {
 
-        try{
-            OrderInAndOutUtil.query(Boolean.TRUE,OrderMethodVo.QUERY,param.getOrderNo());
-        } catch (Exception e) {
-            throw new CoolException(e.getMessage());
-        }
+        OrderInAndOutUtil.query(Boolean.TRUE? "Y":"N",param.getOrderNo());
 
         DocType docType = docTypeService.selectOrAdd(param.getOrderType(), Boolean.TRUE);
         Date now = new Date();
@@ -103,11 +95,9 @@
                 now,    // 淇敼鏃堕棿
                 null    // 澶囨敞
         );
-        try{
-            OrderInAndOutUtil.insertOrder(Boolean.TRUE,OrderMethodVo.INSERT_ORDER,order);
-        } catch (Exception e) {
-            throw new CoolException(e.getMessage());
-        }
+
+        OrderInAndOutUtil.insertOrder(Boolean.TRUE,order);
+
         // 鍗曟嵁鏄庣粏妗�
         List<DetlDto> list = new ArrayList<>();
         List<DetlDto> orderDetails = param.getOrderDetails();
@@ -138,11 +128,7 @@
             orderDetl.setUpdateTime(now);
             orderDetl.setStatus(1);
             orderDetl.setQty(0.0D);
-            try{
-                OrderInAndOutUtil.insertOrderDetl(Boolean.TRUE,OrderMethodVo.INSERT_ORDERDETL,order,orderDetl);
-            } catch (Exception e) {
-                throw new CoolException(e.getMessage());
-            }
+            OrderInAndOutUtil.insertOrderDetl(Boolean.TRUE,order,orderDetl);
         }
     }
 
@@ -154,7 +140,7 @@
             // 鎸囧畾璁㈠崟
 //            Order order = orderService.selectByNo(param.getOrderNo());
 
-            Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE,OrderMethodVo.SELECT_BY_NO,param.getOrderNo());
+            Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE,param.getOrderNo());
 
             if (null != order) {
                 OpenOrderCompeteResult result = new OpenOrderCompeteResult();
@@ -163,7 +149,7 @@
                 result.setOrderTime(order.getOrderTime());
                 result.setOrderType(order.getDocType$());
 //                List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
-                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.TRUE, OrderMethodVo.SELECT_BY_NO, order.getId());
+                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.TRUE, order.getId());
 
                 for (OrderDetl orderDetl : orderDetls) {
                     result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty()));
@@ -173,26 +159,33 @@
 //                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
 //                        throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
 //                    }
-                    OrderInAndOutUtil.updateOrder(Boolean.TRUE, OrderMethodVo.SELECT_BY_NO,order.getId(), 6L, null);
+                    OrderInAndOutUtil.updateOrder(Boolean.TRUE,order.getId(), 6L, null);
                 }
             }
         } else {
             // 鎵�鏈夎鍗�
-            List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L));
+//            List<Order> orders = orderService.selectBySettle(4L);
+            List<Order> orders = OrderInAndOutUtil.selectBySettle(null, 4L);
+            if (orders.isEmpty()){
+                orders = new ArrayList<>();
+            }
             for (Order order : orders) {
                 OpenOrderCompeteResult result = new OpenOrderCompeteResult();
                 results.add(result);
                 result.setOrderNo(order.getOrderNo());
                 result.setOrderTime(order.getOrderTime());
                 result.setOrderType(order.getDocType$());
-                List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
+//                List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
+                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.TRUE, order.getId());
+
                 for (OrderDetl orderDetl : orderDetls) {
                     result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getQty()));
                 }
-                // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.宸蹭笂鎶�
-                if (!orderService.updateSettle(order.getId(), 6L, null)) {
-                    throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
-                }
+//                // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.宸蹭笂鎶�
+//                if (!orderService.updateSettle(order.getId(), 6L, null)) {
+//                    throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
+//                }
+                OrderInAndOutUtil.updateOrder(Boolean.TRUE,order.getId(), 6L, null);
             }
         }
         return results;

--
Gitblit v1.9.1