Browse Source

复核优化

master
robin 7 years ago
parent
commit
c2a5067095
3 changed files with 14 additions and 5 deletions
  1. +3
    -0
      B3QingDaoWanFu/BO/TrustPay_/TrustPay.cs
  2. +1
    -0
      B3QingDaoWanFu/Tasks/CreatGatheringTask.cs
  3. +10
    -5
      B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs

+ 3
- 0
B3QingDaoWanFu/BO/TrustPay_/TrustPay.cs View File

@ -59,6 +59,9 @@ namespace BWP.B3QingDaoWanFu.BO {
[DbColumn(DefaultValue = 0)] [DbColumn(DefaultValue = 0)]
public bool ReChecked { get; set; } public bool ReChecked { get; set; }
[DbColumn(DefaultValue = 0)]
public int ReCheckCount { get; set; }
[ReferenceTo(typeof(Customer), "Name")] [ReferenceTo(typeof(Customer), "Name")]
[Join("AccountCustomer_ID", "ID")] [Join("AccountCustomer_ID", "ID")]
[LogicName("结账客户")] [LogicName("结账客户")]


+ 1
- 0
B3QingDaoWanFu/Tasks/CreatGatheringTask.cs View File

@ -19,6 +19,7 @@ namespace BWP.B3QingDaoWanFu.Tasks {
var query = new DQueryDom(new JoinAlias(typeof(TrustPay))); var query = new DQueryDom(new JoinAlias(typeof(TrustPay)));
query.Where.Conditions.Add(DQCondition.EQ("PayState", .)); query.Where.Conditions.Add(DQCondition.EQ("PayState", .));
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID"))); query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID")));
query.Where.Conditions.Add(DQCondition.GreaterThan("CreateTime", BLContext.Now.AddDays(-1)));
query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("ID"));
var list = query.EExecuteList<long>(); var list = query.EExecuteList<long>();


+ 10
- 5
B3QingDaoWanFu/Tasks/RecheckTrustPayTask.cs View File

@ -22,8 +22,11 @@ namespace BWP.B3QingDaoWanFu.Tasks {
var query = new DQueryDom(new JoinAlias(typeof(TrustPay))); var query = new DQueryDom(new JoinAlias(typeof(TrustPay)));
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("PayState", .)); query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("PayState", .));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("ReCheckTime", BLContext.Now)); query.Where.Conditions.Add(DQCondition.LessThanOrEqual("ReCheckTime", BLContext.Now));
query.Where.Conditions.Add(DQCondition.GreaterThan("CreateTime", BLContext.Now.AddHours(-5)));
query.Where.Conditions.Add(DQCondition.EQ("ReChecked", false)); query.Where.Conditions.Add(DQCondition.EQ("ReChecked", false));
query.Where.Conditions.Add(DQCondition.LessThan("ReCheckCount", 6));
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID"))); query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID")));
query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("ID"));
var list = query.EExecuteList<long>(); var list = query.EExecuteList<long>();
foreach (var id in list) { foreach (var id in list) {
@ -60,10 +63,11 @@ namespace BWP.B3QingDaoWanFu.Tasks {
if (trustPay == null || trustPay.AccountCustomer_ID == null) if (trustPay == null || trustPay.AccountCustomer_ID == null)
return; return;
trustPay.ID = _trustPayID; trustPay.ID = _trustPayID;
trustPay.ReCheckCount++;
if (trustPay.Gathering_ID > 0) { if (trustPay.Gathering_ID > 0) {
if (!trustPay.ReChecked) { if (!trustPay.ReChecked) {
trustPay.ReChecked = true; trustPay.ReChecked = true;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked", "ReCheckCount");
session.Commit(); session.Commit();
} }
return; return;
@ -85,7 +89,7 @@ namespace BWP.B3QingDaoWanFu.Tasks {
var config = new WanFuOnlineConfig(); var config = new WanFuOnlineConfig();
using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) { using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) {
bl.CreateGathering(trustPay, out gatheringID); bl.CreateGathering(trustPay, out gatheringID);
}
}
if (gatheringID > 0) { if (gatheringID > 0) {
trustPay.Gathering_ID = gatheringID; trustPay.Gathering_ID = gatheringID;
} }
@ -98,7 +102,8 @@ namespace BWP.B3QingDaoWanFu.Tasks {
using (var session = Dmo.NewSession()) { using (var session = Dmo.NewSession()) {
trustPay.ReChecked = trustPay.Gathering_ID > 0; trustPay.ReChecked = trustPay.Gathering_ID > 0;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID", "PayState", "ReChecked", "ReCheckCount");
session.Commit(); session.Commit();
} }
if (!string.IsNullOrEmpty(msg)) if (!string.IsNullOrEmpty(msg))
@ -118,12 +123,12 @@ namespace BWP.B3QingDaoWanFu.Tasks {
if (res.Status == "01" || res.Status == "02" || res.Status == "03") { if (res.Status == "01" || res.Status == "02" || res.Status == "03") {
trustPay.ReCheckTime = BLContext.Now.AddMinutes(5); trustPay.ReCheckTime = BLContext.Now.AddMinutes(5);
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReCheckTime");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReCheckTime", "ReCheckCount");
session.Commit(); session.Commit();
return false; return false;
} }
trustPay.ReChecked = true; trustPay.ReChecked = true;
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked");
InnerBLUtil.UpdateEntityProperties(session, trustPay, "ReChecked", "ReCheckCount");
session.Commit(); session.Commit();
return false; return false;
} }


Loading…
Cancel
Save