diff --git a/BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs b/BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs new file mode 100644 index 0000000..d27a4a1 --- /dev/null +++ b/BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Forks.EnterpriseServices.BusinessInterfaces; +using TSingSoft.WebPluginFramework.Install; + +namespace BWP.B3_YunKen.DataPatchs +{ + [DataPatch] + public class UpdateCustomerStartedTime : IDataPatch + { + public void Execute(TransactionContext context) + { + var sql = @"update a set a.StartedTime = (case when (select Max(LoadTime) from B3Sale_CustomerAccept b where b.CustomerDealer_ID = a.ID and BillState = 20) is null then a.CreateTime else (select Max(LoadTime) from B3Sale_CustomerAccept b where b.CustomerDealer_ID = a.ID and BillState = 20) end) from B3Sale_Customer a where IsDealers = 1"; + context.Session.ExecuteSqlNonQuery(sql); + } + } +} diff --git a/BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs b/BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs index abb00a3..ba67d53 100644 --- a/BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs +++ b/BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs @@ -50,7 +50,7 @@ namespace BWP.B3_YunKen.TimerTask { var mDmoTypeID = DmoTypeIDAttribute.GetID(typeof(Customer)); var dom = new DQueryDom(new JoinAlias(typeof(Customer))); dom.Columns.Add(DQSelectColumn.Field("ID")); - dom.Columns.Add(DQSelectColumn.Field("StopedTime")); + dom.Columns.Add(DQSelectColumn.Field("StartedTime")); dom.Where.Conditions.Add(DQCondition.EQ("Stopped", false)); dom.Where.Conditions.Add(DQCondition.EQ("IsDealers", true)); var list = dom.EExecuteList();