Commit 0d4ee57f authored by 黄奎's avatar 黄奎

页面修改

parent cdda6138
...@@ -56,6 +56,37 @@ namespace Edu.Module.StudyAbroad ...@@ -56,6 +56,37 @@ namespace Edu.Module.StudyAbroad
return list; return list;
} }
/// <summary>
/// 获取留学就业审核分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadAuditPageModule(int pageIndex, int pageSize, out long rowsCount, RB_StudyAbroad_ViewModel query)
{
var list = studyAbroadRepository.GetStudyAbroadAuditPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string ids = string.Join(",", list.Select(qitem => qitem.Id));
List<RB_StudyaBroad_Preferential_ViewModel> preferentialList = new List<RB_StudyaBroad_Preferential_ViewModel>();
if (query.IsQPrice == 1)
{
preferentialList = GetStudyaBroadPreferentialListModule(new RB_StudyaBroad_Preferential_ViewModel()
{
QStudyabroadIds = ids
});
}
foreach (var item in list)
{
item.PreferentialList = preferentialList?.Where(qitem => qitem.StudyabroadId == item.Id)?.ToList() ?? new List<RB_StudyaBroad_Preferential_ViewModel>();
}
}
return list;
}
/// <summary> /// <summary>
/// 获取留学就业列表 /// 获取留学就业列表
/// </summary> /// </summary>
......
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Sale;
using Edu.Model.Entity.StudyAbroad; using Edu.Model.Entity.StudyAbroad;
using Edu.Model.ViewModel.StudyAbroad; using Edu.Model.ViewModel.StudyAbroad;
using System; using System;
...@@ -52,37 +53,70 @@ WHERE 1=1 ...@@ -52,37 +53,70 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Type), query.Type); builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Type), query.Type);
} }
//部门主管审核 if (query.SaleState > 0)
if (query.AuditType == 1)
{ {
//待审核 builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.SaleState),(int)query.SaleState);
if (query.AuditState == 1) }
{ return GetPage<RB_StudyAbroad_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
builder.AppendFormat(" AND A.SaleState=2 AND A.DirectorStatus=0 AND A.DirectorId={0} ", query.AuditManId); }
} }
//已审核
else
{ /// <summary>
builder.AppendFormat(" AND A.DirectorStatus>0 AND A.DirectorId={0} ", query.AuditManId); /// 获取留学就业审核分页列表
} /// </summary>
} /// <param name="pageIndex"></param>
//部门负责人审核 /// <param name="pageSize"></param>
else if (query.AuditType == 2) /// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadAuditPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_StudyAbroad_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName,IFNULL(B.ContractUrl,'') AS ContractUrl
FROM RB_StudyAbroad AS A LEFT JOIN rb_supplier AS B ON A.SupplierId=B.Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Status), (int)DateStateEnum.Normal);
builder.AppendFormat(" AND A.{0}>{1}", nameof(RB_StudyAbroad_ViewModel.SaleState), (int)SaleStateEnum.NoPerfect);
if (query == null)
{
return new List<RB_StudyAbroad_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{ {
//待审核 builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Group_Id), query.Group_Id);
if (query.AuditState == 1)
{
builder.AppendFormat(" AND A.SaleState=2 AND A.DirectorId>0 AND A.DirectorStatus=1 AND A.ManagerStatus=0 AND A.ManagerId={0} ", query.AuditManId);
}
//已审核
else
{
builder.AppendFormat(" AND A.ManagerStatus>0 AND A.ManagerId={0} ", query.AuditManId);
}
} }
if (query.SaleState > 0) if (!string.IsNullOrEmpty(query.Name))
{ {
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.SaleState),(int)query.SaleState); builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_StudyAbroad_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Type), query.Type);
}
//待审核
if (query.AuditState == 1)
{
builder.AppendFormat(@" AND (
(A.SaleState=2 AND A.DirectorId>0 AND A.DirectorStatus=1 AND A.ManagerStatus=0 AND A.ManagerId={0})
OR (A.SaleState=2 AND A.DirectorStatus=0 AND A.DirectorId={0})
) ", query.AuditManId);
}
//已审核
else if(query.AuditState == 2)
{
builder.AppendFormat(@" AND (
(A.ManagerStatus>0 AND A.ManagerId={0})
OR (A.DirectorStatus>0 AND A.DirectorId={0})
)", query.AuditManId);
} }
return GetPage<RB_StudyAbroad_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_StudyAbroad_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
......
...@@ -217,7 +217,6 @@ namespace Edu.WebApi.Controllers.StudyAbroad ...@@ -217,7 +217,6 @@ namespace Edu.WebApi.Controllers.StudyAbroad
SaleState=(SaleStateEnum)base.ParmJObj.GetInt("SaleState"), SaleState=(SaleStateEnum)base.ParmJObj.GetInt("SaleState"),
AuditState=base.ParmJObj.GetInt("AuditState"), AuditState=base.ParmJObj.GetInt("AuditState"),
}; };
query.AuditManId = base.UserInfo.Id;
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>(); List<object> result = new List<object>();
var list = studyAbroadModule.GetStudyAbroadPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = studyAbroadModule.GetStudyAbroadPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
...@@ -274,6 +273,81 @@ namespace Edu.WebApi.Controllers.StudyAbroad ...@@ -274,6 +273,81 @@ namespace Edu.WebApi.Controllers.StudyAbroad
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
/// <summary>
/// 获取留学就业审核分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudyAbroadAuditPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_StudyAbroad_ViewModel()
{
Name = base.ParmJObj.GetStringValue("Name"),
Type = base.ParmJObj.GetInt("Type"),
SupplierId = base.ParmJObj.GetInt("SupplierId"),
IsQPrice = base.ParmJObj.GetInt("IsQPrice"),
AuditType = base.ParmJObj.GetInt("AuditType"),
AuditState = base.ParmJObj.GetInt("AuditState"),
};
query.AuditManId = base.UserInfo.Id;
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = studyAbroadModule.GetStudyAbroadAuditPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
if (item.DirectorId > 0)
{
item.DirectorName = UserReidsCache.GetUserLoginInfo(item.DirectorId)?.AccountName ?? "";
}
if (item.ManagerId > 0)
{
item.ManagerName = UserReidsCache.GetUserLoginInfo(item.ManagerId)?.AccountName ?? "";
}
result.Add(new
{
item.Id,
item.Type,
item.Name,
item.SupplierId,
item.SupplierName,
SupplierContract = item.ContractUrl,
item.SuggestPrice,
item.SellPrice,
item.Remark,
item.SaleState,
SaleStateName = Common.Plugin.EnumHelper.ToName(item.SaleState),
item.CreateByName,
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.UpdateByName,
UpdateTimeStr = Common.ConvertHelper.FormatTime(item.UpdateTime),
item.PreferentialList,
item.DirectorName,
item.DirectorId,
item.DirectorStatus,
item.DirectorOpinion,
DirectorAuditTime = Common.ConvertHelper.FormatTime(item.DirectorAuditTime),
item.ManagerName,
item.ManagerId,
item.ManagerStatus,
item.ManagerOpinion,
ManagerAuditTime = Common.ConvertHelper.FormatTime(item.ManagerAuditTime),
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
/// <summary> /// <summary>
/// 获取留学就业列表 /// 获取留学就业列表
/// </summary> /// </summary>
......
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