Commit f6a34101 authored by liudong1993's avatar liudong1993

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

parents cc5489fe 9411bd0e
using Edu.CacheManager.Base;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Cache.Customer
{
public class CustomerRedisCache
{
/// <summary>
/// 使用redis第几号库
/// </summary>
public static readonly int REDIS_DB3 = 3;
static readonly RedisHelper redis = new RedisHelper(REDIS_DB3);
static readonly string DISTRIBUTION_RULE_KEY = "DISTRIBUTION_CURSOR";
static readonly object LOCKER = new object();
static readonly object LOCKED = new object();
public static void Set(object Data)
{
lock (LOCKER)
{
lock (LOCKED)
{
try
{
redis.StringSet(DISTRIBUTION_RULE_KEY, Data);
}
catch (Exception)
{
}
}
}
}
public static int Get()
{
lock (LOCKER)
{
lock (LOCKED)
{
try
{
var info = redis.StringGet<int>(DISTRIBUTION_RULE_KEY);
//默认往后移动一位
redis.StringSet(DISTRIBUTION_RULE_KEY, (info + 1));
return info;
}
catch (Exception)
{
return 0;
}
}
}
}
}
}
......@@ -3,6 +3,7 @@ using Edu.Common;
using Edu.Common.API;
using Edu.Common.Enum;
using Edu.Common.Enum.Customer;
using Edu.Common.Enum.User;
using Edu.Model.CacheModel;
using Edu.Repository.Customer;
using Edu.Repository.User;
......@@ -161,6 +162,9 @@ namespace Edu.Cache.User
DeptName = model.DeptName,
PostName = model.PostName,
Email = model.Email,
IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0,
IsMarket = (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0,
};
UserInfoSet(Cache.CacheKey.User_Login_Key + Id.ToString(), userInfo, Common.Config.JwtExpirTime);
}
......
......@@ -172,6 +172,11 @@ namespace Edu.Model.CacheModel
/// 是否是课程顾问(1-是)
/// </summary>
public int IsCourseConsultant { get; set; }
/// <summary>
/// 是否是市场(1-是)
/// </summary>
public int IsMarket { get; set; }
}
/// <summary>
......
......@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
......
......@@ -671,7 +671,7 @@ namespace Edu.Module.Course
/// <param name="userInfo"></param>
/// <returns></returns>
public virtual bool SetClassOrderCommonModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message)
public bool SetClassOrderCommonModule(RB_Order_ViewModel demodel, UserInfo userInfo, bool isEditOrder, out string message)
{
bool flag = false;
message = "";
......@@ -1057,6 +1057,10 @@ namespace Edu.Module.Course
return flag;
}
demodel.Class_Price = courseModel.SellPrice;
if (demodel.EnterID <= 0 && demodel.CreateBy > 0)
{
demodel.EnterID = demodel.CreateBy;
}
int OrderId = orderRepository.Insert(demodel);
demodel.OrderId = OrderId;
flag = OrderId > 0;
......@@ -2505,8 +2509,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool SetOrderGuestInfo(RB_Order_Guest_ViewModel dmodel, out string message)
public bool SetOrderGuestInfo(RB_Order_Guest_ViewModel dmodel, out string message)
{
bool flag = false;
if (dmodel.BirthDate != null)
......
......@@ -482,9 +482,9 @@ namespace Edu.Module.Course
/// <param name="guestId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public RB_Order_Guest_Extend GetOrderGusetHoursInfo(int guestId, int group_Id)
public RB_Order_Guest_Extend GetOrderGusetHoursInfo(int guestId, int classId)
{
var gmodel = order_GuestRepository.GetOrderGusetHoursInfo(guestId, group_Id);
var gmodel = order_GuestRepository.GetOrderGusetHoursInfo(guestId, classId);
return gmodel;
}
......
......@@ -12,6 +12,7 @@ using Edu.Common.Plugin;
using Edu.Repository.System;
using Edu.Model.Entity.System;
using Edu.Model.ViewModel.System;
using Edu.Cache.Customer;
namespace Edu.Module.Customer
{
......@@ -85,6 +86,8 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
private readonly Rb_dictvalueRepository dictvalueRepository = new Rb_dictvalueRepository();
#region 学员约访
......@@ -721,10 +724,12 @@ namespace Edu.Module.Customer
/// <returns></returns>
public bool CheckAssistTypeExistsModule(RB_Student_Assist_Extend query)
{
List<WhereHelper> list = new List<WhereHelper>();
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.AssistType), (int)query.AssistType));
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.Status), (int)DateStateEnum.Normal));
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.StuId), query.StuId));
List<WhereHelper> list = new List<WhereHelper>
{
new WhereHelper(nameof(RB_Student_Assist_Extend.AssistType), (int)query.AssistType),
new WhereHelper(nameof(RB_Student_Assist_Extend.Status), (int)DateStateEnum.Normal),
new WhereHelper(nameof(RB_Student_Assist_Extend.StuId), query.StuId)
};
if (query.Id > 0)
{
list.Add(new WhereHelper()
......@@ -737,6 +742,87 @@ namespace Edu.Module.Customer
return student_AssistRepository.Exists(list);
}
public (bool result, string msg) SetStudentAssistBatchModule(string studIds,int uid)
{
var tempList = studIds.Split(',', StringSplitOptions.RemoveEmptyEntries);
var pushKey = "PUSH_STU_UNION_EMP";
var pushRule = "PUSH_STU_RULETYPE";
if (tempList.Length > 0)
{
var push = dictvalueRepository.GetList(new RB_Dictvalue_Extend() { DictKey = pushKey }).FirstOrDefault();
var rule = dictvalueRepository.GetList(new RB_Dictvalue_Extend() { DictKey = pushRule }).FirstOrDefault();
var guwen = push.Content.Split(',', StringSplitOptions.RemoveEmptyEntries);
var guwenName = push.Mask.Split(',', StringSplitOptions.RemoveEmptyEntries);
if (guwen.Length > 1)
{
if (rule.Content.Equals("1"))
{
var mask = string.Empty;
tempList.ToList().ForEach(x =>
{
Random ran = new Random();
var cur = ran.Next(0, guwen.Length - 1);
var model = new RB_Student_Assist_Extend()
{
Id = 0,
AssistId = int.Parse(guwen[cur]),
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
StuId = int.Parse(x),
Status = Common.Enum.DateStateEnum.Normal
};
SetStudentAssistModule(int.Parse(x), model, uid);
mask += mask.Contains("," + guwenName[cur]) ? "" : "," + guwenName[cur];
});
return (true, "学员批量转课程顾问成功,已分别转给顾问:" + mask);
}
else
{
var mask = string.Empty;
tempList.ToList().ForEach(x =>
{
var cache = CustomerRedisCache.Get();
if (cache >= guwen.Length)
{
CustomerRedisCache.Set(1);
cache = 0;
}
var model = new RB_Student_Assist_Extend()
{
Id = 0,
AssistId = int.Parse(guwen[cache]),
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
StuId = int.Parse(x),
Status = Common.Enum.DateStateEnum.Normal
};
SetStudentAssistModule(int.Parse(x), model, uid);
mask += mask.Contains("," + guwenName[cache]) ? "" : "," + guwenName[cache];
});
return (true, "学员批量转课程顾问成功,已分别转给顾问:" + mask);
}
}
else
{
tempList.ToList().ForEach(x =>
{
var model = new RB_Student_Assist_Extend()
{
Id = 0,
AssistId = int.Parse(guwen[0]),
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
StuId = int.Parse(x),
Status = Common.Enum.DateStateEnum.Normal
};
SetStudentAssistModule(int.Parse(x), model, uid);
});
return (true, "学员批量转课程顾问成功,已全部转给顾问:" + push.Mask);
}
}
else
{
return (false, "未获取到学员信息");
}
}
/// <summary>
/// 获取学员协助人员列表
/// </summary>
......
......@@ -2,6 +2,12 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Nullable>warnings</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
......
......@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
<ProjectReference Include="..\Edu.Model\Edu.Model.csproj" />
......
......@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
......
......@@ -73,32 +73,31 @@ namespace Edu.Module.Exam
{
var titleRandomNum = Common.ConvertHelper.CreateRandomNum();
var tempWords = reviewList[i];
reviewGroupList.Add(CreateSingleModule(tempWords,totalList));
////选择题
//if (titleRandomNum % 2 == 0)
//{
//
// if (tempList != null && tempList.Count > 2)
// {
// reviewGroupList.Add(CreateSingleModule(tempWords, tempList));
// }
// else
// {
// if (!string.IsNullOrEmpty(tempWords.ChineseMean) || !string.IsNullOrEmpty(tempWords.WordWrite))
// {
// reviewGroupList.Add(CreateFillInModule(tempWords));
// }
// }
//}
////填空题
//else
//{
// if (!string.IsNullOrEmpty(tempWords.ChineseMean) || !string.IsNullOrEmpty(tempWords.WordWrite))
// {
// reviewGroupList.Add(CreateFillInModule(tempWords));
// }
//}
var count = totalList?.Where(qitem => qitem.Id != tempWords.Id)?.Count()??0;
//reviewGroupList.Add(CreateSingleModule(tempWords,totalList));
//选择题
if (titleRandomNum % 2 == 0)
{
if (count > 2)
{
reviewGroupList.Add(CreateSingleModule(tempWords, totalList));
}
else
{
if (!string.IsNullOrEmpty(tempWords.ChineseMean) || !string.IsNullOrEmpty(tempWords.WordWrite))
{
reviewGroupList.Add(CreateFillInModule(tempWords));
}
}
}
//填空题
else
{
if (!string.IsNullOrEmpty(tempWords.ChineseMean) || !string.IsNullOrEmpty(tempWords.WordWrite))
{
reviewGroupList.Add(CreateFillInModule(tempWords));
}
}
}
}
......@@ -196,17 +195,24 @@ namespace Edu.Module.Exam
for (var i = 0; i < 3; i++)
{
var cItem = tempList[i];
string Content = cItem.WordContent;
if (string.IsNullOrEmpty(Content))
{
var cTempList = totalList?.Where(qitem => qitem.Id != cItem.Id && qitem.Id != item.Id && !string.IsNullOrEmpty(qitem.WordContent))?.OrderBy(qitem => Guid.NewGuid());
Content = cTempList?.FirstOrDefault()?.WordContent ?? "";
}
if (options.Where(qitem => qitem.Content.Equals(Content)).Count() > 0)
{
Content += GetRandWords(i);
}
options.Add(new optionItem()
{
Content = !string.IsNullOrEmpty(cItem.WordContent)
? cItem.WordContent
: (totalList?.FirstOrDefault(qitem => qitem.Id != item.Id &&!string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""),
Content = Content,
IsAnswer = false,
Name = "",
ShowName = "",
});
}
break;
//根据日语书写选择中文意思
case 2:
......@@ -223,11 +229,18 @@ namespace Edu.Module.Exam
for (var i = 0; i < 3; i++)
{
var cItem = tempList[i];
string Content = cItem.WordContent;
if (string.IsNullOrEmpty(Content))
{
Content = (totalList?.OrderBy(qitem => Guid.NewGuid())?.FirstOrDefault(qitem => qitem.Id != cItem.Id && qitem.Id != item.Id && !string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? "");
}
if (options.Where(qitem => qitem.Content.Equals(Content)).Count() > 0)
{
Content += GetRandWords(i);
}
options.Add(new optionItem()
{
Content = !string.IsNullOrEmpty(cItem.WordContent)
? cItem.WordContent :
(totalList?.FirstOrDefault(qitem => qitem.Id != item.Id&&!string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""),
Content = Content,
IsAnswer = false,
Name = "",
ShowName = "",
......@@ -254,11 +267,21 @@ namespace Edu.Module.Exam
for (var i = 0; i < 3; i++)
{
var cItem = tempList[i];
string Content = cItem.WordWrite;
if (string.IsNullOrEmpty(Content))
{
Content = totalList
?.OrderBy(qitem => Guid.NewGuid())
?.FirstOrDefault(qitem =>qitem.Id != cItem.Id && qitem.Id != item.Id && !string.IsNullOrEmpty(qitem.WordWrite))
?.WordWrite ?? "";
}
if (options.Where(qitem => qitem.Content.Equals(Content)).Count() > 0)
{
Content += GetRandWords(i);
}
options.Add(new optionItem()
{
Content = !string.IsNullOrEmpty(cItem.WordWrite)
? cItem.WordWrite
:(totalList?.FirstOrDefault(qitem => qitem.Id != item.Id &&!string.IsNullOrEmpty(qitem.WordWrite))?.WordWrite ?? ""),
Content = Content,
IsAnswer = false,
Name = "",
ShowName = "",
......@@ -271,10 +294,8 @@ namespace Edu.Module.Exam
}
break;
}
options = options?.OrderBy(qitem => Guid.NewGuid())?.ToList();
string Answer = "";
for (var j = 1; j <= options.Count; j++)
{
......@@ -305,6 +326,18 @@ namespace Edu.Module.Exam
return singleObj;
}
/// <summary>
/// 获取随机假名
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public string GetRandWords(int index)
{
var array = new string[4] { "ん", "ー", "ム", "い" };
return array[index];
}
/// <summary>
/// 生成默认的选择题
/// </summary>
......@@ -325,10 +358,21 @@ namespace Edu.Module.Exam
for (var i = 0; i < 3; i++)
{
var cItem = totalList[i];
string Content = cItem.ChineseMean;
if (string.IsNullOrEmpty(Content))
{
Content = totalList
?.OrderBy(qitem => Guid.NewGuid())
?.FirstOrDefault(qitem => qitem.Id != cItem.Id && qitem.Id != item.Id && !string.IsNullOrEmpty(qitem.ChineseMean))
?.ChineseMean ?? "";
}
if (options.Where(qitem => qitem.Content.Equals(Content)).Count() > 0)
{
Content += GetRandWords(i);
}
options.Add(new optionItem()
{
Content = !string.IsNullOrEmpty(cItem.ChineseMean) ? cItem.ChineseMean :
(totalList?.FirstOrDefault(qitem =>qitem.Id!=item.Id && !string.IsNullOrEmpty(qitem.ChineseMean))?.ChineseMean ?? ""),
Content = Content,
IsAnswer = false,
Name = "",
ShowName = "",
......
......@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Aop\Edu.Aop.csproj" />
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
......
......@@ -1634,7 +1634,7 @@ namespace Edu.Module.Exam
/// <returns></returns>
public virtual bool SetStuExamStartTimeModule(int PublishId, int GuestId, int PaperId)
{
bool flag = false;
bool flag = true;
var model = examination_StudentRepository.GetExaminationStudentListRepository(new RB_Examination_Student_ViewModel()
{
PaperId = PaperId,
......
......@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;NETSDK1138</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Cache\Edu.Cache.csproj" />
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
......
......@@ -379,7 +379,9 @@ namespace Edu.Module.User
Common.Message.MessageHelper.SendMessage(modelWork);
}
}
}
return flag;
}
......
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -30,13 +27,11 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Config.Type)} ={demodel.Type}";
}
string sql = $@"
SELECT * From RB_Activity_Config r
WHERE {where}
ORDER BY r.Id DESC ";
return Get<RB_Activity_Config_ViewModel>(sql).ToList();
}
}
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -22,7 +19,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetList(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -55,8 +51,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.ActivityName)} like '%{demodel.ActivityName}%'";
}
string sql = $@" select r.* from RB_Activity_PeriodsDetail r where {where} order by r.Id asc";
return Get<RB_Activity_PeriodsDetail_ViewModel>(sql).ToList();
}
......@@ -69,7 +63,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetPageList(int pageIndex,int pageSize,out long count,RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -110,7 +103,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.DSUserName)} like '%{demodel.DSUserName}%'";
}
string sql = $@" select r.* from RB_Activity_PeriodsDetail r where {where} order by r.Id asc";
return GetPage<RB_Activity_PeriodsDetail_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
......@@ -123,7 +115,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetActivityCommissionUserList(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -152,8 +143,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.OrderId)} ={demodel.OrderId}";
}
string sql = $@" select r.UserId,r.Depart_Id,r.School_Id,sum(r.CommissionMoney) as CommissionMoney
from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.School_Id";
return Get<RB_Activity_PeriodsDetail_ViewModel>(sql).ToList();
......@@ -167,7 +156,6 @@ from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.S
public decimal GetSellCommissionStatistics(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -208,11 +196,9 @@ from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.S
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.DSUserName)} like '%{demodel.DSUserName}%'";
}
string sql = $@" select sum(r.CommissionMoney) from RB_Activity_PeriodsDetail r where {where}";
var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToDecimal(obj);
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -21,7 +18,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_Periods_ViewModel> GetList(RB_Activity_Periods_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -34,7 +30,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Periods)} ='{demodel.Periods}'";
}
string sql = $@" select r.* from RB_Activity_Periods r where {where} order by r.Id desc";
return Get<RB_Activity_Periods_ViewModel>(sql).ToList();
}
......@@ -50,7 +45,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_Periods_ViewModel> GetPageList(int pageIndex, int pageSize, out long count, RB_Activity_Periods_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -59,10 +53,8 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Name)} like '%{demodel.Name}%'";
}
string sql = $@" select r.* from RB_Activity_Periods r where {where} order by r.Id desc";
return GetPage<RB_Activity_Periods_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Advertising;
using Edu.Model.ViewModel.Advertising;
......@@ -28,8 +26,6 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Extend> GetAdvertisingList(int pageIndex, int pageSize, out long count, string advName, int IsFee, int RB_Group_id)
{
string where = $@" where 1=1 and A.{nameof(Rb_Advertising.Group_Id)}={RB_Group_id} and A.{nameof(Rb_Advertising.Status)}=0";
if (IsFee > 0)
{
where += $@" and A.{nameof(Rb_Advertising.IsFee)}={IsFee}";
......@@ -54,7 +50,6 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Extend> GetAdvertsingListForComboBox( string advName, int RB_Group_id)
{
string where = $@" where 1=1 and {nameof(Rb_Advertising.Group_Id)}={RB_Group_id} and {nameof(Rb_Advertising.Status)}=0";
if (!string.IsNullOrWhiteSpace(advName))
{
where += $@" and {nameof(Rb_Advertising.Title)} like '%{advName}%'";
......@@ -62,4 +57,4 @@ namespace Edu.Repository.Advertising
return Get<Rb_Advertising_Extend>($@"select * from {nameof(Rb_Advertising)} {where} order by {nameof(Rb_Advertising.CreateDate)} desc").ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Advertising;
using Edu.Model.ViewModel.Advertising;
......@@ -14,7 +12,6 @@ namespace Edu.Repository.Advertising
/// </summary>
public string TableName { get { return nameof(Rb_Advertising_Make); } }
/// <summary>
/// 获取创建的广告信息
/// </summary>
......@@ -25,24 +22,19 @@ namespace Edu.Repository.Advertising
/// <returns></returns>
public List<Rb_Advertising_Make_Extend> GetPage(int pageIndex, int pageSize, Rb_Advertising_Make_Extend model, out long count)
{
string where = $@" where 1=1 and {nameof(Rb_Advertising_Make.Status)}={(int)Common.Enum.DateStateEnum.Normal}";
if (model.School_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.School_Id)}={model.School_Id}";
}
if (model.Group_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.Group_Id)}={model.Group_Id}";
}
if (model.UpdateBy > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.UpdateBy)}={model.UpdateBy}";
}
string sql = $@" select * from {TableName} {where} ";
return GetPage<Rb_Advertising_Make_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......@@ -55,15 +47,12 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Make_Extend> Get(Rb_Advertising_Make_Extend model)
{
string where = $@" where 1=1 and A.{nameof(Rb_Advertising_Make.Status)}={(int)Common.Enum.DateStateEnum.Normal}";
if (model.School_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.School_Id)}={model.School_Id}";
}
if (model.Group_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.Group_Id)}={model.Group_Id}";
}
if (model.UpdateBy > 0)
......@@ -78,22 +67,5 @@ namespace Edu.Repository.Advertising
ON A.AdvertisingID = B.ID {where}";
return Get<Rb_Advertising_Make_Extend>(sql).ToList();
}
/// <summary>
/// 获取广告信息
/// </summary>
/// <param name="ids">广告id</param>
/// <returns></returns>
public List<Rb_Advertising_Make_Extend> GetListByIds(List<int> ids)
{
List<Rb_Advertising_Make_Extend> sellAdvertisingList = new List<Rb_Advertising_Make_Extend>();
if (ids.Count > 0)
{
string sql = $@" SELECT * from Rb_Advertising_Make a where a.ID in ({string.Join(",", ids)}) and a.`Status` = 0";
sellAdvertisingList = Get<Rb_Advertising_Make_Extend>(sql).ToList();
}
return sellAdvertisingList;
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
......@@ -36,4 +35,4 @@ namespace Edu.Repository.App
return Get<RB_HomePage_Banner>(builder.ToString()).ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
......
using Edu.Common.Enum.Course;
using Edu.Model.Entity.BackClass;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.EduTask;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.BackClass;
using Edu.Model.ViewModel.Contract;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.EduTask;
using Edu.Model.ViewModel.Sell;
using Edu.Repository.Contract;
using Edu.Repository.Course;
using Edu.Repository.EduTask;
using Edu.Repository.Sell;
using System;
......@@ -137,7 +134,6 @@ WHERE 1=1 ");
//更新退课协议审核状态
flag = backClass_ProtocolRepository.Update(backprotocolFileds, new WhereHelper(nameof(RB_BackClass_Protocol_ViewModel.BackId), backModel.BackId));
}
if (flag)
{
var guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { OrderId = backModel.OrderId });
......@@ -150,7 +146,6 @@ WHERE 1=1 ");
};
flag = orderRepository.Update(orderFileds, new WhereHelper(nameof(RB_Order.OrderId), backModel.OrderId));
}
}
if (flag)
{
......
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Course;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Sell;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -32,11 +29,11 @@ namespace Edu.Repository.BackClass
SELECT A.*,C.GuestName, D.ClassName,E.CourseName,F.TeacherName,G.RoomName,C.GuestState,H.StartTime,H.EndTime,H.TimeHour
FROM RB_Student_Makeup AS A LEFT JOIN rb_class_check AS B ON A.ClassCheckId=B.ClassCheckId
LEFT JOIN rb_order_guest AS C ON A.OrderGuestId=C.Id
LEFT JOIN rb_class AS D ON A.ClassId=D.ClassId
LEFT JOIN rb_course AS E ON D.CouseId=E.CourseId
LEFT JOIN rb_teacher AS F ON B.TeacherId=F.TId
LEFT JOIN rb_class_room AS G ON B.ClassRoomId=G.RoomId
LEFT JOIN rb_class_time AS H ON B.ClassTimeId=H.ClassTimeId
LEFT JOIN rb_class AS D ON A.ClassId=D.ClassId
LEFT JOIN rb_course AS E ON D.CouseId=E.CourseId
LEFT JOIN rb_teacher AS F ON B.TeacherId=F.TId
LEFT JOIN rb_class_room AS G ON B.ClassRoomId=G.RoomId
LEFT JOIN rb_class_time AS H ON B.ClassTimeId=H.ClassTimeId
WHERE 1=1 and B.CheckStatus IN(1,2)
");
if (query != null)
......@@ -163,4 +160,4 @@ WHERE 1=1
return base.Exists("Id", whereHelpers);
}
}
}
}
\ No newline at end of file
......@@ -39,4 +39,4 @@ WHERE 1=1
return Get<RB_Personnel_BonusDetail_Extend>(builder.ToString()).ToList();
}
}
}
}
\ No newline at end of file
......@@ -73,5 +73,4 @@ WHERE 1=1
return newId > 0;
}
}
}
}
\ No newline at end of file
......@@ -28,7 +28,6 @@ namespace Edu.Repository.Bonus
public List<RB_Personnel_Bonus_Extend> GetPersonnelBonusPageRepository(int pageIndex,int pageSize,out long rowsCount, RB_Personnel_Bonus_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Personnel_Bonus AS A
......@@ -66,7 +65,6 @@ WHERE 1=1
public List<RB_Personnel_Bonus_Extend> GetPersonnelBonusListRepository(RB_Personnel_Bonus_Extend query,bool isGetDetail=false)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Personnel_Bonus AS A
......@@ -137,6 +135,5 @@ WHERE 1=1
string sql = string.Format(@" UPDATE RB_Personnel_Bonus SET IsIssue=1 WHERE Id IN({0})", Ids);
return base.Execute(sql) > 0;
}
}
}
}
\ No newline at end of file
......@@ -10,7 +10,6 @@ namespace Edu.Repository.Contract
/// </summary>
public class RB_Education_ContractAdjustRepository : BaseRepository<RB_Education_ContractAdjust>
{
/// <summary>
/// 获取列表
/// </summary>
......
using Edu.Common.Enum;
using Edu.Model.Entity.Contract;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Contract;
using Edu.Model.ViewModel.Contract;
using Edu.Model.ViewModel.Course;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
......@@ -293,7 +290,6 @@ left join {datebaseStr}.rb_tradeway t on f.FrID = t.FinanceId
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
......@@ -368,82 +364,6 @@ left join {datebaseStr}.rb_tradeway t on f.FrID = t.FinanceId
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetEducationContractPageListRepository_V3(int pageIndex, int pageSize, out long rowsCount, RB_Education_Contract_ViewModel demodel)
{
DynamicParameters parameters = new DynamicParameters();
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.CType > 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
if (!string.IsNullOrEmpty(demodel.ContractNo))
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.ContractNo)} LIKE @ContractNo ";
parameters.Add("ContractNo", "%" + demodel.ContractNo.Trim() + "%");
}
if (!string.IsNullOrEmpty(demodel.StudentName))
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.StudentName)} LIKE @StudentName ";
parameters.Add("StudentName", "%" + demodel.StudentName.Trim() + "%");
}
if (demodel.IsAduit == 1)
{
if (demodel.Status >= 0)
{
if (demodel.Status == 5)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} in( 5,2)";
}
else
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
}
}
else
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} NOT IN(0,4) ";
}
}
else
{
if (demodel.CreateBy > 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.CreateBy)} ={demodel.CreateBy}";
}
if (demodel.Status >= 0)
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
}
}
string sql = $@" SELECT * FROM RB_Education_Contract WHERE {where} ORDER BY Id DESC ";
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
}
/// <summary>
/// 根据学生id获取学生的有效合同信息
/// </summary>
......
......@@ -26,7 +26,7 @@ SELECT A.*,IFNULL(B.CateName,'') AS CateName
FROM RB_Course AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
......@@ -80,7 +80,7 @@ WHERE 1=1
//所属科目
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseSubject),query.CourseSubject);
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseSubject), query.CourseSubject);
}
}
return Get<RB_Course_ViewModel>(builder.ToString(), parameters).ToList();
......@@ -105,8 +105,6 @@ FROM RB_Course AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_ViewModel.Group_Id), query.Group_Id);
//builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_ViewModel.School_Id), query.School_Id);
if (query != null)
{
if ((int)query.Status > -1)
......@@ -156,14 +154,14 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseSubject), (int)query.CourseSubject);
}
}
return GetPage<RB_Course_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
return GetPage<RB_Course_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 查询所有正常课程的章节信息
/// </summary>
/// <returns></returns>
public List<RB_Course_ViewModel> GetCourseAllChapterCount(int groupId,int courseId)
public List<RB_Course_ViewModel> GetCourseAllChapterCount(int groupId, int courseId)
{
StringBuilder sql = new StringBuilder("select CourseId,CourseName,(select Count(0) from rb_course_chapter b where b.CourseId=a.CourseId and ParentId=0 and b.`Status`=0) as UnitCount,(select Count(0) from rb_course_chapter b where b.CourseId=a.CourseId and ParentId>0 and b.`Status`=0) as ChapterCount from rb_course a where Status=0");
sql.AppendFormat(" AND a.{0}={1} ", nameof(RB_Course_ViewModel.Group_Id), groupId);
......
using Edu.Common.Enum;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......
......@@ -40,7 +40,6 @@ WHERE 1=1
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Course_Notice_ViewModel.CourseId), query.CourseIds);
}
}
return GetPage<RB_Course_Notice_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
......
......@@ -43,10 +43,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Offer_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
//builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Offer_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Course_Offer_ViewModel.Name));
......@@ -134,10 +130,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Offer_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
//builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Offer_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Course_Offer_ViewModel.Name));
......
......@@ -38,16 +38,5 @@ WHERE 1=1
}
return Get<RB_Course_StepPrice_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 根据课程编号删除课程阶梯价格
/// </summary>
/// <param name="CourseId"></param>
/// <returns></returns>
public bool DeleteStepPriceRepository(int CourseId)
{
bool flag = base.DeleteOne(new VT.FW.DB.WhereHelper(nameof(RB_Course_StepPrice_ViewModel.CourseId), CourseId));
return flag;
}
}
}
......@@ -40,6 +40,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Words_Extend.CourseId), query.CourseId);
}
if (query.ChapterId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Words_Extend.ChapterId), query.ChapterId);
}
if (!string.IsNullOrEmpty(query.QCourseIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_Words_Extend.CourseId), query.QCourseIds);
......@@ -48,8 +52,6 @@ WHERE 1=1
return GetPage<RB_Course_Words_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取课程单词列表
/// </summary>
......
......@@ -26,7 +26,6 @@ SELECT A.*
FROM RB_Question AS A INNER JOIN rb_question_bank AS B ON A.BankId=B.BankId
WHERE 1=1 AND B.Status=0
");
if (query == null)
{
return new List<RB_Question_ViewModel>();
......@@ -89,7 +88,6 @@ WHERE 1=1 AND B.Status=0 AND A.Status=0
}
}
/// <summary>
/// 获取问题分页列表
/// </summary>
......@@ -167,6 +165,5 @@ WHERE 1=1
builder.AppendFormat(" UPDATE RB_Question SET LevelType={0} WHERE QuestionId IN ({1}) ", (int)levelTypeEnum, string.Join(",", questionIdList));
return base.Execute(builder.ToString()) > 0;
}
}
}
\ No newline at end of file
......@@ -55,6 +55,5 @@ WHERE 1=1 ");
return GetPage<RB_Question_Bank_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
}
\ No newline at end of file
......@@ -130,7 +130,6 @@ WHERE 1=1
var startTime = query.ClassDateStr + " " + query.ClassTime + ":00";
var endTime= query.ClassDateStr + " " + query.EndTime + ":00";
StringBuilder builder = new StringBuilder();
//CONCAT(substring(C.ClassDate,1,10),' ',C.ClassTime,':00') AS StartTime,CONCAT(substring(C.ClassDate,1,10),' ',C.EndTime,':00') AS EndTime
builder.AppendFormat(@"
SELECT 1
FROM RB_Reserve_Class c
......
......@@ -170,7 +170,6 @@ WHERE 1=1 {0}
return Get<RB_Visitor_Reserve_Extend>(sql, parameters).ToList();
}
/// <summary>
/// 根据约课信息获取访客列表
/// </summary>
......
......@@ -807,18 +807,25 @@ WHERE g.`Status` =0 and g.Group_Id ={groupId} and o.OrderState <>3 and o.OrderTy
/// 获取学生课时 请假 缺席
/// </summary>
/// <param name="guestId"></param>
/// <param name="group_Id"></param>
/// <param name="classId"></param>
/// <returns></returns>
public RB_Order_Guest_Extend GetOrderGusetHoursInfo(int guestId, int classId)
{
string sql = $@"
SELECT A.* ,IFNULL(gc.AbsenceNum,0) AS AbsenceNum,IFNULL(gc.LeaveNum,0) AS LeaveNum
SELECT A.* ,IFNULL(gc.AbsenceNum,0) AS AbsenceNum,IFNULL(gc2.LeaveNum,0) AS LeaveNum
FROM RB_Order_Guest AS A
LEFT JOIN (
SELECT OrderGuestId,SUM(CASE CheckStatus WHEN 1 THEN 1 ELSE 0 END) AS AbsenceNum,SUM(CASE CheckStatus WHEN 2 THEN 1 ELSE 0 END) AS LeaveNum
SELECT OrderGuestId,SUM(CurrentDeductionHours) AS AbsenceNum
FROM rb_class_check
WHERE `Status`=0 and CheckStatus <>0 and ClassId ={classId} GROUP BY OrderGuestId
WHERE Status=0 AND CheckStatus=1 AND ClassId ={classId} AND OrderGuestId={guestId}
GROUP BY OrderGuestId
) AS gc on gc.OrderGuestId=a.Id
LEFT JOIN (
SELECT OrderGuestId,SUM(CurrentDeductionHours) AS LeaveNum
FROM rb_class_check
WHERE Status=0 AND CheckStatus=1 AND ClassId ={classId} AND OrderGuestId={guestId}
GROUP BY OrderGuestId
) AS gc2 on gc2.OrderGuestId=a.Id
WHERE A.Id ={guestId}
";
return Get<RB_Order_Guest_Extend>(sql).FirstOrDefault();
......
......@@ -93,4 +93,4 @@ WHERE 1=1
return extModel;
}
}
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Model.Entity.System;
using Edu.Model.ViewModel.System;
using System.Collections.Generic;
using System.Linq;
......@@ -17,7 +16,7 @@ namespace Edu.Repository.System
/// <param name="isQueryPermission">是否只查询权限菜单</param>
/// <param name="roleId">角色编号</param>
/// <returns></returns>
public List<RB_Menu_ViewModel> GetMenuListRepository(RB_Menu_ViewModel query,bool isQueryPermission=false,int roleId=0)
public List<RB_Menu_ViewModel> GetMenuListRepository(RB_Menu_ViewModel query, bool isQueryPermission = false, int roleId = 0)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
......@@ -41,7 +40,7 @@ WHERE 1=1
}
if (query.MenuLevel > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Menu_ViewModel.MenuLevel),query.MenuLevel);
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Menu_ViewModel.MenuLevel), query.MenuLevel);
}
if (query.MenuId > 0)
{
......@@ -60,11 +59,11 @@ WHERE 1=1
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Menu_ViewModel.IsUserCenter), query.IsUserCenter);
}
}
if (isQueryPermission && roleId>0)
if (isQueryPermission && roleId > 0)
{
builder.AppendFormat(" AND MenuId IN(SELECT Menu_Id FROM RB_Role_Permission WHERE Role_Id={0}) ", roleId);
}
return Get<RB_Menu_ViewModel>(builder.ToString(),parameters).ToList();
return Get<RB_Menu_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
......@@ -84,7 +83,6 @@ SELECT *
FROM rb_menu
WHERE 1=1
");
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.MenuName))
......@@ -119,7 +117,7 @@ WHERE 1=1
}
}
builder.AppendFormat(" ORDER BY {0} DESC ", nameof(RB_Menu_ViewModel.MenuId));
return GetPage<RB_Menu_ViewModel>(pageIndex,pageSize,out rowsCount, builder.ToString(), parameters).ToList();
return GetPage<RB_Menu_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
......@@ -128,7 +126,7 @@ WHERE 1=1
/// <param name="postIds"></param>
/// <param name="menuType"></param>
/// <returns></returns>
public List<RB_Menu_ViewModel> GetPostMenuListRepository(string postIds,int menuType, int teamType)
public List<RB_Menu_ViewModel> GetPostMenuListRepository(string postIds, int menuType, int teamType)
{
if (string.IsNullOrEmpty(postIds))
{
......
......@@ -91,7 +91,8 @@ WHERE 1=1
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.MenuName,'') AS MenuName,IFNULL(B.MenuUrl,'') AS MenuUrl
FROM RB_Menu_Function AS A LEFT JOIN rb_menu AS B ON A.MenuId=B.MenuId
WHERE 1=1 AND A.Status=0 AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({0})))
WHERE 1=1 AND A.Status=0
AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({0})))
", postIds);
return Get<RB_Menu_Function_ViewModel>(builder.ToString()).ToList();
}
......@@ -117,7 +118,8 @@ WHERE 1=1 AND A.Status=0 AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermi
builder.AppendFormat(@"
SELECT 1
FROM RB_Menu_Function AS A
WHERE 1=1 AND A.FunctionCode='{0}' AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
WHERE 1=1 AND A.FunctionCode='{0}'
AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
", actionCode.Trim(), postIds);
var obj = base.ExecuteScalar(builder.ToString());
if (obj != null)
......
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.System;
using Edu.Model.ViewModel.System;
namespace Edu.Repository.System
{
public class RB_Menu_InformationRepository:BaseRepository<RB_Menu_Information>
/// <summary>
/// 系统菜单消息(气泡)仓储层
/// </summary>
public class RB_Menu_InformationRepository : BaseRepository<RB_Menu_Information>
{
/// <summary>
/// 根据where获取菜单列表
......
......@@ -33,10 +33,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.School_Id), query.School_Id);
}
if (query.RoleId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.RoleId), query.RoleId);
......@@ -74,10 +70,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.Status), (int)query.Status);
}
//if (query.School_Id > 0)
//{
// builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.School_Id), query.School_Id);
//}
if (query.RoleId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Role_ViewModel.RoleId), query.RoleId);
......
......@@ -22,11 +22,9 @@ namespace Edu.Repository.System
public List<RB_Stage_ViewModel> GetPeersCustomerStageCount(int gid, int id)
{
string sql = "select Id,StageName,`No`,(select Count(0) from rb_Student where CustomerId=@id and StuStage=a.Id) as ChildCount from rb_stage a where Group_Id=@gid order by `No`";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("gid", gid);
parameters.Add("id", id);
return Get<RB_Stage_ViewModel>(sql, parameters).ToList();
}
......
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.System;
......@@ -8,13 +7,6 @@ namespace Edu.Repository.System
{
public class RB_System_HolidayRepository : BaseRepository<RB_System_Holiday>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_System_Holiday); } }
/// <summary>
/// 节假日列表
/// </summary>
......@@ -27,23 +19,19 @@ namespace Edu.Repository.System
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat(@" SELECT a.* from RB_System_Holiday as a where 1=1");
sb.AppendFormat(" AND A.{0}={1} ", nameof(RB_System_Holiday.Status), (int)Common.Enum.DateStateEnum.Normal);
if (model.HolidayId > 0)
{
sb.AppendFormat(" AND A.{0}={1} ", nameof(RB_System_Holiday.HolidayId), model.HolidayId);
}
if (model.Group_Id > 0)
{
sb.AppendFormat(" AND A.{0}={1} ", nameof(RB_System_Holiday.Group_Id), model.Group_Id);
}
if (model.StartTime.HasValue)
{
sb.AppendFormat(" AND DATE_FORMAT(A.{0}, '%y/%m/%d') >= DATE_FORMAT('{1}', '%y/%m/%d') ", nameof(RB_System_Holiday.StartTime), model.StartTime.Value.ToString("yyyy-MM-dd"));
}
if (model.EndTime.HasValue)
{
sb.AppendFormat(" AND DATE_FORMAT(A.{0}, '%y/%m/%d') <= DATE_FORMAT('{1}', '%y/%m/%d') ", nameof(RB_System_Holiday.StartTime), model.EndTime.Value.ToString("yyyy-MM-dd"));
......@@ -60,8 +48,6 @@ namespace Edu.Repository.System
return GetPage<RB_System_Holiday>(pageIndex, pageSize, out count, sb.ToString()).ToList();
}
/// <summary>
/// 判断某一天是否在节假日里
/// </summary>
......@@ -74,9 +60,6 @@ namespace Edu.Repository.System
return Get<RB_System_Holiday>(sql).ToList();
}
/// <summary>
/// 判断某一个时间段是否在节假日里
/// </summary>
......@@ -93,7 +76,5 @@ AND DATE_FORMAT(EndTime, '%y/%m/%d') >= DATE_FORMAT('{endTime}', '%y/%m/%d'))
) ";
return Get<RB_System_Holiday>(sql).ToList();
}
}
}
......@@ -73,7 +73,6 @@ namespace Edu.Repository.User
return GetPage<RB_AccountRemark_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
......@@ -122,6 +121,7 @@ ORDER BY DATE_FORMAT(CreateTime,'%Y-%m-%d') DESC
";
return GetPage<RB_AccountRemark_ViewList>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
......@@ -163,4 +163,4 @@ ORDER BY DATE_FORMAT(CreateTime,'%Y-%m-%d') DESC
return Get<RB_AccountRemark_ViewModel>(sql).ToList();
}
}
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ namespace Edu.Repository.User
/// <summary>
/// 学生仓储层
/// </summary>
public class RB_StudentRepository : BaseRepository<Model.Entity.User.RB_Student>
public class RB_StudentRepository : BaseRepository<RB_Student>
{
/// <summary>
/// 账号
......@@ -133,7 +133,6 @@ WHERE 1=1
public int GetStudentOrderCount(int studentId)
{
var sql = "select Count(0) from rb_student_orderguest a left join rb_order b on a.OrderId=b.OrderId where a.Student_Id=@stuId and b.OrderState!=3";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("stuId",studentId);
var result = ExecuteScalar(sql, parameters);
......
......@@ -28,7 +28,7 @@ SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,I
FROM RB_Student_OrderGuest AS A INNER JOIN rb_class AS B ON A.ClassId=B.ClassId
INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
INNER JOIN rb_order_guest AS D ON A.GuestId=D.Id
WHERE 1=1
WHERE 1=1 AND C.OrderState<>3
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
......
......@@ -106,12 +106,13 @@ namespace Edu.WebApi.Controllers.Applet
//获取课程
var courseModel = courseModule.GetCourseModule(LearningInfo.CourseId);
//获取课时信息
var guestModel = orderModule.GetOrderGusetHoursInfo(LearningInfo.GuestId, userInfo.Group_Id);
var guestModel = orderModule.GetOrderGusetHoursInfo(LearningInfo.GuestId, LearningInfo.ClassId);
CourseInfo = new
{
State = 1,
TotalHours = guestModel?.TotalHours ?? 0,
CompleteHours = guestModel?.CompleteHours ?? 0,
MakeUpHours= guestModel?.MakeUpHours??0,
AbsenceNum = guestModel?.AbsenceNum ?? 0,
LeaveNum = guestModel?.LeaveNum ?? 0,
CourseId = courseModel?.CourseId ?? 0,
......
......@@ -452,7 +452,7 @@ namespace Edu.WebApi.Controllers.Customer
[HttpPost]
public ApiResult SetStudentAssist()
{
var AssistList = new List<RB_Student_Assist_Extend>();
//var AssistList = new List<RB_Student_Assist_Extend>();
var StuId = base.ParmJObj.GetInt("StuId");
var model = new RB_Student_Assist_Extend()
{
......@@ -470,6 +470,17 @@ namespace Edu.WebApi.Controllers.Customer
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 批量添加课程顾问
/// </summary>
/// <returns></returns>
public ApiResult SetStudentAssistBatch()
{
var stuIds = base.ParmJObj.GetStringValue("stuIds");
var result = customerStudentModule.SetStudentAssistBatchModule(stuIds,base.UserInfo.Id);
return result.result ? ApiResult.Success(message: result.msg) : ApiResult.Failed(message: result.msg);
}
/// <summary>
/// 删除协同人员
/// </summary>
......
......@@ -227,6 +227,7 @@ namespace Edu.WebApi.Controllers.User
Email = model.Email,
IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0,
IsMarket= (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0,
ActionMenuList = actionList?.Select(qitem => new { qitem.FunctionCode, qitem.FunctionName, qitem.MenuName, qitem.MenuUrl }),
UploadConfig = new
{
......
......@@ -759,6 +759,8 @@ namespace Edu.WebApi.Controllers.User
item.StuNeeds,
item.StuNeedsName,
item.StuRealMobile,
item.OrderCount,
item.RenewOrderCount,
});
}
pageModel.Count = rowsCount;
......@@ -868,8 +870,24 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.Failed("此学员微信号已绑定同行!请重新录入!");
}
var isInsert = extModel.StuId == 0;
bool flag = studentModule.SetStudentModule(extModel);
if (flag && isInsert)
{
if (base.UserInfo.IsCourseConsultant == 1)
{
//课程顾问创建学员,默认写入顾问信息
var assistModel = new RB_Student_Assist_Extend()
{
Id = 0,
AssistId = base.UserInfo.Id,
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
StuId = extModel.StuId,
Status = Common.Enum.DateStateEnum.Normal
};
new CustomerStudentModule().SetStudentAssistModule(extModel.StuId, assistModel, base.UserInfo.Id);
}
}
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
......@@ -1109,7 +1127,7 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.Failed("此学员微信号已绑定同行!请重新录入!");
}
bool flag = studentModule.SetStudentModule(extModel, 1);
bool flag = studentModule.SetStudentModule(extModel, fromApp:1);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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