From cdaab6b7109fc5f748769a206075f30dbfb798d7 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期三, 10 十二月 2025 23:18:45 +0800
Subject: [PATCH] 蓝宝优化项更新
---
WebApi/Gs.Wom/Service/WompbaGxManager.cs | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 112 insertions(+), 2 deletions(-)
diff --git a/WebApi/Gs.Wom/Service/WompbaGxManager.cs b/WebApi/Gs.Wom/Service/WompbaGxManager.cs
index 90c8735..6aad561 100644
--- a/WebApi/Gs.Wom/Service/WompbaGxManager.cs
+++ b/WebApi/Gs.Wom/Service/WompbaGxManager.cs
@@ -284,7 +284,7 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
-
+
@@ -335,7 +335,7 @@
catch (Exception ex)
{
LogHelper.Debug(ToString(), "prc_wom_pba_select error锛�" + ex.Message);
- return ReturnDto<PageList<dynamic>>.QuickReturn( default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
+ return ReturnDto<PageList<dynamic>>.QuickReturn(default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
}
var _pglist = new PageList<dynamic>
@@ -598,4 +598,114 @@
}
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
}
+
+
+
+ /// <summary>
+ /// 鎵归噺澶勭悊鏄庣粏鏁版嵁
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> BatchProcessDetails([FromBody] dynamic model)
+ {
+ dynamic result = new ExpandoObject();
+ result.outSum = 0;
+ result.outMsg = "";
+
+ try
+ {
+ // 鑾峰彇璇锋眰鍙傛暟
+ string operatorGuid = model.operatorGuid?.ToString() ?? "";
+ string operationType = model.operationType?.ToString() ?? "BatchProcess";
+ var selectedDetails = model.selectedDetails;
+
+ if (selectedDetails == null)
+ {
+ result.outMsg = "鏈帴鏀跺埌瑕佸鐞嗙殑鏄庣粏鏁版嵁锛�";
+ return ReturnDto<ExpandoObject>.QuickReturn(result, ReturnCode.Default, result.outMsg);
+ }
+
+ // 鏋勫缓鏄庣粏鏁版嵁瀛楃涓诧紝鐢ㄤ簬浼犻�掔粰瀛樺偍杩囩▼
+ var _sb = new StringBuilder();
+ var _split = "|";
+ int processCount = 0;
+
+ foreach (var detail in selectedDetails)
+ {
+ string detailGuid = detail.guid?.ToString() ?? "";
+ string daa002 = detail.daa002?.ToString() ?? "";
+ string daa003 = detail.daa003?.ToString() ?? "";
+ string daa005 = detail.daa005?.ToString() ?? "";
+ string daa010 = detail.daa010?.ToString() ?? "";
+
+ // 楠岃瘉蹇呰瀛楁
+ if (string.IsNullOrEmpty(detailGuid))
+ continue;
+
+ // 鏋勫缓鏄庣粏琛屾暟鎹瓧绗︿覆
+ var _line = detailGuid + _split
+ + daa002 + _split
+ + daa003 + _split
+ + daa005 + _split
+ + daa010 + _split
+ + operationType + _split
+ + _userCode + _split
+ + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
+ if (_sb.Length > 0)
+ _sb.Append("~");
+ _sb.Append(_line);
+ processCount++;
+ }
+
+ if (processCount == 0)
+ {
+ result.outMsg = "娌℃湁鏈夋晥鐨勬槑缁嗘暟鎹渶瑕佸鐞嗭紒";
+ return ReturnDto<ExpandoObject>.QuickReturn(result, ReturnCode.Default, result.outMsg);
+ }
+
+ // 璋冪敤瀛樺偍杩囩▼杩涜鎵归噺澶勭悊
+ SqlParameter[] parameters =
+ {
+ new("@inOperatorGuid", operatorGuid),
+ new("@inOperationType", operationType),
+ new("@inDetailsData", _sb.ToString()),
+ new("@inUserCode", _userCode),
+ new("@inUserGuid", _userGuid),
+ new("@inOrgFids", _orgFids),
+ new("@outSum", SqlDbType.Int) { Direction = ParameterDirection.Output },
+ new("@outMsg", SqlDbType.NVarChar, 500) { Direction = ParameterDirection.Output }
+ };
+
+ var dset = new DataSet();
+ dset = DbHelperSQL.RunProcedure("prc_wom_pbagx_batch_process", parameters, "0");
+
+ // 鑾峰彇杈撳嚭鍙傛暟
+ int outSum = Convert.ToInt32(parameters[6].Value ?? 0);
+ string outMsg = parameters[7].Value?.ToString() ?? "";
+
+ result.outSum = outSum;
+ result.outMsg = outMsg;
+
+ if (outSum > 0)
+ {
+
+ return ReturnDto<ExpandoObject>.QuickReturn(result, ReturnCode.Success, outMsg);
+ }
+ else
+ {
+
+ return ReturnDto<ExpandoObject>.QuickReturn(result, ReturnCode.Default, outMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ result.outMsg = "鎵归噺澶勭悊鏄庣粏鏃跺彂鐢熷紓甯革細" + ex.Message;
+ return ReturnDto<ExpandoObject>.QuickReturn(result, ReturnCode.Exception, result.outMsg);
+ }
+ }
+
+
+
}
\ No newline at end of file
--
Gitblit v1.9.3