From 1b3db8f5683373dd8e179b006e7314783dd1f9db Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期三, 10 九月 2025 14:42:12 +0800
Subject: [PATCH] 文件补充
---
WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs | 115 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 89 insertions(+), 26 deletions(-)
diff --git a/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs b/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
index 445460a..44e4de0 100644
--- a/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
+++ b/WebApi/Gs.Warehouse/Services/VArrivalBarcodeManager.cs
@@ -7,7 +7,6 @@
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-
namespace Gs.Warehouse.Services;
[ApiGroup(ApiGroupNames.PerMission)]
@@ -78,7 +77,7 @@
{
LogHelper.Debug(ToString(), ex.Message);
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
- ReturnCode.Exception, ex.Message);
+ ReturnCode.Exception, ex.Message);
}
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
@@ -103,7 +102,7 @@
{
new("@inOrderGuid", inOrderGuid),
new("@inP1", ""),
- new("@inP2", "")
+ new("@inP2", ""),
};
var dset = new DataSet();
try
@@ -116,19 +115,81 @@
m = dr.RowToDynamic();
m.list1 = dset.Tables[1].TableToDynamicList();
m.list2 = dset.Tables[2].TableToDynamicList();
+ m.list3 = dset.Tables[3].TableToDynamicList();
}
}
catch (Exception ex)
{
LogHelper.Debug(ToString(), ex.Message);
}
-
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
- "璇诲彇鎴愬姛锛�");
+ "璇诲彇鎴愬姛锛�");
}
+ /* /// <summary>
+ /// 鍒犻櫎鏉$爜
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ string guidList = model.guidList;
+ string aboutType = model.aboutType;
+ string aboutGuid = model.aboutGuid;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_barcode_del]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", aboutGuid),
+ new("@inEdtUserGuid", _userGuid),
+ new("@guidList", guidList),
+ new("@aboutType", aboutType)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_barcode_del error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
+ _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
+ */
/// <summary>
- /// 鍒犻櫎鏉$爜
+
+
+ /// <summary>
+ /// 鍒犻櫎鏉$爜
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -141,9 +202,15 @@
string aboutGuid = model.aboutGuid;
var _outMsg = "";
var _outSum = -1;
+
+ // 鍒ゆ柇aboutGuid鏄惁涓烘湁鏁堢殑uniqueidentifier
+ bool is_validGuid = Guid.TryParse(aboutGuid, out _);
+ // 鏍规嵁楠岃瘉缁撴灉閫夋嫨瀵瑰簲鐨勫瓨鍌ㄨ繃绋�
+ string storedProcedureName = is_validGuid ? "[prc_barcode_del]" : "[prc_barcode_del_hb]";
+
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand("[prc_barcode_del]", conn))
+ using (var cmd = new SqlCommand(storedProcedureName, conn))
{
try
{
@@ -151,13 +218,13 @@
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter[] parameters =
{
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inOrderGuid", aboutGuid),
- new("@inEdtUserGuid", _userGuid),
- new("@guidList", guidList),
- new("@aboutType", aboutType)
- };
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", aboutGuid),
+ new("@inEdtUserGuid", _userGuid),
+ new("@guidList", guidList),
+ new("@aboutType", aboutType)
+ };
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
foreach (var parameter in parameters)
@@ -169,7 +236,7 @@
catch (Exception ex)
{
LogHelper.Debug(ToString(),
- "prc_barcode_del error锛�" + ex.Message);
+ $"{storedProcedureName} error锛歿ex.Message}");
_outMsg = ex.Message;
_outSum = -1;
}
@@ -186,8 +253,10 @@
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
+
+
/// <summary>
- /// 閫夋嫨鏉$爜
+ /// 閫夋嫨鏉$爜
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -200,7 +269,6 @@
string keyWhere = model.keyWhere;
string aboutGuid = model.aboutGuid;
string aboutType = model.aboutType;
- string qcGuid = model.qcGuid;
var dset = new DataSet();
try
{
@@ -218,8 +286,7 @@
new("@inSortOrder", ""),
new("@inQueryWhere", keyWhere),
new("@inP1", aboutGuid),
- new("@inP2", aboutType),
- new("@inP3", qcGuid)
+ new("@inP2", aboutType)
};
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
@@ -228,18 +295,14 @@
dt.Fill(dset, "0");
}
}
-
conn.Close();
}
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(),
- "prc_barcode_select error锛�" + ex.Message);
- return ReturnDto<PageList<dynamic>>.QuickReturn(
- default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ LogHelper.Debug(ToString(), "prc_barcode_select error锛�" + ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
}
-
var _pglist = new PageList<dynamic>
{
total = 0,
@@ -261,8 +324,8 @@
var _dy = dset.Tables[0].TableToDynamicList();
_pglist.list = _dy;
}
-
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
+
}
\ No newline at end of file
--
Gitblit v1.9.3