Commit 71cc80dc authored by 黄奎's avatar 黄奎

页面修改

parent 564f6a20
......@@ -93,5 +93,10 @@ namespace Edu.Model.ViewModel.Customer
/// 销售额
/// </summary>
public decimal OrderSales { get; set; }
/// <summary>
/// 查询创建人
/// </summary>
public int QCreateBy { get; set; }
}
}
......@@ -37,18 +37,51 @@ namespace Edu.Model.ViewModel.Sell
}
/// <summary>
/// 适用人员列表
/// 适用人员详情列表
/// </summary>
public List<int> SaleIdList { get { return Common.ConvertHelper.StringToList(this.SaleIds); } }
public List<SaleManItem> SaleList { get; set; }
/// <summary>
/// 适用课程编号列表
/// 适用课程详情
/// </summary>
public List<int> UseCourseIdList { get { return Common.ConvertHelper.StringToList(this.UseCourseIds); } }
public List<CourseItem> UseCourseList { get; set; }
/// <summary>
/// 不适用课程编号列表
/// 不适用课程详情列表
/// </summary>
public List<int> NotUseCourseIdList { get { return Common.ConvertHelper.StringToList(this.NotUseCourseIds); } }
public List<CourseItem> NotUseCourseList { get; set; }
}
/// <summary>
/// 适用人员项目配置
/// </summary>
public class SaleManItem
{
/// <summary>
///人员编号
/// </summary>
public int SaleId { get; set; }
/// <summary>
/// 人员名称
/// </summary>
public string SaleManName { get; set; }
}
/// <summary>
/// 课程项目配置
/// </summary>
public class CourseItem
{
/// <summary>
/// 课程编号
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
}
}
......@@ -6,6 +6,10 @@ using System.Text;
using System.Linq;
using VT.FW.DB;
using Edu.Common.Enum;
using Edu.Repository.User;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
using Edu.Model.ViewModel.Course;
namespace Edu.Module.Course
{
......@@ -24,6 +28,16 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Bouns_PlanDetailRepository bouns_PlanDetailRepository = new RB_Bouns_PlanDetailRepository();
/// <summary>
/// 员工账号仓储层对象
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 课程仓储层对象
/// </summary>
private readonly RB_CourseRepository courseRepository = new RB_CourseRepository();
/// <summary>
/// 获取课程顾问、市场达标奖金配置分页列表
/// </summary>
......@@ -42,8 +56,82 @@ namespace Edu.Module.Course
{
QPlanIds = Ids
});
//适用人员
string saleIds = string.Join(",", list.Where(qitem=>!string.IsNullOrEmpty(qitem.SaleIds)).Select(qitem => qitem.SaleIds));
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (!string.IsNullOrEmpty(saleIds))
{
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = saleIds
});
}
List<int> courseIdList = new List<int>();
var useCourseList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => !string.IsNullOrEmpty(qitem.UseCourseIds)).Select(qitem => qitem.UseCourseIds)));
if (useCourseList != null)
{
courseIdList.AddRange(useCourseList);
}
var notUseCourseList= Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => !string.IsNullOrEmpty(qitem.NotUseCourseIds)).Select(qitem => qitem.NotUseCourseIds)));
if (notUseCourseList != null)
{
courseIdList.AddRange(notUseCourseList);
}
List<RB_Course_ViewModel> courseList = new List<RB_Course_ViewModel>();
if (courseIdList != null && courseIdList.Count > 0)
{
courseRepository.GetCourseListRepository(new RB_Course_ViewModel()
{
QCourseIds = string.Join(",", courseIdList)
});
}
foreach (var item in list)
{
item.SaleList = new List<SaleManItem>();
item.UseCourseList = new List<CourseItem>();
item.NotUseCourseList = new List<CourseItem>();
var saleList = Common.ConvertHelper.StringToList(item.SaleIds);
foreach (var sItem in saleList)
{
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == sItem);
if (tempEmp != null)
{
item.SaleList.Add(new SaleManItem()
{
SaleId = tempEmp.Id,
SaleManName = tempEmp.EmployeeName
});
}
}
var useList= Common.ConvertHelper.StringToList(item.UseCourseIds);
foreach (var cItem in useList)
{
var tempCourse = courseList?.FirstOrDefault(qitem => qitem.CourseId == cItem);
if (tempCourse != null)
{
item.UseCourseList.Add(new CourseItem()
{
CourseId = tempCourse.CourseId,
CourseName = tempCourse.CourseName
});
}
}
var notuseList = Common.ConvertHelper.StringToList(item.NotUseCourseIds);
foreach (var cItem in notuseList)
{
var tempCourse = courseList?.FirstOrDefault(qitem => qitem.CourseId == cItem);
if (tempCourse != null)
{
item.NotUseCourseList.Add(new CourseItem()
{
CourseId = tempCourse.CourseId,
CourseName = tempCourse.CourseName
});
}
}
item.DetailList = detailsList?.Where(qitem => qitem.PlanId == item.Id)?.ToList();
}
}
......@@ -139,7 +227,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Bonus_PlanExtend GetBonusPlanModule(int Id)
public object GetBonusPlanModule(int Id)
{
var extModel = bonus_PlanRepository.GetEntity<RB_Bonus_PlanExtend>(Id);
if (extModel != null)
......@@ -149,7 +237,23 @@ namespace Edu.Module.Course
PlanId = extModel.Id
});
}
return extModel;
var obj = new
{
extModel?.Id,
extModel?.PlanType,
extModel?.PlanName,
extModel?.BasicSalary,
extModel?.OpenBonus,
extModel?.WorkAgeSalary,
extModel?.ClueNumSalary,
extModel?.SaleIds,
SaleIdList = Common.ConvertHelper.StringToList(extModel?.SaleIds),
extModel?.UseCourseIds,
UseCourseIdList = Common.ConvertHelper.StringToList(extModel?.UseCourseIds),
NotUseCourseIdList = Common.ConvertHelper.StringToList(extModel?.NotUseCourseIds),
DetailList = extModel?.DetailList ?? new List<RB_Bouns_PlanDetail_Extend>()
};
return obj;
}
/// <summary>
......
......@@ -60,6 +60,9 @@ namespace Edu.WebApi.Controllers.Bonus
item.PlanTypeStr,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
item.DetailList,
item.SaleList,
item.UseCourseList,
item.NotUseCourseList,
});
}
pageModel.Count = rowsCount;
......
......@@ -118,6 +118,7 @@ namespace Edu.WebApi.Controllers.Customer
model.ApproveState = 1;
model.ApproveId = base.UserInfo.Id;
model.ApproveTime = DateTime.Now;
model.CustomerState = CustomerStateEnum.Normal;
var flag = customerModule.SetCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -655,6 +656,11 @@ namespace Edu.WebApi.Controllers.Customer
ApproveState = 1,
QCustomerState = 1,
};
query.QCreateBy = base.ParmJObj.GetInt("QCreateBy");
if (query.QCreateBy > 0)
{
query.CreateBy = base.UserInfo.Id;
}
var list = customerModule.GetCustomerListModule(query);
return ApiResult.Success(data: list);
}
......
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