Commit 6ed9df02 authored by 黄奎's avatar 黄奎

页面修改

parent 2955df7e
...@@ -725,7 +725,7 @@ namespace Edu.Module.Customer ...@@ -725,7 +725,7 @@ namespace Edu.Module.Customer
} }
/// <summary> /// <summary>
/// 新增修改课程顾问部目标 /// 修改课程顾问部目标
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
...@@ -742,11 +742,29 @@ namespace Edu.Module.Customer ...@@ -742,11 +742,29 @@ namespace Edu.Module.Customer
}; };
flag = consultant_GoalRepository.Update(fileds, new WhereHelper(nameof(RB_Consultant_Goal_Extend.Id), model.Id)); flag = consultant_GoalRepository.Update(fileds, new WhereHelper(nameof(RB_Consultant_Goal_Extend.Id), model.Id));
} }
else
return flag;
}
/// <summary>
/// 批量添加课程顾问部目标
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool AddConsultantGoalModule(List<RB_Consultant_Goal_Extend> list)
{
bool flag = false;
if (list != null && list.Count > 0)
{ {
var newId = consultant_GoalRepository.Insert(model); foreach (var item in list)
model.Id = newId; {
flag = newId > 0; if (!flag)
{
var newId = consultant_GoalRepository.Insert(item);
item.Id = newId;
flag = newId > 0;
}
}
} }
return flag; return flag;
} }
......
...@@ -13,6 +13,7 @@ using Edu.Common.Enum.User; ...@@ -13,6 +13,7 @@ using Edu.Common.Enum.User;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.CacheModel; using Edu.Model.CacheModel;
using Edu.Model.Public; using Edu.Model.Public;
using Edu.Model.ViewModel.DataStatistics;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Module.Course; using Edu.Module.Course;
using Edu.Module.Customer; using Edu.Module.Customer;
...@@ -2552,6 +2553,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2552,6 +2553,7 @@ namespace Edu.WebApi.Controllers.User
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowRepeatAttribute]
public ApiResult MarketStatic() public ApiResult MarketStatic()
{ {
string startTime = base.ParmJObj.GetStringValue("startTime"); string startTime = base.ParmJObj.GetStringValue("startTime");
...@@ -2584,6 +2586,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2584,6 +2586,7 @@ namespace Edu.WebApi.Controllers.User
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowRepeatAttribute]
public ApiResult ConsultantStatic() public ApiResult ConsultantStatic()
{ {
string startTime = base.ParmJObj.GetStringValue("startTime"); string startTime = base.ParmJObj.GetStringValue("startTime");
...@@ -2614,6 +2617,126 @@ namespace Edu.WebApi.Controllers.User ...@@ -2614,6 +2617,126 @@ namespace Edu.WebApi.Controllers.User
#region 课程顾问部目标 #region 课程顾问部目标
/// <summary>
/// 获取课程顾问部目标分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetConsultantGoalPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Consultant_Goal_Extend()
{
YearStr=base.ParmJObj.GetInt("YearStr"),
MonthStr=base.ParmJObj.GetInt("MonthStr"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data= marketConsultantModule.GetConsultantGoalPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = data;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 修改课程顾问部目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult UpdateConsultantGoal()
{
var model = new RB_Consultant_Goal_Extend()
{
Id=base.ParmJObj.GetInt("Id"),
YearStr=base.ParmJObj.GetInt("YearStr"),
MonthStr=base.ParmJObj.GetInt("MonthStr"),
GoalMoney=base.ParmJObj.GetDecimal("GoalMoney"),
Dept_Id=base.ParmJObj.GetInt("Dept_Id"),
};
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.Status = Common.Enum.DateStateEnum.Normal;
bool flag = marketConsultantModule.SetConsultantGoalModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 新增课程顾问部目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult AddConsultantGoal()
{
List<RB_Consultant_Goal_Extend> list = new List<RB_Consultant_Goal_Extend>();
var timeListStr = base.ParmJObj.GetStringValue("TimeList");
if (!string.IsNullOrEmpty(timeListStr))
{
List<string> timeList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(timeListStr);
if (timeList != null && timeList.Count > 0)
{
foreach (var item in timeList)
{
var tempArray = item.Split('-');
if (tempArray != null && tempArray.Length == 2)
{
Int32.TryParse(tempArray[0], out int YearStr);
Int32.TryParse(tempArray[1], out int MonthStr);
var model = new RB_Consultant_Goal_Extend()
{
Id = 0,
YearStr = YearStr,
MonthStr = MonthStr,
GoalMoney = base.ParmJObj.GetDecimal("GoalMoney"),
Dept_Id = base.ParmJObj.GetInt("Dept_Id"),
};
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.Status = Common.Enum.DateStateEnum.Normal;
if (YearStr > 0 && MonthStr > 0)
{
list.Add(model);
}
}
}
}
}
bool flag = marketConsultantModule.AddConsultantGoalModule(list);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetConsultantGoal()
{
var Id = base.ParmJObj.GetInt("Id");
var extModel = marketConsultantModule.GetConsultantGoalModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 根据编号删除目标
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveConsultantGoal()
{
var Id = base.ParmJObj.GetInt("Id");
var extModel = marketConsultantModule.RemoveConsultantGoalModule(Id);
return ApiResult.Success(data: extModel);
}
#endregion #endregion
} }
} }
\ 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