Commit 081484fd authored by 黄奎's avatar 黄奎

页面修改

parent b08068ed
......@@ -64,6 +64,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public int Q_NotCollect { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public string Q_EffectTime { get; set; }
/// <summary>
/// 销售备注
/// </summary>
......
......@@ -253,7 +253,37 @@ namespace Edu.Module.Course
public virtual bool DealOrderEffectStatusModule()
{
bool flag = false;
// orderRepository.GetList
var orderList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel()
{
OrderState = Common.Enum.Course.OrderStateEnum.Normal,
IsChaBan = 1,
Q_EffectTime = Common.ConvertHelper.FormatDate(DateTime.Now)
});
if (orderList != null && orderList.Count > 0)
{
var tempOrderList = orderList.Where(qitem => qitem.EffectStatus == 0)?.ToList();
if (tempOrderList != null && tempOrderList.Count > 0)
{
foreach (var item in tempOrderList)
{
Dictionary<string, object> fileds1 = new Dictionary<string, object>()
{
{ nameof(RB_Order_ViewModel.EffectStatus),1 }
};
//更新当前订单为“生效中”
flag = orderRepository.Update(fileds1, new WhereHelper(nameof(RB_Order_ViewModel.OrderId), item.OrderId));
if (item.UpOrderId > 0)
{
Dictionary<string, object> fileds2 = new Dictionary<string, object>()
{
{ nameof(RB_Order_ViewModel.EffectStatus),2 }
};
//更新前置订单为“完成”
flag = orderRepository.Update(fileds2, new WhereHelper(nameof(RB_Order_ViewModel.OrderId), item.UpOrderId));
}
}
}
}
return flag;
}
}
......
......@@ -22,7 +22,7 @@ namespace Edu.Repository.Course
/// <returns></returns>
public List<RB_Order_ViewModel> GetOrderListRepository(RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -90,7 +90,14 @@ namespace Edu.Repository.Course
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if (demodel.IsChaBan ==1 )
{
where += $@" and o.{nameof(RB_Order_ViewModel.IsChaBan)} ={demodel.IsChaBan}";
}
if (!string.IsNullOrEmpty(demodel.Q_EffectTime))
{
where += string.Format(" and DATE_FORMAT(o.EffectTime,'%y/%m/%d')=DATE_FORMAT('{0}','%y/%m/%d') ", demodel.Q_EffectTime);
}
string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1)
{
......
......@@ -46,7 +46,7 @@ namespace Edu.WebApi.Timers
timer3 = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1) //1小时执行一次
Interval = (1000 * 60) * (1 * 60 * 6) //6小时执行一次
};
timer3.Elapsed += new System.Timers.ElapsedEventHandler(DealOrderEffectStatus);
timer3.Enabled = true;
......
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