Commit 1d484200 authored by 黄奎's avatar 黄奎

新增退课协议相关类

parent 1d580472
using System; using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Contract namespace Edu.Model.Entity.Contract
{ {
/// <summary> /// <summary>
/// 学员退课协议实体类 /// 学员退课协议实体类
/// </summary> /// </summary>
public class RB_BackClass_Protocol [Serializable]
{ [DB(ConnectionName = "DefaultConnection")]
public class RB_BackClass_Protocol
{
/// <summary> /// <summary>
/// 主键编号 /// 主键编号
/// </summary> /// </summary>
...@@ -132,5 +135,24 @@ namespace Edu.Model.Entity.Contract ...@@ -132,5 +135,24 @@ namespace Edu.Model.Entity.Contract
/// </summary> /// </summary>
public int? AuditStatus { get; set; } public int? AuditStatus { 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; }
} }
} }
...@@ -82,6 +82,11 @@ namespace Edu.Module.Course ...@@ -82,6 +82,11 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_CourseRepository courseRepository = new RB_CourseRepository(); private readonly RB_CourseRepository courseRepository = new RB_CourseRepository();
/// <summary>
/// 退课协议仓储层
/// </summary>
private readonly RB_BackClass_ProtocolRepository backClass_ProtocolRepository = new RB_BackClass_ProtocolRepository();
/// <summary> /// <summary>
/// 获取学员信息 /// 获取学员信息
/// </summary> /// </summary>
...@@ -169,7 +174,7 @@ namespace Edu.Module.Course ...@@ -169,7 +174,7 @@ namespace Edu.Module.Course
item.SchoolStatusStr = "草稿"; item.SchoolStatusStr = "草稿";
item.AdminStatusStr = "草稿"; item.AdminStatusStr = "草稿";
} }
else if (item.Status == 1) else if (item.Status == 1)
{ {
item.SchoolStatusStr = "待审核"; item.SchoolStatusStr = "待审核";
item.AdminStatusStr = "待审核"; item.AdminStatusStr = "待审核";
...@@ -646,5 +651,18 @@ namespace Edu.Module.Course ...@@ -646,5 +651,18 @@ namespace Edu.Module.Course
return financeOrderRecordRepository.GetOrderRecordList(model); return financeOrderRecordRepository.GetOrderRecordList(model);
} }
#endregion #endregion
/// <summary>
/// 获取退课协议分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="query"></param>
/// <param name="rowsCount"></param>
/// <returns></returns>
public List<RB_BackClass_Protocol_ViewModel> GetBackClassProtocolPageModule(int pageIndex, int pageSize, RB_BackClass_Protocol_ViewModel query, out long rowsCount)
{
return backClass_ProtocolRepository.GetBackClassProtocolPageRepository(pageIndex, pageSize, query, out rowsCount);
}
} }
} }
\ No newline at end of file
...@@ -13,6 +13,9 @@ using Edu.Model.ViewModel.BackClass; ...@@ -13,6 +13,9 @@ using Edu.Model.ViewModel.BackClass;
using Edu.Model.ViewModel.Sell; using Edu.Model.ViewModel.Sell;
using Edu.Repository.BackClass; using Edu.Repository.BackClass;
using Edu.Repository.Grade; using Edu.Repository.Grade;
using Edu.Repository.Contract;
using Edu.Model.Entity.Contract;
using Edu.Model.Entity.Course;
namespace Edu.Module.Course namespace Edu.Module.Course
{ {
...@@ -42,6 +45,12 @@ namespace Edu.Module.Course ...@@ -42,6 +45,12 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_Education_ReceiptRepository education_ReceiptRepository = new RB_Education_ReceiptRepository(); private readonly RB_Education_ReceiptRepository education_ReceiptRepository = new RB_Education_ReceiptRepository();
/// <summary>
/// 退课协议仓储层对象
/// </summary>
private readonly RB_BackClass_ProtocolRepository backClass_ProtocolRepository = new RB_BackClass_ProtocolRepository();
/// <summary> /// <summary>
/// 创建退课流程 /// 创建退课流程
...@@ -50,9 +59,13 @@ namespace Edu.Module.Course ...@@ -50,9 +59,13 @@ namespace Edu.Module.Course
/// <param name="OrderId"></param> /// <param name="OrderId"></param>
/// <param name="reason"></param> /// <param name="reason"></param>
/// <param name="userinfo"></param> /// <param name="userinfo"></param>
/// <param name="receiptFile"></param>
/// <param name="BackAccountName"></param>
/// <param name="BackAccount"></param>
/// <param name="StateMent">退课协议申明</param>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public virtual bool CreateBackClassApplyModule(int GuestId, int OrderId, string reason, UserInfo userinfo,string receiptFile,string BackAccountName,string BackAccount, out string message) public virtual bool CreateBackClassApplyModule(int GuestId, int OrderId, string reason, UserInfo userinfo,string receiptFile,string BackAccountName,string BackAccount,string StateMent,out string message)
{ {
bool flag; bool flag;
message = ""; message = "";
...@@ -83,6 +96,9 @@ namespace Edu.Module.Course ...@@ -83,6 +96,9 @@ namespace Edu.Module.Course
AccountType = Common.Enum.User.AccountTypeEnum.Teacher AccountType = Common.Enum.User.AccountTypeEnum.Teacher
})?.FirstOrDefault(); })?.FirstOrDefault();
var teacherId = teacherModel?.Id ?? 0; var teacherId = teacherModel?.Id ?? 0;
var saleMan = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel() {
Id = orderModel.EnterID
})?.FirstOrDefault();
var totalBackCount = student_BackClassRepository.GetStudentBackClassNumRepository(); var totalBackCount = student_BackClassRepository.GetStudentBackClassNumRepository();
string backNum; string backNum;
if (totalBackCount < 10000) if (totalBackCount < 10000)
...@@ -96,13 +112,22 @@ namespace Edu.Module.Course ...@@ -96,13 +112,22 @@ namespace Edu.Module.Course
var stuCheckList = class_CheckRepository.GetGuestFinishMinutesRepository(GuestId.ToString()); var stuCheckList = class_CheckRepository.GetGuestFinishMinutesRepository(GuestId.ToString());
//完成课时数 //完成课时数
var FinishHours = stuCheckList?.Sum(qitem => qitem.FinishClassHours) ?? 0; var FinishHours = stuCheckList?.Sum(qitem => qitem.FinishClassHours) ?? 0;
var courseModel = new RB_Course();
if (orderModel.CourseId > 0)
{
courseModel = courseRepository.GetEntity(orderModel.CourseId);
}
else
{
courseModel = courseRepository.GetEntity(classModel.CouseId);
}
//课时单价 //课时单价
decimal classHourPrice = 0; decimal classHourPrice = 0;
//原课时单价 //原课时单价
//classHourPrice = orderModel.PreferPrice / orderModel.GuestNum / classModel.ClassHours; //classHourPrice = orderModel.PreferPrice / orderModel.GuestNum / classModel.ClassHours;
//标准课时单价=课程卖价/课时 //标准课时单价=课程卖价/课时
classHourPrice = classModel.SellPrice / classModel.ClassHours; classHourPrice = courseModel.SellPrice / classModel.ClassHours;
//预计退款金额 //预计退款金额
decimal backMoney =0; decimal backMoney =0;
//违约金 //违约金
...@@ -162,6 +187,44 @@ namespace Edu.Module.Course ...@@ -162,6 +187,44 @@ namespace Edu.Module.Course
flag = order_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), GuestId)); flag = order_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), GuestId));
} }
} }
//生成退课协议
if (flag)
{
string FinaceNum = "";
var flist = financeRepository.GetListSingle(new Model.ViewModel.Finance.RB_Finance_Extend() { RB_Group_Id = orderModel.Group_Id, FinanceType = 2, IsSelectNormal = 1, OrderIdStr = OrderId.ToString(), GuestIdStr = GuestId.ToString() });
if (flist != null && flist.Count > 0)
{
FinaceNum = string.Join(",", flist.Select(qitem => qitem.FrID));
}
RB_BackClass_Protocol model = new RB_BackClass_Protocol()
{
Id=0,
BackId= newBackId,
ProtocolNum=Common.ConvertHelper.FormatDate(DateTime.Now),
PartyAName=guestModel.GuestName,
PartyAGuardian="",
PartyBName="",
PartyBLegal="",
SignDate=null,
OldSaleMan= saleMan?.AccountName??"",
OldCourseName=courseModel?.CourseName??"",
OldSellPrice=courseModel?.SellPrice??0,
OldDiscountMoney=orderModel?.DiscountMoney??0,
OldIncome=(orderModel?.Income??0) +(orderModel?.PlatformTax??0) -(orderModel?.Refund??0),
OldFinaceNum= FinaceNum,
OldReceiveMan=saleMan?.AccountName??"",
TotalClassHours=guestModel.TotalHours,
CompleteHours=guestModel.CompleteHours,
SurplusHours= guestModel.TotalHours- guestModel.CompleteHours,
BackMoney= backClassModel.BackMoney,
AuditStatus=(int)Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
CreateBy=orderModel.EnterID,
CreateTime=DateTime.Now,
Group_Id=orderModel.School_Id,
School_Id=classModel.School_Id,
};
flag = backClass_ProtocolRepository.Insert(model) > 0;
}
return flag; return flag;
} }
......
using Edu.Model.Entity.Contract;
using Edu.Model.ViewModel.Contract;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Contract
{
/// <summary>
/// 退课协议仓储层对象
/// </summary>
public class RB_BackClass_ProtocolRepository : BaseRepository<RB_BackClass_Protocol>
{
/// <summary>
/// 获取退课协议列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_BackClass_Protocol_ViewModel> GetBackClassProtocolListRepository(RB_BackClass_Protocol_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_BackClass_Protocol AS A
WHERE 1=1
");
if (query != null)
{
}
return Get<RB_BackClass_Protocol_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取退课协议分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="query"></param>
/// <param name="rowsCount"></param>
/// <returns></returns>
public List<RB_BackClass_Protocol_ViewModel> GetBackClassProtocolPageRepository(int pageIndex, int pageSize, RB_BackClass_Protocol_ViewModel query,out long rowsCount)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_BackClass_Protocol AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_BackClass_Protocol_ViewModel.Group_Id), query.Group_Id);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_BackClass_Protocol_ViewModel.CreateBy), query.CreateBy);
}
}
return GetPage<RB_BackClass_Protocol_ViewModel>(pageIndex,pageSize,out rowsCount,builder.ToString()).ToList();
}
}
}
...@@ -216,11 +216,6 @@ namespace Edu.WebApi.Controllers.Course ...@@ -216,11 +216,6 @@ namespace Edu.WebApi.Controllers.Course
} }
/// <summary> /// <summary>
/// 获取合同详情 /// 获取合同详情
/// </summary> /// </summary>
...@@ -310,8 +305,6 @@ namespace Edu.WebApi.Controllers.Course ...@@ -310,8 +305,6 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary> /// <summary>
/// 设置合同审核 /// 设置合同审核
/// </summary> /// </summary>
...@@ -440,5 +433,51 @@ namespace Edu.WebApi.Controllers.Course ...@@ -440,5 +433,51 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success("", path); return ApiResult.Success("", path);
} }
#endregion #endregion
/// <summary>
/// 获取退课分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetBackClassProtocolPage()
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var dmodel = new RB_BackClass_Protocol_ViewModel()
{
};
dmodel.Group_Id = userInfo.Group_Id;
dmodel.CreateBy = userInfo.Id;
var list = educationContractModule.GetBackClassProtocolPageModule(pageModel.PageIndex, pageModel.PageSize, dmodel, out long count);
pageModel.Count = Convert.ToInt32(count);
pageModel.PageData = list.Select(x => new
{
x.Id,
//x.CType,
//CTypeName = x.CType.ToName(),
//IsStuSign = !string.IsNullOrEmpty(x.Sign) ? 1 : 0,
//x.OrderId,
//x.GuestId,
//x.ContractNo,
//x.StudentName,
//x.SchoolName,
//x.CourseName,
//x.CNYCaps,
//x.Money,
//x.Exam,
//x.Sign,
//x.Status,
//x.StatusStr,
//x.IsCompanySeal,
//x.CreateBy,
//x.CreateByName,
//x.CreateByPhoto,
//CreateTime = x.CreateTime.ToString("yyyy-MM-dd HH:mm"),
//x.SchoolStatusStr,
//x.AdminStatusStr
});
return ApiResult.Success("", pageModel);
}
} }
} }
...@@ -2149,8 +2149,9 @@ namespace Edu.WebApi.Controllers.Course ...@@ -2149,8 +2149,9 @@ namespace Edu.WebApi.Controllers.Course
} }
var BackAccountName = base.ParmJObj.GetStringValue("BackAccountName"); var BackAccountName = base.ParmJObj.GetStringValue("BackAccountName");
var BackAccount = base.ParmJObj.GetStringValue("BackAccount"); var BackAccount = base.ParmJObj.GetStringValue("BackAccount");
var StateMent = base.ParmJObj.GetStringValue("StateMent");
bool flag = orderModule.CreateBackClassApplyModule(GuestId, OrderId, applyReason, base.UserInfo, receiptFile, BackAccountName, BackAccount, out string message); bool flag = orderModule.CreateBackClassApplyModule(GuestId, OrderId, applyReason, base.UserInfo, receiptFile, BackAccountName, BackAccount,StateMent,out string message);
return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message); return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
} }
#endregion #endregion
......
...@@ -26,7 +26,7 @@ namespace Edu.WebApi.Timers ...@@ -26,7 +26,7 @@ namespace Edu.WebApi.Timers
/// <summary> /// <summary>
/// 订单处理类对象 /// 订单处理类对象
/// </summary> /// </summary>
private static readonly Module.EduTask.StopStudentClassModule stopStudentClassModule = AOP.AOPHelper.CreateAOPObject<Module.EduTask.StopStudentClassModule>(); private static readonly StopStudentClassModule stopStudentClassModule = AOP.AOPHelper.CreateAOPObject<StopStudentClassModule>();
/// <summary> /// <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