Commit 8c121015 authored by liudong1993's avatar liudong1993

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

parents 9a7387ad 46a5c297
......@@ -17,9 +17,9 @@ namespace Edu.Common.Enum.Course
Train = 1,
/// <summary>
/// 留学
/// 留学就业
/// </summary>
[EnumField("留学")]
[EnumField("留学就业")]
StudyAbroad = 2
}
}
......@@ -55,18 +55,7 @@ namespace Edu.Common.Plugin
{
//TimeSpan表示时间间隔
TimeSpan span = (DateTime.Now - dt).Duration();//表示取timespan绝对值
//if (span.TotalDays > 60)
//{
// return dt.ToString("yyyy-MM-dd");
//}
//else if (span.TotalDays > 30)
//{
// return "1个月前";
//}
//else if (span.TotalDays > 14)
//{
// return "2周前";
//}
if (dt.Year == DateTime.Now.Year)
{
if (span.TotalDays > 7)
......
......@@ -15,7 +15,7 @@ namespace Edu.Model.Entity.Course
public class RB_Education_Contract
{
/// <summary>
/// Id
/// 合同主键编号
/// </summary>
public int Id { get; set; }
......@@ -24,154 +24,324 @@ namespace Edu.Model.Entity.Course
/// </summary>
public ContractTypeEnum CType { get; set; }
/// <summary>
/// 关联订单id
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 合同编号
/// </summary>
public string ContractNo { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string StudentName { get; set; }
/// <summary>
/// 学校名称
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 课程内容
/// </summary>
public string CourseContent { get; set; }
/// <summary>
/// 大写金额
/// </summary>
public string CNYCaps { get; set; }
/// <summary>
/// 金额
/// </summary>
public string Money { get; set; }
/// <summary>
/// 乙方当前选择考试
/// </summary>
public string Exam { get; set; }
/// <summary>
/// 旅游代表签名
/// </summary>
public string Sign { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 状态(0-草稿,1-提交审核,2-审核通过,3-驳回,4-取消)
/// </summary>
public int Status { get; set; }
/// <summary>
/// 是否盖章(0-未盖章,1-已盖章)
/// </summary>
public int IsCompanySeal { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime? AuditDate { get; set; }
/// <summary>
/// 签名时间
/// </summary>
public DateTime? SignDate { get; set; }
/// <summary>
/// 盖章时间
/// </summary>
public DateTime? SealDate { get; set; }
/// <summary>
/// 审核人
/// </summary>
public int AuditEmpId { get; set; }
/// <summary>
/// 学生名单id
/// </summary>
public int GuestId { get; set; }
/// <summary>
/// 性别 1男 2女 0未设置
/// </summary>
public int Sex { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IDCard { get; set; }
/// <summary>
/// 身份证居住地
/// </summary>
public string Domicile { get; set; }
/// <summary>
/// 联系地址
/// </summary>
public string ContactAddress { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string ContactMobile { get; set; }
/// <summary>
/// 紧急联系人
/// </summary>
public string EmergencyContact { get; set; }
/// <summary>
/// 紧急联系电话
/// </summary>
public string EmergencyMobile { get; set; }
}
/// <summary>
/// 关联订单id
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 学生名单id
/// </summary>
public int GuestId { get; set; }
/// <summary>
/// 合同编号
/// </summary>
public string ContractNo { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string StudentName { get; set; }
/// <summary>
/// 学生生日
/// </summary>
public DateTime StuBirth { get; set; }
/// <summary>
/// 学生性别(0-男,1-女)
/// </summary>
public int StuSex { get; set; }
/// <summary>
/// 学生地址
/// </summary>
public string StuAddress { get; set; }
/// <summary>
/// 学生电话
/// </summary>
public string StuTel { get; set; }
/// <summary>
/// 学生邮箱
/// </summary>
public string StuEmail { get; set; }
/// <summary>
/// 家长姓名
/// </summary>
public string ParentName { get; set; }
/// <summary>
/// 家长与学员关系
/// </summary>
public string ParentRelation { get; set; }
/// <summary>
/// 家长电话
/// </summary>
public string ParentTel { get; set; }
/// <summary>
/// 家长邮箱
/// </summary>
public string ParentEmail { get; set; }
/// <summary>
/// 紧急联系人姓名
/// </summary>
public string UrgentName { get; set; }
/// <summary>
/// 紧急联系人与学生关系
/// </summary>
public string UrgentRelation { get; set; }
/// <summary>
/// 紧急联系人电话
/// </summary>
public string UrgentTel { get; set; }
/// <summary>
/// 紧急联系人邮箱
/// </summary>
public string UrgentEmail { get; set; }
/// <summary>
/// 监护人身份证后4位
/// </summary>
public string GuardianIDCard { get; set; }
/// <summary>
/// 培训课程内容
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 校区名称
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 校区负责人
/// </summary>
public string SchoolPrincipal { get; set; }
/// <summary>
/// 起始级别
/// </summary>
public string StartLevel { get; set; }
/// <summary>
/// 课程顾问
/// </summary>
public string CourseConsultant { get; set; }
/// <summary>
/// 收款人
/// </summary>
public string Payee { get; set; }
/// <summary>
/// 第一期-培训课时数
/// </summary>
public int FirstClassHours { get; set; }
/// <summary>
/// 第一期-培训课程费
/// </summary>
public decimal FirstCourseFee { get; set; }
/// <summary>
/// 第一期-培训教材费
/// </summary>
public decimal FirstBookFee { get; set; }
/// <summary>
/// 第一期-培训课件费
/// </summary>
public decimal FirstClassFee { get; set; }
/// <summary>
/// 第一期-折让价格
/// </summary>
public decimal FirstDiscountMoney { get; set; }
/// <summary>
/// 第一期-费用总计
/// </summary>
public decimal FirstMoney { get; set; }
/// <summary>
/// 第一期-支付日期
/// </summary>
public DateTime FirstPayDate { get; set; }
/// <summary>
/// 第二期-培训课时数
/// </summary>
public int SecondClassHours { get; set; }
/// <summary>
/// 第二期-培训课程费
/// </summary>
public decimal SecondCourseFee { get; set; }
/// <summary>
/// 第二期-培训教材费
/// </summary>
public decimal SecondBookFee { get; set; }
/// <summary>
/// 第二期-培训课件费
/// </summary>
public decimal SecondClassFee { get; set; }
/// <summary>
/// 第二期-折让价格
/// </summary>
public decimal SecondDiscountMoney { get; set; }
/// <summary>
/// 第二期-费用总计
/// </summary>
public decimal SecondMoney { get; set; }
/// <summary>
/// 第二期-支付日期
/// </summary>
public DateTime SecondPayDate { get; set; }
/// <summary>
/// 第三期-培训课时数
/// </summary>
public int ThirdClassHours { get; set; }
/// <summary>
/// 第三期-培训课程费
/// </summary>
public decimal ThirdCourseFee { get; set; }
/// <summary>
/// 第三期-培训教材费
/// </summary>
public decimal ThirdBookFee { get; set; }
/// <summary>
/// 第三期-培训课件费
/// </summary>
public decimal ThirdClassFee { get; set; }
/// <summary>
/// 第三期-折让价格
/// </summary>
public decimal ThirdDiscountMoney { get; set; }
/// <summary>
/// 第三期-费用总计
/// </summary>
public decimal ThirdMoney { get; set; }
/// <summary>
/// 第三期-支付日期
/// </summary>
public DateTime ThirdPayDate { get; set; }
/// <summary>
/// 人民币大写金额
/// </summary>
public string CNYCaps { get; set; }
/// <summary>
/// 金额
/// </summary>
public decimal Money { get; set; }
/// <summary>
/// 乙方当前选择考试
/// </summary>
public string Exam { get; set; }
/// <summary>
/// 是否有补充协议(1-有)
/// </summary>
public int IsSupplement { get; set; }
/// <summary>
/// 学生签名
/// </summary>
public string Sign { get; set; }
/// <summary>
/// 签名时间
/// </summary>
public DateTime SignDate { get; set; }
/// <summary>
/// 监护人签字
/// </summary>
public string GuardianSign { get; set; }
/// <summary>
/// 监护人签字时间
/// </summary>
public DateTime GuardianSignDate { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime AuditDate { get; set; }
/// <summary>
/// 审核人id
/// </summary>
public int AuditEmpId { get; set; }
/// <summary>
/// 是否盖章(0-未盖章,1-已盖章)
/// </summary>
public int IsCompanySeal { get; set; }
/// <summary>
/// 盖章时间
/// </summary>
public DateTime SealDate { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 状态(0-草稿,1-提交审核,2-审核通过,3-驳回,4-取消)
/// </summary>
public int Status { get; set; }
}
}
......@@ -23,7 +23,7 @@ namespace Edu.Model.Entity.User
public string From { get; set; }
/// <summary>
/// 发送
/// 抄送部门(-1全公司)
/// </summary>
public string To { get; set; }
......
......@@ -26,7 +26,6 @@ namespace Edu.Model.Entity.User
/// </summary>
public string SAddress { get; set; }
/// <summary>
/// 联系电话
/// </summary>
......@@ -86,5 +85,10 @@ namespace Edu.Model.Entity.User
/// 负责人编号
/// </summary>
public int ManagerId { get; set; }
/// <summary>
/// 合同抬头
/// </summary>
public string ContractTitle { get; set; }
}
}
\ No newline at end of file
......@@ -26,6 +26,11 @@ namespace Edu.Model.Entity.Web
/// </summary>
public string ImgCover { get; set; }
/// <summary>
/// 选中图片
/// </summary>
public string CheckImg { get; set; }
/// <summary>
/// 删除状态
/// </summary>
......
......@@ -74,6 +74,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 校区负责人编号
/// </summary>
public int ManagerId { get; set; }
/// <summary>
/// 班级阶梯价列表
/// </summary>
......
......@@ -18,36 +18,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string CreateByPhoto { get; set; }
/// <summary>
/// 公司章
/// </summary>
public string CompanySealImage { get; set; }
/// <summary>
/// 合同公司名称
/// </summary>
public string ContractBranch { get; set; }
/// <summary>
/// 合同电话
/// </summary>
public string ContractTel { get; set; }
/// <summary>
/// 公司名称
/// </summary>
public string BranchName { get; set; }
/// <summary>
/// 法人代表
/// </summary>
public string LegalPerson { get; set; }
/// <summary>
/// 公司列表
/// </summary>
public List<string> BranchNList { get; set; }
/// <summary>
/// 学生名单ids
/// </summary>
......
......@@ -29,5 +29,10 @@ namespace Edu.Model.ViewModel.User
/// 部门id
/// </summary>
public int DeptId { get; set; }
/// <summary>
/// 查看时间
/// </summary>
public string LookTime { get; set; }
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
using Edu.Repository.User;
using Newtonsoft.Json.Linq;
......@@ -25,15 +26,95 @@ namespace Edu.Module.Course
/// 教育合同
/// </summary>
private readonly RB_Education_ContractRepository education_ContractRepository = new RB_Education_ContractRepository();
/// <summary>
/// 账号
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 集团仓储对象
/// </summary>
private readonly RB_GroupRepository groupRepository = new RB_GroupRepository();
/// <summary>
/// 校区仓储层对象
/// </summary>
private readonly RB_SchoolRepository schoolRepository = new RB_SchoolRepository();
/// <summary>
/// 订单仓储层对象
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 订单学员仓储层对象
/// </summary>
private readonly RB_Order_GuestRepository order_GuestRepository = new RB_Order_GuestRepository();
/// <summary>
/// 班级仓储层对象
/// </summary>
private readonly RB_ClassRepository classRepository = new RB_ClassRepository();
/// <summary>
/// 获取学员信息
/// </summary>
/// <param name="OrderId"></param>
/// <param name="GuestId"></param>
/// <returns></returns>
public object GetStudentInfoModule(int OrderId, int GuestId)
{
var obj = new object();
var glist = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel() { OrderId = OrderId, GuestState = 1 });
var orderModel = orderRepository.GetEntity(OrderId);
var guestModel = glist.Where(qitem=>qitem.Id==GuestId)?.FirstOrDefault();
var classModel =new RB_Class_ViewModel();
decimal PreferPrice = 0;//总金额
decimal DiscountMoney = 0;//优惠金额
decimal Money = 0;//实际金额
if (orderModel != null && orderModel.OrderId > 0)
{
if (orderModel.OrderType == Common.Enum.Sale.OrderTypeEnum.CourseOrder)
{
classModel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = orderModel.ClassId })?.FirstOrDefault();
}
}
var qids = (classModel?.ManagerId ?? 0).ToString() + "," + (orderModel?.EnterID ?? 0).ToString();
var empList= accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = qids }) ;
if (glist != null && glist.Count > 0)
{
PreferPrice = orderModel.PreferPrice / glist.Count();
DiscountMoney = orderModel.DiscountMoney / glist.Count();
Money = (orderModel.PreferPrice - orderModel.DiscountMoney) / glist.Count();//平均每人费用
}
string dxMoney = StringHelper.MoneyToUpper(Money.ToString());
obj = new
{
StudentName=guestModel?.GuestName??"",
StuBirth="",
StuSex=(guestModel?.Sex??0)==1?0:1,
StuAddress=guestModel?.ContactAddress??"",
StuTel= guestModel?.Mobile??"",
StuEmail="",
CourseName=classModel?.CourseName??"",
SchoolName=classModel?.SchoolName??"",
SchoolPrincipal= empList?.Where(qitem=>qitem.Id==(classModel?.ManagerId??0))?.FirstOrDefault()?.EmployeeName??"",
StartLevel=guestModel?.Basics??"",
CourseConsultant= empList?.Where(qitem => qitem.Id == (orderModel?.EnterID ?? 0))?.FirstOrDefault()?.EmployeeName ?? "",
Payee= empList?.Where(qitem => qitem.Id == (orderModel?.EnterID ?? 0))?.FirstOrDefault()?.EmployeeName ?? "",
FirstClassHours=classModel?.ClassHours??0,
FirstCourseFee= PreferPrice,
FirstBookFee =0,
FirstClassFee=0,
FirstDiscountMoney= DiscountMoney,
FirstMoney= Money,
CNYCaps= dxMoney,
Money,
};
return obj;
}
/// <summary>
/// 获取合同分页列表
......@@ -43,14 +124,15 @@ namespace Edu.Module.Course
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetEducationContractPageList(int pageIndex, int pageSize, out long count, RB_Education_Contract_ViewModel dmodel)
public List<RB_Education_Contract_ViewModel> GetEducationContractPageListModule(int pageIndex, int pageSize, out long count, RB_Education_Contract_ViewModel dmodel)
{
var list = education_ContractRepository.GetPageList(pageIndex, pageSize, out count, dmodel);
if (list.Any())
var list = education_ContractRepository.GetEducationContractPageListRepository(pageIndex, pageSize, out count, dmodel);
if (list != null &&list.Count>0)
{
var userIds = string.Join(",", list.Select(x => x.CreateBy).Distinct());
var alist = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel() { QIds = userIds });
foreach (var item in list) {
foreach (var item in list)
{
var amodel = alist.Where(x => x.Id == item.CreateBy).FirstOrDefault();
item.CreateByName = amodel?.AccountName ?? "";
item.CreateByPhoto = amodel?.UserIcon ?? "";
......@@ -63,99 +145,115 @@ namespace Edu.Module.Course
/// 单独新增/修改合同
/// </summary>
/// <param name="dmodel"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetEducationContractInfo(RB_Education_Contract_ViewModel dmodel, UserInfo userInfo)
public bool SetEducationContractModule(RB_Education_Contract_ViewModel model)
{
if (dmodel.Id > 0)
bool flag;
if (model.Id > 0)
{
dmodel.CNYCaps = StringHelper.MoneyToUpper(dmodel.Money.ToString());
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_Contract_ViewModel.StudentName),dmodel.StudentName},
{ nameof(RB_Education_Contract_ViewModel.SchoolName),dmodel.SchoolName},
{ nameof(RB_Education_Contract_ViewModel.CourseName),dmodel.CourseName},
{ nameof(RB_Education_Contract_ViewModel.CourseContent),dmodel.CourseContent},
{ nameof(RB_Education_Contract_ViewModel.CNYCaps),dmodel.CNYCaps},
{ nameof(RB_Education_Contract_ViewModel.Money),dmodel.Money},
{ nameof(RB_Education_Contract_ViewModel.Exam),dmodel.Exam},
{ nameof(RB_Education_Contract_ViewModel.UpdateBy),userInfo.Id},
{ nameof(RB_Education_Contract_ViewModel.UpdateTime),dmodel.UpdateTime},
{ nameof(RB_Education_Contract_ViewModel.Sex),dmodel.Sex},
{ nameof(RB_Education_Contract_ViewModel.IDCard),dmodel.IDCard},
{ nameof(RB_Education_Contract_ViewModel.Domicile),dmodel.Domicile},
{ nameof(RB_Education_Contract_ViewModel.ContactAddress),dmodel.ContactAddress},
{ nameof(RB_Education_Contract_ViewModel.ContactMobile),dmodel.ContactMobile},
{ nameof(RB_Education_Contract_ViewModel.EmergencyContact),dmodel.EmergencyContact},
{ nameof(RB_Education_Contract_ViewModel.EmergencyMobile),dmodel.EmergencyMobile},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Education_Contract_ViewModel.Id),
FiledValue=dmodel.Id,
OperatorEnum=OperatorEnum.Equal
}
model.CNYCaps = StringHelper.MoneyToUpper(model.Money.ToString());
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Education_Contract_ViewModel.StudentName),model.StudentName},
{ nameof(RB_Education_Contract_ViewModel.StuBirth),model.StuBirth},
{ nameof(RB_Education_Contract_ViewModel.StuSex),model.StuSex},
{ nameof(RB_Education_Contract_ViewModel.StuAddress),model.StuAddress},
{ nameof(RB_Education_Contract_ViewModel.StuTel),model.StuTel},
{ nameof(RB_Education_Contract_ViewModel.StuEmail),model.StuEmail},
{ nameof(RB_Education_Contract_ViewModel.ParentName),model.ParentName},
{ nameof(RB_Education_Contract_ViewModel.ParentRelation),model.ParentRelation},
{ nameof(RB_Education_Contract_ViewModel.ParentTel),model.ParentTel},
{ nameof(RB_Education_Contract_ViewModel.ParentEmail),model.ParentEmail},
{ nameof(RB_Education_Contract_ViewModel.UrgentName),model.UrgentName},
{ nameof(RB_Education_Contract_ViewModel.UrgentRelation),model.UrgentRelation},
{ nameof(RB_Education_Contract_ViewModel.UrgentTel),model.UrgentTel},
{ nameof(RB_Education_Contract_ViewModel.UrgentEmail),model.UrgentEmail},
{ nameof(RB_Education_Contract_ViewModel.GuardianIDCard),model.GuardianIDCard},
{ nameof(RB_Education_Contract_ViewModel.CourseName),model.CourseName},
{ nameof(RB_Education_Contract_ViewModel.SchoolName),model.SchoolName},
{ nameof(RB_Education_Contract_ViewModel.SchoolPrincipal),model.SchoolPrincipal},
{ nameof(RB_Education_Contract_ViewModel.StartLevel),model.StartLevel},
{ nameof(RB_Education_Contract_ViewModel.CourseConsultant),model.CourseConsultant},
{ nameof(RB_Education_Contract_ViewModel.Payee),model.Payee},
{ nameof(RB_Education_Contract_ViewModel.FirstClassHours),model.FirstClassHours},
{ nameof(RB_Education_Contract_ViewModel.FirstCourseFee),model.FirstCourseFee},
{ nameof(RB_Education_Contract_ViewModel.FirstBookFee),model.FirstBookFee},
{ nameof(RB_Education_Contract_ViewModel.FirstClassFee),model.FirstClassFee},
{ nameof(RB_Education_Contract_ViewModel.FirstDiscountMoney),model.FirstDiscountMoney},
{ nameof(RB_Education_Contract_ViewModel.FirstMoney),model.FirstMoney},
{ nameof(RB_Education_Contract_ViewModel.FirstPayDate),model.FirstPayDate},
{ nameof(RB_Education_Contract_ViewModel.SecondClassHours),model.SecondClassHours},
{ nameof(RB_Education_Contract_ViewModel.SecondCourseFee),model.SecondCourseFee},
{ nameof(RB_Education_Contract_ViewModel.SecondBookFee),model.SecondBookFee},
{ nameof(RB_Education_Contract_ViewModel.SecondClassFee),model.SecondClassFee},
{ nameof(RB_Education_Contract_ViewModel.SecondDiscountMoney),model.SecondDiscountMoney},
{ nameof(RB_Education_Contract_ViewModel.SecondMoney),model.SecondMoney},
{ nameof(RB_Education_Contract_ViewModel.SecondPayDate),model.SecondPayDate},
{ nameof(RB_Education_Contract_ViewModel.ThirdClassHours),model.ThirdClassHours},
{ nameof(RB_Education_Contract_ViewModel.ThirdCourseFee),model.ThirdCourseFee},
{ nameof(RB_Education_Contract_ViewModel.ThirdBookFee),model.ThirdBookFee},
{ nameof(RB_Education_Contract_ViewModel.ThirdClassFee),model.ThirdClassFee},
{ nameof(RB_Education_Contract_ViewModel.ThirdDiscountMoney),model.ThirdDiscountMoney},
{ nameof(RB_Education_Contract_ViewModel.ThirdMoney),model.ThirdMoney},
{ nameof(RB_Education_Contract_ViewModel.ThirdPayDate),model.ThirdPayDate},
{ nameof(RB_Education_Contract_ViewModel.CNYCaps),model.CNYCaps},
{ nameof(RB_Education_Contract_ViewModel.Money),model.Money},
{ nameof(RB_Education_Contract_ViewModel.Exam),model.Exam},
{ nameof(RB_Education_Contract_ViewModel.IsSupplement),model.IsSupplement},
};
return education_ContractRepository.Update(keyValues, wheres);
flag = education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id),model.Id));
}
else {
else
{
var orderModel = orderRepository.GetEntity(model.OrderId);
var classModel = new RB_Class_ViewModel();
if (orderModel != null && orderModel.ClassId > 0)
{
classModel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = orderModel.ClassId })?.FirstOrDefault();
}
model.School_Id = classModel?.School_Id ?? 0;
//生成合同编码
dmodel.ContractNo = CreateContractNum(userInfo.Group_Id);
return education_ContractRepository.Insert(dmodel) > 0;
model.ContractNo = CreateContractNumModule(model.Group_Id,model.School_Id);
var newId = education_ContractRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 获取详情
/// 生成合同编号
/// </summary>
/// <param name="contractId"></param>
/// <param name="GroupId"></param>
/// <returns></returns>
public RB_Education_Contract_ViewModel GetEducationContractInfo(int contractId)
public string CreateContractNumModule(int GroupId,int schoolId)
{
var model = education_ContractRepository.GetEntity<RB_Education_Contract_ViewModel>(contractId);
if (model == null) return model;
var gmodel = groupRepository.GetEntity(model.Group_Id);
if (model.IsCompanySeal == 1) {
model.CompanySealImage = gmodel?.SealImage ?? "";
}
model.ContractBranch = gmodel?.ContractBranch ?? "";
model.ContractTel = gmodel?.Tel ?? "";
model.LegalPerson = gmodel?.LegalPerson ?? "";
model.BranchNList = new List<string>();
if (!string.IsNullOrEmpty(model.ContractBranch))
var schoolModel= schoolRepository.GetEntity(schoolId);
string newContractNum = "JH-CD";
if (schoolModel != null && schoolModel.SId > 0)
{
string[] arr = model.ContractBranch.Split(',');
model.BranchNList = arr.ToList();
model.BranchName = arr[1] + arr[2];
model.ContractBranch = model.ContractBranch.Replace(",", "");
newContractNum = schoolModel?.ContractTitle ?? "JH-CD";
}
return model;
var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = GroupId });
string num = (totalCount + 1).ToString("D4");
return newContractNum + num;
}
/// <summary>
/// 生成合同编号
/// 获取详情
/// </summary>
/// <param name="GroupId"></param>
/// <param name="contractId"></param>
/// <returns></returns>
public string CreateContractNum(int GroupId)
public RB_Education_Contract_ViewModel GetEducationContractModule(int contractId)
{
string newContractNum = "JH-CD0018";
var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = GroupId });
string num = (totalCount + 1).ToString();
switch (num.Length) {
case 1:
num = "00000" + num;break;
case 2:
num = "0000" + num; break;
case 3:
num = "000" + num; break;
case 4:
num = "00" + num; break;
case 5:
num = "0" + num; break;
}
return newContractNum + num;
var model = education_ContractRepository.GetEntity<RB_Education_Contract_ViewModel>(contractId);
if (model == null) return model;
var gmodel = groupRepository.GetEntity(model.Group_Id);
return model;
}
/// <summary>
/// 同和审核
/// </summary>
......@@ -163,28 +261,17 @@ namespace Edu.Module.Course
/// <param name="state"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetEducationContractAudit(int contractId, int state, UserInfo userInfo)
public bool SetEducationContractAuditModule(int contractId, int state, UserInfo userInfo)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>();
if (state == 5)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_Contract_ViewModel.IsCompanySeal),1},
{ nameof(RB_Education_Contract_ViewModel.SealDate),DateTime.Now}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Education_Contract_ViewModel.Id),
FiledValue=contractId,
OperatorEnum=OperatorEnum.Equal
}
};
return education_ContractRepository.Update(keyValues, wheres);
keyValues.Add(nameof(RB_Education_Contract_ViewModel.IsCompanySeal), 1);
keyValues.Add(nameof(RB_Education_Contract_ViewModel.SealDate), DateTime.Now);
}
else
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_Contract_ViewModel.Status),state}
};
keyValues.Add(nameof(RB_Education_Contract_ViewModel.Status), state);
if (state == 1 || state == 4)
{
keyValues.Add(nameof(RB_Education_Contract_ViewModel.UpdateBy), userInfo.Id);
......@@ -195,15 +282,8 @@ namespace Edu.Module.Course
keyValues.Add(nameof(RB_Education_Contract_ViewModel.AuditEmpId), userInfo.Id);
keyValues.Add(nameof(RB_Education_Contract_ViewModel.AuditDate), DateTime.Now);
}
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Education_Contract_ViewModel.Id),
FiledValue=contractId,
OperatorEnum=OperatorEnum.Equal
}
};
return education_ContractRepository.Update(keyValues, wheres);
}
return education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id), contractId));
}
/// <summary>
......@@ -213,62 +293,14 @@ namespace Edu.Module.Course
/// <param name="sign"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetEducationContractSign(int contractId, string sign)
public bool SetEducationContractSignModule(int contractId, string sign)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Education_Contract_ViewModel.Sign),sign},
{ nameof(RB_Education_Contract_ViewModel.SignDate),DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Education_Contract_ViewModel.Id),
FiledValue=contractId,
OperatorEnum=OperatorEnum.Equal
}
};
return education_ContractRepository.Update(keyValues, wheres);
}
/// <summary>
/// 复制合同
/// </summary>
/// <param name="contractId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetEducationContractCopy(int contractId, UserInfo userInfo)
{
var model = education_ContractRepository.GetEntity(contractId);
return education_ContractRepository.Insert(new Model.Entity.Course.RB_Education_Contract()
{
Id = 0,
GuestId = 0,
ContractNo = CreateContractNum(userInfo.Group_Id),
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
CType = model.CType,
Exam = "",
Group_Id = userInfo.Group_Id,
IsCompanySeal = 0,
CNYCaps = model.CNYCaps,
Money = model.Money,
OrderId = 0,
CourseName = model.CourseName,
CourseContent = model.CourseContent,
SchoolName = model.SchoolName,
School_Id = model.School_Id,
Sign = "",
Status = 0,
StudentName = model.StudentName,
UpdateBy = userInfo.Id,
UpdateTime = DateTime.Now,
IDCard = model.IDCard,
Sex = model.Sex,
ContactAddress = model.ContactAddress,
ContactMobile = model.ContactMobile,
Domicile = model.Domicile,
EmergencyContact = model.EmergencyContact,
EmergencyMobile = model.EmergencyMobile,
}) > 0;
return education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id), contractId));
}
}
}
......@@ -1646,85 +1646,6 @@ namespace Edu.Module.Course
{
return orderRepository.GetMyOrderStatistics(demodel);
}
/// <summary>
/// 订单领取合同
/// </summary>
/// <param name="orderId"></param>
/// <param name="guestId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetOrderReceiveContract(int orderId, int guestId, UserInfo userInfo)
{
var glist = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel() { Group_Id = userInfo.Group_Id, Id = guestId, OrderId = orderId, GuestState = 1 });
if (glist.Any())
{
//订单信息
var omodel = orderRepository.GetEntity(orderId);
decimal Money = (omodel.PreferPrice - omodel.DiscountMoney) / glist.Count();//平均每人费用 (看是否根据订单单价)
string dxMoney = StringHelper.MoneyToUpper(Money.ToString());
//班级信息
var classmodel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = omodel.ClassId }).FirstOrDefault();
string newContractNum = "JH-CD0018";
var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id });
//查询已有合同的
string guestIds = string.Join(",", glist.Select(x => x.Id));
var clist = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id, OrderId = orderId, GuestIds = guestIds, Status = -1 }).Where(x => x.Status != 4).ToList();
foreach (var item in glist) {
var cmodel = clist.Where(x => x.GuestId == item.Id).FirstOrDefault();
if (cmodel == null) {
totalCount += 1;
string num = totalCount.ToString();
switch (num.Length)
{
case 1:
num = "00000" + num; break;
case 2:
num = "0000" + num; break;
case 3:
num = "000" + num; break;
case 4:
num = "00" + num; break;
case 5:
num = "0" + num; break;
}
string ContractNo = newContractNum + num;
education_ContractRepository.Insert(new Model.Entity.Course.RB_Education_Contract()
{
Id = 0,
GuestId = item.Id,
ContractNo = ContractNo,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
CType = ContractTypeEnum.Train,
Exam = "",
Group_Id = userInfo.Group_Id,
IsCompanySeal = 0,
CNYCaps = dxMoney,
Money = Money.ToString(),
OrderId = orderId,
CourseName = classmodel.CateName,
CourseContent = classmodel.CourseName,
SchoolName = classmodel.SchoolName,
School_Id = classmodel.School_Id,
Sign = "",
Status = 0,
StudentName = item.GuestName,
UpdateBy = userInfo.Id,
UpdateTime = DateTime.Now,
ContactAddress = item.ContactAddress,
Domicile = item.Domicile,
IDCard = item.IDCard,
ContactMobile = item.Mobile,
EmergencyContact = item.Contact,
EmergencyMobile = item.ContactMobile,
Sex = item.Sex
});
}
}
}
return true;
}
#endregion
#region 订单操作
......
......@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
using VT.FW.DB.Dapper;
namespace Edu.Module.User
{
......@@ -49,18 +50,10 @@ namespace Edu.Module.User
/// </summary>
/// <param name="group_Id"></param>
/// <returns></returns>
public object GetNoticeBaseInfo(int group_Id)
public RB_Notice_Base_ViewModel GetNoticeBaseInfo(int group_Id)
{
var model = notice_BaseRepository.GetList(new RB_Notice_Base_ViewModel() { Group_Id = group_Id }).FirstOrDefault();
return new
{
model?.Id,
model?.Image,
model?.From,
model?.NumberRule,
NumberRuleName = model?.NumberRule.ToName(),
model?.CopyPeople
};
return model;
}
/// <summary>
......@@ -68,11 +61,13 @@ namespace Edu.Module.User
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public string SetNoticeBaseInfo(RB_Notice_Base_ViewModel dmodel) {
public string SetNoticeBaseInfo(RB_Notice_Base_ViewModel dmodel)
{
bool flag;
if (dmodel.Id > 0)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Notice_Base.Image),dmodel.Image},
{ nameof(RB_Notice_Base.CopyPeople),dmodel.CopyPeople},
{ nameof(RB_Notice_Base.From),dmodel.From},
......@@ -80,26 +75,24 @@ namespace Edu.Module.User
{ nameof(RB_Notice_Base.UpdateBy),dmodel.UpdateBy},
{ nameof(RB_Notice_Base.UpdateTime),DateTime.Now},
};
List<WhereHelper> whereHelpers = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Notice_Base.Id),
FiledValue=dmodel.Id,
OperatorEnum=OperatorEnum.Equal
}
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Notice_Base.Id), dmodel.Id)
};
flag = notice_BaseRepository.Update(keyValues, whereHelpers);
flag = notice_BaseRepository.Update(keyValues, wheres);
}
else {
else
{
var model = notice_BaseRepository.GetList(new RB_Notice_Base_ViewModel() { Group_Id = dmodel.Group_Id }).FirstOrDefault();
if (model == null)
{
flag = notice_BaseRepository.Insert(dmodel) > 0;
}
else {
else
{
return "已存在配置,无法新增";
}
}
return flag ? "" : "出错了,请联系管理员";
}
......@@ -115,22 +108,14 @@ namespace Edu.Module.User
public List<RB_Notice_ViewModel> GetNoticePageList(int pageIndex, int pageSize, out long rowsCount, RB_Notice_ViewModel dmodel)
{
var list = noticeRepository.GetPageList(pageIndex, pageSize, out rowsCount, dmodel);
if (list.Any()) {
if (list.Any())
{
//查询阅读人数
string NoticeIds = string.Join(",", list.Select(x => x.Id));
var readList = notice_ReadRepository.GetNoticeReadNumList(NoticeIds);
//var dList = notice_DeptRepository.GetList(new RB_Notice_Dept() { }, NoticeIds);
foreach (var item in list) {
foreach (var item in list)
{
item.ReadNum = readList.Where(x => x.NoticeId == item.Id).FirstOrDefault()?.ReadNum ?? 0;
//var idList = dList.Where(x => x.NoticeId == item.Id).ToList();
//if (idList.Any())
//{
// item.To = string.Join(",", idList.Select(x => x.DeptId));
//}
//else
//{
// item.To = "-1";
//}
}
}
return list;
......@@ -148,7 +133,8 @@ namespace Edu.Module.User
{
#region 我的上级部门
var dlist = departmentRepository.GetAllSuperiorDepartmentListRepository(dmodel.DeptId);
if (dlist.Any()) {
if (dlist.Any())
{
dmodel.To = string.Join(",", dlist.Select(x => x.DeptId));
}
#endregion
......@@ -158,18 +144,9 @@ namespace Edu.Module.User
//查询阅读人数
string NoticeIds = string.Join(",", list.Select(x => x.Id));
var readList = notice_ReadRepository.GetNoticeReadNumList(NoticeIds);
//var dList = notice_DeptRepository.GetList(new RB_Notice_Dept() { }, NoticeIds);
foreach (var item in list)
{
item.ReadNum = readList.Where(x => x.NoticeId == item.Id).FirstOrDefault()?.ReadNum ?? 0;
//var idList = dList.Where(x => x.NoticeId == item.Id).ToList();
//if (idList.Any())
//{
// item.To = string.Join(",", idList.Select(x => x.DeptId));
//}
//else {
// item.To = "-1";
//}
}
}
return list;
......@@ -184,17 +161,21 @@ namespace Edu.Module.User
{
var model = noticeRepository.GetEntity<RB_Notice_ViewModel>(noticeId);
if (model == null) { return ApiResult.ParamIsNull(); }
var noticeBaseModel = notice_BaseRepository.GetList(new RB_Notice_Base_ViewModel() { Group_Id = model.Group_Id }).FirstOrDefault();
var dList = notice_DeptRepository.GetList(new RB_Notice_Dept() { NoticeId = noticeId }, "");
model.To = "-1";
if (dList.Any()) {
if (dList.Any())
{
model.To = string.Join(",", dList.Select(x => x.DeptId));
}
List<object> DepartmentList = new List<object>() { new { DepartmentId = -1, DeptName = "全公司" } };
if (!string.IsNullOrEmpty(model.To) && model.To != "-1") {
if (!string.IsNullOrEmpty(model.To) && model.To != "-1")
{
//查询所有的部门
var dlist = departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { Group_Id = model.Group_Id, QDeptIds = model.To });
DepartmentList = new List<object>();
foreach (var item in dlist) {
foreach (var item in dlist)
{
DepartmentList.Add(new
{
DepartmentId = item.DeptId,
......@@ -203,10 +184,12 @@ namespace Edu.Module.User
}
}
List<object> CopyPeopleList = new List<object>();
if (!string.IsNullOrEmpty(model.CopyPeople) && model.CopyPeople != "-1") {
if (!string.IsNullOrEmpty(model.CopyPeople) && model.CopyPeople != "-1")
{
//查询所有人
var elist = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { Group_Id = model.Group_Id, QIds = model.CopyPeople });
foreach (var item in elist) {
foreach (var item in elist)
{
CopyPeopleList.Add(new
{
EmployeeId = item.Id,
......@@ -214,34 +197,50 @@ namespace Edu.Module.User
});
}
}
//转换文件列表
model.FileList = new List<FileModel>();
if (!string.IsNullOrEmpty(model.File)) {
if (!string.IsNullOrEmpty(model.File))
{
model.FileList = JsonHelper.DeserializeObject<List<FileModel>>(model.File);
}
string DayStr = "";
if (model.UpdateTime != null)
{
DayStr = Common.Plugin.StringHelper.DateFormatToString(Convert.ToDateTime(model.UpdateTime));
}
var empModel = new RB_Account_ViewModel();
if (model.UpdateBy > 0)
{
empModel= accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
{
Id = model.UpdateBy
})?.FirstOrDefault();
}
return ApiResult.Success("", new
{
model.Id,
model.From,
model.To,
DepartmentList,
model.CopyPeople,
CopyPeopleList,
model.Number,
model.Title,
model.NoticeState,
NoticeStateName = model.NoticeState.ToName(),
model.Is_Top,
model.To,
toList= DepartmentList,
model.CopyPeople,
ccList=CopyPeopleList,
model.Content,
FileList = model.FileList.Select(x => new
fileList = model.FileList.Select(x => new
{
x.FileName,
x.FileUrl
}),
model.NoticeState,
NoticeStateName = model.NoticeState.ToName(),
model.Is_Top,
model.UpdateBy,
UpdateTime = model.UpdateTime.HasValue ? model.UpdateTime.Value.ToString("yyyy年MM月dd日") : ""
UpdateByName = empModel?.AccountName ?? "",
UpdateByIcon = empModel?.UserIcon ?? "",
UpdateTime = model.UpdateTime.HasValue ? model.UpdateTime.Value.ToString("yyyy年MM月dd日") : "",
DayStr,
BgImage = noticeBaseModel?.Image ?? ""
});
}
......@@ -291,10 +290,11 @@ namespace Edu.Module.User
return false;
}
}
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Notice.UpdateBy),userInfo.Id},
{ nameof(RB_Notice.UpdateTime),DateTime.Now},
};
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Notice.UpdateBy),userInfo.Id},
{ nameof(RB_Notice.UpdateTime),DateTime.Now},
};
if (type == 1)
{
keyValues.Add(nameof(RB_Notice.Is_Top), 1);
......@@ -311,14 +311,7 @@ namespace Edu.Module.User
{
keyValues.Add(nameof(RB_Notice.Status), Common.Enum.DateStateEnum.Delete);
}
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Notice.Id),
FiledValue=noticeId,
OperatorEnum=OperatorEnum.Equal
}
};
return noticeRepository.Update(keyValues, wheres);
return noticeRepository.Update(keyValues, new WhereHelper(nameof(RB_Notice.Id), noticeId));
}
}
......@@ -340,19 +333,16 @@ namespace Edu.Module.User
{ nameof(RB_Notice.Title),demodel.Title},
{ nameof(RB_Notice.Content),demodel.Content},
{ nameof(RB_Notice.File),demodel.File},
{ nameof(RB_Notice.NoticeState),demodel.NoticeState},
{ nameof(RB_Notice.NoticeState),(int)demodel.NoticeState},
{ nameof(RB_Notice.Is_Top),demodel.Is_Top},
{ nameof(RB_Notice.UpdateBy),demodel.UpdateBy},
{ nameof(RB_Notice.UpdateTime),demodel.UpdateTime}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Notice.Id),
FiledValue=demodel.Id,
OperatorEnum=OperatorEnum.Equal
}
IList<WhereHelper> whereHelpers = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Notice.Id), demodel.Id)
};
bool flag = noticeRepository.Update(keyValues, wheres);
bool flag = noticeRepository.Update(keyValues, whereHelpers);
if (flag)
{
//更新部门
......@@ -376,7 +366,8 @@ namespace Edu.Module.User
notice_DeptRepository.Delete(item);
}
}
else {
else
{
//删除部门关联
foreach (var item in dList)
{
......@@ -387,7 +378,6 @@ namespace Edu.Module.User
if (flag && oldModel.NoticeState == Common.Enum.User.NoticeStateEnum.Draft && demodel.NoticeState == Common.Enum.User.NoticeStateEnum.Publish)
{
//推送消息
}
return flag;
}
......@@ -395,7 +385,10 @@ namespace Edu.Module.User
{
//查询生成规则
var model = notice_BaseRepository.GetList(new RB_Notice_Base_ViewModel() { Group_Id = demodel.Group_Id }).FirstOrDefault();
if (model == null) { return false; }
if (model == null)
{
return false;
}
demodel.Number = "";
demodel.NumberRule = model.NumberRule;
if (model.NumberRule == Common.Enum.User.NoticeRuleEnum.One)
......@@ -414,7 +407,8 @@ namespace Edu.Module.User
Letter = LetterStr.Substring(Index, Index + 1);
Num = 1;
}
else {
else
{
Num++;
}
demodel.Number = DateTime.Now.ToString("yyyy") + "-" + Letter + "-" + Num.ToString().PadLeft(3, '0');
......@@ -424,15 +418,16 @@ namespace Edu.Module.User
demodel.Number = DateTime.Now.ToString("yyyy") + "-A-001";
}
}
int Id = noticeRepository.Insert(demodel);
bool flag = Id > 0;
if (flag) {
if (flag)
{
//更新部门
if (demodel.To != "-1")
{
List<int> ToList = JsonHelper.DeserializeObject<List<int>>("[" + demodel.To + "]");
foreach (var item in ToList) {
foreach (var item in ToList)
{
notice_DeptRepository.Insert(new RB_Notice_Dept()
{
Id = 0,
......@@ -445,10 +440,10 @@ namespace Edu.Module.User
if (flag && demodel.NoticeState == Common.Enum.User.NoticeStateEnum.Publish)
{
//推送消息
}
return flag;
}
}
}
}
}
\ No newline at end of file
......@@ -107,6 +107,7 @@ namespace Edu.Module.User
{nameof(RB_School_ViewModel.Status),model.Status },
{nameof(RB_School_ViewModel.Dept_Id),model.Dept_Id },
{nameof(RB_School_ViewModel.ManagerId),model.ManagerId },
{nameof(RB_School_ViewModel.ContractTitle),model.ContractTitle },
};
flag = schoolRepository.Update(fileds, new WhereHelper(nameof(RB_School_ViewModel.SId), model.SId));
}
......
......@@ -66,6 +66,7 @@ namespace Edu.Module.Web
{
{nameof(RB_Web_RecruitmentType_ViewModel.TypeName),model.TypeName },
{nameof(RB_Web_RecruitmentType_ViewModel.ImgCover),model.ImgCover },
{nameof(RB_Web_RecruitmentType_ViewModel.CheckImg),model.CheckImg },
};
flag = web_RecruitmentTypeRepository.Update(fileds, new WhereHelper(nameof(RB_Web_RecruitmentType_ViewModel.Id), model.Id));
}
......
......@@ -67,12 +67,12 @@ WHERE 1=1
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.CourseName,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead ,E.SName AS SchoolName,c.CateName
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
left join rb_course_category c on b.CateId = c.CateId
SELECT A.*,B.CourseName,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead ,E.SName AS SchoolName,c.CateName,E.ManagerId
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_course_category c on b.CateId = c.CateId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
LEFT JOIN rb_school AS E ON A.School_Id=E.SId
WHERE 1=1
LEFT JOIN rb_school AS E ON A.School_Id=E.SId
WHERE 1=1
");
if (query != null)
{
......@@ -134,7 +134,6 @@ left join rb_course_category c on b.CateId = c.CateId
/// <returns></returns>
public List<RB_Class_ViewModel> GetClassPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Class_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -346,10 +345,10 @@ FROM (
/// <param name="GroupId"></param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetTeachingPerfClassList(int GroupId) {
string sql = $@"SELECT c.* FROM rb_class c
LEFT JOIN rb_teaching_perf t on (c.ClassId = t.ClassId AND t.`Status`=0)
string sql = $@"
SELECT c.*
FROM rb_class c LEFT JOIN rb_teaching_perf t on (c.ClassId = t.ClassId AND t.`Status`=0)
WHERE c.`Status`=0 and c.Group_Id ={GroupId} and c.ClassStatus =3 and c.EndClassDate <='2030-12-16' AND t.Id IS NULL";
return Get<RB_Class_ViewModel>(sql).ToList();
}
......@@ -381,19 +380,15 @@ GROUP BY Teacher_Id
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"SELECT c.*,cp.ClassPlanId,cp.ClassDate from rb_class as c
LEFT JOIN rb_student_orderguest as sog on sog.ClassId=c.ClassId
LEFT JOIN (SELECT ClassId,MIN(ClassDate) as ClassDate,MIN(ClassPlanId) as ClassPlanId from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%y-%M-%d')>=DATE_FORMAT(now(),'%y-%M-%d') GROUP BY ClassId) as cp
on c.ClassId=cp.ClassId
where c.`Status`=0 and sog.`Status`=0 ");
builder.AppendFormat(@"
SELECT c.*,cp.ClassPlanId,cp.ClassDate
FROM rb_class as c LEFT JOIN rb_student_orderguest as sog on sog.ClassId=c.ClassId
LEFT JOIN (SELECT ClassId,MIN(ClassDate) as ClassDate,MIN(ClassPlanId) as ClassPlanId from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%y-%M-%d')>=DATE_FORMAT(now(),'%y-%M-%d') GROUP BY ClassId) as cp
on c.ClassId=cp.ClassId
WHERE c.`Status`=0 and sog.`Status`=0 ");
builder.AppendFormat(" AND sog.Student_Id={0} ", Student_Id);
builder.AppendFormat(" AND c.{0}={1} ", nameof(RB_Class_ViewModel.Group_Id), Group_Id);
return Get<RB_Class_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ namespace Edu.Repository.Course
/// </summary>
public class RB_Education_ContractRepository : BaseRepository<RB_Education_Contract>
{
/// <summary>
/// 获取分页列表
/// </summary>
......@@ -24,40 +23,42 @@ namespace Edu.Repository.Course
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_Education_Contract_ViewModel demodel)
public List<RB_Education_Contract_ViewModel> GetEducationContractPageListRepository(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}";
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}";
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}";
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}";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
if (demodel.Status >= 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
}
if (!string.IsNullOrEmpty(demodel.ContractNo))
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.ContractNo)} like '%{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 '%{demodel.StudentName}%'";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.StudentName)} LIKE @StudentName ";
parameters.Add("StudentName", "%" + demodel.StudentName.Trim() + "%");
}
string sql = $@" select * from RB_Education_Contract where {where} order by Id desc";
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
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>
......@@ -68,49 +69,50 @@ namespace Edu.Repository.Course
/// <returns></returns>
public List<RB_Education_Contract_ViewModel> GetList(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}";
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}";
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}";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(demodel.OrderIds))
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.OrderId)} in({demodel.OrderIds})";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.OrderId)} IN({demodel.OrderIds})";
}
if (!string.IsNullOrEmpty(demodel.GuestIds))
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.GuestId)} in({demodel.GuestIds})";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.GuestId)} IN({demodel.GuestIds})";
}
if (demodel.CType > 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
if (demodel.Status >= 0)
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
}
if (!string.IsNullOrEmpty(demodel.ContractNo))
{
where += $@" and {nameof(RB_Education_Contract_ViewModel.ContractNo)} like '%{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 '%{demodel.StudentName}%'";
where += $@" AND {nameof(RB_Education_Contract_ViewModel.StudentName)} LIKE @StudentName ";
parameters.Add("StudentName", "%" + demodel.StudentName.Trim() + "%");
}
string sql = $@" select * from RB_Education_Contract where {where} order by Id desc";
return Get<RB_Education_Contract_ViewModel>(sql).ToList();
string sql = $@" SELECT * FROM RB_Education_Contract WHERE {where} ORDER BY Id DESC";
return Get<RB_Education_Contract_ViewModel>(sql, parameters).ToList();
}
/// <summary>
/// 根据查询条件获取合同的总条数
/// </summary>
......@@ -118,24 +120,23 @@ namespace Edu.Repository.Course
/// <returns></returns>
public int GetContractCount(RB_Education_Contract_ViewModel where)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT COUNT(1) FROM RB_Education_Contract WHERE 1=1
");
builder.AppendFormat(@"SELECT COUNT(1) FROM RB_Education_Contract WHERE 1=1 ");
if (where != null)
{
if (where.Group_Id > 0)
{
builder.AppendFormat($" and {nameof(RB_Education_Contract_ViewModel.Group_Id)} ={where.Group_Id}");
builder.AppendFormat($" AND {nameof(RB_Education_Contract_ViewModel.Group_Id)} ={where.Group_Id}");
}
if (where.ContractNo != null && !string.IsNullOrEmpty(where.ContractNo.Trim()))
{
builder.AppendFormat(" AND ContractNo LIKE '%{0}%' ", where.ContractNo.Trim());
builder.AppendFormat($@" AND {nameof(RB_Education_Contract_ViewModel.ContractNo)} LIKE @ContractNo ");
parameters.Add("ContractNo", "%" + where.ContractNo.Trim() + "%");
}
}
var obj = base.ExecuteScalar(builder.ToString());
var obj = base.ExecuteScalar(builder.ToString(), parameters);
return obj == null ? 0 : Convert.ToInt32(obj);
}
}
}
......@@ -162,6 +162,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_StudyAbroad_ViewModel.Id), query.QIds);
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_StudyAbroad_ViewModel.Type), query.Type);
}
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
}
}
......
......@@ -25,7 +25,8 @@ namespace Edu.Repository.User
/// <returns></returns>
public List<RB_Notice_ViewModel> GetPageList(int pageIndex,int pageSize, out long count,RB_Notice_ViewModel demodel)
{
string where = $@" 1=1 and {nameof(RB_Notice.Status)}=0 ";
var parameters = new DynamicParameters();
string where = $@" 1=1 AND {nameof(RB_Notice.Status)}=0 ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Notice.Group_Id)} ={demodel.Group_Id}";
......@@ -36,11 +37,13 @@ namespace Edu.Repository.User
}
if (!string.IsNullOrEmpty(demodel.Title))
{
where += $@" and {nameof(RB_Notice.Title)} like '%{demodel.Title}%'";
where += $@" AND {nameof(RB_Notice.Title)} LIKE @Title ";
parameters.Add("Title", "%" + demodel.Title.Trim() + "%");
}
if (!string.IsNullOrEmpty(demodel.Number))
{
where += $@" and {nameof(RB_Notice.Number)} like '%{demodel.Number}%'";
where += $@" and {nameof(RB_Notice.Number)} LIKE @Number ";
parameters.Add("Number", "%" + demodel.Number.Trim() + "%");
}
if (demodel.NoticeState > 0)
{
......@@ -50,7 +53,8 @@ namespace Edu.Repository.User
{
where += $@" and {nameof(RB_Notice.Is_Top)} ={demodel.Is_Top}";
}
if (demodel.UpdateBy > 0) {
if (demodel.UpdateBy > 0)
{
where += $@" and {nameof(RB_Notice.UpdateBy)} ={demodel.UpdateBy}";
}
......@@ -59,12 +63,12 @@ namespace Edu.Repository.User
{
OrderBy = " UpdateTime desc";
}
else if (demodel.OrderBy == 2) {
else if (demodel.OrderBy == 2)
{
OrderBy = " Is_Top asc,UpdateTime desc";
}
string sql = $@" select * from RB_Notice where {where} order by {OrderBy}";
return GetPage<RB_Notice_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
return GetPage<RB_Notice_ViewModel>(pageIndex, pageSize, out count, sql,parameters).ToList();
}
/// <summary>
......@@ -158,6 +162,10 @@ namespace Edu.Repository.User
if (!string.IsNullOrEmpty(demodel.To)) {
where += $@" and (FIND_IN_SET(d.DeptId,'{demodel.To}') or d.DeptId =-1)";
}
if (!string.IsNullOrEmpty(demodel.LookTime))
{
where += $@" and n.{nameof(RB_Notice.UpdateTime)} >'{demodel.LookTime}'";
}
string OrderBy = " n.Id desc";
if (demodel.OrderBy == 1)
......@@ -169,9 +177,12 @@ namespace Edu.Repository.User
OrderBy = " n.Is_Top asc,n.UpdateTime desc";
}
string sql = $@" select n.* from RB_Notice n
left join rb_notice_dept d on n.Id = d.NoticeId
where {where} group by n.Id order by {OrderBy}";
string sql = $@"
SELECT n.*
FROM RB_Notice n LEFT JOIN rb_notice_dept d on n.Id = d.NoticeId
WHERE {where}
GROUP BY n.Id
ORDER BY {OrderBy}";
return GetPage<RB_Notice_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
}
......
......@@ -16,7 +16,7 @@ namespace Edu.Repository.User
{
public List<RB_Notice_Read_ViewModel> GetList(RB_Notice_Read_ViewModel demodel)
{
string where = $@" 1=1 and Status=0 ";
string where = $@" 1=1 ";
if (demodel.NoticeId > 0)
{
where += $@" and {nameof(RB_Notice_Read.NoticeId)} ={demodel.NoticeId}";
......@@ -25,7 +25,6 @@ namespace Edu.Repository.User
{
where += $@" and {nameof(RB_Notice_Read.AccountId)} ={demodel.AccountId}";
}
string sql = $@" select * from RB_Notice_Read where {where}";
return Get<RB_Notice_Read_ViewModel>(sql).ToList();
}
......@@ -37,7 +36,7 @@ namespace Edu.Repository.User
/// <returns></returns>
public List<RB_Notice_Read_ViewModel> GetNoticeReadNumList(string noticeIds)
{
string sql = $@" select NoticeId,count(0) as ReadNum from RB_Notice_Read where NoticeId in ({noticeIds}) group by NoticeId";
string sql = $@" select NoticeId,count(0) as ReadNum from RB_Notice_Read where NoticeId in ({noticeIds}) group by NoticeId ";
return Get<RB_Notice_Read_ViewModel>(sql).ToList();
}
}
......
......@@ -48,6 +48,10 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} LIKE @PositionName ", nameof(RB_Web_Recruitment_ViewModel.PositionName));
parameters.Add("PositionName", "%" + query.PositionName.Trim() + "%");
}
if (query.TypeId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Recruitment_ViewModel.TypeId), query.TypeId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Web_Recruitment_ViewModel.Id));
return GetPage<RB_Web_Recruitment_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Log;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
......@@ -28,9 +26,21 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
private readonly EducationContractModule educationContractModule = AOP.AOPHelper.CreateAOPObject<EducationContractModule>();
#region 合同列表
/// <summary>
/// 获取学员信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentInfo()
{
int OrderId = base.ParmJObj.GetInt("OrderId", 0);//订单编号
int GuestId = base.ParmJObj.GetInt("GuestId", 0);//学员编号
var model = educationContractModule.GetStudentInfoModule(OrderId,GuestId);
return ApiResult.Success("", model);
}
/// <summary>
/// 获取合同分页列表
/// </summary>
......@@ -40,22 +50,26 @@ namespace Edu.WebApi.Controllers.Course
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
var dmodel = new RB_Education_Contract_ViewModel()
{
OrderId = base.ParmJObj.GetInt("OrderId"),
ContractNo = base.ParmJObj.GetStringValue("ContractNo"),
CType=(ContractTypeEnum)base.ParmJObj.GetInt("CType"),
Status=base.ParmJObj.GetInt("Status"),
StudentName=base.ParmJObj.GetStringValue("StudentName"),
};
dmodel.Group_Id = userInfo.Group_Id;
var list = educationContractModule.GetEducationContractPageList(pageModel.PageIndex, pageModel.PageSize, out long count, dmodel);
var list = educationContractModule.GetEducationContractPageListModule(pageModel.PageIndex, pageModel.PageSize, out long count, dmodel);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.Id,
x.CType,
CTypeName = x.CType.ToName(),
x.OrderId,
x.ContractNo,
x.StudentName,
x.SchoolName,
x.CourseName,
x.CourseContent,
x.CNYCaps,
x.Money,
x.Exam,
......@@ -66,13 +80,6 @@ namespace Edu.WebApi.Controllers.Course
x.CreateBy,
x.CreateByName,
x.CreateByPhoto,
x.Sex,
x.IDCard,
x.Domicile,
x.ContactAddress,
x.ContactMobile,
x.EmergencyContact,
x.EmergencyMobile,
CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm")
});
return ApiResult.Success("", pageModel);
......@@ -84,23 +91,23 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetEducationContractInfo() {
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
var model = educationContractModule.GetEducationContractInfo(ContractId);
if (model == null) { return ApiResult.Failed("合同不存在"); }
public ApiResult GetEducationContractInfo()
{
int ContractId = base.ParmJObj.GetInt("ContractId", 0);//合同id
var model = educationContractModule.GetEducationContractModule(ContractId);
if (model == null)
{
return ApiResult.Failed("合同不存在");
}
return ApiResult.Success("", new
{
model.Id,
model.CType,
CTypeName = model.CType.ToName(),
model.OrderId,
model.ContractNo,
model.StudentName,
model.SchoolName,
model.CourseName,
model.CourseContent,
model.CNYCaps,
model.Money,
model.Exam,
......@@ -108,21 +115,7 @@ namespace Edu.WebApi.Controllers.Course
model.Status,
model.StatusStr,
model.IsCompanySeal,
model.CompanySealImage,
model.ContractBranch,
model.ContractTel,
model.BranchNList,
model.BranchName,
model.Sex,
model.IDCard,
model.Domicile,
model.ContactAddress,
model.ContactMobile,
model.EmergencyContact,
model.EmergencyMobile,
model.LegalPerson,
SignDate = model.SignDate.HasValue ? model.SignDate.Value.ToString("yyyy-MM-dd") : "",
SealDate = model.SealDate.HasValue ? model.SealDate.Value.ToString("yyyy-MM-dd") : ""
});
}
......@@ -133,43 +126,69 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost]
public ApiResult SetEducationContractInfo()
{
var userInfo = base.UserInfo;
var dmodel = JsonHelper.DeserializeObject<RB_Education_Contract_ViewModel>(RequestParm.Msg.ToString());
if (string.IsNullOrEmpty(dmodel.StudentName)) {
return ApiResult.ParamIsNull("请输入学生姓名");
}
if (string.IsNullOrEmpty(dmodel.SchoolName)) {
return ApiResult.ParamIsNull("请输入学校名称");
}
if (string.IsNullOrEmpty(dmodel.CourseName)) {
return ApiResult.ParamIsNull("请输入课程名称");
}
if (string.IsNullOrEmpty(dmodel.CourseContent)) {
return ApiResult.ParamIsNull("请输入课程内容");
}
if (string.IsNullOrEmpty(dmodel.CNYCaps)) {
return ApiResult.ParamIsNull("请输入大写金额");
}
if (string.IsNullOrEmpty(dmodel.Money)) {
return ApiResult.ParamIsNull("请输入金额");
}
var userInfo = base.UserInfo;
var dmodel = new RB_Education_Contract_ViewModel()
{
Id = base.ParmJObj.GetInt("Id"),
CType = (ContractTypeEnum)base.ParmJObj.GetInt("CType"),
OrderId = base.ParmJObj.GetInt("OrderId"),
GuestId = base.ParmJObj.GetInt("GuestId"),
ContractNo = base.ParmJObj.GetStringValue("ContractNo"),
StudentName = base.ParmJObj.GetStringValue("StudentName"),
StuBirth = base.ParmJObj.GetDateTime("StuBirth"),
StuSex = base.ParmJObj.GetInt("StuSex"),
StuAddress = base.ParmJObj.GetStringValue("StuAddress"),
StuTel = base.ParmJObj.GetStringValue("StuTel"),
StuEmail = base.ParmJObj.GetStringValue("StuEmail"),
ParentName = base.ParmJObj.GetStringValue("ParentName"),
ParentRelation = base.ParmJObj.GetStringValue("ParentRelation"),
ParentTel = base.ParmJObj.GetStringValue("ParentTel"),
ParentEmail = base.ParmJObj.GetStringValue("ParentEmail"),
UrgentName = base.ParmJObj.GetStringValue("UrgentName"),
UrgentRelation = base.ParmJObj.GetStringValue("UrgentRelation"),
UrgentTel = base.ParmJObj.GetStringValue("UrgentTel"),
UrgentEmail = base.ParmJObj.GetStringValue("UrgentEmail"),
GuardianIDCard = base.ParmJObj.GetStringValue("GuardianIDCard"),
CourseName = base.ParmJObj.GetStringValue("CourseName"),
SchoolName = base.ParmJObj.GetStringValue("SchoolName"),
SchoolPrincipal = base.ParmJObj.GetStringValue("SchoolPrincipal"),
StartLevel = base.ParmJObj.GetStringValue("StartLevel"),
CourseConsultant = base.ParmJObj.GetStringValue("CourseConsultant"),
Payee = base.ParmJObj.GetStringValue("Payee"),
FirstClassHours = base.ParmJObj.GetInt("FirstClassHours"),
FirstCourseFee = base.ParmJObj.GetDecimal("FirstCourseFee"),
FirstBookFee = base.ParmJObj.GetDecimal("FirstBookFee"),
FirstClassFee = base.ParmJObj.GetDecimal("FirstClassFee"),
FirstDiscountMoney = base.ParmJObj.GetDecimal("FirstDiscountMoney"),
FirstMoney = base.ParmJObj.GetDecimal("FirstMoney"),
FirstPayDate = base.ParmJObj.GetDateTime("FirstPayDate"),
SecondClassHours = base.ParmJObj.GetInt("SecondClassHours"),
SecondCourseFee = base.ParmJObj.GetDecimal("SecondCourseFee"),
SecondBookFee = base.ParmJObj.GetDecimal("SecondBookFee"),
SecondClassFee = base.ParmJObj.GetDecimal("SecondClassFee"),
SecondDiscountMoney = base.ParmJObj.GetDecimal("SecondDiscountMoney"),
SecondMoney = base.ParmJObj.GetDecimal("SecondMoney"),
SecondPayDate = base.ParmJObj.GetDateTime("SecondPayDate"),
ThirdClassHours = base.ParmJObj.GetInt("ThirdClassHours"),
ThirdCourseFee = base.ParmJObj.GetDecimal("ThirdCourseFee"),
ThirdBookFee = base.ParmJObj.GetDecimal("ThirdBookFee"),
ThirdClassFee = base.ParmJObj.GetDecimal("ThirdClassFee"),
ThirdDiscountMoney = base.ParmJObj.GetDecimal("ThirdDiscountMoney"),
ThirdMoney=base.ParmJObj.GetDecimal("ThirdMoney"),
ThirdPayDate=base.ParmJObj.GetDateTime("ThirdPayDate"),
CNYCaps=base.ParmJObj.GetStringValue("CNYCaps"),
Money=base.ParmJObj.GetDecimal("Money"),
Exam=base.ParmJObj.GetStringValue("Exam"),
IsSupplement=base.ParmJObj.GetInt("IsSupplement"),
};
dmodel.Group_Id = userInfo.Group_Id;
dmodel.School_Id = userInfo.School_Id;
dmodel.CreateBy = userInfo.Id;
dmodel.CreateTime = DateTime.Now;
dmodel.UpdateBy = userInfo.Id;
dmodel.UpdateTime = DateTime.Now;
dmodel.Status = 0;
bool flag = educationContractModule.SetEducationContractInfo(dmodel, userInfo);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
bool flag = educationContractModule.SetEducationContractModule(dmodel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......@@ -180,47 +199,14 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult SetEducationContractAudit()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
int State = parms.GetInt("State", 1);// 状态 1提交审核 2通过 3驳回 4取消 5盖章
if (ContractId <= 0) {
return ApiResult.ParamIsNull("请传递合同id");
}
bool flag = educationContractModule.SetEducationContractAudit(ContractId, State, userInfo);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 合同复制
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetEducationContractCopy() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
int ContractId = base.ParmJObj.GetInt("ContractId", 0);//合同id
int State = base.ParmJObj.GetInt("State", 1);// 状态 1提交审核 2通过 3驳回 4取消 5盖章
if (ContractId <= 0)
{
return ApiResult.ParamIsNull("请传递合同id");
}
bool flag = educationContractModule.SetEducationContractCopy(ContractId, userInfo);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
bool flag = educationContractModule.SetEducationContractAuditModule(ContractId, State, userInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......@@ -229,24 +215,16 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult SetEducationContractSign() {
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int ContractId = parms.GetInt("ContractId", 0);//合同id
string Sign = parms.GetStringValue("Sign");//签名
public ApiResult SetEducationContractSign()
{
int ContractId = base.ParmJObj.GetInt("ContractId", 0);//合同id
string Sign = base.ParmJObj.GetStringValue("Sign");//签名
if (ContractId <= 0)
{
return ApiResult.ParamIsNull("请传递合同id");
}
bool flag = educationContractModule.SetEducationContractSign(ContractId, Sign);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
bool flag = educationContractModule.SetEducationContractSignModule(ContractId, Sign);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......@@ -259,15 +237,12 @@ namespace Edu.WebApi.Controllers.Course
string path = "/upfile/Temporary/" + time + ".pdf";
string basepath = AppContext.BaseDirectory;
string tempPath = basepath + "\\upfile\\Temporary\\" + time + ".pdf";
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
var ID = parms.GetInt("ContractId");
var CType = parms.GetInt("CType");
var ID = base.ParmJObj.GetInt("ContractId");
var CType = base.ParmJObj.GetInt("CType");
string curl = Common.Config.UploadSiteUrl + string.Format(@"/Home/EducationContractInfo?ID={0}&CType={1}", ID, CType);
//string curl = "http://localhost:50034"+ string.Format(@"/Home/EducationContractInfo?ID={0}&CType={1}", ID, CType);
var flag = new ToPdfHelper().HtmlWJtoPdf(tempPath, curl);
return ApiResult.Success("", path);
}
#endregion
}
}
......@@ -1171,33 +1171,6 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Failed();
}
}
/// <summary>
/// 订单领取合同
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOrderReceiveContract() {
var userInfo = base.UserInfo;
JObject prams = JObject.Parse(RequestParm.Msg.ToString());
int OrderId = prams.GetInt("OrderId", 0);
int GuestId = prams.GetInt("GuestId", 0);
if (OrderId <= 0)
{
return ApiResult.ParamIsNull("请传递订单id");
}
bool flag = orderModule.SetOrderReceiveContract(OrderId, GuestId, userInfo);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
#region 退课申请
......
......@@ -10,6 +10,7 @@ using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.Public;
using Edu.Model.ViewModel.User;
using Edu.Module.User;
using Edu.WebApi.Filter;
......@@ -43,6 +44,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
public readonly AttendanceRecodModule attendRecodeModule = new AttendanceRecodModule();
/// <summary>
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
#region 字典管理
/// <summary>
......@@ -96,8 +102,17 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult GetNoticeBaseInfo()
{
var Robj = noticeModule.GetNoticeBaseInfo(base.UserInfo.Group_Id);
return ApiResult.Success("", Robj);
var model = noticeModule.GetNoticeBaseInfo(base.UserInfo.Group_Id);
var obj = new
{
model?.Id,
model?.Image,
model?.From,
model?.NumberRule,
NumberRuleName = model?.NumberRule.ToName(),
model?.CopyPeople
};
return ApiResult.Success("", obj);
}
/// <summary>
......@@ -107,7 +122,14 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult SetNoticeBaseInfo()
{
var demodel = JsonHelper.DeserializeObject<RB_Notice_Base_ViewModel>(RequestParm.Msg.ToString());
var demodel = new RB_Notice_Base_ViewModel()
{
Id=base.ParmJObj.GetInt("Id"),
Image=base.ParmJObj.GetStringValue("Image"),
From=base.ParmJObj.GetStringValue("From"),
NumberRule= (NoticeRuleEnum)base.ParmJObj.GetInt("NumberRule"),
CopyPeople=base.ParmJObj.GetStringValue("CopyPeople"),
};
demodel.Group_Id = base.UserInfo.Group_Id;
demodel.School_Id = base.UserInfo.School_Id;
demodel.CreateBy = base.UserInfo.Id;
......@@ -150,7 +172,14 @@ namespace Edu.WebApi.Controllers.User
public ApiResult GetNoticePageList()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = JsonHelper.DeserializeObject<RB_Notice_ViewModel>(RequestParm.Msg.ToString());
var query = new RB_Notice_ViewModel()
{
Is_Top=base.ParmJObj.GetInt("Is_Top"),
NoticeState=(NoticeStateEnum)base.ParmJObj.GetInt("NoticeState"),
Number=base.ParmJObj.GetStringValue("Number"),
Title=base.ParmJObj.GetStringValue("Title"),
UpdateBy = base.ParmJObj.GetInt("UpdateBy"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = noticeModule.GetNoticePageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......@@ -184,7 +213,6 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.ParamIsNull("请传递公告id");
}
return noticeModule.GetNoticeInfo(NoticeId);
}
......@@ -196,7 +224,29 @@ namespace Edu.WebApi.Controllers.User
public ApiResult SetNoticeInfo()
{
UserInfo userInfo = base.UserInfo;
RB_Notice_ViewModel demodel = JsonHelper.DeserializeObject<RB_Notice_ViewModel>(RequestParm.Msg.ToString());
RB_Notice_ViewModel demodel = new RB_Notice_ViewModel()
{
Id=base.ParmJObj.GetInt("Id"),
Content=base.ParmJObj.GetStringValue("Content"),
CopyPeople=base.ParmJObj.GetStringValue("CopyPeople"),
From=base.ParmJObj.GetStringValue("From"),
Is_Top=base.ParmJObj.GetInt("Is_Top"),
NoticeState=(NoticeStateEnum)base.ParmJObj.GetInt("NoticeState"),
Title=base.ParmJObj.GetStringValue("Title"),
To=base.ParmJObj.GetStringValue("To")
};
if (demodel.To == "0")
{
demodel.To = "-1";
}
try
{
demodel.FileList = Common.Plugin.JsonHelper.DeserializeObject<List<FileModel>>(base.ParmJObj.GetStringValue("FileList"));
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetNoticeInfo_FileList");
}
if (string.IsNullOrEmpty(demodel.From))
{
return ApiResult.ParamIsNull("请传递来源");
......@@ -205,10 +255,6 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.ParamIsNull("请传递发送部门");
}
if (string.IsNullOrEmpty(demodel.CopyPeople))
{
return ApiResult.ParamIsNull("请选择抄送人");
}
if (string.IsNullOrEmpty(demodel.Title))
{
return ApiResult.ParamIsNull("请输入标题");
......@@ -246,14 +292,12 @@ namespace Edu.WebApi.Controllers.User
public ApiResult SetNoticeOperation()
{
UserInfo userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int NoticeId = parms.GetInt("NoticeId", 0);
int Type = parms.GetInt("Type", 1);// 类型 1置顶 2取消置顶 3撤回 4删除 5公告阅读
int NoticeId = base.ParmJObj.GetInt("NoticeId", 0);
int Type = base.ParmJObj.GetInt("Type", 1);// 类型 1置顶 2取消置顶 3撤回 4删除 5公告阅读
if (NoticeId <= 0)
{
return ApiResult.ParamIsNull("公告id");
return ApiResult.ParamIsNull("公告编号不存在!");
}
bool flag = noticeModule.SetNoticeOperation(NoticeId, Type, userInfo);
if (flag)
{
......@@ -291,22 +335,85 @@ namespace Edu.WebApi.Controllers.User
var query = JsonHelper.DeserializeObject<RB_Notice_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
query.DeptId = base.UserInfo.DeptId;
query.NoticeState = NoticeStateEnum.Publish;
var noticeBaseModel=noticeModule.GetNoticeBaseInfo(base.UserInfo.Group_Id);
var list = noticeModule.GetMyNoticePageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list.Select(x => new
List<object> result = new List<object>();
foreach (var item in list)
{
x.Id,
x.From,
x.Number,
x.Title,
x.NoticeState,
NoticeStateName = x.NoticeState.ToName(),
x.Is_Top,
x.ReadNum,
x.UpdateBy,
UpdateByName = UserReidsCache.GetUserLoginInfo(x.UpdateBy)?.AccountName ?? "",
UpdateTime = x.UpdateTime.HasValue ? x.UpdateTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
var fileList = new List<FileModel>();
if (!string.IsNullOrEmpty(item.File))
{
try
{
fileList= Common.Plugin.JsonHelper.DeserializeObject<List<FileModel>>(item.File);
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetMyNoticePageList_Item");
}
}
List<string> ccList = new List<string>();
if (!string.IsNullOrEmpty(item.CopyPeople))
{
var peopleList = Common.ConvertHelper.StringToList(item.CopyPeople);
foreach (var sItem in peopleList)
{
string aName = UserReidsCache.GetUserLoginInfo(sItem)?.AccountName ?? "";
if (!string.IsNullOrEmpty(aName))
{
ccList.Add(aName);
}
}
}
List<string> toList = new List<string>();
if (!string.IsNullOrEmpty(item.To))
{
var deptList = Common.ConvertHelper.StringToList(item.To);
if (deptList != null && deptList.Count > 0)
{
var departMentList = departmentModule.GetDepartmentListModule(new RB_Department_ViewModel() { QDeptIds = string.Join(",", deptList) });
foreach (var dItem in departMentList)
{
toList.Add(dItem.DeptName);
}
}
}
if (toList != null && toList.Count == 0)
{
toList.Add("全公司");
}
string DayStr = "";
if (item.UpdateTime != null)
{
DayStr = Common.Plugin.StringHelper.DateFormatToString(Convert.ToDateTime(item.UpdateTime));
}
var obj = new
{
item.Id,
item.From,
item.Number,
item.Title,
item.NoticeState,
NoticeStateName = item.NoticeState.ToName(),
item.Is_Top,
item.ReadNum,
item.UpdateBy,
UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "",
UpdateByIcon = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.UserIcon ?? "",
UpdateTime = Common.ConvertHelper.FormatDate2(item.UpdateTime),
UpdateTimeStr = Common.ConvertHelper.FormatTime(item.UpdateTime),
item.Content,
fileList,
ccList,
toList,
DayStr,
BgImage = noticeBaseModel?.Image ?? "",
};
result.Add(obj);
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success("", pageModel);
}
......
......@@ -267,8 +267,8 @@ namespace Edu.WebApi.Controllers.User
SLogo=base.ParmJObj.GetStringValue("SLogo"),
SName = base.ParmJObj.GetStringValue("SName"),
Status=(DateStateEnum)base.ParmJObj.GetInt("Status"),
ContractTitle=base.ParmJObj.GetStringValue("ContractTitle"),
};
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
......
......@@ -598,7 +598,7 @@ namespace Edu.WebApi.Controllers.Web
query.Group_Id = groupId;
}
var list = webRecruitmentModule.GetWebRecruitmentTypeListModule(query);
return ApiResult.Success(data: list.Select(qitem => new { qitem.Id, qitem.TypeName, qitem.ImgCover }));
return ApiResult.Success(data: list.Select(qitem => new { qitem.Id, qitem.TypeName, qitem.CheckImg,qitem.ImgCover }));
}
/// <summary>
......
......@@ -778,6 +778,7 @@ namespace Edu.WebApi.Controllers.Web
Id = base.ParmJObj.GetInt("Id"),
TypeName = base.ParmJObj.GetStringValue("TypeName"),
ImgCover = base.ParmJObj.GetStringValue("ImgCover"),
CheckImg=base.ParmJObj.GetStringValue("CheckImg"),
};
extModel.School_Id = base.UserInfo.School_Id;
extModel.Group_Id = base.UserInfo.Group_Id;
......
......@@ -52,6 +52,10 @@ namespace Edu.WebApi
"http://testmall.oytour.com",
"http://yx.oytour.com",
"http://edu.oytour.com",
"http://jiahe.oytour.com",
"http://jiahe.oytour.com",
"http://www.kookaku.com",
"http://www.kookaku.cn"
};
services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray())));
}
......
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