Commit bb43df16 authored by 黄奎's avatar 黄奎

页面修改

parent 8b4c5ac2
......@@ -238,6 +238,10 @@ namespace Mall.Model.Entity.Education
/// </summary>
public int WeiXinType { get; set; }
/// <summary>
/// 关联老师
/// </summary>
public int TeacherId { get; set; }
}
}
......@@ -87,6 +87,11 @@ namespace Mall.Model.Extend.Education
public string StuBirth { get; set; }
public List<int> ExcelEnumIds { get; set; }
/// <summary>
/// 教师名称
/// </summary>
public string TeacherName { get; set; }
}
......
......@@ -154,10 +154,10 @@ namespace Mall.Module.Education
/// </summary>
private readonly RB_Education_ActivityPlanRepository education_ActivityPlanRepository = new RB_Education_ActivityPlanRepository();
/// <summary>
#region 活动分类
/// <summary>
/// 活动分类
/// <summary>
/// 获取商会活动类型分页列表
/// </summary>
/// <param name="pageIndex"></param>
......@@ -573,7 +573,7 @@ namespace Mall.Module.Education
var list = education_EduSellRepository.GetEducationStuList(query, true);
if (list != null && list.Any(x => x.EduSellId > 0))
{
string qIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type ==1).Distinct().Select(x => x.EduSellId));
string qIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type == 1).Distinct().Select(x => x.EduSellId));
var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { QIds = qIds }).ToList();
string qstuIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type == 2).Distinct().Select(x => x.EduSellId));
var stuList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel() { QIds = qstuIds, AccountType = 4 });
......@@ -584,7 +584,8 @@ namespace Mall.Module.Education
{
item.employeeModel = employeeList.Where(x => x.Id == item.EduSellId).FirstOrDefault();
}
else if (item.Type == 2) {
else if (item.Type == 2)
{
var stuModel = stuList.Where(x => x.Id == item.EduSellId).FirstOrDefault();
item.employeeModel = new Employee_ViewModel()
{
......@@ -644,7 +645,8 @@ namespace Mall.Module.Education
if (model.Id == 0)
{
flag = education_EduSellRepository.Insert(model) > 0;
if (flag) {
if (flag)
{
//绑定成功 直接初始化 免费咖啡劵
//if (model.Type == 1)
//{
......@@ -933,6 +935,11 @@ namespace Mall.Module.Education
var employeeList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel { QIds = qIds }).ToList();
list.ForEach(x => x.EduStudentName = x.EduStudentId > 0 ? employeeList.Where(y => y.Id == x.EduStudentId).FirstOrDefault()?.AccountName : "");
}
List<Employee_ViewModel> teacherList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel
{
AccountTypeStr = "2"
}).ToList();
List<RB_Finance_Extend> flist = new List<RB_Finance_Extend>();
string orderIds = string.Join(",", list.Select(x => x.Id));
flist = financeRepository.GetListJH(new RB_Finance_Extend() { ReFinanceIds2 = orderIds });
......@@ -978,16 +985,17 @@ namespace Mall.Module.Education
}
}
}
}
foreach (var item in list)
}
}
foreach (var item in list)
{
item.FinanceList = new List<RB_Finance_Extend>();
item.FinanceList = flist.Where(x => x.ReFinanceId2 == item.Id).ToList();
if (item.FinanceList == null || !item.FinanceList.Any())
{
item.FinanceList = new List<RB_Finance_Extend>();
item.FinanceList = flist.Where(x => x.ReFinanceId2 == item.Id).ToList();
if (item.FinanceList == null || !item.FinanceList.Any())
{
item.FinanceList = new List<RB_Finance_Extend>();
}
}
item.TeacherName = teacherList?.FirstOrDefault(qitem => qitem.AccountId == item.TeacherId)?.EmployeeName ?? "";
}
}
return list;
......@@ -1107,21 +1115,23 @@ namespace Mall.Module.Education
try
{
flag = education_ConsultRepository.Insert(demodel, trans);
if (flag > 0)
{
if (demodel.TotalPoint > 0)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(Model.Extend.User.RB_Member_User_Extend.PointNum),umodel.PointNum - demodel.TotalPoint}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Member_User_Extend.Id),
FiledValue=umodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
{
nameof(Model.Extend.User.RB_Member_User_Extend.PointNum),umodel.PointNum - demodel.TotalPoint}
};
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName=nameof(RB_Member_User_Extend.Id),
FiledValue=umodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
member_UserRepository.Update(keyValues, wheres, trans);
member_PointBalanceRepository.Insert(new Model.Entity.User.RB_Member_PointBalance()
{
......@@ -1146,7 +1156,6 @@ namespace Mall.Module.Education
LogHelper.Write(ex, "SetActivityEnrollInfo");
education_ConsultRepository.DBSession.Rollback("SetActivityEnrollInfo");
return 0;
}
}
else if (demodel.PaymentWay == Common.Enum.Goods.OrderPaymentTypeEnum.OnlinePayment)
......@@ -1174,8 +1183,6 @@ namespace Mall.Module.Education
}
/// <summary>
/// 订单记录当前用户的所有上级
/// </summary>
......@@ -1937,7 +1944,6 @@ namespace Mall.Module.Education
#endregion
#region 教育学生信息
/// <summary>
/// 获取学生列表
......@@ -2033,9 +2039,6 @@ namespace Mall.Module.Education
#endregion
#region 活动总结
/// <summary>
......@@ -2231,8 +2234,6 @@ namespace Mall.Module.Education
}
#endregion
#region 财务单据信息
......@@ -2619,7 +2620,8 @@ namespace Mall.Module.Education
DateTime STime = Convert.ToDateTime(query.SelectStartTimeStr);
DateTime ETime = Convert.ToDateTime(query.SelectEndTimeStr);
List<object> RList = new List<object>();
while (true) {
while (true)
{
var alist = list.Where(x => Convert.ToDateTime(x.StartTime.ToString("yyyy-MM-dd")) <= STime && Convert.ToDateTime(x.EndTime.ToString("yyyy-MM-dd")) >= STime).ToList();
RList.Add(new
{
......@@ -2639,7 +2641,8 @@ namespace Mall.Module.Education
x.ActivityStatus
})
});
if (STime == ETime) {
if (STime == ETime)
{
break;
}
STime = STime.AddDays(1);
......
......@@ -2391,6 +2391,7 @@ namespace Mall.WebApi.Controllers.Education
StartTime = jObj.GetDateTime("StartTime"),//活动开始时间
EndTime = jObj.GetDateTime("EndTime"),//活动结束时间
Id = jObj.GetInt("Id", 0),//订单号
TeacherId=jObj.GetInt("TeacherId"),
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
......@@ -2444,6 +2445,8 @@ namespace Mall.WebApi.Controllers.Education
x.CoverImg,
IncomeFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.IN && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(),
ExpendFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.OUT && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(),
x.TeacherId,
x.TeacherName,
})
};
......@@ -2709,8 +2712,25 @@ namespace Mall.WebApi.Controllers.Education
public ApiResult SetActivityEnrollInfo()
{
var request = RequestParm;
Model.Extend.Education.RB_Education_Consult_Extend demodel = JsonConvert.DeserializeObject<Model.Extend.Education.RB_Education_Consult_Extend>(request.msg.ToString());
JObject jObj = JObject.Parse(RequestParm.msg.ToString());
RB_Education_Consult_Extend demodel = new RB_Education_Consult_Extend()
{
Id=jObj.GetInt("Id"),
LinkMan=jObj.GetStringValue("LinkMan"),
LinkTel=jObj.GetStringValue("LinkTel"),
Remark=jObj.GetStringValue("Remark"),
ActivityId=jObj.GetInt("ActivityId"),
PeopleNum=jObj.GetInt("PeopleNum"),
Sex=jObj.GetInt("Sex"),
EduStudentId=jObj.GetInt("EduStudentId"),
UnitPrice=jObj.GetDecimal("UnitPrice"),
Money=jObj.GetInt("Money"),
EduUserId=jObj.GetInt("EduUserId"),
PayWay=(Common.Enum.Goods.OrderPayTypeEnum)jObj.GetInt("PayWay"),
TenantId=jObj.GetInt("TenantId"),
MallBaseId=jObj.GetInt("MallBaseId"),
TeacherId=jObj.GetInt("TeacherId"),
};
var model = activityModule.GetActivityModule(demodel.ActivityId);
List<RB_Education_Consult_Extend> list = new List<RB_Education_Consult_Extend>();
if (demodel.EduStudentId > 0)
......@@ -2798,7 +2818,6 @@ namespace Mall.WebApi.Controllers.Education
}
else
{
var bmodel = activityModule.GetStudentListByEnterID(new RB_Student { StuId = demodel.EduStudentId }, demodel.EduUserId).FirstOrDefault();
if (bmodel == null || bmodel.StuId == 0)
{
......
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