| @ -0,0 +1,71 @@ | |||
| using System; | |||
| using BWP.B3Frameworks; | |||
| using BWP.B3Frameworks.Utils; | |||
| using BWP.B3QingDaoWanFu.BL; | |||
| using BWP.B3QingDaoWanFu.BO; | |||
| using BWP.B3QingDaoWanFu.BO.NamedValueTemplate; | |||
| using BWP.B3QingDaoWanFu.Utils; | |||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using TSingSoft.WebPluginFramework; | |||
| using TSingSoft.WebPluginFramework.QueueTasks; | |||
| using TSingSoft.WebPluginFramework.TimerTasks; | |||
| namespace BWP.B3QingDaoWanFu.Tasks { | |||
| [Serializable] | |||
| public class QueryNoGatheringTrustPayTask : ITimerTask { | |||
| public void Execute() { | |||
| var query = new DQueryDom(new JoinAlias(typeof(TrustPay))); | |||
| query.Where.Conditions.Add(DQCondition.EQ("PayState", 마운榴檄.마운냥묘)); | |||
| query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("Gathering_ID"))); | |||
| query.Columns.Add(DQSelectColumn.Field("ID")); | |||
| var list = query.EExecuteList<long>(); | |||
| foreach (var id in list) { | |||
| QueueTaskService.Add(new CreatGatheringTask(id)); | |||
| } | |||
| } | |||
| public string Name { | |||
| get { return "꿴璂灌눼쉔澗운데돨크契마운"; } | |||
| } | |||
| } | |||
| [Serializable] | |||
| public class CreatGatheringTask : ITimerTask { | |||
| private readonly long _trustPayID; | |||
| public CreatGatheringTask() { | |||
| } | |||
| public CreatGatheringTask(long id) { | |||
| _trustPayID = id; | |||
| } | |||
| public void Execute() { | |||
| using (var session = Dmo.NewSession()) { | |||
| var config = new WanFuOnlineConfig(); | |||
| var bl = BIFactory.Create<ITrustPayBL>(session); | |||
| long gatheringID; | |||
| var trustPay = InnerBLUtil.GetSingleDmo<TrustPay>(session, "ID", _trustPayID, "AccountCustomer_ID", "PayState", "Gathering_ID", "Money", "Domain_ID"); | |||
| using (new SpecialDomainUserBLScope(config.DomainUserForTrustPay.Value)) { | |||
| bl.CreateGathering(trustPay, out gatheringID); | |||
| } | |||
| trustPay.Gathering_ID = gatheringID; | |||
| InnerBLUtil.UpdateEntityProperties(session, trustPay, "Gathering_ID"); | |||
| session.Commit(); | |||
| } | |||
| } | |||
| public string Name { | |||
| get { | |||
| return string.Format(string.Format("마운데No.{0}껸쩌澗운데", _trustPayID)); | |||
| } | |||
| } | |||
| } | |||
| } | |||