From 35f468eb26def13cba9d3d6fd9ae4a94085e357d Mon Sep 17 00:00:00 2001 From: robin Date: Mon, 7 May 2018 19:04:40 +0800 Subject: [PATCH] =?UTF-8?q?..=E4=BB=98=E6=AC=BE=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 4 +--- .../B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs | 19 ++++++++++++++----- B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs | 14 ++++++++++++-- B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs | 15 ++++++++++----- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj index c976b18..8218881 100644 --- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj +++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj @@ -170,9 +170,7 @@ ASPXCodeBehind - - ASPXCodeBehind - + ASPXCodeBehind diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs index 08d80d1..3d8b7e0 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs @@ -15,16 +15,16 @@ using TSingSoft.WebPluginFramework.QueueTasks; namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ { class TrustPayEdit : BaseDmoEditPage { protected override void OnLoad(EventArgs e) { - if (!IsPostBack && !String.IsNullOrEmpty(Request["MSG"])) { - var result = new B3PaymentResult(Request["MSG"]).Parse(); + if (!IsPostBack && !String.IsNullOrEmpty(Request["MSG"])) { + var result = new B3PaymentResult(Request["MSG"]).Parse(); if (result.IsSuccess) { mBL.ABCPaySuccess(Dmo); AspUtil.AlertAndClose(this, "付款成功"); } else { AspUtil.Alert(this, result.ErrorMessage); - } - } - base.OnLoad(e); + } + } + base.OnLoad(e); } protected override void AddActions(ButtonGroup buttonGroup) { @@ -118,6 +118,15 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ { AspUtil.RedirectAndAlert(this, Request.RawUrl, "完成付款成功"); })); } + if (MinDmo.PayState == 付款状态.付款成功) { + vPanel.Add(new TSButton("创建收款单", delegate { + long gatheringID; + mBL.CreateGathering(Dmo, out gatheringID); + if (gatheringID > 0) + AspUtil.RedirectAndAlert(this, Request.RawUrl, "成功创建收款单No." + gatheringID); + + })); + } } } diff --git a/B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs b/B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs index 187b141..36ed40f 100644 --- a/B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs +++ b/B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs @@ -1,8 +1,11 @@ using System; +using BWP.B3Frameworks; +using BWP.B3Frameworks.BO; using BWP.B3Frameworks.Utils; using BWP.B3QingDaoWanFu.BL; using BWP.B3QingDaoWanFu.BO; using BWP.B3QingDaoWanFu.BO.NamedValueTemplate; +using BWP.B3QingDaoWanFu.Utils; using BWP.BWPTrustPayClient.TrustPayRequests; using Forks.EnterpriseServices.BusinessInterfaces; using Forks.EnterpriseServices.DomainObjects2; @@ -73,19 +76,24 @@ namespace BWP.B3QingDaoWanFu.Tasks { } //创建收款单和事务和更新状态的事务分开 + string msg = ""; try { if (trustPay.PayState == 付款状态.付款成功) { using (var session = Dmo.NewSession()) { var bl = BIFactory.Create(session); long gatheringID; - bl.CreateGathering(trustPay, out gatheringID); + var config = new WanFuOnlineConfig(); + using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) { + bl.CreateGathering(trustPay, out gatheringID); + } if (gatheringID > 0) { trustPay.Gathering_ID = gatheringID; } session.Commit(); } } - } catch (Exception) { + } catch (Exception e) { + msg = e.Message; } using (var session = Dmo.NewSession()) { @@ -93,6 +101,8 @@ namespace BWP.B3QingDaoWanFu.Tasks { InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked"); session.Commit(); } + if (!string.IsNullOrEmpty(msg)) + throw new ApplicationException(msg); } private static bool ABCPaySuccess(IDmoSessionWithTransaction session, TrustPay trustPay) { diff --git a/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs b/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs index d487c20..ea241b0 100644 --- a/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs +++ b/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs @@ -29,10 +29,7 @@ namespace BWP.B3QingDaoWanFu.Utils get { return _saleoutstoreSaveNotCheckStoreGoodsConsistent; } set { _saleoutstoreSaveNotCheckStoreGoodsConsistent = value; } } - - - - + private IntConfigRef _receiptTypeID = new IntConfigRef(0); [LogicName("农行接口收款类型ID")] @@ -68,7 +65,15 @@ namespace BWP.B3QingDaoWanFu.Utils { get { return _accID; } set { _accID = value; } + } + + private IntConfigRef _domainUserForTrustPay = new IntConfigRef(0); + + [LogicName("农行接口默认板块用户ID")] + [ConfigurationItemGroup("青岛万福")] + public IntConfigRef DomainUserForTrustPay { + get { return _domainUserForTrustPay; } + set { _domainUserForTrustPay = value; } } - } }