From ecb9ddedae33dc56867e31b200e263db9c9245c3 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期三, 03 十二月 2025 18:31:05 +0800
Subject: [PATCH] 模具相关,工单排产优化等
---
WebApi/GsMesSolution.sln | 28 +
WebApi/Gs.Mjgl/MesMoldArchivesManager.cs | 400 +++++++++++++++++++++++++++++++++
WebApi/Gs.Mjgl/MesMoldManagementManager.cs | 272 ++++++++++++++++++++++
WebApi/Gs.Mjgl/Gs.Mjgl.csproj | 15 +
4 files changed, 708 insertions(+), 7 deletions(-)
diff --git a/WebApi/Gs.Mjgl/Gs.Mjgl.csproj b/WebApi/Gs.Mjgl/Gs.Mjgl.csproj
new file mode 100644
index 0000000..d974cfa
--- /dev/null
+++ b/WebApi/Gs.Mjgl/Gs.Mjgl.csproj
@@ -0,0 +1,15 @@
+锘�<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net8.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <BaseOutputPath>..\Gs.HostIIS\bin</BaseOutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Gs.Entity\Gs.Entity.csproj" />
+ <ProjectReference Include="..\Gs.Toolbox\Gs.Toolbox.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/WebApi/Gs.Mjgl/MesMoldArchivesManager.cs b/WebApi/Gs.Mjgl/MesMoldArchivesManager.cs
new file mode 100644
index 0000000..7d75b31
--- /dev/null
+++ b/WebApi/Gs.Mjgl/MesMoldArchivesManager.cs
@@ -0,0 +1,400 @@
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
+using 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 static Gs.Toolbox.UtilityHelper;
+
+namespace Gs.Mjgl
+{
+
+ [ApiGroup(ApiGroupNames.PerMission)]
+ public class MesMoldArchivesManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+ public MesMoldArchivesManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 璇诲彇鍒楄〃锛屾敮鎸佸垎椤�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_MES_MOLD_HEAD_lst", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Exception, ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetMoldCodeList([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string sortOrder = model.sortOrder;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", sortOrder),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_MES_MOLD_DETAIL_mold_list", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
+ {
+ var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0 ? intTotal / everyPageSize + 1 : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, ReturnCode.Exception, ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ /// <summary>
+ /// 璇诲彇
+ /// </summary>
+ /// <param name="guid"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ m.list = new List<dynamic>();
+ m.list2 = new List<dynamic>();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[prc_MES_MOLD_HEAD_mx]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ var _tb = dset.Tables[1].TableToDynamicList();
+ m.list = _tb;
+ //var _tb2 = dset.Tables[2].TableToDynamicList();
+ //m.list2 = _tb2;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="mode"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModelSubmit([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_MES_MOLD_HEAD_submit", 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_MES_MOLD_HEAD_submit error锛�" + 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="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.Guid;
+ string moldTypeCode = model.MoldType;
+ string typeName = model.TypeName;
+ bool requireDepotLocation = model.MustSpecifyLoc;
+ string remark = model.Description;
+ var _sb = new StringBuilder();
+ var _split = "|";
+ foreach (var m in model.list)
+ {
+ string _guid = m.Guid.ToString();
+ var _line =
+ m.MoldCode + _split
+ + m.MoldName + _split
+ + m.MoldSpec + _split
+ + m.MoldStatus + _split
+ + m.CavityCount + _split
+ + m.OpenCloseCount + _split
+ + m.Manufacturer + _split
+ + m.MaintainWarnCount + _split
+ + m.MaintainWarnDays + _split
+ + m.InStockFlag + _split
+ + m.Location + _split
+ + m.FixedLocation + _split
+ + m.ScrapFlag + _split
+ + m.Scrapper + _split
+ + m.ScrapTime + _split
+ + m.Remark + _split
+ + (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString());
+ if (_sb.Length > 0)
+ _sb.Append("~");
+ _sb.Append(_line);
+ }
+ dynamic mObj = new ExpandoObject();
+ mObj.outMsg = "";
+ mObj.outSum = -1;
+ mObj.outGuid = "";
+ mObj.outNo = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_MES_MOLD_HEAD_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@outGuid", SqlDbType.UniqueIdentifier),
+ new("@outNo", SqlDbType.NVarChar, 300),
+ new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
+ new("@inMoldTypeCode", moldTypeCode),
+ new("@inTypeName", typeName),
+ new("@inRequireDepotLocation", requireDepotLocation),
+ new("@inRemark", remark),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inLineList", _sb.ToString())
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ parameters[2].Direction = ParameterDirection.Output;
+ parameters[3].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+ cmd.ExecuteNonQuery();
+ mObj.outMsg = parameters[0].Value.ToString();
+ mObj.outSum = int.Parse(parameters[1].Value.ToString());
+ mObj.outGuid = parameters[2].Value.ToString();
+ mObj.outNo = parameters[3].Value.ToString();
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_MES_MOLD_HEAD_edt error锛�" + ex.Message);
+ mObj.outMsg = ex.Message;
+ mObj.outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (mObj.outSum <= 0)
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
+ return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
+ }
+
+ /// <summary>
+ /// 鍒犻櫎涓昏〃鎴栨槑缁�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModelOrMx([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid; //鍒拌揣鍗曚富閿�
+ string mxGuid = model.mxGuid;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_MES_MOLD_HEAD_del]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid",
+ UtilityHelper.CheckGuid(guid)
+ ? guid
+ : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inMxGuid", mxGuid)
+ };
+ 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_MES_MOLD_HEAD_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);
+ }
+ }
+}
diff --git a/WebApi/Gs.Mjgl/MesMoldManagementManager.cs b/WebApi/Gs.Mjgl/MesMoldManagementManager.cs
new file mode 100644
index 0000000..096eeb5
--- /dev/null
+++ b/WebApi/Gs.Mjgl/MesMoldManagementManager.cs
@@ -0,0 +1,272 @@
+using System.Data;
+using System.Data.SqlClient;
+using System.Dynamic;
+using System.Text;
+using 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 static Gs.Toolbox.UtilityHelper;
+
+namespace Gs.Mjgl
+{
+ [ApiGroup(ApiGroupNames.PerMission)]
+ public class MesMoldManagementManager : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+ public MesMoldManagementManager(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string?> TestConn([FromBody] dynamic _)
+ {
+ var msg = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ try
+ {
+ conn.Open();
+ using (var cmd = new SqlCommand("SELECT GETDATE()", conn))
+ {
+ cmd.ExecuteScalar();
+ }
+ msg = "杩炴帴鎴愬姛";
+ return ReturnDto<string>.QuickReturn("", ReturnCode.Success, msg);
+ }
+ catch (Exception ex)
+ {
+ msg = ex.Message;
+ return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, msg);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("prc_MES_MOLD_MAT_CAP_lst", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Exception, ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> GetModel([FromBody] dynamic model)
+ {
+ string guid = model.guid.ToString();
+ dynamic m = new ExpandoObject();
+ SqlParameter[] parameters =
+ {
+ new("@inMainGuid", guid),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("[prc_MES_MOLD_MAT_CAP_mx]", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0)
+ {
+ var dr = dset.Tables[0].Rows[0];
+ m = dr.RowToDynamic();
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ if (m != null)
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
+ }
+
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string?> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.Guid;
+ string moldCode = model.MoldCode;
+ string itemCode = model.ItemCode;
+ int inItemId = model.ItemId;
+ string status = model.Status;
+ int inPackQty = model.PackQty;
+ int inCapacity = model.Capacity;
+ string remark = model.Description;
+ var outMsg = "";
+ var outSum = -1;
+ var outGuid = "";
+ var outNo = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_MES_MOLD_MAT_CAP_edt]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@outGuid", SqlDbType.UniqueIdentifier),
+ new("@outNo", SqlDbType.NVarChar, 300),
+ new("@inOrderGuid", UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
+ new("@inMoldCode", moldCode),
+ new("@inItemCode", itemCode),
+ new("@inItemId", inItemId),
+ new("@inStatus", status),
+ new("@inPackQty", inPackQty),
+ new("@inCapacity", inCapacity),
+ new("@inRemark", remark),
+ new("@inEdtUserGuid", _userGuid)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ parameters[2].Direction = ParameterDirection.Output;
+ parameters[3].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());
+ outGuid = parameters[2].Value.ToString();
+ outNo = parameters[3].Value.ToString();
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_MES_MOLD_MGMT_edt error锛�" + ex.Message);
+ outMsg = ex.Message;
+ outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (outSum <= 0)
+ return ReturnDto<string>.QuickReturn("", ReturnCode.Exception, outMsg);
+ return ReturnDto<string>.QuickReturn(outGuid, ReturnCode.Success, outMsg);
+ }
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteModel([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ var _outMsg = "";
+ var _outSum = -1;
+ JArray arr;
+ if (model is JArray)
+ arr = (JArray)model;
+ else
+ arr = JArray.Parse(model.ToString());
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_MES_MOLD_MAT_CAP_del]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ foreach (var token in arr)
+ {
+ var guidStr = token.ToString();
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", UtilityHelper.CheckGuid(guidStr) ? Guid.Parse(guidStr) : (object)DBNull.Value),
+ new("@inEdtUserGuid", _userGuid)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ cmd.Parameters.Clear();
+ 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_MES_MOLD_MAT_CAP_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);
+ }
+
+ }
+}
diff --git a/WebApi/GsMesSolution.sln b/WebApi/GsMesSolution.sln
index dfdacb7..4637d9f 100644
--- a/WebApi/GsMesSolution.sln
+++ b/WebApi/GsMesSolution.sln
@@ -19,19 +19,21 @@
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.HostIIS", "Gs.HostIIS\Gs.HostIIS.csproj", "{E8851E6F-E65D-4560-851C-406961260265}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.Wom", "Gs.Wom\Gs.Wom.csproj", "{63823BC6-6242-4EBC-8B15-B72B89E8CEDA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.Wom", "Gs.Wom\Gs.Wom.csproj", "{63823BC6-6242-4EBC-8B15-B72B89E8CEDA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.QiTaCk", "Gs.QiTaCk\Gs.QiTaCk.csproj", "{D1743FF9-431C-4D1A-A4B5-3C81D66EE282}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.QiTaCk", "Gs.QiTaCk\Gs.QiTaCk.csproj", "{D1743FF9-431C-4D1A-A4B5-3C81D66EE282}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.QiTaRk", "Gs.QiTaRk\Gs.QiTaRk.csproj", "{27AFDBE0-40C0-49CF-A8AF-7DF01FBFE33A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.QiTaRk", "Gs.QiTaRk\Gs.QiTaRk.csproj", "{27AFDBE0-40C0-49CF-A8AF-7DF01FBFE33A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.Ww", "Gs.Ww\Gs.Ww.csproj", "{A899A72F-5E82-4176-81F6-D34AA8146F3A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.Ww", "Gs.Ww\Gs.Ww.csproj", "{A899A72F-5E82-4176-81F6-D34AA8146F3A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.Sales", "Gs.Sales\Gs.Sales.csproj", "{EA4CCE91-2C56-4E21-B72B-5794DA372890}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.Sales", "Gs.Sales\Gs.Sales.csproj", "{EA4CCE91-2C56-4E21-B72B-5794DA372890}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.Pda", "Gs.Pda\Gs.Pda.csproj", "{33387B1A-A9D8-41D2-B9C0-60F17D350C40}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.Pda", "Gs.Pda\Gs.Pda.csproj", "{33387B1A-A9D8-41D2-B9C0-60F17D350C40}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.JJGZ", "Gs.JJGZ\Gs.JJGZ.csproj", "{09B053B1-2E1E-452B-8236-41477D61D3D9}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gs.JJGZ", "Gs.JJGZ\Gs.JJGZ.csproj", "{09B053B1-2E1E-452B-8236-41477D61D3D9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.Mjgl", "Gs.Mjgl\Gs.Mjgl.csproj", "{D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -223,6 +225,18 @@
{09B053B1-2E1E-452B-8236-41477D61D3D9}.Release|x64.Build.0 = Release|Any CPU
{09B053B1-2E1E-452B-8236-41477D61D3D9}.Release|x86.ActiveCfg = Release|Any CPU
{09B053B1-2E1E-452B-8236-41477D61D3D9}.Release|x86.Build.0 = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|x64.Build.0 = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Debug|x86.Build.0 = Debug|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|x64.ActiveCfg = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|x64.Build.0 = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|x86.ActiveCfg = Release|Any CPU
+ {D4590E80-BF55-4ED5-90C6-DB7329E8ADDE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--
Gitblit v1.9.3