Commit df9f9a3d authored by 吴春's avatar 吴春

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

parents 69afbe39 0f891d57
...@@ -146,6 +146,14 @@ namespace Edu.Common ...@@ -146,6 +146,14 @@ namespace Edu.Common
} }
} }
public static string ErpViewFileSiteUrl
{
get
{
return ReadConfigKey("ErpViewFileSiteUrl");
}
}
/// <summary> /// <summary>
/// 获取Oss文件全路径 /// 获取Oss文件全路径
/// </summary> /// </summary>
...@@ -173,6 +181,33 @@ namespace Edu.Common ...@@ -173,6 +181,33 @@ namespace Edu.Common
} }
} }
/// <summary>
/// 获取erp站点图片
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string GetErpFileUrl(string path)
{
if (string.IsNullOrWhiteSpace(path))
{
return null;
}
else
{
string p = @"(http|https)://(?<domain>[^(:|/]*)";
Regex reg = new Regex(p, RegexOptions.IgnoreCase);
string value = reg.Match(path).Value;
if (!string.IsNullOrEmpty(value))
{
return path;
}
else
{
return ErpViewFileSiteUrl + path;
}
}
}
/// <summary> /// <summary>
/// 获取文件相对路径 /// 获取文件相对路径
/// </summary> /// </summary>
......
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 客人日语基础枚举
/// </summary>
public enum GuestBasicsEnum
{
/// <summary>
/// N1
/// </summary>
[EnumField("N1")]
N1 = 1,
/// <summary>
/// N2
/// </summary>
[EnumField("N2")]
N2 = 2,
/// <summary>
/// N3
/// </summary>
[EnumField("N3")]
N3 = 3,
/// <summary>
/// N4
/// </summary>
[EnumField("N4")]
N4 = 4,
/// <summary>
/// N5
/// </summary>
[EnumField("N5")]
N5 = 5,
/// <summary>
/// 会50音
/// </summary>
[EnumField("会50音")]
L50 = 6,
/// <summary>
/// 无基础
/// </summary>
[EnumField("无基础")]
None = 7,
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 客人学历枚举
/// </summary>
public enum GuestEducationEnum
{
/// <summary>
/// 初中及以下
/// </summary>
[EnumField("初中及以下")]
N1 = 1,
/// <summary>
/// 高中
/// </summary>
[EnumField("高中")]
N2 = 2,
/// <summary>
/// 高职
/// </summary>
[EnumField("高职")]
N3 = 3,
/// <summary>
/// 大专
/// </summary>
[EnumField("大专")]
N4 = 4,
/// <summary>
/// 普通本科
/// </summary>
[EnumField("普通本科")]
N5 = 5,
/// <summary>
/// 211/985本科
/// </summary>
[EnumField("211/985本科")]
N6 = 6,
/// <summary>
/// 硕士
/// </summary>
[EnumField("硕士")]
N7 = 7,
/// <summary>
/// 博士
/// </summary>
[EnumField("博士")]
N8 = 7,
/// <summary>
/// 博士后
/// </summary>
[EnumField("博士后")]
N9 = 7,
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 客人学习目的枚举
/// </summary>
public enum GuestLearningGoalsEnum
{
/// <summary>
/// 旅游
/// </summary>
[EnumField("旅游")]
Travel = 1,
/// <summary>
/// 留学
/// </summary>
[EnumField("留学")]
StudyAbroad = 2,
/// <summary>
/// 游学
/// </summary>
[EnumField("游学")]
StudyTour = 3,
/// <summary>
/// 动漫影音
/// </summary>
[EnumField("动漫影音")]
Anime = 4,
/// <summary>
/// 爱好
/// </summary>
[EnumField("爱好")]
Love = 5,
/// <summary>
/// 工作
/// </summary>
[EnumField("工作")]
Work = 6,
/// <summary>
/// 移民
/// </summary>
[EnumField("移民")]
Immigrant = 7,
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 订单来自于那个平台
/// </summary>
public enum OrderFormEnum
{
/// <summary>
/// 电脑端
/// </summary>
[EnumField("Edu电脑端")]
Computer = 1,
/// <summary>
/// 电脑端
/// </summary>
[EnumField("B2B电脑端")]
ComputerB2B = 2,
/// <summary>
/// 苹果端
/// </summary>
[EnumField("APP苹果")]
Apple = 3,
/// <summary>
/// 安卓端
/// </summary>
[EnumField("APP安卓")]
Android = 4,
/// <summary>
/// 小程序
/// </summary>
[EnumField("报名确认单")]
Applet = 5,
/// <summary>
/// B2B苹果端
/// </summary>
[EnumField("B2B苹果")]
B2BApple = 6,
/// <summary>
/// B2B安卓端
/// </summary>
[EnumField("B2B安卓")]
B2BAndroid = 7,
/// <summary>
/// B2B小程序
/// </summary>
[EnumField("B2B小程序")]
B2BApplet = 8,
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 订单来源枚举
/// </summary>
public enum OrderSourceEnum
{
/// <summary>
/// 网络报名
/// </summary>
[EnumField("网络报名")]
Web = 1,
/// <summary>
/// 线下发展
/// </summary>
[EnumField("线下发展")]
OffLine = 2,
/// <summary>
/// 同行转交
/// </summary>
[EnumField("同行转交")]
Client = 3,
/// <summary>
/// 学员介绍
/// </summary>
[EnumField("学员介绍")]
Student = 4,
/// <summary>
/// 内部亲属
/// </summary>
[EnumField("内部亲属")]
Internal = 5,
/// <summary>
/// 内部员工
/// </summary>
[EnumField("内部员工")]
Employee = 6
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 订单状态枚举
/// </summary>
public enum OrderStateEnum
{
/// <summary>
/// 正常
/// </summary>
[EnumField("正常")]
Normal = 1,
/// <summary>
/// 退学
/// </summary>
[EnumField("退学")]
DropOut = 2,
/// <summary>
/// 取消
/// </summary>
[EnumField("取消")]
Cancel = 3
}
}
using Edu.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Common.Enum.Course
{
/// <summary>
/// 订单交易方式枚举
/// </summary>
public enum TradeWayEnum
{
/// <summary>
/// 线上交易
/// </summary>
[EnumField("线上交易")]
OnLine = 1,
/// <summary>
/// 线下交易
/// </summary>
[EnumField("线下交易")]
OffLine = 2
}
}
...@@ -25,6 +25,18 @@ namespace Edu.Common.Plugin ...@@ -25,6 +25,18 @@ namespace Edu.Common.Plugin
return jObject[key] == null ? "" : jObject[key].ToString(); return jObject[key] == null ? "" : jObject[key].ToString();
} }
/// <summary>
/// 获取日期时间
/// </summary>
/// <param name="jObject"></param>
/// <param name="key"></param>
/// <returns></returns>
public static DateTime GetDateTime(this JObject jObject, string key)
{
DateTime.TryParse(jObject[key] == null ? "" : jObject[key].ToString(), out DateTime result);
return result;
}
/// <summary> /// <summary>
/// 获取Int /// 获取Int
/// </summary> /// </summary>
......
...@@ -150,6 +150,6 @@ namespace Edu.Model.Entity.Course ...@@ -150,6 +150,6 @@ namespace Edu.Model.Entity.Course
/// <summary> /// <summary>
/// 完成进度 /// 完成进度
/// </summary> /// </summary>
public string CompleteProgress { get; set; } public int CompleteProgress { get; set; }
} }
} }
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 订单实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Order
{
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 班级id
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 交易方式 1线上交易 2线下交易
/// </summary>
public TradeWayEnum TradeWay { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal Class_Price { get; set; }
/// <summary>
/// 成交单价
/// </summary>
public decimal Unit_Price { get; set; }
/// <summary>
/// 客人数量
/// </summary>
public int GuestNum { get; set; }
/// <summary>
/// 应收总额
/// </summary>
public decimal PreferPrice { get; set; }
/// <summary>
/// 实收金额
/// </summary>
public decimal Income { get; set; }
/// <summary>
/// 退款金额
/// </summary>
public decimal Refund { get; set; }
/// <summary>
/// 优惠金额
/// </summary>
public decimal DiscountMoney { get; set; }
/// <summary>
/// 订单状态 枚举
/// </summary>
public OrderStateEnum OrderState { get; set; }
/// <summary>
/// 订单来源 枚举
/// </summary>
public OrderSourceEnum OrderSource { get; set; }
/// <summary>
/// 业务人员
/// </summary>
public int EnterID { get; set; }
/// <summary>
/// 订单来自于 枚举
/// </summary>
public OrderFormEnum OrderForm { get; set; }
private decimal commission = -1;
/// <summary>
/// 提成金额
/// </summary>
public decimal CommissionMoney { get => commission; set => commission = value; }
/// <summary>
/// 额外奖励金额
/// </summary>
public decimal ExtraRewardMoney { get; set; }
/// <summary>
/// 额外扣除金额
/// </summary>
public decimal ExtraDeductMoney { get; set; }
/// <summary>
/// 提成是否已发放 1是 0否
/// </summary>
public int IsCommissionGive { get; set; }
/// <summary>
/// 销售备注
/// </summary>
public string SaleRemark { get; set; }
/// <summary>
/// 教务备注
/// </summary>
public string TeacherRemark { get; set; }
/// <summary>
/// 校长备注
/// </summary>
public string RectorRemark { get; set; }
/// <summary>
/// 经理备注
/// </summary>
public string DirectorRemark { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 部门id
/// </summary>
public int Dept_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; }
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 订单客人实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Order_Guest
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 客人名称
/// </summary>
public string GuestName { get; set; }
/// <summary>
/// 状态 1正常 2退学
/// </summary>
public int GuestState { get; set; }
/// <summary>
/// 职业
/// </summary>
public string Profession { get; set; }
/// <summary>
/// 性别 1男 2女
/// </summary>
public int Sex { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 手机号码
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 日语基础
/// </summary>
public string Basics { get; set; }
/// <summary>
/// 学历 枚举
/// </summary>
public GuestEducationEnum Education { get; set; }
/// <summary>
/// 客人来源 枚举
/// </summary>
public OrderSourceEnum GuestSource { get; set; }
/// <summary>
/// 学习目的
/// </summary>
public GuestLearningGoalsEnum LearningGoals { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string Contact { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string ContactMobile { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </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; }
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 订单备注实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Order_Remark
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 订单编号
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 类型 1销售备注 2教务备注 3校长备注 4经理备注 5其他备注
/// </summary>
public int Type { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Content { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}
...@@ -39,5 +39,13 @@ namespace Edu.Model.Entity.Log ...@@ -39,5 +39,13 @@ namespace Edu.Model.Entity.Log
/// 校区编号 /// 校区编号
/// </summary> /// </summary>
public int School_Id { get; set; } public int School_Id { get; set; }
}
private int type = 1;
/// <summary>
/// 类型 1日常日志 2订单日志
/// </summary>
public int Type { get => type; set => type = value; }
}
} }
using System;
using System.Collections.Generic;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 客人实体类
/// </summary>
[Serializable]
public class RB_Order_Guest_ViewModel : Model.Entity.Course.RB_Order_Guest
{
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 订单实体类
/// </summary>
[Serializable]
public class RB_Order_ViewModel : Model.Entity.Course.RB_Order
{
/// <summary>
/// 讲师名称
/// </summary>
public string TeacherName { get; set; }
/// <summary>
/// 讲师头像
/// </summary>
public string TeacherHead { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 订单查询状态 1正常 2取消
/// </summary>
public int Q_OrderState { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Q_OrderBy { get; set; }
}
}
\ No newline at end of file
...@@ -33,6 +33,11 @@ namespace Edu.Model.ViewModel.User ...@@ -33,6 +33,11 @@ namespace Edu.Model.ViewModel.User
/// </summary> /// </summary>
public int IsCompany { get; set; } public int IsCompany { get; set; }
/// <summary>
/// 数据类型(1-部门,2-员工)
/// </summary>
public int DataType { get; set; }
/// <summary> /// <summary>
/// 下级部门列表 /// 下级部门列表
......
using Edu.Common.Enum;
using Edu.Model.ViewModel.Course;
using Edu.Repository.Course;
using Edu.Repository.Log;
using System.Collections.Generic;
using VT.FW.DB;
namespace Edu.Module.Course
{
/// <summary>
/// 订单处理类
/// </summary>
public class OrderModule
{
/// <summary>
/// 订单
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 订单备注
/// </summary>
private readonly RB_Order_RemarkRepository order_RemarkRepository = new RB_Order_RemarkRepository();
/// <summary>
/// 用户日志
/// </summary>
private readonly RB_User_ChangeLogRepository changeLogRepository = new RB_User_ChangeLogRepository();
}
}
...@@ -176,9 +176,9 @@ namespace Edu.Module.User ...@@ -176,9 +176,9 @@ namespace Edu.Module.User
ParentId = fItem.ParentId, ParentId = fItem.ParentId,
ChildList = new List<DepartmentTree_ViewModel>(), ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = fItem.School_Id, School_Id = fItem.School_Id,
IsCompany = fItem.IsCompany IsCompany = fItem.IsCompany,
DataType=1,
}; };
#region 添加员工信息 #region 添加员工信息
if (isQueryEmployee) if (isQueryEmployee)
{ {
...@@ -193,18 +193,21 @@ namespace Edu.Module.User ...@@ -193,18 +193,21 @@ namespace Edu.Module.User
DeptName = eItem.EmployeeName, DeptName = eItem.EmployeeName,
ParentId = 0, ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>(), ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = eItem.School_Id School_Id = eItem.School_Id,
DataType = 2,
}); });
} }
} }
} }
#endregion #endregion
var childList = GetDeptTreeList(fItem.DeptId, deptList, empList: empList);
tModel.ChildList = GetDeptTreeList(fItem.DeptId, deptList, empList: empList); if (childList != null && childList.Count > 0)
{
tModel.ChildList.AddRange(childList);
}
list.Add(tModel); list.Add(tModel);
} }
} }
} }
return list; return list;
} }
...@@ -228,7 +231,8 @@ namespace Edu.Module.User ...@@ -228,7 +231,8 @@ namespace Edu.Module.User
ParentId = item.ParentId, ParentId = item.ParentId,
ChildList = new List<DepartmentTree_ViewModel>(), ChildList = new List<DepartmentTree_ViewModel>(),
School_Id=item.School_Id, School_Id=item.School_Id,
IsCompany = item.IsCompany IsCompany = item.IsCompany,
DataType = 1,
}; };
#region 添加员工信息 #region 添加员工信息
if (empList != null && empList.Count > 0) if (empList != null && empList.Count > 0)
...@@ -244,14 +248,18 @@ namespace Edu.Module.User ...@@ -244,14 +248,18 @@ namespace Edu.Module.User
DeptName = eItem.EmployeeName, DeptName = eItem.EmployeeName,
ParentId = 0, ParentId = 0,
School_Id=eItem.School_Id, School_Id=eItem.School_Id,
ChildList = new List<DepartmentTree_ViewModel>() ChildList = new List<DepartmentTree_ViewModel>(),
DataType = 2,
}); });
} }
} }
} }
#endregion #endregion
var childList= GetDeptTreeList(item.DeptId, sourceList);
model.ChildList = GetDeptTreeList(item.DeptId, sourceList); if (childList != null && childList.Count > 0)
{
model.ChildList.AddRange(childList);
}
treeList.Add(model); treeList.Add(model);
} }
return treeList; return treeList;
......
using Edu.Common.Enum;
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
{
/// <summary>
/// 订单仓储层
/// </summary>
public class RB_OrderRepository : BaseRepository<RB_Order>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetList(RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.ClassId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (demodel.OrderState > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
else if (demodel.Q_OrderState == 2)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
string orderBy = "";
if (demodel.Q_OrderBy == 1)
{
orderBy = " o.Id asc";
}
else if (demodel.Q_OrderBy == 2)
{
orderBy = " o.CreateTime desc";
}
string sql = $@" select o.*,c.ClassName,t.TeacherName,t.TeacherIcon from RB_Order o
left join rb_class c on o.ClassId = c.ClassId
left join rb_teacher t on c.Teacher_Id = t.TId
where {where} order by {orderBy}
";
return Get<RB_Order_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Order_ViewModel> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_Order_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.ClassId > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (demodel.OrderState > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
}
if (demodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if (demodel.OrderForm > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if (demodel.EnterID > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if (demodel.Dept_Id > 0)
{
where += $@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if (demodel.Q_OrderState > 0)
{
if (demodel.Q_OrderState == 1)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
else if (demodel.Q_OrderState == 2)
{
where += $@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
string orderBy = "";
if (demodel.Q_OrderBy == 1)
{
orderBy = " o.Id asc";
}
else if (demodel.Q_OrderBy == 2)
{
orderBy = " o.CreateTime desc";
}
string sql = $@" select o.*,c.ClassName,t.TeacherName,t.TeacherIcon from RB_Order o
left join rb_class c on o.ClassId = c.ClassId
left join rb_teacher t on c.Teacher_Id = t.TId
where {where} order by {orderBy}
";
return GetPage<RB_Order_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
}
}
using Edu.Common.Enum;
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
{
/// <summary>
/// 订单客人仓储层
/// </summary>
public class RB_Order_GuestRepository : BaseRepository<RB_Order_Guest>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_ViewModel> GetList(RB_Order_Guest_ViewModel demodel)
{
string where = $@" 1=1 and Status=0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'";
}
if (demodel.GuestState > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
}
string sql = $@" select * from RB_Order_Guest where {where}";
return Get<RB_Order_Guest_ViewModel>(sql).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_Order_Guest_ViewModel> GetClassPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_ViewModel demodel)
{
string where = $@" 1=1 and Status=0";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'";
}
if (demodel.GuestState > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
}
string sql = $@" select * from RB_Order_Guest where {where}";
return GetPage<RB_Order_Guest_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
}
}
using Edu.Common.Enum;
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
{
/// <summary>
/// 订单备注仓储层
/// </summary>
public class RB_Order_RemarkRepository : BaseRepository<RB_Order_Remark>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Remark> GetList(RB_Order_Remark demodel,string orderIds)
{
string where = $@" 1=1";
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(orderIds))
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} in({orderIds})";
}
if (demodel.Type > 0)
{
where += $@" and {nameof(RB_Order_Remark.Type)} ={demodel.Type}";
}
string sql = $@" select * from RB_Order_Remark where {where}";
return Get<RB_Order_Remark>(sql).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_Order_Remark> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_Order_Remark demodel, string orderIds)
{
string where = $@" 1=1";
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} ={demodel.OrderId}";
}
if (!string.IsNullOrEmpty(orderIds))
{
where += $@" and {nameof(RB_Order_Remark.OrderId)} in({orderIds})";
}
if (demodel.Type > 0)
{
where += $@" and {nameof(RB_Order_Remark.Type)} ={demodel.Type}";
}
string sql = $@" select * from RB_Order_Remark where {where}";
return GetPage<RB_Order_Remark>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
}
}
...@@ -156,7 +156,7 @@ namespace Edu.Repository.User ...@@ -156,7 +156,7 @@ namespace Edu.Repository.User
where += $@" and n.{nameof(RB_Notice.UpdateBy)} ={demodel.UpdateBy}"; where += $@" and n.{nameof(RB_Notice.UpdateBy)} ={demodel.UpdateBy}";
} }
if (!string.IsNullOrEmpty(demodel.To)) { if (!string.IsNullOrEmpty(demodel.To)) {
where += $@" and (FIND_IN_SET(n.DeptId,'{demodel.To}') or n.DeptId =-1)"; where += $@" and (FIND_IN_SET(d.DeptId,'{demodel.To}') or d.DeptId =-1)";
} }
string OrderBy = " n.Id desc"; string OrderBy = " n.Id desc";
......
...@@ -95,13 +95,34 @@ namespace Edu.WebApi.Controllers.Course ...@@ -95,13 +95,34 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost] [HttpPost]
public ApiResult SetClass() public ApiResult SetClass()
{ {
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Class_ViewModel>(RequestParm.Msg.ToString()); var extModel = new RB_Class_ViewModel()
extModel.CreateTime = DateTime.Now; {
extModel.CreateBy = UserInfo.Id; CreateBy = UserInfo.Id,
extModel.UpdateBy = UserInfo.Id; CreateTime = DateTime.Now,
extModel.UpdateTime = DateTime.Now; UpdateBy = UserInfo.Id,
extModel.Group_Id = this.UserInfo.Group_Id; UpdateTime = DateTime.Now,
extModel.School_Id = this.UserInfo.School_Id; Group_Id = this.UserInfo.Group_Id,
ClassName = base.ParmJObj.GetStringValue("ClassName"),
CouseId = base.ParmJObj.GetInt("CouseId"),
Teacher_Id = base.ParmJObj.GetInt("Teacher_Id"),
Assist_Id = base.ParmJObj.GetInt("Assist_Id"),
ClassPersion = base.ParmJObj.GetInt("ClassPersion"),
OpenTime = base.ParmJObj.GetDateTime("OpenTime"),
EndOrderTime=base.ParmJObj.GetDateTime("EndOrderTime"),
OriginalPrice=base.ParmJObj.GetDecimal("OriginalPrice"),
SellPrice=base.ParmJObj.GetDecimal("SellPrice"),
IsStepPrice=base.ParmJObj.GetInt("IsStepPrice"),
ClassRoomId=base.ParmJObj.GetInt("ClassRoomId"),
IsOpenCommission=base.ParmJObj.GetInt("IsOpenCommission"),
CommissionType=base.ParmJObj.GetInt("CommissionType"),
CommissionValue=base.ParmJObj.GetDecimal("CommissionValue"),
ClassHours=base.ParmJObj.GetInt("ClassHours"),
ClassStyle=(ClassStyleEnum)base.ParmJObj.GetInt("ClassStyle"),
ClassStatus=(ClassStatusEnum)base.ParmJObj.GetInt("ClassStatus"),
InnerRemark= base.ParmJObj.GetStringValue("InnerRemark"),
OutRemark=base.ParmJObj.GetStringValue("OutRemark"),
CompleteProgress=base.ParmJObj.GetInt("CompleteProgress"),
};
bool flag = classModule.SetClassModule(extModel); bool flag = classModule.SetClassModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
using System;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
namespace Edu.WebApi.Controllers.Course
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class OrderController : BaseController
{
/// <summary>
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
#region 订单管理
#endregion
}
}
...@@ -1111,7 +1111,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -1111,7 +1111,8 @@ namespace Edu.WebApi.Controllers.User
{ {
var query = new RB_Department_ViewModel() var query = new RB_Department_ViewModel()
{ {
Group_Id = base.ParmJObj.GetInt("Group_Id"), Group_Id = base.UserInfo.Group_Id,
School_Id=base.ParmJObj.GetInt("School_Id")
}; };
var list = departmentModule.GetDepartmentTreeModule(query, isQueryEmployee: true); var list = departmentModule.GetDepartmentTreeModule(query, isQueryEmployee: true);
return ApiResult.Success(data: list); return ApiResult.Success(data: list);
......
...@@ -71,30 +71,28 @@ namespace Edu.WebApi.Controllers.User ...@@ -71,30 +71,28 @@ namespace Edu.WebApi.Controllers.User
} }
list = list.OrderBy(x => x.TemplateType).ToList(); list = list.OrderBy(x => x.TemplateType).ToList();
var GroupList = Common.Plugin.EnumHelper.EnumToList(typeof(WFTGroupTypeEnum)); var GroupList = Common.Plugin.EnumHelper.EnumToList(typeof(WFTGroupTypeEnum));
DataTable dtR = new DataTable(); List<object> dtR = new List<object>();
dtR.Columns.Add("GroupName", typeof(string));
dtR.Columns.Add("GroupNum", typeof(string));
dtR.Columns.Add("List", typeof(object));
dtR.AcceptChanges();
foreach (var item in GroupList) foreach (var item in GroupList)
{ {
var dr = dtR.NewRow();
int id = Convert.ToInt32(item.Id); int id = Convert.ToInt32(item.Id);
var TList = list.Where(x => x.GroupType == (WFTGroupTypeEnum)id).ToList(); var TList = list.Where(x => x.GroupType == (WFTGroupTypeEnum)id).ToList();
dr["GroupName"] = item.Name; var dr = new
dr["GroupNum"] = TList.Count;
dr["List"] = TList.Select(x => new
{ {
Icon = Config.GetFileUrl(x.Icon), GroupName = item.Name,
GroupTypeName = x.GroupType.ToName(), GroupNum = TList.Count,
x.Id, List = TList.Select(x => new
x.Name, {
x.TemplateType, Icon = Config.GetErpFileUrl(x.Icon),
x.GroupType, GroupTypeName = x.GroupType.ToName(),
x.Status, x.Id,
UpdateTime = x.UpdateTime == null ? "" : x.UpdateTime.Value.ToString("yyyy-MM-dd HH:mm:ss") x.Name,
}); x.TemplateType,
dtR.Rows.Add(dr); x.GroupType,
x.Status,
UpdateTime = x.UpdateTime == null ? "" : x.UpdateTime.Value.ToString("yyyy-MM-dd HH:mm:ss")
})
};
dtR.Add(dr);
} }
return ApiResult.Success("", dtR); return ApiResult.Success("", dtR);
} }
......
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "server=192.168.1.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ", "DefaultConnection": "server=192.168.1.214;user id=reborn;password=Reborn@2018;database=reborn_edu;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient" "DefaultConnectionPName": "MySql.Data.MySqlClient"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
} }
}, },
"JwtSecretKey": "@VIITTOREBORN*2018", "JwtSecretKey": "@VIITTOREBORN*2018",
"JwtExpirTime": 2592000, "JwtExpirTime": 2592000,
"IsSendMsg": 2, "IsSendMsg": 2,
"AllowedHosts": "*", "AllowedHosts": "*",
"OpenValidation": "False", "OpenValidation": "False",
"UploadSiteUrl": "http://192.168.1.214:8120", "UploadSiteUrl": "http://192.168.1.214:8120",
"ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com", "ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com",
"Mongo": "mongodb://47.96.25.130:27017", "ErpViewFileSiteUrl": "http://imgfile.oytour.com",
"MongoDBName": "Edu", "Mongo": "mongodb://47.96.25.130:27017",
"RabbitMqConfig": { "MongoDBName": "Edu",
"HostName": "47.96.25.130", "RabbitMqConfig": {
"VirtualHost": "/", "HostName": "47.96.25.130",
"Port": 5672, "VirtualHost": "/",
"UserName": "guest", "Port": 5672,
"Password": "viitto2019" "UserName": "guest",
}, "Password": "viitto2019"
"RedisSetting": { },
"RedisServer": "47.96.23.199", "RedisSetting": {
"RedisPort": "6379", "RedisServer": "47.96.23.199",
"RedisPwd": "Viitto2018" "RedisPort": "6379",
}, "RedisPwd": "Viitto2018"
"VirtualDirectory": "WebFile", },
//Ƿϻ "VirtualDirectory": "WebFile",
"IsOnline": false //Ƿϻ
"IsOnline": false
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment