Browse Source

..付款完善

master
robin 7 years ago
parent
commit
35f468eb26
4 changed files with 37 additions and 15 deletions
  1. +1
    -3
      B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
  2. +14
    -5
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs
  3. +12
    -2
      B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs
  4. +10
    -5
      B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs

+ 1
- 3
B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj View File

@ -170,9 +170,7 @@
<Compile Include="Pages\B3QingDaoWanFu\ExportUI\GoodsExportToMES.cs"> <Compile Include="Pages\B3QingDaoWanFu\ExportUI\GoodsExportToMES.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="Pages\B3QingDaoWanFu\Overlays\PayAnalyse_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Overlays\PayAnalyse_Ext.cs" />
<Compile Include="Pages\B3QingDaoWanFu\Overlays\PayEdit_Ext.cs"> <Compile Include="Pages\B3QingDaoWanFu\Overlays\PayEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>


+ 14
- 5
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/TrustPay_/TrustPayEdit.cs View File

@ -15,16 +15,16 @@ using TSingSoft.WebPluginFramework.QueueTasks;
namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ { namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ {
class TrustPayEdit : BaseDmoEditPage<TrustPay, ITrustPayBL> { class TrustPayEdit : BaseDmoEditPage<TrustPay, ITrustPayBL> {
protected override void OnLoad(EventArgs e) { 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) { if (result.IsSuccess) {
mBL.ABCPaySuccess(Dmo); mBL.ABCPaySuccess(Dmo);
AspUtil.AlertAndClose(this, "付款成功"); AspUtil.AlertAndClose(this, "付款成功");
} else { } else {
AspUtil.Alert(this, result.ErrorMessage); AspUtil.Alert(this, result.ErrorMessage);
}
}
base.OnLoad(e);
}
}
base.OnLoad(e);
} }
protected override void AddActions(ButtonGroup buttonGroup) { protected override void AddActions(ButtonGroup buttonGroup) {
@ -118,6 +118,15 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ {
AspUtil.RedirectAndAlert(this, Request.RawUrl, "完成付款成功"); 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);
}));
}
} }
} }


+ 12
- 2
B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs View File

@ -1,8 +1,11 @@
using System; using System;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.Utils; using BWP.B3Frameworks.Utils;
using BWP.B3QingDaoWanFu.BL; using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.BO; using BWP.B3QingDaoWanFu.BO;
using BWP.B3QingDaoWanFu.BO.NamedValueTemplate; using BWP.B3QingDaoWanFu.BO.NamedValueTemplate;
using BWP.B3QingDaoWanFu.Utils;
using BWP.BWPTrustPayClient.TrustPayRequests; using BWP.BWPTrustPayClient.TrustPayRequests;
using Forks.EnterpriseServices.BusinessInterfaces; using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2;
@ -73,19 +76,24 @@ namespace BWP.B3QingDaoWanFu.Tasks {
} }
//创建收款单和事务和更新状态的事务分开 //创建收款单和事务和更新状态的事务分开
string msg = "";
try { try {
if (trustPay.PayState == .) { if (trustPay.PayState == .) {
using (var session = Dmo.NewSession()) { using (var session = Dmo.NewSession()) {
var bl = BIFactory.Create<ITrustPayBL>(session); var bl = BIFactory.Create<ITrustPayBL>(session);
long gatheringID; 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) { if (gatheringID > 0) {
trustPay.Gathering_ID = gatheringID; trustPay.Gathering_ID = gatheringID;
} }
session.Commit(); session.Commit();
} }
} }
} catch (Exception) {
} catch (Exception e) {
msg = e.Message;
} }
using (var session = Dmo.NewSession()) { using (var session = Dmo.NewSession()) {
@ -93,6 +101,8 @@ namespace BWP.B3QingDaoWanFu.Tasks {
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked"); InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked");
session.Commit(); session.Commit();
} }
if (!string.IsNullOrEmpty(msg))
throw new ApplicationException(msg);
} }
private static bool ABCPaySuccess(IDmoSessionWithTransaction session, TrustPay trustPay) { private static bool ABCPaySuccess(IDmoSessionWithTransaction session, TrustPay trustPay) {


+ 10
- 5
B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs View File

@ -29,10 +29,7 @@ namespace BWP.B3QingDaoWanFu.Utils
get { return _saleoutstoreSaveNotCheckStoreGoodsConsistent; } get { return _saleoutstoreSaveNotCheckStoreGoodsConsistent; }
set { _saleoutstoreSaveNotCheckStoreGoodsConsistent = value; } set { _saleoutstoreSaveNotCheckStoreGoodsConsistent = value; }
} }
private IntConfigRef _receiptTypeID = new IntConfigRef(0); private IntConfigRef _receiptTypeID = new IntConfigRef(0);
[LogicName("农行接口收款类型ID")] [LogicName("农行接口收款类型ID")]
@ -68,7 +65,15 @@ namespace BWP.B3QingDaoWanFu.Utils
{ {
get { return _accID; } get { return _accID; }
set { _accID = value; } set { _accID = value; }
}
private IntConfigRef _domainUserForTrustPay = new IntConfigRef(0);
[LogicName("农行接口默认板块用户ID")]
[ConfigurationItemGroup("青岛万福")]
public IntConfigRef DomainUserForTrustPay {
get { return _domainUserForTrustPay; }
set { _domainUserForTrustPay = value; }
} }
} }
} }

Loading…
Cancel
Save