From 26a078cb60a8f9d23209a0422998128b7df9450e Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期四, 29 八月 2024 14:36:29 +0800 Subject: [PATCH] qq --- MESApplication/bin/Debug/net8.0/MESApplication.pdb | 0 MES.Service/Modes/MessageCenter.cs | 12 ++++++ MES.Service/service/MessageCenterManager.cs | 4 ++ MESApplication/bin/Debug/net8.0/MESApplication.exe | 0 MESApplication/bin/Debug/net8.0/MES.Service.pdb | 0 MESApplication/bin/Debug/net8.0/MESApplication.dll | 0 MES.Service/bin/Debug/net8.0/MES.Service.dll | 0 MES.Service/service/GetErpParametersServer.cs | 67 +++++++++++++++++++++++++++------ MESApplication/bin/Debug/net8.0/MES.Service.dll | 0 MES.Service/service/Warehouse/MesInvItemOutsManager.cs | 2 MES.Service/bin/Debug/net8.0/MES.Service.pdb | 0 11 files changed, 71 insertions(+), 14 deletions(-) diff --git a/MES.Service/Modes/MessageCenter.cs b/MES.Service/Modes/MessageCenter.cs index 637de92..de26f7e 100644 --- a/MES.Service/Modes/MessageCenter.cs +++ b/MES.Service/Modes/MessageCenter.cs @@ -118,6 +118,18 @@ [SugarColumn(ColumnName = "is_message")] public short? IsMessage { get; set; } + /// <summary> + /// 鏈�鍚庝竴娆′慨鏀逛汉 + /// </summary> + [SugarColumn(ColumnName = "UPDATE_BY")] + public string? UpdateBy { get; set; } + + /// <summary> + /// 鏈�鍚庝竴娆′慨鏀规椂闂� + /// </summary> + [SugarColumn(ColumnName = "UPDATE_DATE")] + public string? UpdateDate { get; set; } + [SugarColumn(IsIgnore = true)] public int? isShow { get; set; } diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.dll b/MES.Service/bin/Debug/net8.0/MES.Service.dll index e67a803..17b0621 100644 --- a/MES.Service/bin/Debug/net8.0/MES.Service.dll +++ b/MES.Service/bin/Debug/net8.0/MES.Service.dll Binary files differ diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.pdb b/MES.Service/bin/Debug/net8.0/MES.Service.pdb index fa697fc..a77bd2d 100644 --- a/MES.Service/bin/Debug/net8.0/MES.Service.pdb +++ b/MES.Service/bin/Debug/net8.0/MES.Service.pdb Binary files differ diff --git a/MES.Service/service/GetErpParametersServer.cs b/MES.Service/service/GetErpParametersServer.cs index 0c7ab66..9d1c4d4 100644 --- a/MES.Service/service/GetErpParametersServer.cs +++ b/MES.Service/service/GetErpParametersServer.cs @@ -18,7 +18,7 @@ private readonly MessageCenterManager _messageCenterServer = new(); - public List<MessageCenter> GetErpParameters(List<MessageCenter> data) + private List<MessageCenter> GetErpParameters(List<MessageCenter> data) { var centers = new List<MessageCenter>(); @@ -32,6 +32,9 @@ var queryParameters = HttpUtility.ParseQueryString(queryString); var strings = center.TableName.Split("_"); + + var centerUpdateBy = center.UpdateBy; + var centerUpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); MessageCenter mesToErp = null; var query = new WarehouseQuery(); @@ -47,10 +50,13 @@ //鑾峰彇url涓檮甯︾殑鍙傛暟 query.id = Convert.ToDecimal(queryParameters["id"]); query.billNo = queryParameters["billNo"]; + query.userName = centerUpdateBy; //閲嶆柊鑾峰彇璇锋眰鐨勬暟鎹� mesToErp = _invItemInCDetailsServer.MesToErpParam(query); //璧嬪�间富id mesToErp.Id = center.Id; + mesToErp.UpdateBy = centerUpdateBy; + mesToErp.UpdateDate = centerUpdateDate; centers.Add(mesToErp); //鏇存柊鍓╀笅鐨勮姹傜殑鍙傛暟 @@ -58,9 +64,12 @@ var json = new JObject { new JProperty("id", query.id), - new JProperty("billNo", query.billNo) + new JProperty("billNo", query.billNo), + new JProperty("userName", query.userName) }; messageCenter.Data = json.ToString(); + messageCenter.UpdateBy = centerUpdateBy; + messageCenter.UpdateDate = centerUpdateDate; centers.Add(messageCenter); break; @@ -74,26 +83,39 @@ query.Type = strings[^1]; query.id = Convert.ToDecimal(queryParameters["id"]); query.billNo = queryParameters["itemOutNo"]; + query.userName = centerUpdateBy; //閲嶆柊鑾峰彇璇锋眰鐨勬暟鎹� mesToErp = _invItemOutsServer.MesToErpParam(query); //鏇存涓轰富id mesToErp.Id = center.Id; + mesToErp.UpdateBy = centerUpdateBy; + mesToErp.UpdateDate = centerUpdateDate; //娣诲姞鍒拌姹傞泦鍚堜腑 centers.Add(mesToErp); //鑾峰彇鍓╀綑鐨勮姹� - var find = data.FindAll(s => s.Seq != 1); - var result = new JObject - { - new JProperty("id", query.id), - new JProperty("billNo", query.billNo) - }; - find.ForEach(s => - { - s.Data = result.ToString(); - centers.Add(s); - }); + PostRequest(data, query, centers,centerUpdateDate); + break; + //鐢熶骇棰嗘枡鍗� + case "INV_ITEM_OUTS_A": + //鑾峰彇鍒扮被鍨嬶紙瀹℃牳杩樻槸鍙嶅鏍革級 + query.Type = strings[^1]; + query.id = Convert.ToDecimal(queryParameters["id"]); + query.billNo = queryParameters["itemOutNo"]; + query.userName = centerUpdateBy; + + //閲嶆柊鑾峰彇璇锋眰鐨勬暟鎹� + mesToErp = _invItemOutsServer.ProductionMesToErpParam(query); + //鏇存涓轰富id + mesToErp.Id = center.Id; + mesToErp.UpdateBy = centerUpdateBy; + mesToErp.UpdateDate = centerUpdateDate; + //娣诲姞鍒拌姹傞泦鍚堜腑 + centers.Add(mesToErp); + + //鑾峰彇鍓╀綑鐨勮姹� + PostRequest(data, query, centers,centerUpdateDate); break; default: throw new Exception("鏃犳硶璇嗗埆TableName绫诲瀷"); @@ -103,6 +125,25 @@ return centers.OrderBy(p => p.Seq).ToList(); } + private void PostRequest(List<MessageCenter> data, WarehouseQuery query, List<MessageCenter> centers,string centerUpdateDate) + { + var find = data.FindAll(s => s.Seq != 1); + + var result = new JObject + { + new JProperty("id", query.id), + new JProperty("billNo", query.billNo), + new JProperty("userName", query.userName) + }; + find.ForEach(s => + { + s.Data = result.ToString(); + s.UpdateBy = query.userName; + s.UpdateDate = centerUpdateDate; + centers.Add(s); + }); + } + public string Resend(MessageCenter data) { diff --git a/MES.Service/service/MessageCenterManager.cs b/MES.Service/service/MessageCenterManager.cs index 255bac7..b377f2d 100644 --- a/MES.Service/service/MessageCenterManager.cs +++ b/MES.Service/service/MessageCenterManager.cs @@ -70,6 +70,10 @@ .SetColumns(a => a.ResultData == entity.ResultData) .SetColumns(a => a.Status == entity.Status) .SetColumns(a => a.DealWith == entity.DealWith) + .SetColumnsIF(!string.IsNullOrEmpty(entity.UpdateBy), + a => a.UpdateBy == entity.UpdateBy) + .SetColumnsIF(!string.IsNullOrEmpty(entity.UpdateDate), + a => a.UpdateDate == entity.UpdateDate) .Where(a => a.Id == entity.Id) .ExecuteCommand(); }); diff --git a/MES.Service/service/Warehouse/MesInvItemOutsManager.cs b/MES.Service/service/Warehouse/MesInvItemOutsManager.cs index 6b1d2ec..95cc7b2 100644 --- a/MES.Service/service/Warehouse/MesInvItemOutsManager.cs +++ b/MES.Service/service/Warehouse/MesInvItemOutsManager.cs @@ -831,7 +831,7 @@ throw new Exception("鑾峰彇鏁版嵁澶辫触"); } - private MessageCenter ProductionMesToErpParam(WarehouseQuery query) + public MessageCenter ProductionMesToErpParam(WarehouseQuery query) { var erpParameters = ""; var title = ""; diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.dll b/MESApplication/bin/Debug/net8.0/MES.Service.dll index e67a803..17b0621 100644 --- a/MESApplication/bin/Debug/net8.0/MES.Service.dll +++ b/MESApplication/bin/Debug/net8.0/MES.Service.dll Binary files differ diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.pdb b/MESApplication/bin/Debug/net8.0/MES.Service.pdb index fa697fc..a77bd2d 100644 --- a/MESApplication/bin/Debug/net8.0/MES.Service.pdb +++ b/MESApplication/bin/Debug/net8.0/MES.Service.pdb Binary files differ diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.dll b/MESApplication/bin/Debug/net8.0/MESApplication.dll index 0d74bd0..1869b75 100644 --- a/MESApplication/bin/Debug/net8.0/MESApplication.dll +++ b/MESApplication/bin/Debug/net8.0/MESApplication.dll Binary files differ diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.exe b/MESApplication/bin/Debug/net8.0/MESApplication.exe index 15b3623..9dd5730 100644 --- a/MESApplication/bin/Debug/net8.0/MESApplication.exe +++ b/MESApplication/bin/Debug/net8.0/MESApplication.exe Binary files differ diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.pdb b/MESApplication/bin/Debug/net8.0/MESApplication.pdb index 492f2f4..a54f851 100644 --- a/MESApplication/bin/Debug/net8.0/MESApplication.pdb +++ b/MESApplication/bin/Debug/net8.0/MESApplication.pdb Binary files differ -- Gitblit v1.9.3