Commit b08068ed authored by 黄奎's avatar 黄奎

页面修改

parent 6d6214ff
......@@ -202,7 +202,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
classOrderList = orderRepository.GetClassOrderPeopleNum(ids);
classOrderList = orderRepository.GetClassOrderPeopleNumRepository(ids);
otherCourseList = GetClassCourseListModule(new RB_Class_Course_Extend() { QClassIds = ids });
}
if (isGetStepPrice)
......@@ -748,7 +748,7 @@ namespace Edu.Module.Course
public bool RemoveClassModule(int ClassId, int Status, out string message)
{
message = "";
var orderList = orderRepository.GetPageList(1, 1, out _, new RB_Order_ViewModel()
var orderList = orderRepository.GetOrderPageRepository(1, 1, out _, new RB_Order_ViewModel()
{
ClassId = ClassId,
Q_OrderState = 1
......@@ -2109,7 +2109,7 @@ namespace Edu.Module.Course
{
message = "";
var classCourse = class_CourseRepository.GetEntity(Id);
var orderList = orderRepository.GetList(new RB_Order_ViewModel()
var orderList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel()
{
ClassId = classCourse.ClassId,
CourseId = classCourse.CourseId,
......
......@@ -408,7 +408,7 @@ namespace Edu.Module.Course
if (demodel.OrderId > 0)
{
int BNum = orderRepository.GetClassOrderPeopleNum(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
int BNum = orderRepository.GetClassOrderPeopleNumRepository(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
if (BNum + demodel.GuestNum - orderModel.GuestNum > classModel.ClassPersion)
{
flag = false;
......@@ -418,7 +418,7 @@ namespace Edu.Module.Course
}
else
{
int BNum = orderRepository.GetClassOrderPeopleNum(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
int BNum = orderRepository.GetClassOrderPeopleNumRepository(demodel.ClassId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
if (BNum + demodel.GuestNum > classModel.ClassPersion)
{
flag = false;
......@@ -1003,7 +1003,7 @@ namespace Edu.Module.Course
}
}
//获取订单列表
orderList = orderRepository.GetList(new RB_Order_ViewModel() { Group_Id = groupId, ClassId = classId, SourceId = SourceId });
orderList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel() { Group_Id = groupId, ClassId = classId, SourceId = SourceId });
if (orderList.Any())
{
string orderIds = string.Join(",", orderList.Select(x => x.OrderId));
......@@ -1050,7 +1050,7 @@ namespace Edu.Module.Course
public List<RB_Order_ViewModel> GetClassOrderListExtModule(RB_Order_ViewModel query)
{
//获取订单列表
var orderList = orderRepository.GetList(query);
var orderList = orderRepository.GetOrderListRepository(query);
var guestList = new List<RB_Order_Guest_ViewModel>();
if (orderList != null && orderList.Count > 0)
{
......@@ -1367,7 +1367,7 @@ namespace Edu.Module.Course
var classModel = classRepository.GetEntity(classId);
if (classModel == null) { return "班级不存在"; }
//获取该班级下订单人数
int BNum = orderRepository.GetClassOrderPeopleNum(classId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
int BNum = orderRepository.GetClassOrderPeopleNumRepository(classId.ToString()).FirstOrDefault()?.GuestNum ?? 0;
if (BNum + orderModel.GuestNum > classModel.ClassPersion)
{
return "转入班级剩余招收人数不足,请核实后再试";
......@@ -1470,7 +1470,7 @@ namespace Edu.Module.Course
public List<RB_Order_ViewModel> GetClassOrderList_V2(int classId, int groupId, int SourceId)
{
//获取订单列表
var orderList = orderRepository.GetList(new RB_Order_ViewModel() { Group_Id = groupId, ClassId = classId, SourceId = SourceId });
var orderList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel() { Group_Id = groupId, ClassId = classId, SourceId = SourceId });
return orderList;
}
......@@ -1852,7 +1852,7 @@ namespace Edu.Module.Course
public List<RB_Order_ViewModel> GetMyOrderPageList(int pageIndex, int pageSize, out long count, RB_Order_ViewModel demodel)
{
//获取订单列表
var orderList = orderRepository.GetPageList(pageIndex, pageSize, out count, demodel);
var orderList = orderRepository.GetOrderPageRepository(pageIndex, pageSize, out count, demodel);
if (orderList.Any())
{
string orderIds = string.Join(",", orderList.Select(x => x.OrderId));
......@@ -1971,9 +1971,9 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public RB_Order_ViewModel GetMyOrderStatistics(RB_Order_ViewModel demodel)
public RB_Order_ViewModel GetMyOrderStatisticsModule(RB_Order_ViewModel demodel)
{
return orderRepository.GetMyOrderStatistics(demodel);
return orderRepository.GetMyOrderStatisticsRepository(demodel);
}
#endregion
......
......@@ -245,5 +245,16 @@ namespace Edu.Module.Course
}
return flag;
}
/// <summary>
/// 处理订单生效状态
/// </summary>
/// <returns></returns>
public virtual bool DealOrderEffectStatusModule()
{
bool flag = false;
// orderRepository.GetList
return flag;
}
}
}
......@@ -309,7 +309,7 @@ namespace Edu.Module.Finance
{
string classIds = string.Join(",", classList.Select(x => x.ClassId));
//根据班级查询所有的订单列表
orderAllList = orderRepository.GetList(new RB_Order_ViewModel() { Group_Id = GroupId, ClassIds = classIds, OrderType = Common.Enum.Sale.OrderTypeEnum.CourseOrder, Q_OrderState = 1 });
orderAllList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel() { Group_Id = GroupId, ClassIds = classIds, OrderType = Common.Enum.Sale.OrderTypeEnum.CourseOrder, Q_OrderState = 1 });
//查询班级下所有的财务单据
FAllList = RB_FinanceRepository.GetDataStatisticsListThree(new RB_Finance_Extend() { TCIDStr = classIds, OrderSource = OrderResourceEnum.Education });
teacherBonusList = teaching_BonusDetailRepository.GetList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = GroupId, ClassIds = classIds });
......@@ -424,7 +424,7 @@ namespace Edu.Module.Finance
if (saList.Any()) {
string saIds = string.Join(",", saList.Select(x => x.Id));
//根据班级查询所有的订单列表
orderAllList = orderRepository.GetList(new RB_Order_ViewModel() { Group_Id = GroupId, SourceIds = saIds, OrderType = Common.Enum.Sale.OrderTypeEnum.StudyabroadOrder, Q_OrderState = 1 });
orderAllList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel() { Group_Id = GroupId, SourceIds = saIds, OrderType = Common.Enum.Sale.OrderTypeEnum.StudyabroadOrder, Q_OrderState = 1 });
//查询班级下所有的财务单据
FAllList = RB_FinanceRepository.GetDataStatisticsListThree(new RB_Finance_Extend() { TCIDStr = saIds, OrderSource = OrderResourceEnum.EducationStudy });
}
......
......@@ -20,7 +20,7 @@ namespace Edu.Repository.Course
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetList(RB_Order_ViewModel demodel)
public List<RB_Order_ViewModel> GetOrderListRepository(RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
......@@ -121,7 +121,7 @@ ORDER BY {orderBy}
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_Order_ViewModel demodel)
public List<RB_Order_ViewModel> GetOrderPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)OrderTypeEnum.CourseOrder} ";
......@@ -239,7 +239,7 @@ where {where} order by {orderBy}
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public RB_Order_ViewModel GetMyOrderStatistics(RB_Order_ViewModel demodel)
public RB_Order_ViewModel GetMyOrderStatisticsRepository(RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)OrderTypeEnum.CourseOrder} ";
......@@ -419,7 +419,6 @@ where {where}
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)demodel.OrderType} ";
}
string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1)
{
......@@ -478,7 +477,6 @@ WHERE {where} ORDER BY {orderBy}
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
if (demodel.Group_Id > 0)
......@@ -490,7 +488,6 @@ WHERE {where} ORDER BY {orderBy}
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if (!string.IsNullOrEmpty(demodel.StartTime))
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
......@@ -499,12 +496,10 @@ WHERE {where} ORDER BY {orderBy}
{
where += $@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
}
if (demodel.Q_NotCollect == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) ";
}
string sql = $@"
SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
......@@ -524,9 +519,13 @@ WHERE {where}
/// </summary>
/// <param name="classIds"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetClassOrderPeopleNum(string classIds)
public List<RB_Order_ViewModel> GetClassOrderPeopleNumRepository(string classIds)
{
string sql = $@"SELECT ClassId, SUM(GuestNum) AS GuestNum FROM rb_order WHERE OrderState in (1,2) AND ClassId in ({classIds}) GROUP BY ClassId;";
string sql = $@"
SELECT ClassId, SUM(GuestNum) AS GuestNum
FROM rb_order
WHERE OrderState in (1,2) AND ClassId in ({classIds})
GROUP BY ClassId;";
return Get<RB_Order_ViewModel>(sql).ToList();
}
}
......
......@@ -58,16 +58,9 @@ namespace Edu.Repository.Course
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
}
if (demodel.QEffectStatus > 0)
{
if (demodel.QEffectStatus == 1)
{
where += $@" and B.{nameof(RB_Order_Guest_ViewModel.EffectStatus)} IN(1,2)";
}
if(demodel.QEffectStatus == 2)
{
where += $@" and B.{nameof(RB_Order_Guest_ViewModel.EffectStatus)} IN(0,1,2)";
}
if (demodel.QEffectStatus == 1)
{
where += $@" AND (B.IsChaBan=0 OR (B.IsChaBan=1 AND B.EffectStatus IN(1,2))) ";
}
string sql = $@"
......
......@@ -768,6 +768,16 @@ namespace Edu.WebApi.Controllers.Course
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.Mobile,
item.OrderId,
item.CourseName,
item.CourseId,
item.TotalHours,
item.CompleteHours,
item.StartClassHours,
item.IsChaBan,
item.EffectStatus,
item.EffectStatusStr,
EffectTime=Common.ConvertHelper.FormatDate(item.EffectTime),
item.UpOrderId,
IsCheck = (checkLogList != null && checkLogList.Any()) ? checkLogList.Where(x => x.OrderGuestId == item.Id).FirstOrDefault()?.CheckStatus ?? -1 : -1,
StudyNum = (checkLogList != null && checkLogList.Any()) ? checkLogList.Where(x => x.OrderGuestId == item.Id).FirstOrDefault()?.StudyNum ?? 0 : 0
});
......@@ -885,7 +895,7 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.ParamIsNull("");
}
//获取班级的学员信息
var orderGuestList = classModule.GetOrderGuestListModule(new RB_Order_Guest_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = list.FirstOrDefault().ClassId });
var orderGuestList = classModule.GetOrderGuestListModule(new RB_Order_Guest_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = list.FirstOrDefault().ClassId ,QEffectStatus=1});
if (list.Count() != orderGuestList.Where(x => x.GuestState == 1).Count())
{
return ApiResult.Failed("签到总人数错误,请先检查信息");
......
......@@ -30,10 +30,6 @@ namespace Edu.WebApi.Controllers.Course
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 课程处理类对象
/// </summary>
private readonly CourseModule courseModule = AOP.AOPHelper.CreateAOPObject<CourseModule>();
#region 教室管理
/// <summary>
......
......@@ -1118,7 +1118,7 @@ namespace Edu.WebApi.Controllers.Course
demodel.EnterID = userInfo.Id;
var orderList = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long count, demodel);
var orderS = orderModule.GetMyOrderStatistics(demodel);
var orderS = orderModule.GetMyOrderStatisticsModule(demodel);
pageModel.Count = Convert.ToInt32(count);
var obj = new
{
......@@ -1265,7 +1265,7 @@ namespace Edu.WebApi.Controllers.Course
demodel.Group_Id = userInfo.Group_Id;
var orderList = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long count, demodel);
var orderS = orderModule.GetMyOrderStatistics(demodel);
var orderS = orderModule.GetMyOrderStatisticsModule(demodel);
pageModel.Count = Convert.ToInt32(count);
var obj = new
{
......
using Edu.Common.Plugin;
using Edu.Module.Course;
using Edu.Module.Duty;
using System;
using System.IO;
......@@ -16,6 +17,11 @@ namespace Edu.WebApi.Timers
/// </summary>
private static readonly DutyPlanModule dutyPlanModule = AOP.AOPHelper.CreateAOPObject<DutyPlanModule>();
/// <summary>
/// 订单处理类对象
/// </summary>
private static readonly OrderModule orderModule = AOP.AOPHelper.CreateAOPObject<OrderModule>();
static System.Timers.Timer timer1;//计时器
static System.Timers.Timer timer2;//定期处理未值班数据
......@@ -37,12 +43,20 @@ namespace Edu.WebApi.Timers
};
timer2.Elapsed += new System.Timers.ElapsedEventHandler(DealDuty);
timer2.Enabled = true;
timer3 = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1) //1小时执行一次
};
timer3.Elapsed += new System.Timers.ElapsedEventHandler(DealOrderEffectStatus);
timer3.Enabled = true;
}
public static void RunStop()
{
timer1.Enabled = false;
timer2.Enabled = false;
timer3.Enabled = false;
}
/// <summary>
......@@ -50,6 +64,7 @@ namespace Edu.WebApi.Timers
/// </summary>
private static int inTimer = 0;
private static int inTimer2 = 0;
private static int inTimer3 = 0;
/// <summary>
/// 清理文件
......@@ -119,8 +134,12 @@ namespace Edu.WebApi.Timers
/// <param name="sender"></param>
/// <param name="e"></param>
public static void DealOrderEffectStatus(object sender, System.Timers.ElapsedEventArgs e)
{
{
if (Interlocked.Exchange(ref inTimer3, 1) == 0)
{
orderModule.DealOrderEffectStatusModule();
Interlocked.Exchange(ref inTimer3, 0);
}
}
}
}
\ No newline at end of file
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