Browse Source

错误提交单No.46108 【客户档案】中现在有很多一直没发货的客户,但是没有自动停用

master
wugang 7 years ago
parent
commit
ae94b7154c
2 changed files with 20 additions and 1 deletions
  1. +19
    -0
      BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs
  2. +1
    -1
      BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs

+ 19
- 0
BWP.B3_YunKen/DataPatchs/UpdateCustomerStartedTime.cs View File

@ -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);
}
}
}

+ 1
- 1
BWP.B3_YunKen/TimerTask/NullifyCustomerTask.cs View File

@ -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<long, DateTime?>();


Loading…
Cancel
Save