From b98df034707a61fd2857dbccd5a232605076ca59 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期四, 20 十一月 2025 10:26:08 +0800
Subject: [PATCH] 标准版初始化
---
WebApi/Gs.Wom/Service/WomdaaManager.cs | 388 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 265 insertions(+), 123 deletions(-)
diff --git a/WebApi/Gs.Wom/Service/WomdaaManager.cs b/WebApi/Gs.Wom/Service/WomdaaManager.cs
index e463a4b..00fb426 100644
--- a/WebApi/Gs.Wom/Service/WomdaaManager.cs
+++ b/WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -1,19 +1,21 @@
-锘縰sing System.Data;
-using System.Data.SqlClient;
-using System.Dynamic;
-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;
namespace Gs.Wom.Service;
[ApiGroup(ApiGroupNames.WOM)]
-public class WomdaaManager :IRomteService
+public class WomdaaManager : IRomteService
{
private readonly IHttpContextAccessor _http;
@@ -125,10 +127,16 @@
m.list2 = _tb2;
var _tb3 = dset.Tables[3].TableToDynamicList();
m.list3 = _tb3;
- var _tb4= dset.Tables[4].TableToDynamicList();
+ var _tb4 = dset.Tables[4].TableToDynamicList();
m.list4 = _tb4;
var _tb5 = dset.Tables[5].TableToDynamicList();
m.list5 = _tb5;
+ var _tb6 = dset.Tables[6].TableToDynamicList();
+ m.list6 = _tb6;
+ var _tb7 = dset.Tables[7].TableToDynamicList();
+ m.list7 = _tb7;
+ var _tb8 = dset.Tables[8].TableToDynamicList();
+ m.list8 = _tb8;
}
}
catch (Exception ex)
@@ -257,63 +265,69 @@
- ///// <summary>
- ///// 澧炲姞鎴栫紪杈戝疄浣�
- ///// </summary>
- ///// <param name="model"></param>
- ///// <returns></returns>
- //[RequestMethod(RequestMethods.POST)]
- //public ReturnDto<string?> EditModel([FromBody] dynamic model)
- //{
- // Guid? guid = model.guid; //涓婚敭
- // string sjxt = model.sjxt; //宸ュ崟鍙�
- // string bz = model.bz;//浠撳簱
- // var _outMsg = "";
- // var _outSum = -1;
- // using (var conn = new SqlConnection(DbHelperSQL.strConn))
- // {
- // using (var cmd = new SqlCommand("[prc_wom_daa_edt]", 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("@inSjxt", sjxt),
- // new("@inBz", bz),
- // new("@inEdtUserGuid", _userGuid),
- // };
- // 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_wom_daa_edt error锛�" + ex.Message);
- // _outMsg = ex.Message;
- // _outSum = -1;
- // }
- // finally
- // {
- // conn.Close();
- // }
- // }
- // }
- // if (_outSum <= 0)
- // return ReturnDto<string>.QuickReturn(guid.ToString(),
- // ReturnCode.Exception, _outMsg);
- // return ReturnDto<string>.QuickReturn(guid.ToString(),
- // ReturnCode.Success, _outMsg);
- //}
+ /// <summary>
+ /// 澧炲姞鎴栫紪杈戝疄浣�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<string?> EditModel([FromBody] dynamic model)
+ {
+ Guid? guid = model.guid; //涓婚敭
+ string sjxt = model.sjxt; //宸ュ崟鍙�
+ string bz = model.bz;
+ string sclx = model.sclx;
+ string dtKg = model.dtKg;
+ string dtWg = model.dtWg;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_wom_daa_edt]", 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("@inSjxt", sjxt),
+ new("@inBz", bz),
+ new("@inSclx", sclx),
+ new("@dtKg", dtKg),
+ new("@dtWg", dtWg),
+ new("@inEdtUserGuid", _userGuid),
+ };
+ 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_wom_daa_edt error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ if (_outSum <= 0)
+ return ReturnDto<string>.QuickReturn(guid.ToString(),
+ ReturnCode.Exception, _outMsg);
+ return ReturnDto<string>.QuickReturn(guid.ToString(),
+ ReturnCode.Success, _outMsg);
+ }
/// <summary>
@@ -464,65 +478,6 @@
}
/// <summary>
- ///
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [RequestMethod(RequestMethods.POST)]
- public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model)
- {
- int? rtnInt = (int)ReturnCode.Default;
- string mxGuid = model.mxGuid;
- string inType = model.inType;
- var _outMsg = "";
- var _outSum = -1;
- using (var conn = new SqlConnection(DbHelperSQL.strConn))
- {
- using (var cmd = new SqlCommand("[prc_wom_daatm_del]", conn))
- {
- try
- {
- conn.Open();
- cmd.CommandType = CommandType.StoredProcedure;
- SqlParameter[] parameters =
- {
- new("@outMsg", SqlDbType.NVarChar, 300),
- new("@outSum", SqlDbType.Int),
- new("@inEdtUserGuid", _userGuid),
- new("@inMxGuid", mxGuid),
- new("@inType", inType)
- };
- 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_wom_daatm_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>
/// <param name="model"></param>
@@ -578,8 +533,195 @@
}
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>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<ExpandoObject> EditGy([FromBody] dynamic model)
+ {
+ Guid? guid = model.guid; //浜у搧涓婚敭
+ var _sb = new StringBuilder();
+ var _split = "|";
+ foreach (var m in model.list)
+ {
+ var _line = m.processNo + _split
+ + m.frontProcessNo;
+ 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_wom_daa_technique]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inLineList", _sb.ToString())
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].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());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "prc_wom_daa_technique 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="query"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<List<dynamic>> GetGyList(
+ [FromBody] dynamic model)
+ {
+ string daaGuid = model.guid;
+ var lst = new List<dynamic>();
+ var dset = new DataSet();
+ System.Text.StringBuilder sbSql = new System.Text.StringBuilder();
+ sbSql.Append(" select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" + daaGuid + "' order by processNo asc ");
+ try
+ {
+ 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();
+ return ReturnDto<List<dynamic>>.QuickReturn(lst, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ }
+
+
+ /// <summary>
+ /// 鍙樻洿鍐呭寘瑁呮暟閲�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> EditTb([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ string sl = model.sl;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("[prc_wom_daa_nbz]", 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("@inSl", sl)
+ };
+ 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_wom_daa_nbz 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>
+ /// 鏍规嵁daaNo,璇诲彇鏄庣粏锛岀敤浜庡嚭鍏ュ簱閫夋嫨
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<List<dynamic>> SelectDaaMx([FromBody] dynamic model)
+ {
+ string strDaaNo = model.strDaaNo;
+ var lst = new List<dynamic>();
+ var dset = new DataSet();
+ System.Text.StringBuilder sbSql = new StringBuilder();
+ sbSql.Append(" select dab003 as itemId,dab004 as itemName,dab005 as itemModel,dw.fname as dwName,i.item_no as itemNo,'' as sl,'' as bz,'' as bllx");
+ sbSql.Append(" ,isnull( cet0.[搴撳瓨瀵规瘮],'(鏈浠撳簱)0/0') as kcQty");
+ sbSql.Append(" ,cet0.[浠撳簱ID] as depotId");
+ sbSql.Append(" ,cet0.[浠撳簱鍚嶇О] as depotName");
+ sbSql.Append(" from WOMDAB dab left join MES_ITEMS i on dab.dab003=i.item_id ");
+ sbSql.Append(" left join MES_UNIT dw on dw.id=dab009 ");
+ sbSql.Append(" left join [dbo].鍗虫椂搴撳瓨宸紓琛� cet0 on (cet0.鐗╂枡ID=i.id and i.depot_code=cet0.浠撳簱ID) ");
+ sbSql.Append(" where dab.dab001='" + strDaaNo + "' order by dab.erpid asc");
+ try
+ {
+ dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), "SelectDaaMx error锛�" + ex.Message);
+ }
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ lst = dset.Tables[0].TableToDynamicList();
+ return ReturnDto<List<dynamic>>.QuickReturn(lst, ReturnCode.Success,
+ "璇诲彇鎴愬姛锛�");
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3