小程序培训记录接口
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using BLL;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 培训记录
|
||||
/// </summary>
|
||||
public class TrainingRecordController : ApiController
|
||||
{
|
||||
#region 根据ProjectId、PersonId获取培训记录列表
|
||||
/// <summary>
|
||||
/// 根据ProjectId、PersonId获取培训记录列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personId"></param>
|
||||
/// <param name="isRetakeCourse">是否重修:1:重修任务</param>
|
||||
/// <param name="pageIndex">页码</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getTrainingRecordListByProjectIdPersonId(string projectId, string personId, string isRetakeCourse, int pageIndex)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getQualityLists = APITrainingTaskService.getTrainingRecordItemListByProjectIdPersonId(projectId, personId, isRetakeCourse);
|
||||
int pageCount = getQualityLists.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
var getdata = from x in getQualityLists.OrderBy(u => u.TrainingItemCode).Skip(BLL.Funs.PageSize * (pageIndex - 1)).Take(BLL.Funs.PageSize)
|
||||
select x;
|
||||
responeData.data = new { pageCount, getdata };
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user