Commit ff84bd30 authored by 黄奎's avatar 黄奎

新增接口

parent d9346fe5
...@@ -14,7 +14,6 @@ namespace Edu.Repository.Customer ...@@ -14,7 +14,6 @@ namespace Edu.Repository.Customer
/// </summary> /// </summary>
public class RB_EnterpriseRepository:BaseRepository<RB_Enterprise> public class RB_EnterpriseRepository:BaseRepository<RB_Enterprise>
{ {
/// <summary> /// <summary>
/// 获取企业分页列表 /// 获取企业分页列表
/// </summary> /// </summary>
......
...@@ -44,7 +44,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -44,7 +44,7 @@ namespace Edu.WebApi.Controllers.Customer
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetCustomerPage() public ApiResult GetCustomerPage()
{ {
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Customer_Extend() var query = new RB_Customer_Extend()
{ {
...@@ -54,7 +54,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -54,7 +54,7 @@ namespace Edu.WebApi.Controllers.Customer
ContactNumber = base.ParmJObj.GetStringValue("ContactNumber"), ContactNumber = base.ParmJObj.GetStringValue("ContactNumber"),
ApproveState = base.ParmJObj.GetInt("ApproveState"), ApproveState = base.ParmJObj.GetInt("ApproveState"),
QCustomerState = base.ParmJObj.GetInt("QCustomerState"), QCustomerState = base.ParmJObj.GetInt("QCustomerState"),
}; };
var list = customerModule.GetCustomerPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = customerModule.GetCustomerPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list) foreach (var item in list)
{ {
...@@ -97,7 +97,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -97,7 +97,7 @@ namespace Edu.WebApi.Controllers.Customer
Remark = base.ParmJObj.GetStringValue("Remark"), Remark = base.ParmJObj.GetStringValue("Remark"),
EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName"), EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName"),
CustomerType = base.ParmJObj.GetInt("CustomerType"), CustomerType = base.ParmJObj.GetInt("CustomerType"),
WeChatNo=base.ParmJObj.GetStringValue("WeChatNo"), WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
}; };
if (string.IsNullOrEmpty(model.CustomerName)) if (string.IsNullOrEmpty(model.CustomerName))
{ {
...@@ -114,7 +114,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -114,7 +114,7 @@ namespace Edu.WebApi.Controllers.Customer
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id; model.School_Id = base.UserInfo.School_Id;
model.ApproveState = 1; model.ApproveState = 1;
model.ApproveId= base.UserInfo.Id; model.ApproveId = base.UserInfo.Id;
model.ApproveTime = DateTime.Now; model.ApproveTime = DateTime.Now;
var flag = customerModule.SetCustomerModule(model); var flag = customerModule.SetCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
...@@ -654,5 +654,116 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -654,5 +654,116 @@ namespace Edu.WebApi.Controllers.Customer
var list = customerModule.GetCustomerListModule(query); var list = customerModule.GetCustomerListModule(query);
return ApiResult.Success(data: list); return ApiResult.Success(data: list);
} }
#region 企业管理
/// <summary>
/// 获取企业分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEnterprisePage()
{
var userInfo = base.UserInfo;
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Enterprise_Extend()
{
Group_Id = base.UserInfo.Group_Id,
EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName")
};
query.CreateBy = userInfo.Id;
var list = customerModule.GetEnterprisePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> result = new List<object>();
foreach (var item in list)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
result.Add(new
{
item.Id,
item.EnterpriseName,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
pageModel.PageData = result;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取企业列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEnterpriseList()
{
var userInfo = base.UserInfo;
var query = new RB_Enterprise_Extend()
{
Group_Id = base.UserInfo.Group_Id,
EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName")
};
query.CreateBy = userInfo.Id;
var list = customerModule.GetEnterpriseListModule(query);
List<object> result = new List<object>();
foreach (var item in list)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
result.Add(new
{
item.Id,
item.EnterpriseName,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
return ApiResult.Success(data: result);
}
/// <summary>
/// 新增修改企业
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetEnterprise()
{
var extModel = new RB_Enterprise_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName")
};
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateTime = DateTime.Now;
extModel.Status = Common.Enum.DateStateEnum.Normal;
bool flag = customerModule.SetEnterpriseModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取企业信息
/// </summary>
/// <returns></returns>
public ApiResult GetEnterprise()
{
var Id = base.ParmJObj.GetInt("Id");
var extModel = customerModule.GetEnterpriseModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 根据编号删除企业信息
/// </summary>
/// <returns></returns>
public ApiResult RemoveEnterprise()
{
var Id = base.ParmJObj.GetInt("Id");
bool flag = customerModule.RemoveEnterpriseModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
} }
} }
...@@ -4,6 +4,7 @@ using Edu.Common.Enum.User; ...@@ -4,6 +4,7 @@ using Edu.Common.Enum.User;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.Entity.System; using Edu.Model.Entity.System;
using Edu.Model.ViewModel.Customer; using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.System;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Module.Customer; using Edu.Module.Customer;
using Edu.WebApi.Filter; using Edu.WebApi.Filter;
...@@ -648,5 +649,215 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -648,5 +649,215 @@ namespace Edu.WebApi.Controllers.Customer
bool flag = customerStudentModule.RemodeStudentTypeModule(Id); bool flag = customerStudentModule.RemodeStudentTypeModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 获取学习目的分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetLearningGoalsPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_LearningGoals_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetLearningGoalsPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
list.Add(new
{
item.Id,
item.Name,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取学习目的下拉列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetLearningGoalsList()
{
var query = new RB_LearningGoals_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetLearningGoalsListModule(query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
list.Add(new
{
item.Id,
item.Name,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改学习目的
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetLearningGoals()
{
var extModel = new RB_LearningGoals_Extend()
{
Id=base.ParmJObj.GetInt("Id"),
Name=base.ParmJObj.GetStringValue("Name"),
};
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Status = Common.Enum.DateStateEnum.Normal;
bool flag = customerStudentModule.SetLearningGoalsModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取学习目的详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetLearningGoals()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetLearningGoalsExtEntityModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除学习目的详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveLearningGoals()
{
var Id = base.ParmJObj.GetInt("Id");
bool flag = customerStudentModule.RemoveLearningGoalsModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取渠道分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetChannelPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Channel_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetChannelPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
list.Add(new
{
item.Id,
item.Name,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取渠道下拉列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetChannelList()
{
var query = new RB_Channel_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetChannelListModule(query);
List<object> list = new List<object>();
foreach (var item in data)
{
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
list.Add(new
{
item.Id,
item.Name,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
});
}
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改渠道
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetChannel()
{
var extModel = new RB_Channel_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
};
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Status = Common.Enum.DateStateEnum.Normal;
bool flag = customerStudentModule.SetChannelModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取渠道详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetChannel()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetChannelExtEntityModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除渠道详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveLearningGoals()
{
var Id = base.ParmJObj.GetInt("Id");
bool flag = customerStudentModule.RemoveChannelModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
} }
} }
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