Commit 92d2c687 authored by 黄奎's avatar 黄奎

接口修改

parent 103fb329
......@@ -190,9 +190,12 @@ namespace Edu.Module.StudyAbroad
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_StudyAbroad_ViewModel GetStudyAbroadModule(object Id,int IsGetPrice=0)
public RB_StudyAbroad_ViewModel GetStudyAbroadModule(int Id,int IsGetPrice=0)
{
var model= studyAbroadRepository.GetEntity<RB_StudyAbroad_ViewModel>(Id);
var model = studyAbroadRepository.GetStudyAbroadListExtRepository(new RB_StudyAbroad_ViewModel()
{
Id = Id
})?.FirstOrDefault();
if (model != null && IsGetPrice == 1)
{
model.PreferentialList = GetStudyaBroadPreferentialListModule(new RB_StudyaBroad_Preferential_ViewModel()
......
......@@ -101,5 +101,59 @@ WHERE 1=1
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
}
}
/// <summary>
/// 获取留学就业列表扩展
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StudyAbroad_ViewModel> GetStudyAbroadListExtRepository(RB_StudyAbroad_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName
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);
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 (!string.IsNullOrEmpty(query.Name))
{
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.AuditType == 1)
{
builder.AppendFormat(" AND A.SaleState=2 AND A.DirectorStatus=0 ");
}
else if (query.AuditType == 2)
{
builder.AppendFormat(" AND A.SaleState=2 AND A.DirectorId>0 AND A.DirectorStatus=1 AND A.ManagerStatus=0 ");
}
if (query.SaleState > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.SaleState), (int)query.SaleState);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Id), query.Id);
}
return Get<RB_StudyAbroad_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
}
......@@ -364,6 +364,34 @@ namespace Edu.WebApi.Controllers.StudyAbroad
{
extModel = new RB_StudyAbroad_ViewModel();
}
var obj = new
{
extModel.Id,
extModel.Type,
extModel.Name,
extModel.SupplierId,
extModel.SupplierName,
extModel.SupplierContract,
extModel.SuggestPrice,
extModel.SellPrice,
extModel.Remark,
extModel.SaleState,
SaleStateName = Common.Plugin.EnumHelper.ToName(extModel.SaleState),
extModel.CreateBy,
CreateByName= UserReidsCache.GetUserLoginInfo(extModel.CreateBy)?.AccountName ?? "",
CreateTimeStr=Common.ConvertHelper.FormatTime(extModel.CreateTime),
extModel.DirectorId,
extModel.DirectorStatus,
extModel.DirectorOpinion,
DirectorAuditTimeStr= Common.ConvertHelper.FormatTime(extModel.DirectorAuditTime),
DirectorName= UserReidsCache.GetUserLoginInfo(extModel.DirectorId)?.AccountName ?? "",
extModel.ManagerId,
extModel.ManagerStatus,
extModel.ManagerOpinion,
ManagerAuditTimeStr= Common.ConvertHelper.FormatTime(extModel.ManagerAuditTime),
ManagerName = UserReidsCache.GetUserLoginInfo(extModel.ManagerId)?.AccountName ?? "",
extModel.PreferentialList,
};
return ApiResult.Success(data: extModel);
}
......
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