Commit 59cd5795 authored by 黄奎's avatar 黄奎

页面修改

parent 4f5fec1f
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.Entity.System
{
/// <summary>
/// 客户需求实体类
/// </summary>
public class RB_Needs
{
/// <summary>
/// 需求编号(主键)
/// </summary>
public int Id { get; set; }
/// <summary>
/// 需求名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 删除状态(1-删除)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using Edu.Model.Entity.System;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.System
{
/// <summary>
/// 客户需求扩展实体类
/// </summary>
public class RB_Needs_Extend : RB_Needs
{
}
}
...@@ -80,6 +80,11 @@ namespace Edu.Module.Customer ...@@ -80,6 +80,11 @@ namespace Edu.Module.Customer
/// </summary> /// </summary>
private readonly RB_ChannelRepository channelRepository = new RB_ChannelRepository(); private readonly RB_ChannelRepository channelRepository = new RB_ChannelRepository();
/// <summary>
/// 客户需求仓储层对象
/// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
#region 学员约访 #region 学员约访
...@@ -535,6 +540,8 @@ namespace Edu.Module.Customer ...@@ -535,6 +540,8 @@ namespace Edu.Module.Customer
} }
#endregion #endregion
#region 学员日志
/// <summary> /// <summary>
/// 获取学员日志分页列表 /// 获取学员日志分页列表
/// </summary> /// </summary>
...@@ -549,6 +556,10 @@ namespace Edu.Module.Customer ...@@ -549,6 +556,10 @@ namespace Edu.Module.Customer
return list; return list;
} }
#endregion
#region 学员订单和合同
/// <summary> /// <summary>
/// 获取学员关联订单分页列表 /// 获取学员关联订单分页列表
/// </summary> /// </summary>
...@@ -574,6 +585,10 @@ namespace Edu.Module.Customer ...@@ -574,6 +585,10 @@ namespace Edu.Module.Customer
return list; return list;
} }
#endregion
#region 协助人员
/// <summary> /// <summary>
/// 新增修改协助人员 /// 新增修改协助人员
/// </summary> /// </summary>
...@@ -700,6 +715,9 @@ namespace Edu.Module.Customer ...@@ -700,6 +715,9 @@ namespace Edu.Module.Customer
return list; return list;
} }
#endregion
#region 客户阶段
/// <summary> /// <summary>
/// 获取客户阶段列表 /// 获取客户阶段列表
...@@ -755,7 +773,9 @@ namespace Edu.Module.Customer ...@@ -755,7 +773,9 @@ namespace Edu.Module.Customer
return flag; return flag;
} }
#endregion
#region 客户类型
/// <summary> /// <summary>
/// 获取客户类型列表 /// 获取客户类型列表
/// </summary> /// </summary>
...@@ -810,6 +830,9 @@ namespace Edu.Module.Customer ...@@ -810,6 +830,9 @@ namespace Edu.Module.Customer
bool flag = student_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Stage.Id), Id)); bool flag = student_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Stage.Id), Id));
return flag; return flag;
} }
#endregion
#region 学习目的
/// <summary> /// <summary>
/// 获取学习目的分页列表 /// 获取学习目的分页列表
...@@ -890,7 +913,9 @@ namespace Edu.Module.Customer ...@@ -890,7 +913,9 @@ namespace Edu.Module.Customer
return flag; return flag;
} }
#endregion
#region 客户渠道
/// <summary> /// <summary>
/// 获取渠道分页列表 /// 获取渠道分页列表
/// </summary> /// </summary>
...@@ -929,7 +954,7 @@ namespace Edu.Module.Customer ...@@ -929,7 +954,7 @@ namespace Edu.Module.Customer
} }
/// <summary> /// <summary>
/// 新增修改收客 /// 新增修改收客渠道
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
...@@ -969,5 +994,87 @@ namespace Edu.Module.Customer ...@@ -969,5 +994,87 @@ namespace Edu.Module.Customer
var flag = channelRepository.Update(fileds, new WhereHelper(nameof(RB_Channel_Extend.Id), Id)); var flag = channelRepository.Update(fileds, new WhereHelper(nameof(RB_Channel_Extend.Id), Id));
return flag; return flag;
} }
#endregion
#region 客户需求
/// <summary>
/// 获取客户需求分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Needs_Extend> GetNeedsPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Needs_Extend query)
{
var list = needsRepository.GetNeedsPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 获取客户需求列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Needs_Extend> GetNeedsListModule(RB_Needs_Extend query)
{
var list = needsRepository.GetNeedsListRepository(query);
return list;
}
/// <summary>
/// 获取客户需求实体类
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Needs_Extend GetNeedsExtEntityModule(int Id)
{
var extModel = needsRepository.GetNeedsExtEntityRepository(Id);
return extModel;
}
/// <summary>
/// 新增修改客户需求
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetNeedsModule(RB_Needs_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Needs_Extend.Name),model.Name },
{nameof(RB_Needs_Extend.UpdateBy),model.UpdateBy },
{nameof(RB_Needs_Extend.UpdateTime),model.UpdateTime },
};
flag = needsRepository.Update(fileds, new WhereHelper(nameof(RB_Needs_Extend.Id), model.Id));
}
else
{
var newId = needsRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 删除客户需求
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveNeedsModule(int Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Needs_Extend.Status),(int)DateStateEnum.Delete},
};
var flag = needsRepository.Update(fileds, new WhereHelper(nameof(RB_Needs_Extend.Id), Id));
return flag;
}
#endregion
} }
} }
...@@ -40,7 +40,7 @@ WHERE 1=1 ...@@ -40,7 +40,7 @@ WHERE 1=1
} }
if (!string.IsNullOrEmpty(query.Name)) if (!string.IsNullOrEmpty(query.Name))
{ {
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_LearningGoals_Extend.Name)); builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Channel_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%"); parameters.Add("Name", "%" + query.Name.Trim() + "%");
} }
} }
......
using Edu.Common.Enum;
using Edu.Model.Entity.System;
using Edu.Model.ViewModel.System;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB.Dapper;
using System.Linq;
namespace Edu.Repository.System
{
/// <summary>
/// 客户需求仓储层
/// </summary>
public class RB_NeedsRepository : BaseRepository<RB_Needs>
{
/// <summary>
/// 获取客户需求分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Needs_Extend> GetNeedsPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Needs_Extend query)
{
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Needs AS A
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Needs_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Needs_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Needs_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
}
return GetPage<RB_Needs_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取客户需求列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Needs_Extend> GetNeedsListRepository(RB_Needs_Extend query)
{
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Needs AS A
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Needs_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Needs_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Needs_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.QChannelIds))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Needs_Extend.Id), query.QChannelIds);
}
}
return Get<RB_Needs_Extend>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取客户需求实体类
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Needs_Extend GetNeedsExtEntityRepository(int Id)
{
var extModel = base.GetEntity<RB_Needs_Extend>(Id);
return extModel;
}
}
}
...@@ -859,5 +859,111 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -859,5 +859,111 @@ namespace Edu.WebApi.Controllers.Customer
bool flag = customerStudentModule.RemoveChannelModule(Id); bool flag = customerStudentModule.RemoveChannelModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 获取客户需求分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetNeedsPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Needs_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetNeedsPageModule(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 GetNeedsList()
{
var query = new RB_Needs_Extend()
{
Name = base.ParmJObj.GetStringValue("Name"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetNeedsListModule(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 SetNeeds()
{
var extModel = new RB_Needs_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.SetNeedsModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取客户需求详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetNeeds()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.GetNeedsExtEntityModule(Id);
return ApiResult.Success(data: model);
}
/// <summary>
/// 根据编号删除客户需求
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveNeeds()
{
var Id = base.ParmJObj.GetInt("Id");
bool flag = customerStudentModule.RemoveNeedsModule(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