From ae94b7154c761cb27e69f816b8a5254e4cee3e1f Mon Sep 17 00:00:00 2001 From: wugang <425674808@qq.com> Date: Mon, 23 Jul 2018 15:32:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E4=BA=A4=E5=8D=95No?= =?UTF-8?q?.46108=20=E3=80=90=E5=AE=A2=E6=88=B7=E6=A1=A3=E6=A1=88=E3=80=91?= =?UTF-8?q?=E4=B8=AD=E7=8E=B0=E5=9C=A8=E6=9C=89=E5=BE=88=E5=A4=9A=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E6=B2=A1=E5=8F=91=E8=B4=A7=E7=9A=84=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=81=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataPatchs/UpdateCustomerStartedTime.cs | 19 +++++++++++++++++++ .../TimerTask/NullifyCustomerTask.cs | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs 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();