Commit 28546ef6 authored by 黄奎's avatar 黄奎

新增咨询实体类

parent 8b5e03eb
...@@ -41,20 +41,35 @@ namespace Edu.Model.Entity.Web ...@@ -41,20 +41,35 @@ namespace Edu.Model.Entity.Web
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 处理状态(0-待处理,1-已处理)
/// </summary>
public int DealStatus { get; set; }
/// <summary>
/// 处理内容
/// </summary>
public string DealContent { get; set; }
/// <summary> /// <summary>
/// 删除状态 /// 删除状态
/// </summary> /// </summary>
public DateStateEnum Status { get; set; } public DateStateEnum Status { get; set; }
/// <summary> /// <summary>
/// 创建时间 /// 处理人
/// </summary> /// </summary>
public DateTime CreateDate { get; set; } public int DealBy { get; set; }
/// <summary>
/// 处理时间
/// </summary>
public DateTime DealTime { get; set; }
/// <summary> /// <summary>
/// 创建人编号 /// 创建时间
/// </summary> /// </summary>
public int CreateBy { get; set; } public DateTime CreateDate { get; set; }
/// <summary> /// <summary>
/// 集团编号 /// 集团编号
......
...@@ -8,8 +8,37 @@ namespace Edu.Model.ViewModel.Web ...@@ -8,8 +8,37 @@ namespace Edu.Model.ViewModel.Web
/// <summary> /// <summary>
/// 咨询管理视图实体类 /// 咨询管理视图实体类
/// </summary> /// </summary>
public class RB_Web_Advisory_ViewModel: RB_Web_Advisory public class RB_Web_Advisory_ViewModel : RB_Web_Advisory
{ {
/// <summary>
/// 咨询类型对应的资源名称(1-课程名称,2-班级名称,3-留学就业产品名称)
/// </summary>
public string SourceName { get; set; }
/// <summary>
/// 处理状态字符串
/// </summary>
public string DealStatusStr
{
get
{
string str = "待处理";
if (this.DealStatus == 1)
{
str = "已处理";
}
return str;
}
}
/// <summary>
/// 处理人姓名
/// </summary>
public string DealByName { get; set; }
/// <summary>
/// 处理时间字符串
/// </summary>
public string DealTimeStr { get { return Common.ConvertHelper.FormatTime(this.DealTime); } }
} }
} }
using Edu.Model.ViewModel.Web;
using Edu.Repository.Web;
using System.Collections.Generic;
using VT.FW.DB;
namespace Edu.Module.Web
{
/// <summary>
/// 咨询管理处理类
/// </summary>
public class WebAdvisoryModule
{
/// <summary>
/// 咨询管理仓储层对象
/// </summary>
private readonly RB_Web_AdvisoryRepository web_AdvisoryRepository = new RB_Web_AdvisoryRepository();
/// <summary>
/// 获取咨询管理分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Web_Advisory_ViewModel> GetWebAdvisoryPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Web_Advisory_ViewModel query)
{
return web_AdvisoryRepository.GetWebAdvisoryPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 新增修改咨询管理
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetWebAdvisoryModule(RB_Web_Advisory_ViewModel model)
{
bool flag;
var newId = web_AdvisoryRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
return flag;
}
/// <summary>
/// 修改咨询回复
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool UpdateWebAdvisoryModule(RB_Web_Advisory_ViewModel model)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Web_Advisory_ViewModel.DealStatus),model.DealStatus },
{nameof(RB_Web_Advisory_ViewModel.DealContent),model.DealContent },
{nameof(RB_Web_Advisory_ViewModel.BgImg),model.BgImg },
{nameof(RB_Web_Advisory_ViewModel.LinkUrl),model.LinkUrl },
{nameof(RB_Web_Advisory_ViewModel.NavType),model.NavType },
};
var flag = web_AdvisoryRepository.Update(fileds, new WhereHelper(nameof(RB_Web_Advisory_ViewModel.Id), model.Id));
return flag;
}
/// <summary>
/// 根据编号获取咨询管理详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Web_Advisory_ViewModel GetWebAdvisoryModule(object Id)
{
return web_AdvisoryRepository.GetEntity<RB_Web_Advisory_ViewModel>(Id);
}
/// <summary>
/// 修改咨询管理状态
/// </summary>
/// <param name="Id"></param>
/// <param name="Status">0-正常,1-删除</param>
/// <returns></returns>
public bool RemoveWebAdvisoryStatusModule(int Id, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Web_Advisory_ViewModel.Status),Status },
};
var flag = web_AdvisoryRepository.Update(fileds, new WhereHelper(nameof(RB_Web_Advisory_ViewModel.Id), Id));
return flag;
}
}
}
...@@ -14,7 +14,7 @@ namespace Edu.Repository.Web ...@@ -14,7 +14,7 @@ namespace Edu.Repository.Web
public class RB_Web_AdvisoryRepository : BaseRepository<RB_Web_Advisory> public class RB_Web_AdvisoryRepository : BaseRepository<RB_Web_Advisory>
{ {
/// <summary> /// <summary>
/// 获取网站咨询分页列表 /// 获取咨询管理分页列表
/// </summary> /// </summary>
/// <param name="pageIndex">页码</param> /// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param> /// <param name="pageSize">每页显示调试</param>
...@@ -27,8 +27,17 @@ namespace Edu.Repository.Web ...@@ -27,8 +27,17 @@ namespace Edu.Repository.Web
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append(@" builder.Append(@"
SELECT A.* SELECT A.* FROM
FROM RB_Web_Advisory AS A (
SELECT A.*,IFNULL(B.CourseName,'') AS SourceName
FROM rb_web_advisory AS A INNER JOIN rb_course AS B ON (A.SourceId=B.CourseId AND A.AdvType=1)
UNION ALL
SELECT A.*,IFNULL(B.ClassName,'') AS SourceName
FROM rb_web_advisory AS A INNER JOIN rb_class AS B ON (A.SourceId=B.ClassId AND A.AdvType=2)
UNION ALL
SELECT A.*,IFNULL(B.`Name`,'') AS SourceName
FROM rb_web_advisory AS A INNER JOIN rb_studyabroad AS B ON (A.SourceId=B.Id AND A.AdvType=3)
) AS A
WHERE 1=1 WHERE 1=1
"); ");
if (query == null) if (query == null)
...@@ -50,8 +59,13 @@ WHERE 1=1 ...@@ -50,8 +59,13 @@ WHERE 1=1
{ {
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Advisory_ViewModel.Status), (int)query.Status); builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Advisory_ViewModel.Status), (int)query.Status);
} }
if (query.DealStatus >= 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Advisory_ViewModel.DealStatus), query.DealStatus);
}
} }
return GetPage<RB_Web_Advisory_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Web_Advisory_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
} }
} }
\ No newline at end of file
...@@ -37,6 +37,11 @@ namespace Edu.WebApi.Controllers.Web ...@@ -37,6 +37,11 @@ namespace Edu.WebApi.Controllers.Web
/// </summary> /// </summary>
private readonly WebTeacherModule teacherModule = new WebTeacherModule(); private readonly WebTeacherModule teacherModule = new WebTeacherModule();
/// <summary>
/// 咨询管理处理类对象
/// </summary>
private readonly WebAdvisoryModule advisoryModule = new WebAdvisoryModule();
#region 网站导航管理 #region 网站导航管理
/// <summary> /// <summary>
/// 获取网站导航列表 /// 获取网站导航列表
...@@ -497,6 +502,32 @@ namespace Edu.WebApi.Controllers.Web ...@@ -497,6 +502,32 @@ namespace Edu.WebApi.Controllers.Web
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
#endregion
#region 咨询管理
/// <summary>
/// 获取咨询管理分页
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetWebAdvisoryPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Web_Advisory_ViewModel()
{
LinkMan = base.ParmJObj.GetStringValue("LinkMan"),
DealStatus=base.ParmJObj.GetInt("DealStatus"),
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = advisoryModule.GetWebAdvisoryPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
#endregion #endregion
} }
} }
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