Commit aaf5fc90 authored by 吴春's avatar 吴春

提交diam

parent b39851ca
......@@ -279,9 +279,9 @@ where {where} order by di.CreateDate desc";
{
where += $@" and di.{nameof(RB_Distributor_Info.UserId)} in({dmodel.UserIds})";
}
if (dmodel.GradeId >= 0)
if (dmodel.FXGradeId >= 0)
{
where += $@" and di.{nameof(RB_Distributor_Info.GradeId)}={dmodel.GradeId}";
where += $@" and di.{nameof(RB_Distributor_Info.FXGradeId)}={dmodel.FXGradeId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
......@@ -289,7 +289,7 @@ where {where} order by di.CreateDate desc";
}
if (dmodel.IsSelectOverTime > 0)
{
where += $@" and DATE_FORMAT( di.{nameof(RB_Distributor_Info.VipExpiryDate)},'%y-%m-%d')=DATE_FORMAT( {DateTime.Now.AddDays(-1)},'%y-%m-%d')";
where += $@" and DATE_FORMAT( di.{nameof(RB_Distributor_Info.VipExpiryDate)},'%y-%m-%d')<=DATE_FORMAT( '{DateTime.Now.AddDays(-1)}','%y-%m-%d')";
}
string sql = $@"select di.* from RB_Distributor_Info di where {where} order by di.CreateDate desc";
return Get<RB_Distributor_Info_Extend>(sql).ToList();
......
......@@ -1557,46 +1557,53 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
try
{
var fxGradeList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend { IsGuest = 3 });
foreach (var itemFXGradeList in fxGradeList)
var baseList = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend());
foreach (var itemBase in baseList)
{
var financeConfigurineList = distributor_InfoRepository.GetOverTimeVipList(new RB_Distributor_Info_Extend { IsSelectOverTime = 1, AuditStatus = DistributorAuditStatusEnum.Audited ,GradeId= itemFXGradeList.Id});
var mallList = financeConfigurineList.GroupBy(x => new { x.TenantId, x.MallBaseId });
foreach (var item in mallList)
if ((itemBase?.IsEnableFXGrade ?? 2) == 1)//判断是否开启粉象等级
{
var fxGradeModel = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend { TenantId = item.Key.TenantId, MallBaseId = item.Key.MallBaseId, IsGuest = 1 }).FirstOrDefault();
var list = financeConfigurineList.Where(x => x.MallBaseId == item.Key.MallBaseId & x.TenantId == item.Key.TenantId & x.FXGradeId != fxGradeModel.Id);
if (list != null && list.Any())
var fxGradeList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend { TenantId = itemBase.TenantId, MallBaseId = itemBase.MallBaseId });//获取小程序中的粉象等级
if (fxGradeList != null && fxGradeList.Any())
{
foreach (var itemDistributor in list)
var fxGradeVipModel = fxGradeList.Where(x => x.IsGuest == 3).FirstOrDefault();//vip等级
var fxGradeModel = fxGradeList.Where(x => x.IsGuest == 1).FirstOrDefault();//普通会员等级
if (fxGradeVipModel != null && fxGradeModel != null)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
keyValues.Add(nameof(RB_Distributor_Info.FXGradeId), fxGradeModel.Id);
keyValues.Add(nameof(RB_Goods_Order_Extend.CancelTime), DateTime.Now);
var financeConfigurineList = distributor_InfoRepository.GetOverTimeVipList(new RB_Distributor_Info_Extend { TenantId = itemBase.TenantId, MallBaseId = itemBase.MallBaseId, IsSelectOverTime = 1, AuditStatus = DistributorAuditStatusEnum.Audited, FXGradeId = fxGradeVipModel.Id });//获取过期的粉象vip
if (financeConfigurineList!=null&&financeConfigurineList.Any())
{
foreach (var item in financeConfigurineList)
{
//var list = financeConfigurineList.Where(x => x.MallBaseId == itemBase.MallBaseId & x.TenantId == itemBase.TenantId & x.FXGradeId == fxGradeVipModel.Id);
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
keyValues.Add(nameof(RB_Distributor_Info.FXGradeId), fxGradeModel.Id);
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper(){
FiledName=nameof(RB_Distributor_Info.Id),
FiledValue=item.Id,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Distributor_Info.TenantId),
FiledValue=item.TenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Distributor_Info.MallBaseId),
FiledValue=item.MallBaseId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = distributor_InfoRepository.Update(keyValues, wheres);
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_Order_Extend.OrderId),
FiledValue=itemDistributor.Id,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_Order_Extend.TenantId),
FiledValue=itemDistributor.TenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_Order_Extend.MallBaseId),
FiledValue=itemDistributor.MallBaseId,
OperatorEnum=OperatorEnum.Equal
}
}
};
flag = goods_OrderRepository.Update(keyValues, wheres);
}
}
}
}
}
catch (Exception ex)
{
......
......@@ -12,9 +12,9 @@ namespace Mall.WindowsService
partial class WindowsService : ServiceBase
{
System.Timers.Timer timer1; //计时器
//private System.Timers.Timer timer2; //订单取消计时器
//private System.Timers.Timer timer3; //订单自动收货计时器
//private System.Timers.Timer timer4; //七天自动取消下线计时器
private System.Timers.Timer timer2; //订单取消计时器
private System.Timers.Timer timer3; //订单自动收货计时器
private System.Timers.Timer timer4; //七天自动取消下线计时器
public WindowsService()
{
......@@ -31,40 +31,40 @@ namespace Mall.WindowsService
timer1.Elapsed += new System.Timers.ElapsedEventHandler(helper.RevenueFinance);
timer1.Enabled = true;
//#region 订单取消定时器
#region 订单取消定时器
//timer2 = new System.Timers.Timer
//{
// Interval = 1000 * (60 * 10) //10分钟处理一次
//};
//timer2.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoCancelOrder);
//timer2.Enabled = true;
timer2 = new System.Timers.Timer
{
Interval = 1000 * (60 * 10) //10分钟处理一次
};
timer2.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoCancelOrder);
timer2.Enabled = true;
//#endregion
#endregion
//#region 订单自动完成定时器
#region 订单自动完成定时器
//timer3 = new System.Timers.Timer();
//timer3 = new System.Timers.Timer
//{
// Interval = 1000 * (60 * 60) //60分钟调用一次
//};
//timer3.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReceivingOrder);
//timer3.Enabled = true;
timer3 = new System.Timers.Timer();
timer3 = new System.Timers.Timer
{
Interval = 1000 * (60 * 60) //60分钟调用一次
};
timer3.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReceivingOrder);
timer3.Enabled = true;
//#endregion
#endregion
//#region 七天自动取消下线
#region 七天自动取消下线
//timer4 = new System.Timers.Timer();
//timer4 = new System.Timers.Timer
//{
// Interval = 1000 * (60 * 60) //60分钟调用一次
//};
//timer4.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReleaseTheOffline);
//timer4.Enabled = true;
timer4 = new System.Timers.Timer();
timer4 = new System.Timers.Timer
{
Interval = 1000 * (60 * 60) //60分钟调用一次
};
timer4.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReleaseTheOffline);
timer4.Enabled = true;
//#endregion
#endregion
}
protected override void OnStop()
......@@ -72,9 +72,9 @@ namespace Mall.WindowsService
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
Helper.LogHelper.Write("主服务停止运行......");
this.timer1.Enabled = false;
//this.timer2.Enabled = false;
//this.timer3.Enabled = false;
//this.timer4.Enabled = false;
this.timer2.Enabled = false;
this.timer3.Enabled = false;
this.timer4.Enabled = false;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment