From 81fae3c184966eeaa3081e456b1fb2d0e25a3456 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期三, 06 八月 2025 16:57:55 +0800
Subject: [PATCH] 1.调拨入库取消选择申请单号

---
 Controllers/Warehouse/TransferOutController.cs |  137 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 134 insertions(+), 3 deletions(-)

diff --git a/Controllers/Warehouse/TransferOutController.cs b/Controllers/Warehouse/TransferOutController.cs
index d37e531..e4a02de 100644
--- a/Controllers/Warehouse/TransferOutController.cs
+++ b/Controllers/Warehouse/TransferOutController.cs
@@ -1,6 +1,7 @@
 锘縰sing System.Dynamic;
 using Microsoft.AspNetCore.Mvc;
 using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.service.@base;
 using NewPdaSqlServer.service.Warehouse;
 using NewPdaSqlServer.util;
 
@@ -15,6 +16,8 @@
 {
     private readonly TransferOutManager _manager = new();
 
+    private readonly MesPrintMangeer _mCf = new();
+
     #region 鍩虹CRUD
 
     /// <summary>
@@ -28,6 +31,57 @@
         {
             dynamic resultInfos = new ExpandoObject();
             resultInfos.tbBillList = _manager.GetList();
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    #endregion
+
+    #region 璋冩嫧鍏ュ簱涓氬姟
+
+    /// <summary>
+    ///     鎵弿鏉$爜杩涜璋冩嫧鍏ュ簱澶勭悊
+    /// </summary>
+    /// <param name="query">鏌ヨ鍙傛暟</param>
+    /// <returns>澶勭悊缁撴灉鍜屽緟澶勭悊鏄庣粏</returns>
+    /// <remarks>
+    ///     璇锋眰绀轰緥:
+    ///     POST /api/TransferOut/ScanReceiveBarcode
+    ///     {
+    ///     "billNo": "DB202401010001",  // 璋冩嫧鍗曞彿(蹇呭~)
+    ///     "userName": "admin",          // 鐢ㄦ埛鍚�(蹇呭~)
+    ///     "barcode": "BC001"           // 鏉$爜鍙�(蹇呭~)
+    ///     }
+    ///     涓氬姟澶勭悊锛�
+    ///     - 楠岃瘉璋冩嫧鍗曠姸鎬�
+    ///     - 楠岃瘉鏉$爜搴撳瓨淇℃伅
+    ///     - 楠岃瘉浠撳簱涓�鑷存��
+    ///     - 楠岃瘉鏁伴噺鏄惁瓒呭嚭鏈壂鏁伴噺
+    ///     - 鎵ц璋冩嫧鍏ュ簱浜嬪姟澶勭悊
+    ///     杩斿洖鏁版嵁鍖呭惈锛�
+    ///     - form: 澶勭悊缁撴灉琛ㄥ崟
+    ///     - items: 寰呭鐞嗘槑缁嗗垪琛�
+    /// </remarks>
+    /// <response code="200">鎵弿鎴愬姛</response>
+    /// <response code="400">鎵弿澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
+    [HttpPost("ScanReceiveBarcode")]
+    public ResponseResult ScanReceiveBarcode([FromBody] WarehouseQuery query)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var (form, items) = _manager.ScanReceiveBarcode(query);
+            resultInfos.form = form;
+            resultInfos.items = items;
             return new ResponseResult
             {
                 status = 0,
@@ -115,6 +169,30 @@
         }
     }
 
+
+    [HttpPost("GetTransferInDetailListByBillNo")]
+    public ResponseResult GetTransferInDetailListByBillNo(
+    [FromBody] WarehouseQuery query)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList =
+                _manager.GetTransferInDetailListByBillNo(query);
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+
     /// <summary>
     ///     鎵弿鏉$爜杩涜璋冩嫧鍑哄簱澶勭悊
     /// </summary>
@@ -146,9 +224,62 @@
         try
         {
             dynamic resultInfos = new ExpandoObject();
-            var (form, items) = _manager.ScanMoveBarcode(query);
-            resultInfos.form = form;
-            resultInfos.items = items;
+            resultInfos.tbBillList = _manager.ScanMoveBarcode(query);
+            if (resultInfos.tbBillList.result == "2")
+            {
+                return new ResponseResult
+                {
+                    status = Convert.ToInt32(resultInfos.tbBillList.result),
+                    message = resultInfos.tbBillList.strMsg,
+                    data = resultInfos
+                };
+            }
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     鍒嗗壊鏉$爜杩涜璋冩嫧鍑哄簱澶勭悊
+    /// </summary>
+    /// <param name="query">鏌ヨ鍙傛暟</param>
+    /// <returns>澶勭悊缁撴灉鍜屽緟澶勭悊鏄庣粏</returns>
+    /// <remarks>
+    ///     璇锋眰绀轰緥:
+    ///     POST /api/TransferOut/SplitBarcode
+    ///     {
+    ///     "billNo": "DB202401010001",  // 璋冩嫧鍗曞彿(蹇呭~)
+    ///     "userName": "admin",          // 鐢ㄦ埛鍚�(蹇呭~)
+    ///     "barcode": "BC001"           // 鏉$爜鍙�(蹇呭~)
+    ///     "fum": "1"                  // 鎷嗗垎鏁�(蹇呭~)
+    ///     }
+    ///     涓氬姟澶勭悊锛�
+    ///     - 楠岃瘉璋冩嫧鍗曠姸鎬�
+    ///     - 楠岃瘉鏉$爜搴撳瓨淇℃伅
+    ///     - 楠岃瘉浠撳簱涓�鑷存��
+    ///     - 楠岃瘉鏁伴噺鏄惁瓒呭嚭鏈壂鏁伴噺
+    ///     - 鎵ц鍒嗗壊鏉$爜鐨勮皟鎷ㄥ嚭搴撲簨鍔″鐞�
+    /// </remarks>
+    /// <response code="200">鍒嗗壊鎴愬姛</response>
+    /// <response code="400">鍒嗗壊澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
+    [HttpPost("ScanCodeCF")]
+    public ResponseResult ScanCodeCF(WarehouseQuery query)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = new ExpandoObject();
+            resultInfos.tbBillList.printInfo = _mCf.getPrintInfo(query);
+            var scanResult = _manager.ScanCodeCF(query);
+            resultInfos.tbBillList.cfBarInfo = _mCf.getCfInfo(scanResult);
             return new ResponseResult
             {
                 status = 0,

--
Gitblit v1.9.3