From 430f4df6519253ffaf49f2d098ac1df77aa5891e Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 11 九月 2025 14:43:02 +0800
Subject: [PATCH] 销售出库添加一行'制单人'
---
Controllers/Warehouse/TransferOutController.cs | 210 ++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 169 insertions(+), 41 deletions(-)
diff --git a/Controllers/Warehouse/TransferOutController.cs b/Controllers/Warehouse/TransferOutController.cs
index b826b2b..e4a02de 100644
--- a/Controllers/Warehouse/TransferOutController.cs
+++ b/Controllers/Warehouse/TransferOutController.cs
@@ -1,13 +1,14 @@
锘縰sing System.Dynamic;
using Microsoft.AspNetCore.Mvc;
using NewPdaSqlServer.Dto.service;
+using NewPdaSqlServer.service.@base;
using NewPdaSqlServer.service.Warehouse;
using NewPdaSqlServer.util;
namespace NewPdaSqlServer.Controllers.Warehouse;
/// <summary>
-/// 璋冩嫧鍑哄簱鐩稿叧鎺ュ彛
+/// 璋冩嫧鍑哄簱鐩稿叧鎺ュ彛
/// </summary>
[Route("api/[controller]")]
[ApiController]
@@ -15,10 +16,12 @@
{
private readonly TransferOutManager _manager = new();
+ private readonly MesPrintMangeer _mCf = new();
+
#region 鍩虹CRUD
/// <summary>
- /// 鑾峰彇鎵�鏈夎皟鎷ㄥ嚭搴撳崟
+ /// 鑾峰彇鎵�鏈夎皟鎷ㄥ嚭搴撳崟
/// </summary>
/// <returns>璋冩嫧鍑哄簱鍗曞垪琛�</returns>
[HttpPost("GetList")]
@@ -43,14 +46,65 @@
#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,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ #endregion
+
#region 璋冩嫧鍑哄簱涓氬姟
/// <summary>
- /// 鑾峰彇鏈畬鎴愮殑璋冩嫧鍑哄簱鍗曞彿鍒楄〃
+ /// 鑾峰彇鏈畬鎴愮殑璋冩嫧鍑哄簱鍗曞彿鍒楄〃
/// </summary>
/// <returns>鏈畬鎴愮殑璋冩嫧鍑哄簱鍗曞彿鍒楄〃</returns>
/// <remarks>
- /// 鑾峰彇鐢宠鏁伴噺(sq)涓嶇瓑浜庡凡鎵暟閲�(ys)鐨勮皟鎷ㄥ嚭搴撳崟鍙峰垪琛�
+ /// 鑾峰彇鐢宠鏁伴噺(sq)涓嶇瓑浜庡凡鎵暟閲�(ys)鐨勮皟鎷ㄥ嚭搴撳崟鍙峰垪琛�
/// </remarks>
/// <response code="200">鎴愬姛鑾峰彇璋冩嫧鍑哄簱鍗曞彿鍒楄〃</response>
/// <response code="400">鑾峰彇澶辫触</response>
@@ -75,33 +129,111 @@
}
/// <summary>
- /// 鏍规嵁鍗曟嵁鍙疯幏鍙栧緟澶勭悊鐨勮皟鎷ㄥ嚭搴撴槑缁嗗垪琛�
+ /// 鏍规嵁鍗曟嵁鍙疯幏鍙栧緟澶勭悊鐨勮皟鎷ㄥ嚭搴撴槑缁嗗垪琛�
/// </summary>
/// <param name="query">鏌ヨ鍙傛暟</param>
/// <returns>寰呭鐞嗙殑璋冩嫧鍑哄簱鏄庣粏鍒楄〃</returns>
/// <remarks>
- /// 璇锋眰绀轰緥:
- ///
+ /// 璇锋眰绀轰緥:
/// POST /api/TransferOut/GetTransferOutDetailListByBillNo
/// {
- /// "billNo": "DB202401010001" // 璋冩嫧鍗曞彿(蹇呭~)
+ /// "billNo": "DB202401010001" // 璋冩嫧鍗曞彿(蹇呭~)
/// }
- ///
- /// 杩斿洖鏈畬鎴愮殑鏄庣粏璁板綍(ShNum-YsNum>0)锛屽寘鍚細
- /// - ItemNo: 鐗╂枡缂栧彿
- /// - ItemModel: 鐗╂枡瑙勬牸
- /// - ShNum: 鐢宠鏁伴噺
- /// - YsNum: 宸叉壂鏁伴噺
+ /// 杩斿洖鏈畬鎴愮殑鏄庣粏璁板綍(ShNum-YsNum>0)锛屽寘鍚細
+ /// - ItemNo: 鐗╂枡缂栧彿
+ /// - ItemModel: 鐗╂枡瑙勬牸
+ /// - ShNum: 鐢宠鏁伴噺
+ /// - YsNum: 宸叉壂鏁伴噺
/// </remarks>
/// <response code="200">鎴愬姛鑾峰彇璋冩嫧鍑哄簱鏄庣粏</response>
/// <response code="400">鑾峰彇澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
[HttpPost("GetTransferOutDetailListByBillNo")]
- public ResponseResult GetTransferOutDetailListByBillNo([FromBody] WarehouseQuery query)
+ public ResponseResult GetTransferOutDetailListByBillNo(
+ [FromBody] WarehouseQuery query)
{
try
{
dynamic resultInfos = new ExpandoObject();
- resultInfos.tbBillList = _manager.GetTransferOutDetailListByBillNo(query);
+ resultInfos.tbBillList =
+ _manager.GetTransferOutDetailListByBillNo(query);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+
+ [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>
+ /// <param name="query">鏌ヨ鍙傛暟</param>
+ /// <returns>澶勭悊缁撴灉鍜屽緟澶勭悊鏄庣粏</returns>
+ /// <remarks>
+ /// 璇锋眰绀轰緥:
+ /// POST /api/TransferOut/ScanMoveBarcode
+ /// {
+ /// "billNo": "DB202401010001", // 璋冩嫧鍗曞彿(蹇呭~)
+ /// "userName": "admin", // 鐢ㄦ埛鍚�(蹇呭~)
+ /// "barcode": "BC001" // 鏉$爜鍙�(蹇呭~)
+ /// }
+ /// 涓氬姟澶勭悊锛�
+ /// - 楠岃瘉璋冩嫧鍗曠姸鎬�
+ /// - 楠岃瘉鏉$爜搴撳瓨淇℃伅
+ /// - 楠岃瘉浠撳簱涓�鑷存��
+ /// - 楠岃瘉鏁伴噺鏄惁瓒呭嚭鏈壂鏁伴噺
+ /// - 鎵ц璋冩嫧鍑哄簱浜嬪姟澶勭悊
+ /// 杩斿洖鏁版嵁鍖呭惈锛�
+ /// - form: 澶勭悊缁撴灉琛ㄥ崟
+ /// - items: 寰呭鐞嗘槑缁嗗垪琛�
+ /// </remarks>
+ /// <response code="200">鎵弿鎴愬姛</response>
+ /// <response code="400">鎵弿澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
+ [HttpPost("ScanMoveBarcode")]
+ public ResponseResult ScanMoveBarcode([FromBody] WarehouseQuery query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ 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,
@@ -116,42 +248,38 @@
}
/// <summary>
- /// 鎵弿鏉$爜杩涜璋冩嫧鍑哄簱澶勭悊
+ /// 鍒嗗壊鏉$爜杩涜璋冩嫧鍑哄簱澶勭悊
/// </summary>
/// <param name="query">鏌ヨ鍙傛暟</param>
/// <returns>澶勭悊缁撴灉鍜屽緟澶勭悊鏄庣粏</returns>
/// <remarks>
- /// 璇锋眰绀轰緥:
- ///
- /// POST /api/TransferOut/ScanMoveBarcode
+ /// 璇锋眰绀轰緥:
+ /// POST /api/TransferOut/SplitBarcode
/// {
- /// "billNo": "DB202401010001", // 璋冩嫧鍗曞彿(蹇呭~)
- /// "userName": "admin", // 鐢ㄦ埛鍚�(蹇呭~)
- /// "barcode": "BC001" // 鏉$爜鍙�(蹇呭~)
+ /// "billNo": "DB202401010001", // 璋冩嫧鍗曞彿(蹇呭~)
+ /// "userName": "admin", // 鐢ㄦ埛鍚�(蹇呭~)
+ /// "barcode": "BC001" // 鏉$爜鍙�(蹇呭~)
+ /// "fum": "1" // 鎷嗗垎鏁�(蹇呭~)
/// }
- ///
- /// 涓氬姟澶勭悊锛�
- /// - 楠岃瘉璋冩嫧鍗曠姸鎬�
- /// - 楠岃瘉鏉$爜搴撳瓨淇℃伅
- /// - 楠岃瘉浠撳簱涓�鑷存��
- /// - 楠岃瘉鏁伴噺鏄惁瓒呭嚭鏈壂鏁伴噺
- /// - 鎵ц璋冩嫧鍑哄簱浜嬪姟澶勭悊
- ///
- /// 杩斿洖鏁版嵁鍖呭惈锛�
- /// - form: 澶勭悊缁撴灉琛ㄥ崟
- /// - items: 寰呭鐞嗘槑缁嗗垪琛�
+ /// 涓氬姟澶勭悊锛�
+ /// - 楠岃瘉璋冩嫧鍗曠姸鎬�
+ /// - 楠岃瘉鏉$爜搴撳瓨淇℃伅
+ /// - 楠岃瘉浠撳簱涓�鑷存��
+ /// - 楠岃瘉鏁伴噺鏄惁瓒呭嚭鏈壂鏁伴噺
+ /// - 鎵ц鍒嗗壊鏉$爜鐨勮皟鎷ㄥ嚭搴撲簨鍔″鐞�
/// </remarks>
- /// <response code="200">鎵弿鎴愬姛</response>
- /// <response code="400">鎵弿澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
- [HttpPost("ScanMoveBarcode")]
- public ResponseResult ScanMoveBarcode([FromBody] WarehouseQuery query)
+ /// <response code="200">鍒嗗壊鎴愬姛</response>
+ /// <response code="400">鍒嗗壊澶辫触锛岃繑鍥炲叿浣撻敊璇俊鎭�</response>
+ [HttpPost("ScanCodeCF")]
+ public ResponseResult ScanCodeCF(WarehouseQuery query)
{
try
{
dynamic resultInfos = new ExpandoObject();
- var (form, items) = _manager.ScanMoveBarcode(query);
- resultInfos.form = form;
- resultInfos.items = items;
+ 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