Commit c4ea89a6 authored by 黄奎's avatar 黄奎

no message

parents df432485 6c93fdad
......@@ -120,5 +120,10 @@ namespace Edu.Model.Entity.Course
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 退课备注
/// </summary>
public string DropOutRemark { get; set; }
}
}
......@@ -151,5 +151,10 @@ namespace Edu.Model.ViewModel.User
/// 身份证
/// </summary>
public string IDCard { get; set; }
/// <summary>
/// 行政备注
/// </summary>
public string AccountRemark { get; set; }
}
}
......@@ -66,6 +66,18 @@ namespace Edu.Module.Course
/// 助教
/// </summary>
private readonly RB_AssistRepository assistRepository = new RB_AssistRepository();
/// <summary>
/// 学生
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 学生关联
/// </summary>
private readonly RB_Student_OrderGuestRepository student_OrderGuestRepository = new RB_Student_OrderGuestRepository();
/// <summary>
/// 账号
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
#region 日语培训
......@@ -459,6 +471,30 @@ namespace Edu.Module.Course
return orderList;
}
/// <summary>
/// 设置订单使用最新的班级价格
/// </summary>
/// <param name="orderId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public bool SetClassOrderUseNewClassPrice(int orderId, UserInfo userInfo)
{
var demodel = orderRepository.GetEntity(orderId);
//查询班级信息
var classModel = classRepository.GetEntity(demodel.ClassId);
if (classModel == null)
{
return false;
}
List<RB_Class_StepPrice_ViewModel> spList = new List<RB_Class_StepPrice_ViewModel>();
if (classModel.IsStepPrice == 1)
{
spList = class_StepPriceRepository.GetClassStepPriceListRepository(new RB_Class_StepPrice_ViewModel() { ClassId = demodel.ClassId });
}
return true;
}
/// <summary>
/// 更新订单销售
/// </summary>
......@@ -804,6 +840,7 @@ namespace Edu.Module.Course
bool flag = order_GuestRepository.Update(gModel);
if (flag)
{
//记录日志
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
......@@ -831,6 +868,79 @@ namespace Edu.Module.Course
bool flag = Id > 0;
if (flag)
{
var classmodel = classRepository.GetEntity(ordermodel.ClassId);
//验证账号是否存在
var accmodel = accountRepository.GetAccountListRepository(new RB_Account_ViewModel() { Group_Id = dmodel.Group_Id, AccountType = Common.Enum.User.AccountTypeEnum.Student, Account = dmodel.Mobile }).FirstOrDefault();
string LogContent = "新增学生名单【" + Id + "】";
if (accmodel != null)
{
student_OrderGuestRepository.Insert(new Model.Entity.User.RB_Student_OrderGuest()
{
Id = 0,
Account_Id = accmodel.Id,
ClassId = ordermodel.ClassId,
CreateBy = dmodel.CreateBy,
CreateTime = DateTime.Now,
GuestId = Id,
OrderId = dmodel.OrderId,
Status = DateStateEnum.Normal,
Student_Id = accmodel.AccountId
});
LogContent += ",添加学生账号关联【" + accmodel.Id + "】";
}
else
{
//创建学生账号
int StudentId = studentRepository.Insert(new Model.Entity.User.RB_Student()
{
StuId = 0,
AreaId = 0,
CityId = 0,
CreateBy = dmodel.CreateBy,
CreateTime = DateTime.Now,
Group_Id = dmodel.Group_Id,
IsDisable = 1,
ProviceId = 0,
School_Id = classmodel.School_Id,
Status = DateStateEnum.Normal,
StuBirth = null,
StuIcon = "",
StuName = dmodel.GuestName,
StuSex = dmodel.Sex - 1,
StuTel = dmodel.Mobile,
UpdateBy = dmodel.CreateBy,
UpdateTime = DateTime.Now
});
int AccountId = accountRepository.Insert(new Model.Entity.User.RB_Account()
{
Id = 0,
Account = dmodel.Mobile,
AccountId = StudentId,
AccountType = Common.Enum.User.AccountTypeEnum.Student,
AnnualLeaveDay = 0,
CreateBy = dmodel.CreateBy,
CreateTime = DateTime.Now,
Group_Id = dmodel.Group_Id,
School_Id = classmodel.School_Id,
Status = DateStateEnum.Normal,
UpdateBy = dmodel.UpdateBy,
UpdateTime = DateTime.Now,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd)
});
student_OrderGuestRepository.Insert(new Model.Entity.User.RB_Student_OrderGuest()
{
Id = 0,
Account_Id = AccountId,
ClassId = ordermodel.ClassId,
CreateBy = dmodel.CreateBy,
CreateTime = DateTime.Now,
GuestId = Id,
OrderId = dmodel.OrderId,
Status = DateStateEnum.Normal,
Student_Id = StudentId
});
LogContent += ",自动创建学生账号【" + AccountId + "】";
}
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
......@@ -838,7 +948,7 @@ namespace Edu.Module.Course
CreateBy = dmodel.CreateBy,
CreateTime = DateTime.Now,
Group_Id = dmodel.Group_Id,
LogContent = "新增学生名单【" + Id + "】",
LogContent = LogContent,
School_Id = dmodel.School_Id,
SourceId = dmodel.OrderId
});
......@@ -869,6 +979,22 @@ namespace Edu.Module.Course
if (flag)
{
var gmodel = order_GuestRepository.GetEntity(guestId);
//查询学生账号
//var sModel = student_OrderGuestRepository.GetStrOrderGuestListRepository(new RB_Student_OrderGuest_ViewModel() { OrderId = gmodel?.OrderId ?? 0, GuestId = guestId }).FirstOrDefault();
//if (sModel != null) {
// //更新账号表
// Dictionary<string, object> valuePairs = new Dictionary<string, object>() {
// { nameof(RB_Account_ViewModel.Status),DateStateEnum.Delete}
// };
// List<WhereHelper> wheres1 = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName=nameof(RB_Account_ViewModel.Id),
// FiledValue=sModel.Account_Id,
// OperatorEnum=OperatorEnum.Equal
// }
// };
// accountRepository.Update(valuePairs, wheres1);
//}
changeLogRepository.Insert(new Model.Entity.Log.RB_User_ChangeLog()
{
Id = 0,
......
......@@ -297,7 +297,7 @@ FROM
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
SELECT ar.AccountRemark,A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName
......@@ -331,6 +331,8 @@ b.School_Id,IFNULL(B.AssistName,'') AS EmployeeName,B.AssistIcon AS UserIcon,B.D
LEFT JOIN rb_school AS s ON A.School_Id=s.SId
LEFT JOIN rb_department AS d ON A.Dept_Id=d.DeptId
LEFT JOIN rb_post AS p ON A.Post_Id=p.PostId
LEFT JOIN (SELECT AccountId,AccountType,MAX(Content) as AccountRemark from rb_accountremark where Group_Id=100000 and `Status`=0 GROUP BY AccountId,AccountType ORDER BY CreateTime desc)
as ar on a.AccountId=ar.AccountId and A.AccountType=ar.AccountType
WHERE 1=1 {4}
", where.ToString(), wheremanager.ToString(), whereteacher.ToString(), whereassist.ToString(), where2.ToString());
return builder.ToString();
......
......@@ -544,9 +544,24 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetClassOrderUseNewPrice() {
public ApiResult SetClassOrderUseNewClassPrice()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(RequestParm.Msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
if (OrderId <= 0) {
return ApiResult.ParamIsNull();
}
bool flag = orderModule.SetClassOrderUseNewClassPrice(OrderId, userInfo);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
}
#endregion
......@@ -602,7 +617,9 @@ namespace Edu.WebApi.Controllers.Course
if (string.IsNullOrEmpty(dmodel.GuestName)) {
return ApiResult.ParamIsNull("请输入客人姓名");
}
if (string.IsNullOrEmpty(dmodel.Mobile)) {
return ApiResult.ParamIsNull("请输入手机号码");
}
dmodel.GuestState = 1;
dmodel.Status = 0;
......
......@@ -662,6 +662,7 @@ namespace Edu.WebApi.Controllers.User
qitem.School_Id,
qitem.Group_Id,
qitem.Dept_Id,
qitem.AccountRemark
});
return ApiResult.Success(data: pageModel);
}
......@@ -857,8 +858,11 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult GetAccountRemarkTypeEnumList()
{
int type = base.ParmJObj.GetInt("Type", 0);
var list = EnumHelper.EnumToList(typeof(RemarkTypeEnum));
return ApiResult.Success("", list);
}
/// <summary>
......
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