Commit 38ccaf32 authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 81434059 ac67e3c0
...@@ -136,5 +136,11 @@ namespace Edu.Model.Entity.StudyAbroad ...@@ -136,5 +136,11 @@ namespace Edu.Model.Entity.StudyAbroad
/// 封面图 /// 封面图
/// </summary> /// </summary>
public string ImgCover { get; set; } public string ImgCover { get; set; }
/// <summary>
/// 确认时间(确认后 才能发提成 才进报表)
/// </summary>
public DateTime? ConfirmDate { get; set; }
} }
} }
...@@ -78,7 +78,7 @@ namespace Edu.Model.ViewModel.Course ...@@ -78,7 +78,7 @@ namespace Edu.Model.ViewModel.Course
/// </summary> /// </summary>
public List<RB_Class_LessonPlan_ViewModel> LessonPlanList { get; set; } public List<RB_Class_LessonPlan_ViewModel> LessonPlanList { get; set; }
public RB_Course_Chapter_ViewModel Chapter { get; set; } public List<ChapterTree_ViewModel> Chapter { get; set; }
public string CourseName { get; set; } public string CourseName { get; set; }
......
...@@ -84,5 +84,15 @@ namespace Edu.Model.ViewModel.StudyAbroad ...@@ -84,5 +84,15 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 结束时间 /// 结束时间
/// </summary> /// </summary>
public string EndTime { get; set; } public string EndTime { get; set; }
/// <summary>
/// 确认开始时间
/// </summary>
public string ConfirmSTime { get; set; }
/// <summary>
/// 确认结束时间
/// </summary>
public string ConfirmETime { get; set; }
} }
} }
...@@ -1422,10 +1422,13 @@ namespace Edu.Module.Course ...@@ -1422,10 +1422,13 @@ namespace Edu.Module.Course
var tempList = list?.Where(qitem => qitem.CheckStatus > 0)?.ToList(); var tempList = list?.Where(qitem => qitem.CheckStatus > 0)?.ToList();
foreach (var item in tempList) foreach (var item in tempList)
{
if (item.ClassId > 5)
{ {
var guestModel = order_GuestRepository.GetEntity(item.OrderGuestId); var guestModel = order_GuestRepository.GetEntity(item.OrderGuestId);
flag = CalcGuestHoursModule(guestModel, item); flag = CalcGuestHoursModule(guestModel, item);
} }
}
return flag; return flag;
} }
......
...@@ -568,9 +568,15 @@ namespace Edu.Module.Course ...@@ -568,9 +568,15 @@ namespace Edu.Module.Course
return treeList; return treeList;
} }
public RB_Course_Chapter_ViewModel GetMatchHoursChapterModule(int courseId,double currentHours) public List<ChapterTree_ViewModel> GetMatchHoursChapterModule(int courseId,double currentHours)
{ {
return chapterRepository.GetMatchHoursChapterRepository(courseId,currentHours); var list = chapterRepository.GetMatchHoursChapterRepository(courseId, currentHours);
list.ForEach(x =>
{
x.SerialNumber = int.Parse(x.ChapterNo.Replace(".", ""));
});
List<ChapterTree_ViewModel> treeList = GetChapterChild(list, 0);
return treeList;
} }
/// <summary> /// <summary>
......
...@@ -1143,6 +1143,7 @@ namespace Edu.Module.Course ...@@ -1143,6 +1143,7 @@ namespace Edu.Module.Course
ClassInfo = new ClassInfo = new
{ {
cModel.ClassName, cModel.ClassName,
cModel.ClassNo,
tModel?.TeacherName, tModel?.TeacherName,
tModel?.TeacherIcon, tModel?.TeacherIcon,
zModel?.AssistName, zModel?.AssistName,
......
...@@ -527,6 +527,7 @@ namespace Edu.Module.Course ...@@ -527,6 +527,7 @@ namespace Edu.Module.Course
{ {
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours;//使用签到表的课时 decimal KSNum = item.CurrentDeductionHours;//使用签到表的课时
if (item.ClassId == 18) { KSNum = 0; }//18班级暂不算课时
var typeModel = typeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = typeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
......
...@@ -113,6 +113,10 @@ namespace Edu.Module.Finance ...@@ -113,6 +113,10 @@ namespace Edu.Module.Finance
/// </summary> /// </summary>
private readonly RB_Teaching_PerfRepository teaching_PerfRepository = new RB_Teaching_PerfRepository(); private readonly RB_Teaching_PerfRepository teaching_PerfRepository = new RB_Teaching_PerfRepository();
/// <summary> /// <summary>
/// 销售提成明细
/// </summary>
private readonly RB_Sell_Commission_DetailsRepository sell_Commission_DetailsRepository = new RB_Sell_Commission_DetailsRepository();
/// <summary>
/// 学校仓储层对象 /// 学校仓储层对象
/// </summary> /// </summary>
private readonly RB_SchoolRepository schoolRepository = new RB_SchoolRepository(); private readonly RB_SchoolRepository schoolRepository = new RB_SchoolRepository();
...@@ -330,7 +334,7 @@ namespace Edu.Module.Finance ...@@ -330,7 +334,7 @@ namespace Edu.Module.Finance
//根据班级查询所有的订单列表 //根据班级查询所有的订单列表
orderAllList = orderRepository.GetOrderListRepository(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 }); FAllList = RB_FinanceRepository.GetDataStatisticsListThree(new RB_Finance_Extend() { RB_Group_Id = GroupId, TCIDStr = classIds, OrderSource = OrderResourceEnum.Education });
teacherBonusList = teaching_BonusDetailRepository.GetList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = GroupId, ClassIds = classIds }); teacherBonusList = teaching_BonusDetailRepository.GetList(new RB_Teaching_BonusDetail_ViewModel { Group_Id = GroupId, ClassIds = classIds });
meritsProfitList = teaching_PerfRepository.GetList(new RB_Teaching_Perf_ViewModel { Group_Id = GroupId, ClassIds = classIds }); meritsProfitList = teaching_PerfRepository.GetList(new RB_Teaching_Perf_ViewModel { Group_Id = GroupId, ClassIds = classIds });
//查询班级下已上课时数量 //查询班级下已上课时数量
...@@ -454,7 +458,7 @@ namespace Edu.Module.Finance ...@@ -454,7 +458,7 @@ namespace Edu.Module.Finance
//根据班级查询所有的订单列表 //根据班级查询所有的订单列表
orderAllList = orderRepository.GetOrderListRepository(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 }); FAllList = RB_FinanceRepository.GetDataStatisticsListThree(new RB_Finance_Extend() { RB_Group_Id = GroupId, TCIDStr = saIds, OrderSource = OrderResourceEnum.EducationStudy });
} }
//排除取消/删除项目 //排除取消/删除项目
oldlist = edu_RevenueReportRepository.GetList(new RB_Edu_RevenueReport_Extend() { StartTime = STime, EndTime = ETime, IsSelectStuAbroad = 1, Rb_Group_Id = GroupId }); oldlist = edu_RevenueReportRepository.GetList(new RB_Edu_RevenueReport_Extend() { StartTime = STime, EndTime = ETime, IsSelectStuAbroad = 1, Rb_Group_Id = GroupId });
...@@ -516,7 +520,7 @@ namespace Edu.Module.Finance ...@@ -516,7 +520,7 @@ namespace Edu.Module.Finance
demodel.QTShouRu = cfinanceList.Where(y => y.Is_Cashier == 1).Sum(x => x.Money ?? 0); demodel.QTShouRu = cfinanceList.Where(y => y.Is_Cashier == 1).Sum(x => x.Money ?? 0);
demodel.QTShouRu -= cfinanceList.Where(x => x.Is_Cashier == 1 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0); demodel.QTShouRu -= cfinanceList.Where(x => x.Is_Cashier == 1 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
//支出 //支出
demodel.TiCheng = orderList.Where(x => x.IsCommissionGive == 1).Sum(x => x.CommissionMoney);//销售提成 demodel.TiCheng = 0;//销售提成 -留学提成暂定
demodel.ClassFee = 0;//老师提成 -留学暂定 demodel.ClassFee = 0;//老师提成 -留学暂定
demodel.JiXiaoMoney = 0;//绩效提成 -留学暂定 demodel.JiXiaoMoney = 0;//绩效提成 -留学暂定
...@@ -625,7 +629,7 @@ namespace Edu.Module.Finance ...@@ -625,7 +629,7 @@ namespace Edu.Module.Finance
var FYLXList = new List<string>(FYLX.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)); var FYLXList = new List<string>(FYLX.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
var RZFYLXList = new List<string>(RZFYLX.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)); var RZFYLXList = new List<string>(RZFYLX.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
//财务单据 //财务单据
var RZFinancelist = RB_FinanceRepository.GetListForReport(new RB_Finance_Extend() { sAduitDate = DateTime.Parse(sDate), eAduitDate = DateTime.Now.AddYears(1).AddDays(-1), RB_Branch_Id = -1, RB_Group_Id = GroupId, Is_TCID = 1, TCID = -1 }); var RZFinancelist = RB_FinanceRepository.GetListForReport(new RB_Finance_Extend() { sAduitDate = DateTime.Parse(sDate), eAduitDate = DateTime.Now.AddYears(1).AddDays(-1), RB_Branch_Id = -1, RB_Group_Id = GroupId, Is_TCID = 1, TCID = -1, FinanceType = 2 });
//获取资金调拨单据 //获取资金调拨单据
var CapitalAllocationFinanceList = RB_FinanceRepository.GetTradeWayForCapitalAllocation(new RB_Finance_Extend() { sAduitDate = DateTime.Parse(sDate), eAduitDate = DateTime.Now.AddYears(1).AddDays(-1), RB_Branch_Id = -1, RB_Group_Id = GroupId, Is_TCID = 1, TCID = -1 }); var CapitalAllocationFinanceList = RB_FinanceRepository.GetTradeWayForCapitalAllocation(new RB_Finance_Extend() { sAduitDate = DateTime.Parse(sDate), eAduitDate = DateTime.Now.AddYears(1).AddDays(-1), RB_Branch_Id = -1, RB_Group_Id = GroupId, Is_TCID = 1, TCID = -1 });
//营收报表数据 //营收报表数据
...@@ -2410,10 +2414,12 @@ namespace Edu.Module.Finance ...@@ -2410,10 +2414,12 @@ namespace Edu.Module.Finance
{ {
foreach (var item in list) foreach (var item in list)
{ {
int Minutes = (int)(Convert.ToDateTime("2021-06-29 " + item.EndDate) - Convert.ToDateTime("2021-06-29 " + item.StartDate)).TotalMinutes; decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
decimal Hours = Math.Round(Convert.ToDecimal(Minutes) / 60, 2, MidpointRounding.AwayFromZero);//小时 //if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours;//使用签到表的课时 decimal KSNum = item.CurrentDeductionHours;//使用签到表的课时
if (item.ClassId == 18) { KSNum = 0; }//特殊班级处理
decimal Hours = Math.Round(KSNum * ClassHourMinute / 60, 2, MidpointRounding.AwayFromZero);//小时
var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
...@@ -2421,8 +2427,6 @@ namespace Edu.Module.Finance ...@@ -2421,8 +2427,6 @@ namespace Edu.Module.Finance
//课时费 需要每个班级 单独计算 因为 班级有附加费用 //课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal KSMoney = KSNum * unitPrice; decimal KSMoney = KSNum * unitPrice;
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费 decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费
DateList.Add(new RB_Teaching_BonusDetail_ViewModel DateList.Add(new RB_Teaching_BonusDetail_ViewModel
...@@ -2560,10 +2564,12 @@ namespace Edu.Module.Finance ...@@ -2560,10 +2564,12 @@ namespace Edu.Module.Finance
{ {
foreach (var item in list) foreach (var item in list)
{ {
int Minutes = (int)(Convert.ToDateTime("2021-06-29 " + item.EndDate) - Convert.ToDateTime("2021-06-29 " + item.StartDate)).TotalMinutes; decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
decimal Hours = Math.Round(Convert.ToDecimal(Minutes) / 60, 2, MidpointRounding.AwayFromZero);//小时 //if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours;//使用签到表课时 decimal KSNum = item.CurrentDeductionHours;//使用签到表课时
if (item.ClassId == 18) { KSNum = 0; }//特殊班级处理
decimal Hours = Math.Round(KSNum * ClassHourMinute / 60, 2, MidpointRounding.AwayFromZero);//小时
var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
...@@ -2571,8 +2577,6 @@ namespace Edu.Module.Finance ...@@ -2571,8 +2577,6 @@ namespace Edu.Module.Finance
//课时费 需要每个班级 单独计算 因为 班级有附加费用 //课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal KSMoney = KSNum * unitPrice; decimal KSMoney = KSNum * unitPrice;
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费 decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费
DateList.Add(new RB_Teaching_BonusDetail_ViewModel DateList.Add(new RB_Teaching_BonusDetail_ViewModel
...@@ -2736,10 +2740,12 @@ namespace Edu.Module.Finance ...@@ -2736,10 +2740,12 @@ namespace Edu.Module.Finance
if (configModel == null || configModel.BasicHourFee <= 0 || configModel.BasicMinutes <= 0) { return RList; } if (configModel == null || configModel.BasicHourFee <= 0 || configModel.BasicMinutes <= 0) { return RList; }
foreach (var item in list) { foreach (var item in list) {
int Minutes = (int)(Convert.ToDateTime("2021-06-29 " + item.EndDate) - Convert.ToDateTime("2021-06-29 " + item.StartDate)).TotalMinutes; decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
decimal Hours = Math.Round(Convert.ToDecimal(Minutes) / 60, 2, MidpointRounding.AwayFromZero);//小时 //if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours;//课时直接取这里的了, 这个可手动调整了; decimal KSNum = item.CurrentDeductionHours;//课时直接取这里的了, 这个可手动调整了;
if (item.ClassId == 18) { KSNum = 0; }//特殊班级处理
decimal Hours = Math.Round(KSNum * ClassHourMinute / 60, 2, MidpointRounding.AwayFromZero);//小时
var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
...@@ -2747,8 +2753,6 @@ namespace Edu.Module.Finance ...@@ -2747,8 +2753,6 @@ namespace Edu.Module.Finance
//课时费 需要每个班级 单独计算 因为 班级有附加费用 //课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal KSMoney = KSNum * unitPrice; decimal KSMoney = KSNum * unitPrice;
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//每小时课时费 decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//每小时课时费
...@@ -2853,10 +2857,12 @@ namespace Edu.Module.Finance ...@@ -2853,10 +2857,12 @@ namespace Edu.Module.Finance
decimal TKSNum = 0, TDKNum = 0, THourMoney = 0, THours = 0, TKSMoney = 0; decimal TKSNum = 0, TDKNum = 0, THourMoney = 0, THours = 0, TKSMoney = 0;
foreach (var item in list) foreach (var item in list)
{ {
int Minutes = (int)(Convert.ToDateTime("2021-06-29 " + item.EndDate) - Convert.ToDateTime("2021-06-29 " + item.StartDate)).TotalMinutes; decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
decimal Hours = Math.Round(Convert.ToDecimal(Minutes) / 60, 2, MidpointRounding.AwayFromZero);//小时 //if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
//上课课时 //上课课时
decimal KSNum = item.CurrentDeductionHours; decimal KSNum = item.CurrentDeductionHours;
if (item.ClassId == 18) { KSNum = 0; }//特殊班级处理
decimal Hours = Math.Round(KSNum * ClassHourMinute / 60, 2, MidpointRounding.AwayFromZero);//小时
var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault(); var typeModel = cTypeList.Where(x => x.CTypeId == item.ClassType).FirstOrDefault();
...@@ -2864,8 +2870,6 @@ namespace Edu.Module.Finance ...@@ -2864,8 +2870,6 @@ namespace Edu.Module.Finance
//课时费 需要每个班级 单独计算 因为 班级有附加费用 //课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal KSMoney = KSNum * unitPrice; decimal KSMoney = KSNum * unitPrice;
decimal ClassHourMinute = configModel.BasicMinutes;//课时分钟数
if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费 decimal HourMoney = Math.Round(unitPrice / ClassHourMinute * 60, 2, MidpointRounding.AwayFromZero);//没小时课时费
RList.Add(new RB_Teaching_BonusDetail_ViewModel RList.Add(new RB_Teaching_BonusDetail_ViewModel
...@@ -3266,7 +3270,7 @@ namespace Edu.Module.Finance ...@@ -3266,7 +3270,7 @@ namespace Edu.Module.Finance
} }
//初始化 基础课时 //初始化 基础课时
DateTime STime = Convert.ToDateTime(StartTime); DateTime STime = Convert.ToDateTime(Convert.ToDateTime(StartTime).ToString("yyyy-MM") + "-01");
while (true) while (true)
{ {
DateTime ETime = STime.AddMonths(1).AddDays(-1); DateTime ETime = STime.AddMonths(1).AddDays(-1);
...@@ -3423,9 +3427,153 @@ namespace Edu.Module.Finance ...@@ -3423,9 +3427,153 @@ namespace Edu.Module.Finance
/// <param name="endTime"></param> /// <param name="endTime"></param>
/// <param name="userInfo"></param> /// <param name="userInfo"></param>
/// <returns></returns> /// <returns></returns>
public object GetAllClassNowMonthStatistics(string startTime, string endTime, UserInfo userInfo) public object GetAllClassNowMonthStatistics(string startTime, string endTime, int classId, string classNo, UserInfo userInfo)
{ {
return null; List<object> RList = new List<object>();
//首先根据签到表 查询出所有的班级 并分页
var list = class_CheckRepository.GetAllClassNowMonthStatistics(startTime, endTime, classId, classNo, userInfo.Group_Id);
if (list.Any())
{
string classIds = string.Join(",", list.Select(x => x.ClassId));
//查询时间范围内 所有班级的学生上课金额
List<RB_Teaching_BonusDetail_ViewModel> StudentHoursList = new List<RB_Teaching_BonusDetail_ViewModel>();
//根据学生签到表 查询
var stulist = class_CheckRepository.GetStudentConsumptionHoursDetialList(0, -1, 0, startTime, endTime, "", 0, "", userInfo.Group_Id, classIds);
if (stulist.Any())
{
foreach (var item in stulist)
{
decimal UnitPrice = Math.Round(item.UnitPrice, 6, MidpointRounding.AwayFromZero);
StudentHoursList.Add(new RB_Teaching_BonusDetail_ViewModel
{
Date = item.ClassDate,
TimeBucket = item.StartDate + "~" + item.EndDate,
TeacherId = item.OrderGuestId,
TeacherName = item.GuestName,
ClassId = item.ClassId,
ClassName = item.ClassName,
ClassNo = item.ClassNo,
CouseId = item.CouseId,
CourseName = item.CourseName,
KSNum = item.CurrentDeductionHours,
Hours = 0,
HourMoney = 0,
UnitPrice = UnitPrice,
Money = Math.Round(item.UnitPrice * item.CurrentDeductionHours, 6, MidpointRounding.AwayFromZero)
});
}
}
//查询时间范围内 所有班级的销售提成 , 老师课时费 , 老师绩效
string STime = Convert.ToDateTime(startTime).AddMonths(-1).ToString("yyyy-MM-dd");
string ETime = Convert.ToDateTime(endTime).AddMonths(-1).ToString("yyyy-MM-dd");
var teacherBonusList = teaching_BonusDetailRepository.GetTeacherBonusForDate(userInfo.Group_Id, classIds, STime, ETime);
var meritsProfitList = teaching_PerfRepository.GetTeacherPerfForDate(userInfo.Group_Id, classIds, startTime, endTime);
var saleList = sell_Commission_DetailsRepository.GetSellCommissionForDate(userInfo.Group_Id, classIds, STime, ETime);
//查询时间范围内 除订单外 班级下其他订单 的其他收入 + 其他成本支出
var financeList = RB_FinanceRepository.GetListForReport(new RB_Finance_Extend() { RB_Group_Id = userInfo.Group_Id, TCIDStr = classIds, sAduitDate = Convert.ToDateTime(startTime), eAduitDate = Convert.ToDateTime(endTime), FinanceType = 2, OrderSource = OrderResourceEnum.Education });
foreach (var item in list) {
#region 学生课耗
var slist = StudentHoursList.Where(x => x.ClassId == item.ClassId).ToList();
decimal TStuMoney = slist.Sum(x => x.Money);//上课总金额
int TStuNum = slist.Select(x => x.TeacherId).Distinct().Count();//上课学生数量
var StuList = slist.GroupBy(x => new { x.TeacherId, x.TeacherName }).Select(g => new
{
g.Key.TeacherId,
g.Key.TeacherName,
KSNum = g.Sum(t => t.KSNum),
Money = g.Sum(t => t.Money)
});
#endregion
#region 提成
decimal BonusMoney = teacherBonusList.Where(x => x.ClassId == item.ClassId).FirstOrDefault()?.Money ?? 0;//老师课时费
decimal PerfMoney = meritsProfitList.Where(x => x.ClassId == item.ClassId).FirstOrDefault()?.Money ?? 0;//老师绩效
decimal SellMoney = saleList.Where(x => x.ClassId == item.ClassId).FirstOrDefault()?.CurrentPeriodMoney ?? 0;//销售提成
#endregion
#region 单据
decimal OtherIncome = financeList.Where(y => y.Type == WFTempLateClassEnum.IN && y.Is_Cashier == 1 && y.OrderID <= 0).Sum(x => x.Money ?? 0);
decimal Fee = financeList.Where(x => x.Type == WFTempLateClassEnum.IN && x.Is_Cashier == 1 && x.OrderID <= 0 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
OtherIncome -= Fee;
decimal OtherCost = financeList.Where(y => y.Type == WFTempLateClassEnum.OUT && y.OrderID <= 0).Sum(x => x.Money ?? 0);//支出也要排除订单订单退款
#endregion
object RModel = new
{
item.ClassId,
item.ClassNo,
item.ClassName,
ClassType = 1,
THoursNum = item.CurrentDeductionHours,
TStuNum,
TStuMoney,
StuList,
BonusMoney,
PerfMoney,
SellMoney,
OtherIncome,
OtherCost
};
RList.Add(RModel);
}
}
//查询留学的
var saList = studyAbroadRepository.GetStudyAbroadListExtRepository(new Model.ViewModel.StudyAbroad.RB_StudyAbroad_ViewModel() { Group_Id = userInfo.Group_Id, SaleState = Common.Enum.Sale.SaleStateEnum.Sell, ConfirmSTime = startTime, ConfirmETime = endTime });
List<RB_Order_ViewModel> orderAllList = new List<RB_Order_ViewModel>();
List<RB_Finance_Extend> FAllList = new List<RB_Finance_Extend>();
if (saList.Any())
{
string saIds = string.Join(",", saList.Select(x => x.Id));
//根据班级查询所有的订单列表
orderAllList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel() { Group_Id = userInfo.Group_Id, SourceIds = saIds, OrderType = Common.Enum.Sale.OrderTypeEnum.StudyabroadOrder, Q_OrderState = 1 });
//查询班级下所有的财务单据
FAllList = RB_FinanceRepository.GetDataStatisticsListThree(new RB_Finance_Extend() { RB_Group_Id = userInfo.Group_Id, TCIDStr = saIds, OrderSource = OrderResourceEnum.EducationStudy });
}
foreach (var item in saList) {
#region 订单
var orderList = orderAllList.Where(x => x.SourceId == item.Id).ToList();
decimal ShiShou = orderList.Sum(x => x.Income - x.Refund + x.PlatformTax);
int GuestNum = orderList.Sum(x => x.GuestNum);
#endregion
#region 财务单据
var financeList = FAllList.Where(x => x.TCID == item.Id).ToList();
//排序订单单据
var cfinanceList = financeList.Where(x => x.OrderID == 0 && x.Type == WFTempLateClassEnum.IN).ToList();
decimal QTShouRu = cfinanceList.Where(y => y.Is_Cashier == 1).Sum(x => x.Money ?? 0);
QTShouRu -= cfinanceList.Where(x => x.Is_Cashier == 1 && x.Fee > 0).GroupBy(x => new { x.FrID, x.Fee }).Sum(x => x.Key.Fee ?? 0);
//支出
decimal TiCheng = 0;//销售提成 -留学提成暂定
decimal ClassFee = 0;//老师提成 -留学暂定
decimal JiXiaoMoney = 0;//绩效提成 -留学暂定
var ofinanceList = financeList.Where(x => x.Type == WFTempLateClassEnum.OUT).ToList();// 支出包括退款
decimal QTZhiChu = ofinanceList.Sum(x => x.Money ?? 0);
#endregion
object RModel = new
{
ClassId = item.Id,
ClassNo = "",
ClassName = item.Name,
ClassType = 2,
THoursNum = 0,
TStuNum = GuestNum,
TStuMoney = ShiShou,
StuList=new List<object>(),
BonusMoney = ClassFee,
PerfMoney = JiXiaoMoney,
SellMoney = TiCheng,
OtherIncome = QTShouRu,
OtherCost = QTZhiChu
};
RList.Add(RModel);
}
return RList;
} }
#endregion #endregion
......
...@@ -4784,6 +4784,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value:yyyy-MM-dd}' and {ruleModel.Time ...@@ -4784,6 +4784,8 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value:yyyy-MM-dd}' and {ruleModel.Time
/// <param name="userInfo"></param> /// <param name="userInfo"></param>
/// <returns></returns> /// <returns></returns>
public object GetOKRMyEmployeeList(UserInfo userInfo) public object GetOKRMyEmployeeList(UserInfo userInfo)
{
try
{ {
var deptModel = departmentRepository.GetEntity(userInfo.DeptId); var deptModel = departmentRepository.GetEntity(userInfo.DeptId);
List<int> UserIdList = new List<int>(); List<int> UserIdList = new List<int>();
...@@ -5069,6 +5071,12 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value:yyyy-MM-dd}' and {ruleModel.Time ...@@ -5069,6 +5071,12 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value:yyyy-MM-dd}' and {ruleModel.Time
}) })
}; };
} }
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetOKRMyEmployeeList:userInfo" + Common.Plugin.JsonHelper.Serialize(userInfo));
}
return new object();
}
/// <summary> /// <summary>
/// 根据部门获取部门下所有人员 /// 根据部门获取部门下所有人员
......
...@@ -538,7 +538,7 @@ ORDER BY tt.ClassDate ASC ...@@ -538,7 +538,7 @@ ORDER BY tt.ClassDate ASC
/// <param name="contractNo"></param> /// <param name="contractNo"></param>
/// <param name="groupId"></param> /// <param name="groupId"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId) public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds="")
{ {
string where = $@" "; string where = $@" ";
if (teacherId > 0) if (teacherId > 0)
...@@ -553,6 +553,10 @@ ORDER BY tt.ClassDate ASC ...@@ -553,6 +553,10 @@ ORDER BY tt.ClassDate ASC
{ {
where += $@" and p.ClassId ={classId}"; where += $@" and p.ClassId ={classId}";
} }
if (!string.IsNullOrEmpty(classIds) && classIds != "0")
{
where += $@" and p.ClassId in({classIds})";
}
if (!string.IsNullOrEmpty(studentName)) if (!string.IsNullOrEmpty(studentName))
{ {
where += $@" and t2.GuestName like '%{studentName}%'"; where += $@" and t2.GuestName like '%{studentName}%'";
...@@ -647,5 +651,40 @@ GROUP BY tt.ClassId,tt.OrderGuestId ...@@ -647,5 +651,40 @@ GROUP BY tt.ClassId,tt.OrderGuestId
} }
#endregion #endregion
#region 简易报表
/// <summary>
/// 获取时间范围内的班级
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="classId"></param>
/// <param name="classNo"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetAllClassNowMonthStatistics(string startTime, string endTime, int classId, string classNo, int group_Id)
{
string where = "";
if (classId > 0) {
where += " and cc.ClassId =" + classId;
}
if (!string.IsNullOrEmpty(classNo)) {
where += " and c.ClassNo ='" + classNo + "'";
}
string sql = $@"
SELECT q.ClassId,q.ClassNo,q.ClassName,SUM(q.CurrentDeductionHours) AS CurrentDeductionHours FROM(
SELECT cc.ClassId,cc.ClassDate,cc.ClassTimeId,MAX(cc.CurrentDeductionHours) as CurrentDeductionHours,
c.ClassName,c.ClassNo
FROM rb_class_check cc
LEFT JOIN rb_class c on cc.ClassId = c.ClassId
WHERE cc.`Status` =0 and cc.Group_Id ={group_Id} and cc.ClassDate >='{startTime}' and cc.ClassDate <='{endTime} 23:59:59' {where} GROUP BY cc.ClassId,cc.ClassDate,cc.ClassTimeId)q GROUP BY q.ClassId";
return Get<RB_Class_Check_ViewModel>(sql).ToList();
}
#endregion
} }
} }
...@@ -574,14 +574,15 @@ GROUP BY A.ClassPlanId,A.ClassId ,A.ClassDate,A.ClassRoomId,A.CompleteProgress ...@@ -574,14 +574,15 @@ GROUP BY A.ClassPlanId,A.ClassId ,A.ClassDate,A.ClassRoomId,A.CompleteProgress
/// <returns></returns> /// <returns></returns>
public double GetCurrentPlanStudyHoursRepository(int planId) public double GetCurrentPlanStudyHoursRepository(int planId)
{ {
string sql = @"select // string sql = @"select
(select SUM(timestampdiff(MINUTE, Concat(SUBSTRING_INDEX(d.ClassDate, ' ', 1), ' ', c.StartTime), Concat(SUBSTRING_INDEX(d.ClassDate, ' ', 1), ' ', c.EndTime))) / 45 // (select SUM(timestampdiff(MINUTE, Concat(SUBSTRING_INDEX(d.ClassDate, ' ', 1), ' ', c.StartTime), Concat(SUBSTRING_INDEX(d.ClassDate, ' ', 1), ' ', c.EndTime))) / 45
from rb_class_time c left // from rb_class_time c left
join rb_class_plan d on c.ClassPlanId = d.ClassPlanId // join rb_class_plan d on c.ClassPlanId = d.ClassPlanId
where d.ClassDate < b.ClassDate and c.ClassId = b.ClassId) // where d.ClassDate < b.ClassDate and c.ClassId = b.ClassId)
from rb_class_plan b where b.ClassPlanId = " + planId + " and b.`Status`= 0"; //from rb_class_plan b where b.ClassPlanId = " + planId + " and b.`Status`= 0";
string sql = "select (select Count(0) from rb_class_plan b where b.ClassId=a.ClassId and b.ClassDate<a.ClassDate) from rb_class_plan a where ClassPlanId="+planId+" and `Status`=0";
object obj = ExecuteScalar(sql); object obj = ExecuteScalar(sql);
return Convert.IsDBNull(obj) ? -1 : Convert.ToDouble(obj); return Convert.IsDBNull(obj) ? -1 : Convert.ToDouble(obj);
} }
......
...@@ -117,7 +117,7 @@ namespace Edu.Repository.Course ...@@ -117,7 +117,7 @@ namespace Edu.Repository.Course
/// <param name="courseId"></param> /// <param name="courseId"></param>
/// <param name="currentHours"></param> /// <param name="currentHours"></param>
/// <returns></returns> /// <returns></returns>
public RB_Course_Chapter_ViewModel GetMatchHoursChapterRepository(int courseId, double currentHours) public List<RB_Course_Chapter_ViewModel> GetMatchHoursChapterRepository(int courseId, double currentHours)
{ {
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
...@@ -128,9 +128,9 @@ namespace Edu.Repository.Course ...@@ -128,9 +128,9 @@ namespace Edu.Repository.Course
"); ");
builder.AppendFormat(" AND {0}={1}", nameof(RB_Course_Chapter_ViewModel.Status), EnumHelper.ToInt(DateStateEnum.Normal)); builder.AppendFormat(" AND {0}={1}", nameof(RB_Course_Chapter_ViewModel.Status), EnumHelper.ToInt(DateStateEnum.Normal));
builder.AppendFormat(" AND {0}={1}", nameof(RB_Course_Chapter_ViewModel.CourseId), courseId); builder.AppendFormat(" AND {0}={1}", nameof(RB_Course_Chapter_ViewModel.CourseId), courseId);
builder.AppendFormat(" AND {0}<={1}", nameof(RB_Course_Chapter_ViewModel.CurrentHours), currentHours); builder.AppendFormat(" AND ({0}='{1}' or {2} like '{3}.%')", nameof(RB_Course_Chapter_ViewModel.ChapterNo), currentHours, nameof(RB_Course_Chapter_ViewModel.ChapterNo), currentHours);
builder.AppendFormat(" ORDER BY {0} Desc",nameof(RB_Course_Chapter_ViewModel.CurrentHours)); //builder.AppendFormat(" ORDER BY {0} Desc",nameof(RB_Course_Chapter_ViewModel.CurrentHours));
return Get<RB_Course_Chapter_ViewModel>(builder.ToString(), parameters).ToList().FirstOrDefault(); return Get<RB_Course_Chapter_ViewModel>(builder.ToString(), parameters).ToList();
} }
} }
} }
...@@ -249,5 +249,22 @@ FROM ...@@ -249,5 +249,22 @@ FROM
LEFT JOIN rb_sell_commission_periods AS p ON r.PeriodId = p.Id where {where} "; LEFT JOIN rb_sell_commission_periods AS p ON r.PeriodId = p.Id where {where} ";
return Get<RB_Sell_Commission_Details_ViewModel>(sql).ToList(); return Get<RB_Sell_Commission_Details_ViewModel>(sql).ToList();
} }
/// <summary>
/// 获取日期范围 应发放的销售提成
/// </summary>
/// <param name="group_Id"></param>
/// <param name="classIds"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public List<RB_Sell_Commission_Details_ViewModel> GetSellCommissionForDate(int group_Id, string classIds, string startTime, string endTime)
{
string sql = $@"SELECT d.ClassId,SUM(d.CurrentPeriodMoney + d.CurrentExtraMoney + d.DeductionMoney + d.DeductionExtraMoney) AS CurrentPeriodMoney FROM rb_sell_commission_details d
INNER JOIN rb_sell_commission_periods p on d.PeriodId = p.Id
WHERE p.Group_Id ={group_Id} and d.ClassId in ({classIds}) and STR_TO_DATE(CONCAT(p.Periods,'-01'),'%Y-%m-%d') >='{startTime}' and STR_TO_DATE(CONCAT(p.Periods,'-01'),'%Y-%m-%d') <='{endTime} 23:59:59'
GROUP BY d.ClassId";
return Get<RB_Sell_Commission_Details_ViewModel>(sql).ToList();
}
} }
} }
...@@ -344,5 +344,22 @@ where {where}"; ...@@ -344,5 +344,22 @@ where {where}";
string sql = $@" select A.*,b.`Month` from RB_Teaching_BonusDetail as A LEFT JOIN rb_teaching_bonus as b on a.BonusId=b.Id where {where} order by a.Id desc"; string sql = $@" select A.*,b.`Month` from RB_Teaching_BonusDetail as A LEFT JOIN rb_teaching_bonus as b on a.BonusId=b.Id where {where} order by a.Id desc";
return Get<RB_Teaching_BonusDetail_ViewModel>(sql).ToList(); return Get<RB_Teaching_BonusDetail_ViewModel>(sql).ToList();
} }
/// <summary>
/// 获取时间范围老师课时费
/// </summary>
/// <param name="group_Id"></param>
/// <param name="classIds"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public List<RB_Teaching_BonusDetail_ViewModel> GetTeacherBonusForDate(int group_Id, string classIds, string startTime, string endTime)
{
string sql = $@"SELECT d.ClassId,SUM(d.Money) AS Money FROM rb_teaching_bonusdetail d
INNER JOIN rb_teaching_bonus p on d.BonusId = p.Id
WHERE p.Group_Id ={group_Id} and d.ClassId in ({classIds}) and STR_TO_DATE(CONCAT(p.`Month`,'-01'),'%Y-%m-%d') >='{startTime}' and STR_TO_DATE(CONCAT(p.`Month`,'-01'),'%Y-%m-%d') <='{endTime} 23:59:59'
GROUP BY d.ClassId";
return Get<RB_Teaching_BonusDetail_ViewModel>(sql).ToList();
}
} }
} }
...@@ -249,5 +249,21 @@ where {where}"; ...@@ -249,5 +249,21 @@ where {where}";
var obj = ExecuteScalar(sql); var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToDecimal(obj); return obj == null ? 0 : Convert.ToDecimal(obj);
} }
/// <summary>
/// 获取时间范围 班级绩效
/// </summary>
/// <param name="group_Id"></param>
/// <param name="classIds"></param>
/// <param name="sTime"></param>
/// <param name="eTime"></param>
/// <returns></returns>
public List<RB_Teaching_Perf_ViewModel> GetTeacherPerfForDate(int group_Id, string classIds, string sTime, string eTime)
{
string sql = $@"SELECT d.ClassId,SUM(d.Money) AS Money FROM rb_teaching_perf d
WHERE d.Group_Id ={group_Id} and d.ClassId in ({classIds}) and d.ConfirmDate >='{sTime}' and d.ConfirmDate <='{eTime} 23:59:59'
GROUP BY d.ClassId";
return Get<RB_Teaching_Perf_ViewModel>(sql).ToList();
}
} }
} }
...@@ -177,6 +177,10 @@ namespace Edu.Repository.Finance ...@@ -177,6 +177,10 @@ namespace Edu.Repository.Finance
{ {
where += string.Format(" AND A." + nameof(RB_Finance.RB_Branch_Id) + "={0}", model.RB_Branch_Id); where += string.Format(" AND A." + nameof(RB_Finance.RB_Branch_Id) + "={0}", model.RB_Branch_Id);
} }
if (model.RB_Group_Id > 0)
{
where += string.Format(" AND A." + nameof(RB_Finance.RB_Group_Id) + "={0}", model.RB_Group_Id);
}
if (model.OrderSource.HasValue) if (model.OrderSource.HasValue)
{ {
where += string.Format(" AND A." + nameof(RB_Finance.OrderSource) + "={0}", (int)model.OrderSource); where += string.Format(" AND A." + nameof(RB_Finance.OrderSource) + "={0}", (int)model.OrderSource);
...@@ -203,7 +207,6 @@ WHERE {1} {2} ", TableName, where, " ORDER BY A.FrID DESC"); ...@@ -203,7 +207,6 @@ WHERE {1} {2} ", TableName, where, " ORDER BY A.FrID DESC");
where.Append(" and b.Status in(1,2,5) and b.Is_Auto=0 "); where.Append(" and b.Status in(1,2,5) and b.Is_Auto=0 ");
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
//老徐喊修改的 2019-05-11 收款用交易日期 付款用制单日期 //老徐喊修改的 2019-05-11 收款用交易日期 付款用制单日期
if (model.sAduitDate.HasValue && model.eAduitDate.HasValue) if (model.sAduitDate.HasValue && model.eAduitDate.HasValue)
{ {
where.Append(" AND case when b.Type=2 then b.CreateDate>='" + model.sAduitDate.Value.ToString("yyyy-MM-dd") + "' and b.CreateDate<='" + model.eAduitDate.Value.ToString("yyyy-MM-dd") + " 23:59:59' else b.TradeDate>='" + model.sAduitDate.Value.ToString("yyyy-MM-dd") + "' and b." + nameof(RB_Finance.TradeDate) + "<='" + model.eAduitDate.Value.ToString("yyyy-MM-dd") + " 23:59:59' end"); where.Append(" AND case when b.Type=2 then b.CreateDate>='" + model.sAduitDate.Value.ToString("yyyy-MM-dd") + "' and b.CreateDate<='" + model.eAduitDate.Value.ToString("yyyy-MM-dd") + " 23:59:59' else b.TradeDate>='" + model.sAduitDate.Value.ToString("yyyy-MM-dd") + "' and b." + nameof(RB_Finance.TradeDate) + "<='" + model.eAduitDate.Value.ToString("yyyy-MM-dd") + " 23:59:59' end");
...@@ -234,16 +237,13 @@ WHERE {1} {2} ", TableName, where, " ORDER BY A.FrID DESC"); ...@@ -234,16 +237,13 @@ WHERE {1} {2} ", TableName, where, " ORDER BY A.FrID DESC");
} }
if (model.OrderSource.HasValue) if (model.OrderSource.HasValue)
{ {
where.Append(" and IFNULL(b.OrderSource,0)!=" + (int)model.OrderSource); where.Append(" and IFNULL(b.OrderSource,0) =" + (int)model.OrderSource);
} }
if (model.Is_TCID == 1) if (model.FinanceType.HasValue && model.FinanceType > 0)
{
where.Append(" and IFNULL(b.OrderSource,0) not in(" + (int)OrderResourceEnum.BulkAirTicket + "," + (int)OrderResourceEnum.DomesticTicket + "," + (int)OrderResourceEnum.TicketService + "," + (int)OrderResourceEnum.Visia + ")");
}
if (model.Is_ProfitFoHF == 1)
{ {
where.Append($@" And case when td.{nameof(RB_TradeWay.Type)}={(int)BranchAccountEnum.CashPool} then td.AccountId not in (14,15,19,20,21,22,23) else 1=1 end ");//日本 老挝地接部专户 where.Append(" AND b." + nameof(RB_Finance.FinanceType) + "=" + model.FinanceType + "");
} }
builder.AppendFormat(@"select distinct b.FrID,IFNULL(b.MatchMoney,0) as MatchMoney,IFNULL(E.TCID,0)TCID,D.Name,b.Status,b.TradeDate,b.CreateDate,b.RB_Branch_Id,a.ID,a.CostTypeId,IFNULL(b.Is_Cashier,0)Is_Cashier,a.Money,b.OrderID,b.OrderSource,b.SourceID,IFNULL(b.PayMoney,0)PayMoney,IFNULL(b.Fee,0)Fee,b.Type builder.AppendFormat(@"select distinct b.FrID,IFNULL(b.MatchMoney,0) as MatchMoney,IFNULL(E.TCID,0)TCID,D.Name,b.Status,b.TradeDate,b.CreateDate,b.RB_Branch_Id,a.ID,a.CostTypeId,IFNULL(b.Is_Cashier,0)Is_Cashier,a.Money,b.OrderID,b.OrderSource,b.SourceID,IFNULL(b.PayMoney,0)PayMoney,IFNULL(b.Fee,0)Fee,b.Type
from rb_financedetail a INNER JOIN rb_finance as b on a.FinanceId=b.FrID and a.`Status`=0 from rb_financedetail a INNER JOIN rb_finance as b on a.FinanceId=b.FrID and a.`Status`=0
INNER JOIN rb_costtype AS D ON D.ID=a.CostTypeId INNER JOIN rb_costtype AS D ON D.ID=a.CostTypeId
......
...@@ -74,7 +74,11 @@ WHERE 1=1 "); ...@@ -74,7 +74,11 @@ WHERE 1=1 ");
} }
if (!string.IsNullOrEmpty(query.Title)) if (!string.IsNullOrEmpty(query.Title))
{ {
builder.AppendFormat(" AND A.{0} LIKE @Title ", nameof(RB_Question_ViewModel.Title)); builder.AppendFormat(" AND (A.{0} LIKE @Title OR A.{1} LIKE @Title OR A.{2} LIKE @Title) "
,nameof(RB_Question_ViewModel.Title)
,nameof(RB_Question_ViewModel.QuestionContent)
,nameof(RB_Question_ViewModel.AnswerParse)
);
parameters.Add("Title", "%" + query.Title.Trim() + "%"); parameters.Add("Title", "%" + query.Title.Trim() + "%");
} }
if (!string.IsNullOrEmpty(query.PointName)) if (!string.IsNullOrEmpty(query.PointName))
......
...@@ -229,6 +229,14 @@ WHERE 1=1 ...@@ -229,6 +229,14 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59'", nameof(RB_StudyAbroad_ViewModel.CreateTime), query.EndTime); builder.AppendFormat(" AND A.{0} <='{1} 23:59:59'", nameof(RB_StudyAbroad_ViewModel.CreateTime), query.EndTime);
} }
if (!string.IsNullOrEmpty(query.ConfirmSTime))
{
builder.AppendFormat(" AND A.{0} >='{1}'", nameof(RB_StudyAbroad_ViewModel.ConfirmDate), query.ConfirmSTime);
}
if (!string.IsNullOrEmpty(query.ConfirmETime))
{
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59'", nameof(RB_StudyAbroad_ViewModel.ConfirmDate), query.ConfirmETime);
}
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList(); return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
} }
} }
......
...@@ -1381,7 +1381,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1381,7 +1381,7 @@ namespace Edu.WebApi.Controllers.Course
#region 追加章节信息 #region 追加章节信息
var hours = classModule.GetCurrentPlanStudyHoursRepository(model.ClassPlanId); var hours = classModule.GetCurrentPlanStudyHoursRepository(model.ClassPlanId)+1;
if (hours != -1) if (hours != -1)
{ {
var classObj = classModule.GetClassModule(model.ClassId); var classObj = classModule.GetClassModule(model.ClassId);
...@@ -1389,11 +1389,11 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1389,11 +1389,11 @@ namespace Edu.WebApi.Controllers.Course
var courseOjb = new CourseModule().GetCourseModule(classObj.CouseId); var courseOjb = new CourseModule().GetCourseModule(classObj.CouseId);
var chapter = new CourseModule().GetMatchHoursChapterModule(classObj.CouseId, hours); var chapter = new CourseModule().GetMatchHoursChapterModule(classObj.CouseId, hours);
if (chapter != null && chapter.ChapterId > 0) if (chapter != null && chapter.Count > 0)
{ {
chapter.CourseName = courseOjb.CourseName;
model.Chapter = chapter; model.Chapter = chapter;
} }
model.CourseName = courseOjb.CourseName;
} }
#endregion #endregion
......
...@@ -519,7 +519,14 @@ namespace Edu.WebApi.Controllers.Course ...@@ -519,7 +519,14 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost] [HttpPost]
public ApiResult GetChapterTree() public ApiResult GetChapterTree()
{ {
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Chapter_ViewModel>(RequestParm.Msg.ToString()); var query = new RB_Course_Chapter_ViewModel()
{
CourseId = base.ParmJObj.GetInt("CourseId"),
};
if (query.CourseId <= 0)
{
return ApiResult.ParamIsNull(message: "请传递课程编号!");
}
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id; query.School_Id = base.UserInfo.School_Id;
var list = courseModule.GetChapterTreeListModule(query); var list = courseModule.GetChapterTreeListModule(query);
...@@ -556,7 +563,12 @@ namespace Edu.WebApi.Controllers.Course ...@@ -556,7 +563,12 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost] [HttpPost]
public ApiResult BatchRemoveChapter() public ApiResult BatchRemoveChapter()
{ {
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Chapter_ViewModel>(RequestParm.Msg.ToString()); var extModel = new RB_Course_Chapter_ViewModel()
{
CourseId=base.ParmJObj.GetInt("CourseId"),
ChapterNo=base.ParmJObj.GetStringValue("ChapterNo"),
ChapterId=base.ParmJObj.GetInt("ChapterId"),
};
bool flag = courseModule.BatchRemoveChapterModule(extModel); bool flag = courseModule.BatchRemoveChapterModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
...@@ -357,7 +357,15 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -357,7 +357,15 @@ namespace Edu.WebApi.Controllers.Duty
public ApiResult DutyCheck() public ApiResult DutyCheck()
{ {
var Id = base.ParmJObj.GetInt("Id"); var Id = base.ParmJObj.GetInt("Id");
if (Id <= 0)
{
return ApiResult.ParamIsNull(message: "请传递值班编号!");
}
var Shift = base.ParmJObj.GetInt("Shift"); var Shift = base.ParmJObj.GetInt("Shift");
if (Shift <= 0)
{
return ApiResult.ParamIsNull(message: "请传递值班班次!");
}
var Status = base.ParmJObj.GetInt("Status"); var Status = base.ParmJObj.GetInt("Status");
//突发事件 //突发事件
int IsBurst = base.ParmJObj.GetInt("IsBurst"); int IsBurst = base.ParmJObj.GetInt("IsBurst");
......
...@@ -1349,7 +1349,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1349,7 +1349,7 @@ namespace Edu.WebApi.Controllers.Finance
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList"); LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList:" + Common.Plugin.JsonHelper.Serialize(dmodel));
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist); var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", ExcelName); return File(byteData1, "application/octet-stream", ExcelName);
} }
...@@ -1545,7 +1545,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1545,7 +1545,7 @@ namespace Edu.WebApi.Controllers.Finance
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList"); LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList:" + string.Format("TeacherId:{0},SchoolId:{1},StartMonth:{2},EndMonth:{3},Group_Id:{4}", TeacherId, SchoolId, StartMonth, EndMonth, userInfo.Group_Id));
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist); var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", ExcelName); return File(byteData1, "application/octet-stream", ExcelName);
} }
...@@ -1998,6 +1998,8 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -1998,6 +1998,8 @@ namespace Edu.WebApi.Controllers.Finance
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
string StartTime = base.ParmJObj.GetStringValue("StartTime");//开始时间 string StartTime = base.ParmJObj.GetStringValue("StartTime");//开始时间
string EndTime = base.ParmJObj.GetStringValue("EndTime");//结束时间 string EndTime = base.ParmJObj.GetStringValue("EndTime");//结束时间
int ClassId = base.ParmJObj.GetInt("ClassId", 0);
string ClassNo = base.ParmJObj.GetStringValue("ClassNo");//班号
if (string.IsNullOrEmpty(StartTime)) if (string.IsNullOrEmpty(StartTime))
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
...@@ -2016,7 +2018,7 @@ namespace Edu.WebApi.Controllers.Finance ...@@ -2016,7 +2018,7 @@ namespace Edu.WebApi.Controllers.Finance
return ApiResult.Failed("日期格式有误,请核实后再试"); return ApiResult.Failed("日期格式有误,请核实后再试");
} }
var Robj = financeModule.GetAllClassNowMonthStatistics(StartTime, EndTime, userInfo); var Robj = financeModule.GetAllClassNowMonthStatistics(StartTime, EndTime, ClassId, ClassNo, userInfo);
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
......
...@@ -1014,7 +1014,6 @@ namespace Edu.WebApi.Controllers.OKR ...@@ -1014,7 +1014,6 @@ namespace Edu.WebApi.Controllers.OKR
public ApiResult GetOKRMyEmployeeList() public ApiResult GetOKRMyEmployeeList()
{ {
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
var obj = okrPeriodModule.GetOKRMyEmployeeList(userInfo); var obj = okrPeriodModule.GetOKRMyEmployeeList(userInfo);
return ApiResult.Success("", obj); return ApiResult.Success("", obj);
} }
......
...@@ -89,14 +89,16 @@ namespace Edu.WebApi.Controllers.User ...@@ -89,14 +89,16 @@ namespace Edu.WebApi.Controllers.User
} }
List<RB_Account_ViewModel> list = new List<RB_Account_ViewModel>(); List<RB_Account_ViewModel> list = new List<RB_Account_ViewModel>
list.Add(new RB_Account_ViewModel {
new RB_Account_ViewModel
{ {
Id = base.UserInfo.Id, Id = base.UserInfo.Id,
AccountId = base.UserInfo.AccountId, AccountId = base.UserInfo.AccountId,
AccountType = base.UserInfo.AccountType, AccountType = base.UserInfo.AccountType,
Group_Id = base.UserInfo.Group_Id Group_Id = base.UserInfo.Group_Id
}); }
};
bool result = accountModule.SetBatchResetPassword(list, NewPassWord); bool result = accountModule.SetBatchResetPassword(list, NewPassWord);
if (result) if (result)
{ {
......
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