From 774a3473fa942d3460fd208363552af7d81e1aae Mon Sep 17 00:00:00 2001 From: dengyu Date: Mon, 17 Jul 2023 17:59:11 +0800 Subject: [PATCH] 1 --- DSWeb.DJYMQ/App.config | 10 +++++----- DSWeb.DJYMQ/DS7Service.cs | 28 ++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/DSWeb.DJYMQ/App.config b/DSWeb.DJYMQ/App.config index fd512c7a..9962fe29 100644 --- a/DSWeb.DJYMQ/App.config +++ b/DSWeb.DJYMQ/App.config @@ -22,16 +22,16 @@ --> - - --> - - + - + diff --git a/DSWeb.DJYMQ/DS7Service.cs b/DSWeb.DJYMQ/DS7Service.cs index 7f06b8ce..5b2c353e 100644 --- a/DSWeb.DJYMQ/DS7Service.cs +++ b/DSWeb.DJYMQ/DS7Service.cs @@ -2188,6 +2188,7 @@ SELECT @ps_BillNo as N'billno'"; logger.Debug($"更新:{newhead.主提单号};{newhead.DJYID}"); + AfterSave(newhead.编号); //DS6Data.SaveChanges(); } @@ -2301,9 +2302,10 @@ SELECT @ps_BillNo as N'billno'"; mark = 3.3m; - logger.Debug($"新增:{newhead.主提单号};{newhead.DJYID}"); + DS6Data.SaveChanges(); - + logger.Debug($"新增:{newhead.主提单号};{newhead.DJYID}"); + AfterSave(newhead.编号); } } @@ -2327,6 +2329,28 @@ SELECT @ps_BillNo as N'billno'"; } } + public static void AfterSave(string 编号) { + + try + { + //20230717 保存业务后,执行一个存储过程 + using (DS6DataContext context = new DS6DataContext()) + { + SqlParameter bsno = new SqlParameter("@bsno", 编号); + + int count = context.Database.ExecuteSqlCommand("exec p_exec_accmonth @bsno", bsno); + context.SaveChanges(); + logger.Debug($"AfterSave:{编号};{count}"); + } + + } + catch (Exception e) { + var str=JsonConvert.SerializeObject(e); + logger.Error($"AfterSave:{str}"); + } + return ; + + } #region 原保存逻辑 //public static void DingCangToDS6_OLD(JArray jarr)