From 41c2e9f0a5a14382bbc696021fa5ec0ad6ec7e51 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 14 十二月 2022 12:01:51 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/service/erp/ErpService.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/zy/common/service/erp/ErpService.java b/src/main/java/com/zy/common/service/erp/ErpService.java
index 91e38a9..e26992c 100644
--- a/src/main/java/com/zy/common/service/erp/ErpService.java
+++ b/src/main/java/com/zy/common/service/erp/ErpService.java
@@ -53,15 +53,13 @@
         List<Voucher> voucherList = this.selectVoucher(state);
         if (!Cools.isEmpty(voucherList)) {
             for (Voucher voucher : voucherList) {
+                VoucherDto dto = new VoucherDto();
+                dto.setVoucher(voucher);
                 List<VoucherDetail> voucherDetails = this.selectVoucherDetail(voucher.getVoucherID());
                 if (!Cools.isEmpty(voucherDetails)) {
-                    VoucherDto dto = new VoucherDto();
-                    list.add(dto);
-                    dto.setVoucher(voucher);
                     dto.setDetails(voucherDetails);
-                } else {
-                    log.error("{}鍗曟嵁鎵句笉鍒版槑缁嗭紝璇锋敞鎰忔鏌�", voucher.getVoucherID());
                 }
+                list.add(dto);
             }
         }
         return list;
@@ -121,4 +119,17 @@
         return erpSqlServer.update(sql) > 0;
     }
 
+    /**
+     * 鏂板 VoucherDetail 琛�
+     */
+    public boolean insertVoucherDetail(VoucherDetail voucherDetail){
+        String sql = "insert [VoucherDetail] ([VoucherID], [Barcode], [PickID], [LastUpdatedDate]) values (''{0}'', ''{1}'', ''{2}'', ''{3}'');";
+        sql = MessageFormat.format(sql
+                , voucherDetail.getVoucherID()
+                , voucherDetail.getBarcode()
+                , voucherDetail.getPickID()
+                , voucherDetail.getLastUpdatedDate());
+        return erpSqlServer.update(sql) > 0;
+    }
+
 }

--
Gitblit v1.9.1