From 2e0b8acaf3d540ec80bf594da98f19799789e1d8 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 19 Dec 2022 10:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E8=B4=B9=E7=94=B3=E8=AF=B7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E9=83=A8=E5=88=86=E7=9B=AE=E5=89=8D=E4=B8=8D?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E6=AD=A3=E5=B8=B8=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Chfee_payapplicationController.cs | 48 ++----------------- .../Chfee_PayapplicationDAL.cs | 44 ++++++++++++++++- DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs | 2 +- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs b/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs index f79f62c0..27d8b1c7 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs @@ -518,32 +518,7 @@ namespace DSWeb.Areas.Account.Controllers var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"])); - //看是否有系统参数 泛微Appid - //如有且有值 方可执行 - try - { - if (ConfigurationManager.AppSettings["FanWeiOAAPI"] == "true") - { - var 泛微Appid = MsSysParamSetDAL.GetSysParamValue("FanWei_appid"); - if (!string.IsNullOrWhiteSpace(泛微Appid)) - { - //泛微OAHelper.GetToken(); - - var userid = Convert.ToString(Session["USERID"]); - var usercode = Convert.ToString(Session["CODENAME"]); - var companyid = Convert.ToString(Session["COMPANYID"]); - - 泛微OAHelper.PostApplication(headdata, userid, usercode, companyid); - } - } - } - catch (Exception e) - { - - } - var testresult = new DBResult(); - var json2 = JsonConvert.Serialize(testresult); - return new ContentResult() { Content = json2 }; + if (headdata.BILLSTATUS == 1||headdata.BILLSTATUS == 6) @@ -598,22 +573,7 @@ namespace DSWeb.Areas.Account.Controllers bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); if (bl) { - //看是否有系统参数 泛微Appid - //如有且有值 方可执行 - try - { - if (ConfigurationManager.AppSettings["FanWeiOAAPI"] == "true") - { - var 泛微Appid = MsSysParamSetDAL.GetSysParamValue("泛微Appid"); - if (!string.IsNullOrWhiteSpace(泛微Appid)) - { - 泛微OAHelper.GetSecret(); - } - } - } - catch (Exception e) { - - } + ChpayapplicationDAL.FanWeiOA_Submit(bill, Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"])); } } } @@ -648,7 +608,7 @@ namespace DSWeb.Areas.Account.Controllers public ContentResult SubmitAuditList(string bills) { - DBResult result = ChpayapplicationDAL.SubmitAuditList("FeeSettleAudit", Convert.ToString(Session["USERID"]), bills, Convert.ToString(Session["COMPANYID"])); + DBResult result = ChpayapplicationDAL.SubmitAuditList("FeeSettleAudit", bills, Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"])); if (result.Message2 == "1") { var PAYAUDITAUTOCLOSEDR = MsSysParamSetDAL.GetData("PARAMNAME='PAYAUDITAUTOCLOSEDR'"); if (PAYAUDITAUTOCLOSEDR.PARAMVALUE == "1") @@ -707,6 +667,8 @@ namespace DSWeb.Areas.Account.Controllers var json = JsonConvert.Serialize(result); return new ContentResult() { Content = json }; } + + public ContentResult AuditList(string data) { diff --git a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs index 19f6d881..27f67d1e 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs @@ -22,6 +22,8 @@ using DSWeb.MvcShipping.DAL.MsBaseInfoDAL; using DSWeb.Areas.Account.Models.TruckChfee_do_detail; using System.Data.SqlClient; using DSWeb.Areas.Account.Models.BSNOLB; +using static DSWeb.Areas.CommMng.DAL.PublicAPIDAL; +using System.Configuration; namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication { @@ -2474,7 +2476,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication } - public static DBResult SubmitAuditList(String WorkFlowName, String USERID, String bills,string companyid) + public static DBResult SubmitAuditList(String WorkFlowName, String bills, String USERID,string usercode, string companyid) { var FEECLOSEPAYAUTOAUDIT = MsSysParamSetDAL.GetData("PARAMNAME='FEECLOSEPAYAUTOAUDIT'"); @@ -2579,6 +2581,10 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication result.Success = true; result.Message = "提交审核成功"; + + + FanWeiOA_Submit(bill, USERID, usercode, companyid); + } else { @@ -2589,6 +2595,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication } } tran.Commit(); + + } catch (Exception) { @@ -2894,6 +2902,40 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication return result; } + public static DBResult FanWeiOA_Submit(string bill, string userid, string usercode, string companyid) + { + + var result = new DBResult(); + + //看是否有系统参数 泛微Appid + //如有且有值 方可执行 + try + { + if (ConfigurationManager.AppSettings["FanWeiOAAPI"] == "true") + { + var 泛微Appid = MsSysParamSetDAL.GetSysParamValue("FanWei_appid"); + if (!string.IsNullOrWhiteSpace(泛微Appid)) + { + //泛微OAHelper.GetToken(); + + var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", userid, usercode, companyid); + + //var userid = Convert.ToString(Session["USERID"]); + //var usercode = Convert.ToString(Session["CODENAME"]); + //var companyid = Convert.ToString(Session["COMPANYID"]); + + 泛微OAHelper.PostApplication(headdata, userid, usercode, companyid); + } + } + } + catch (Exception e) + { + + } + finally { } + return result; + } + #endregion #region 审核或驳回 diff --git a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs index 10af43eb..50ce1b7b 100644 --- a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs @@ -1203,7 +1203,7 @@ namespace DSWeb.Areas.CommMng.DAL return _res; } finally { } - return _res; + //return _res; } }