From 94d0b18fa47a92a1cb4d1fef4520d35ef2c2c322 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期二, 16 十二月 2025 21:56:49 +0800
Subject: [PATCH] 产能排产相关后端更新
---
WebApi/Gs.Wom/Service/WomdaaManager.cs | 140 ++++++++++++++++++++++++++++++----------------
1 files changed, 90 insertions(+), 50 deletions(-)
diff --git a/WebApi/Gs.Wom/Service/WomdaaManager.cs b/WebApi/Gs.Wom/Service/WomdaaManager.cs
index ce7f9e5..2cda0ed 100644
--- a/WebApi/Gs.Wom/Service/WomdaaManager.cs
+++ b/WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -1,13 +1,14 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-using System.Text;
-using Gs.Toolbox;
+锘縰sing Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json.Linq;
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
using static Gs.Toolbox.UtilityHelper;
@@ -82,7 +83,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,
@@ -151,7 +152,7 @@
/// <summary>
- /// 淇敼宸ュ崟鐘舵��
+ /// 淇敼宸ュ崟鐘舵��
/// </summary>
/// <param name="mode"></param>
/// <returns></returns>
@@ -207,15 +208,71 @@
return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
}
-
/// <summary>
- /// 閲嶆柊鐢熸垚棣栨
+ /// 澶囧崟棰嗘枡
/// </summary>
/// <param name="mode"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<ExpandoObject> EditModelSubmitShouJian(
- [FromBody] dynamic mode)
+ public ReturnDto<ExpandoObject> bdll([FromBody] dynamic mode)
+ {
+ string _guid = mode.guid;
+ string _inFieldValue = mode.inFieldValue;
+ dynamic m = new ExpandoObject();
+ m.outSum = -1;
+ m.outMsg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("prc_wom_daa_bdll", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inOrderGuid", _guid),
+ new("@inFieldValue", _inFieldValue),
+ new("@in1", ""),
+ new("@in2", "")
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ m.outMsg = parameters[0].Value.ToString();
+ m.outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_wom_daa_submit error锛�" + ex.Message);
+ m.outMsg = ex.Message;
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
+ ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
+ }
+
+
+ /// <summary>
+ /// 閲嶆柊鐢熸垚棣栨
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelSubmitShouJian([FromBody] dynamic mode)
{
string _guid = mode.guid;
string _inFieldValue = mode.inFieldValue;
@@ -235,7 +292,7 @@
new("@po_outMsg", SqlDbType.NVarChar, 300),
new("@po_outStatus", SqlDbType.Int),
new("@pi_user", _userCode),
- new("@pi_DAA_guid", _guid)
+ new("@pi_DAA_guid", _guid),
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
@@ -264,6 +321,7 @@
}
+
/// <summary>
/// 澧炲姞鎴栫紪杈戝疄浣�
/// </summary>
@@ -290,12 +348,11 @@
{
new("@outMsg", SqlDbType.NVarChar, 300),
new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
new("@inSjxt", sjxt),
new("@inBz", bz),
new("@inSclx", sclx),
- new("@inEdtUserGuid", _userGuid)
+ new("@inEdtUserGuid", _userGuid),
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
@@ -318,7 +375,6 @@
}
}
}
-
if (_outSum <= 0)
return ReturnDto<string>.QuickReturn(guid.ToString(),
ReturnCode.Exception, _outMsg);
@@ -365,7 +421,6 @@
dt.Fill(dset, "0");
}
}
-
conn.Close();
}
}
@@ -397,20 +452,18 @@
var _dy = dset.Tables[0].TableToDynamicList();
_pglist.list = _dy;
}
-
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
/// <summary>
- /// 閫夋嫨dab寮圭獥浣�
+ /// 閫夋嫨dab寮圭獥浣�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
- public ReturnDto<PageList<dynamic>> GetListSelectDab(
- [FromBody] dynamic model)
+ public ReturnDto<PageList<dynamic>> GetListSelectDab([FromBody] dynamic model)
{
int currentPage = model.currentPage;
int everyPageSize = model.everyPageSize;
@@ -443,7 +496,6 @@
dt.Fill(dset, "0");
}
}
-
conn.Close();
}
}
@@ -453,7 +505,6 @@
return ReturnDto<PageList<dynamic>>.QuickReturn(
default(PageList<dynamic>), ReturnCode.Exception, "璇诲彇澶辫触");
}
-
var _pglist = new PageList<dynamic>
{
total = 0,
@@ -475,7 +526,6 @@
var _dy = dset.Tables[0].TableToDynamicList();
_pglist.list = _dy;
}
-
return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
ReturnCode.Success, "璇诲彇鎴愬姛");
}
@@ -563,7 +613,7 @@
new("@outMsg", SqlDbType.NVarChar, 300),
new("@outSum", SqlDbType.Int),
new("@inOrderGuid",
- CheckGuid(guid)
+ UtilityHelper.CheckGuid(guid)
? guid
: DBNull.Value),
new("@inEdtUserGuid", _userGuid),
@@ -593,13 +643,12 @@
}
if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
/// <summary>
- /// 宸ヨ壓鍙樻洿
+ /// 宸ヨ壓鍙樻洿
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -617,7 +666,6 @@
_sb.Append("~");
_sb.Append(_line);
}
-
dynamic mObj = new ExpandoObject();
mObj.outMsg = "";
mObj.outSum = -1;
@@ -635,8 +683,7 @@
{
new("@outMsg", SqlDbType.NVarChar, 300),
new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
new("@inEdtUserGuid", _userGuid),
new("@inLineList", _sb.ToString())
};
@@ -661,39 +708,34 @@
}
}
}
-
if (mObj.outSum <= 0)
- return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception,
- mObj.outMsg);
- return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success,
- mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
}
/// <summary>
+ ///
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
[RequestMethod(RequestMethods.POST)]
public ReturnDto<List<dynamic>> GetGyList(
- [FromBody] dynamic model)
+ [FromBody] dynamic model)
{
string daaGuid = model.guid;
var lst = new List<dynamic>();
var dset = new DataSet();
- var sbSql = new StringBuilder();
- sbSql.Append(
- " select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" +
- daaGuid + "' order by processNo asc ");
+ System.Text.StringBuilder sbSql = new System.Text.StringBuilder();
+ sbSql.Append(" select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" + daaGuid + "' order by processNo asc ");
try
{
- dset = DbHelperSQL.Query(sbSql.ToString());
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
}
catch (Exception ex)
{
LogHelper.Debug(ToString(), ex.Message);
}
-
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
lst = dset.Tables[0].TableToDynamicList();
@@ -703,7 +745,7 @@
/// <summary>
- /// 鍙樻洿鍐呭寘瑁呮暟閲�
+ /// 鍙樻洿鍐呭寘瑁呮暟閲�
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
@@ -727,8 +769,7 @@
{
new("@outMsg", SqlDbType.NVarChar, 300),
new("@outSum", SqlDbType.Int),
- new("@inOrderGuid",
- CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
new("@inEdtUserGuid", _userGuid),
new("@inSl", sl)
};
@@ -742,8 +783,7 @@
}
catch (Exception ex)
{
- LogHelper.Debug(ToString(),
- "prc_wom_daa_nbz error锛�" + ex.Message);
+ LogHelper.Debug(ToString(), "prc_wom_daa_nbz error锛�" + ex.Message);
_outMsg = ex.Message;
_outSum = -1;
}
@@ -755,8 +795,8 @@
}
if (_outSum <= 0)
- return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
- _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
+
}
\ No newline at end of file
--
Gitblit v1.9.3