Commit 288d5654 authored by liudong1993's avatar liudong1993

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

parents cb8518a4 a577a949
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
......@@ -956,5 +957,29 @@ namespace Edu.Common
return ReadConfigKey("NewAchievementsEnable");
}
}
/// <summary>
/// 不验证学员状态,就可以签到的订单
/// </summary>
public static List<int> NoCheckOrderList
{
get
{
List<int> list = new List<int>();
try
{
string noCheckOrdersStr = ReadConfigKey("NoCheckOrders");
if (!string.IsNullOrEmpty(noCheckOrdersStr))
{
list = Common.ConvertHelper.StringToList(noCheckOrdersStr);
}
}
catch
{
list = new List<int>();
}
return list;
}
}
}
}
\ No newline at end of file
......@@ -2147,7 +2147,14 @@ namespace Edu.Module.Course
//已上课时>=有效课时,如果是,修改学员状态为停课,并且备注“有效课时消耗完毕,系统自动停课”
if (completeHours > guestModel.ValidClassHours)
{
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.GuestState), (int)GuestStateEnum.StopClasses);
if (Common.Config.NoCheckOrderList.Count > 0 && Common.Config.NoCheckOrderList.Contains(guestModel.OrderId))
{
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.GuestState), (int)GuestStateEnum.Normal);
}
else
{
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.GuestState), (int)GuestStateEnum.StopClasses);
}
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.ChangeEffectTime), System.DateTime.Now);
orderFileds.Add(nameof(RB_Order_Guest_ViewModel.DropOutRemark), "有效课时消耗完毕,系统自动停课");
LogContent = guestModel.GuestName + "有效课时消耗完毕,系统自动停课!";
......
......@@ -1502,7 +1502,7 @@ namespace Edu.Module.Course
Id = 0,
OrderId = demodel.OrderId,
ClassId = demodel.ClassId,
GuestName = item.StuName,
GuestName = item.StuName.Trim(),
GuestState = GuestStateEnum.Normal,
Profession = item?.StuProfession ?? "",
Sex = (item?.StuSex ?? 1) + 1,
......@@ -1538,7 +1538,8 @@ namespace Edu.Module.Course
RenewState = item.IsRenewGuest == 1 ? 2 : 1,
QQ = item.QQ,
WeChatNo = item.WeChatNo,
TotalChapterNo = MaxChapterNo
TotalChapterNo = MaxChapterNo,
StudentId=item.StuId,
};
SetOrderGuestInfo(guestModel, out string Nmessage);
......@@ -2917,8 +2918,8 @@ namespace Edu.Module.Course
#region 验证电话是否已是他人客户
if (!string.IsNullOrEmpty(dmodel.Mobile)&& dmodel.StudentId <= 0)
{
var slist = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { Group_Id = dmodel.Group_Id, StuTel = dmodel.Mobile, School_Id = -1 });
if (slist.Where(x => x.CustomerId != ordermodel.CustomerId).Any())
var slist = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { Group_Id = dmodel.Group_Id, StuTel = dmodel.Mobile,StuName=dmodel.GuestName.Trim(), School_Id = -1 });
if (slist.Where(x => x.CustomerId != ordermodel.CustomerId && x.StuName.Trim()==dmodel.GuestName.Trim()).Any())
{
message = "学员'" + dmodel.GuestName + "'已被他人注册";
return false;
......
......@@ -2315,7 +2315,8 @@ namespace Edu.Module.Course
//查询最新的提成规则
rulelist = sell_Achievements_RuleRepository.GetList(new RB_Sell_Achievements_Rule_ViewModel() { Group_Id = userInfo.Group_Id });
}
else {
else
{
rulelist = JsonHelper.DeserializeObject<List<RB_Sell_Achievements_Rule_ViewModel>>(periodsModel.AdminRemark);
}
//非部门规则
......@@ -2404,7 +2405,10 @@ namespace Edu.Module.Course
}
else
{
CMoney = Convert.ToDecimal(Content.Split(',')[1]);
if (Content.Split(',').Length > 1)
{
CMoney = Convert.ToDecimal(Content.Split(',')[1]);
}
}
Remark = "教师续费语培订单提成:" + CMoney + ";课程等级:" + courseModel.CourseRate.ToName();
}
......@@ -2466,7 +2470,7 @@ namespace Edu.Module.Course
}
#endregion
if (RuleModel!=null&&RuleModel.Type == 3)
if (RuleModel != null && RuleModel.Type == 3)
{
//当前匹配教师规则 只查询老师的业绩
foreach (var item in rulelist.Where(x => x.Id == RuleModel.Id))
......@@ -2554,7 +2558,7 @@ namespace Edu.Module.Course
//计算老师业绩
decimal TotalYj = orderChildList.Sum(x => x.PreferPrice - x.DiscountMoney);
decimal YjMoney = TotalYj;//排除同行返佣
//根据业绩所在区间 查询比例
//根据业绩所在区间 查询比例
var rateModel = item.RateList.Where(x => x.StartValue < YjMoney && (x.EndValue >= YjMoney || x.EndValue == -1)).FirstOrDefault();
if (rateModel != null)
{
......@@ -2587,7 +2591,7 @@ namespace Edu.Module.Course
}
}
//再查询当前用户的
foreach (var item in rulelist.Where(x => x.Id == (RuleModel?.Id??0)))
foreach (var item in rulelist.Where(x => x.Id == (RuleModel?.Id ?? 0)))
{
if (string.IsNullOrEmpty(item.ChildEmpIds))
{
......@@ -2737,7 +2741,7 @@ namespace Edu.Module.Course
if (sellOrderList.Any())
{
//计算市场业绩
decimal TotalYj = sellOrderList.Sum(x => x.PreferPrice - x.DiscountMoney);
decimal TotalYj = sellOrderList.Sum(x => x.PreferPrice - x.DiscountMoney);
//查询老师的提成
decimal teacherMoney = AchEmpList.Where(x => x.Type == 3 && sellOrderList.Select(y => y.OrderId).Contains(x.OrderId)).Sum(x => x.PushMoney);
decimal YjMoney = TotalYj - teacherMoney;//排除 老师的提成
......@@ -2852,7 +2856,8 @@ namespace Edu.Module.Course
#endregion
}
else {
else
{
var emoModel = sell_Achievements_EmpRepository.GetMonthSaleMoney(userInfo.Id, periodsModel.Id, userInfo.Group_Id);
//查询本月提成
MonthCommission = emoModel.PushMoney;
......
......@@ -849,6 +849,7 @@ namespace Edu.Module.Exam
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_querty:" + Common.Plugin.JsonHelper.Serialize(query));
}
}
if (item.QuestionTypeKey != "listening" && item.QuestionTypeKey != "reading-comprehensio" && item.Answer!=null && !string.IsNullOrEmpty(item.Answer.ToString()))
......@@ -1051,7 +1052,8 @@ namespace Edu.Module.Exam
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
Common.Plugin.LogHelper.Write(ex, "GetAppBankDetailsPageModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
Common.Plugin.LogHelper.Write(ex, "GetAppBankDetailsPageModule_query:" + Common.Plugin.JsonHelper.Serialize(query));
}
}
if (item.QuestionTypeKey != "listening" && item.QuestionTypeKey != "reading-comprehensio" && !string.IsNullOrEmpty(item.Answer))
......@@ -1364,7 +1366,8 @@ namespace Edu.Module.Exam
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
Common.Plugin.LogHelper.Write(ex, "GetPracticeWrongPageModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
Common.Plugin.LogHelper.Write(ex, "GetPracticeWrongPageModule_query:" + Common.Plugin.JsonHelper.Serialize(query));
}
}
if (tempQuestion.QuestionTypeKey != "listening" && tempQuestion.QuestionTypeKey != "reading-comprehensio" && !string.IsNullOrEmpty(tempQuestion.Answer))
......
......@@ -987,6 +987,17 @@ namespace Edu.WebApi.Controllers.Course
}
}
var orderGuestList = classModule.GetOrderGuestListModule(new RB_Order_Guest_ViewModel { Group_Id = base.UserInfo.Group_Id, School_Id = 0, ClassId = data.ClassId, QEffectStatus = 1 });
if (orderGuestList != null && orderGuestList.Count > 0 && Common.Config.NoCheckOrderList.Count > 0)
{
foreach (var item in orderGuestList)
{
//商务日语听说班,月结,不验证学生状态
if (Common.Config.NoCheckOrderList.Contains(item.OrderId) && item.GuestState == GuestStateEnum.StopClasses)
{
item.GuestState = GuestStateEnum.Normal;
}
}
}
var checkLogList = classModule.GetClassCheckList(new RB_Class_Check_ViewModel
{
Group_Id = data.Group_Id,
......@@ -1211,6 +1222,10 @@ namespace Edu.WebApi.Controllers.Course
});
}
}
if (!list.Any())
{
return ApiResult.Failed(message: "没有要签到的学员!");
}
int groupId = 100000;
int Uid = 1;
if (base.UserInfo != null)
......
......@@ -646,14 +646,15 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSellCenterAchievementsStatistics() {
public ApiResult GetSellCenterAchievementsStatistics()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
string Month = parms.GetStringValue("Month");
if (string.IsNullOrEmpty(Month)) {
if (string.IsNullOrEmpty(Month))
{
return ApiResult.ParamIsNull();
}
Month = Convert.ToDateTime(Month).ToString("yyyy-MM");
var Robj = sellAchievementsModule.GetSellCenterAchievementsStatistics(Month, userInfo);
return ApiResult.Success("", Robj);
......
......@@ -1054,6 +1054,7 @@ namespace Edu.WebApi.Controllers.Exam
BankType = (LevelTypeEnum)base.ParmJObj.GetInt("BankType"),
QCategoryId = string.Format("{0}", (int)QuestionCategoryEnum.ReadingChoose),
StartId = base.ParmJObj.GetInt("StartId"),
BankId = 107,
};
var list = courseExamModule.GetAppQuestionCategoryListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......
......@@ -44,7 +44,7 @@ namespace Edu.WebApi.Timers
public Task StartAsync(CancellationToken cancellationToken)
{
Common.Plugin.LogHelper.Write("定时任务被启动");
Common.Plugin.LogHelper.WriteInfo("定时任务被启动");
int Interval = 0;
Interval = 60;
//Interval = 1;
......@@ -57,7 +57,7 @@ namespace Edu.WebApi.Timers
public Task StopAsync(CancellationToken cancellationToken)
{
Common.Plugin.LogHelper.Write("定时任务被关闭");
Common.Plugin.LogHelper.WriteInfo("定时任务被关闭");
_timer?.Change(Timeout.Infinite, 0);
return Task.CompletedTask;
}
......@@ -69,51 +69,51 @@ namespace Edu.WebApi.Timers
/// <returns></returns>
private void DoWork(object state)
{
Common.Plugin.LogHelper.Write("定时任务被触发");
Common.Plugin.LogHelper.WriteInfo("定时任务被触发");
try
{
if (Interlocked.Exchange(ref marketconsultant_Timer, 1) == 0)
{
Common.Plugin.LogHelper.Write("DealMarketConsultantData========Start");
Common.Plugin.LogHelper.WriteInfo("DealMarketConsultantData========Start");
var today = DateTime.Now;
var currentDate = Common.ConvertHelper.FormatDate(today);
var startDate = Common.ConvertHelper.FormatDate(today.AddDays(-1));
if (!marketConsultantModule.CheckConsultantDataModule(startDate))
{
marketConsultantModule.CreateConsultantDataModule(today);
Common.Plugin.LogHelper.Write("CreateConsultantDataModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateConsultantDataModule:" + startDate);
}
if (!marketConsultantModule.CheckMarketDataModule(startDate))
{
marketConsultantModule.CreateMarketDataModule(today);
Common.Plugin.LogHelper.Write("CreateMarketDataModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateMarketDataModule:" + startDate);
}
//缓存信息
UserInfo user = UserReidsCache.GetUserLoginInfo("1");
if (!studentStatModule.CheckStudentStaticModule(startDate))
{
studentStatModule.CreateStudentStaticModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentStaticModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateStudentStaticModule:" + startDate);
}
if (!studentStatModule.CheckStudentMarketModule(startDate))
{
studentStatModule.CreateStudentMarketModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentMarketModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateStudentMarketModule:" + startDate);
}
if (!studentStatModule.CheckStudentCompanyModule(startDate))
{
studentStatModule.CreateStudentCompanyModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateStudentCompanyModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateStudentCompanyModule:" + startDate);
}
if (!teacherStaticModule.CheckTeacherStaticExistsModule(startDate))
{
teacherStaticModule.CreateTeacherStaticModule(user, startDate, currentDate, isInit: false);
Common.Plugin.LogHelper.Write("CreateTeacherStaticModule:" + startDate);
Common.Plugin.LogHelper.WriteInfo("CreateTeacherStaticModule:" + startDate);
}
Common.Plugin.LogHelper.Write("DealMarketConsultantData========End");
Common.Plugin.LogHelper.WriteInfo("DealMarketConsultantData========End");
educationContractModule.UpdateEducationAnomalyContractModule();
Common.Plugin.LogHelper.Write("更新合同金额========End");
Common.Plugin.LogHelper.WriteInfo("更新合同金额========End");
Interlocked.Exchange(ref marketconsultant_Timer, 0);
}
......@@ -126,7 +126,7 @@ namespace Edu.WebApi.Timers
public void Dispose()
{
Common.Plugin.LogHelper.Write("定时任务被释放闭");
Common.Plugin.LogHelper.WriteInfo("定时任务被释放闭");
_timer?.Dispose();
//iis会回收这个定时任务,这边在回收的时候触发一个请求,来再次唤醒该服务
Thread.Sleep(5000);
......
......@@ -52,7 +52,7 @@
"QYWeiChatToken": "b3e0ebf63301f80cb8e741cf72fdaf3c",
"QYWeiChatEncodingAESKey": "ODRjOGEwYWQxNWJkNDRkMTg2NGJiOWY1ZTE4LCE0NmY",
"RabbitMqConfig": {
"HostName": "47.96.12.235",
"HostName": "192.168.10.214",
"VirtualHost": "/",
"Port": 5672,
"UserName": "guest",
......@@ -60,7 +60,7 @@
"QueenName": "vt_sys_message_test"
},
"RedisSetting": {
"RedisServer": "47.96.23.199",
"RedisServer": "192.168.10.214",
"RedisPort": "6379",
"RedisPwd": "Viitto2018"
},
......@@ -122,5 +122,7 @@
//甲鹤收款手续费
"IncomeFeeRate": "0.0025,0.0054,0.006,0.04,0.004",
//教师考核审批流程编号
"TeacherAssessmentFlowId":12
"TeacherAssessmentFlowId": 12,
//不验证学员状态的订单(1382:商务日语听说班【企业课】)
"NoCheckOrders": "1382"
}
\ No newline at end of file
File added
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