Commit ec8f3036 authored by 黄奎's avatar 黄奎

新增处理学员状态字段

parent 489d7d9f
......@@ -258,5 +258,9 @@ namespace Edu.Model.ViewModel.Sell
}
}
/// <summary>
/// 已完成课时的学员
/// </summary>
public int QFinishGuest { get; set; }
}
}
\ No newline at end of file
......@@ -270,5 +270,31 @@ namespace Edu.Module.Course
}
return flag;
}
/// <summary>
/// 处理学员状态
/// </summary>
/// <returns></returns>
public virtual bool DealGuestStateModule()
{
bool flag = false;
var guestList = order_GuestRepository.GetCommonOrderGuestListRepository(new RB_Order_Guest_ViewModel()
{
QFinishGuest = 1
});
if (guestList != null && guestList.Count > 0)
{
foreach (var item in guestList.Take(1))
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Order_Guest_ViewModel.GuestState),(int)GuestStateEnum.Graduate},
{ nameof(RB_Order_Guest_ViewModel.GraduationTime),DateTime.Now},
};
flag = order_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), item.Id));
}
}
return flag;
}
}
}
using Edu.Model.Entity.Sell;
using Edu.Common.Enum.Course;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Sell;
using System.Collections.Generic;
......@@ -122,6 +123,11 @@ namespace Edu.Repository.Sell
{
where += $@" AND (B.JoinType=1 OR B.JoinType=3 OR B.JoinType=4 OR B.JoinType=5 OR (B.JoinType=2 AND B.EffectStatus IN(1) )) ";
}
//查询课时完成的学员
if (demodel.QFinishGuest == 1)
{
where += string.Format(" AND ( A.TotalHours<=A.ValidClassHours AND A.CompleteHours=A.ValidClassHours AND B.OrderState<>3 AND (IFNULL(A.GraduationTime,'')='' OR A.GuestState={0})) ",(int)GuestStateEnum.Graduate);
}
string sql = $@"
SELECT sog.Student_Id as StudentId,A.*,cs.ClassName,cs.ClassNo,IFNULL(B.JoinType,0) AS JoinType,IFNULL(B.TargetJoinType,0) AS TargetJoinType,IFNULL(B.StartClassHours,0) AS StartClassHours
......
......@@ -51,25 +51,27 @@ namespace Edu.WebApi.Timers
static System.Timers.Timer examTimer;//考卷定时处理
static System.Timers.Timer finishGuest;//处理学生毕业状态
public static void RunTimer()
{
timer1 = new System.Timers.Timer
{
Interval = 1000 * (60 * 60) * 3 //60分钟
Interval = (1000 * 60) * (60 * 3) //3销售
};
timer1.Elapsed += new System.Timers.ElapsedEventHandler(ClearFile);
timer1.Enabled = true;
timer2 = new System.Timers.Timer
{
Interval = (1000 * 60) * (1 * 60) //1小时执行一次
Interval = (1000 * 60) * (60 * 1) //1小时执行一次
};
timer2.Elapsed += new System.Timers.ElapsedEventHandler(DealDuty);
timer2.Enabled = true;
timer3 = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1 * 60 * 6) //6小时执行一次
Interval = (1000 * 60) * (60 * 6) //6小时执行一次
};
timer3.Elapsed += new System.Timers.ElapsedEventHandler(DealOrderEffectStatus);
timer3.Enabled = true;
......@@ -77,24 +79,31 @@ namespace Edu.WebApi.Timers
timer4 = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1 * 10 ) //1小时执行一次
Interval = (1000 * 60) * (1 * 10 ) //10分中执行一次
};
timer4.Elapsed += new System.Timers.ElapsedEventHandler(UpdateAuditThroughStudent);
timer4.Enabled = true;
changeOrder = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1 * 10) //10分钟执行一次
Interval = (1000 * 60) * (1 * 20) //20分钟执行一次
};
changeOrder.Elapsed += new System.Timers.ElapsedEventHandler(BatchDealChangeOrder);
changeOrder.Enabled = true;
examTimer = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1 * 5) //5分钟执行一次
Interval = (1000 * 60) * (1 * 30) //30分钟执行一次
};
examTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealExamPublich);
examTimer.Enabled = true;
finishGuest = new System.Timers.Timer()
{
Interval = (1000 * 60) * (60 * 23) //23小时执行一次
};
finishGuest.Elapsed += new System.Timers.ElapsedEventHandler(DealGuestFinish);
finishGuest.Enabled = true;
}
public static void RunStop()
......@@ -105,6 +114,7 @@ namespace Edu.WebApi.Timers
timer4.Enabled = false;
changeOrder.Enabled = false;
examTimer.Enabled = false;
finishGuest.Enabled = false;
}
/// <summary>
......@@ -116,6 +126,21 @@ namespace Edu.WebApi.Timers
private static int inTimer4 = 0;
private static int changeOrder_Timer = 0;
private static int examPublish_Timer = 0;
private static int guestfinish_Timer = 0;
/// <summary>
/// 处理学员毕业状态
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public static void DealGuestFinish(object sender, System.Timers.ElapsedEventArgs e)
{
if (Interlocked.Exchange(ref guestfinish_Timer, 1) == 0)
{
orderModule.DealGuestStateModule();
Interlocked.Exchange(ref guestfinish_Timer, 0);
}
}
/// <summary>
/// 处理值班数据
......@@ -209,7 +234,7 @@ namespace Edu.WebApi.Timers
}
// <summary>
/// <summary>
/// 定时处理停课申请生效日期以及学员的上课状态
/// </summary>
/// <param name="sender"></param>
......
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