Compare commits
2 Commits
2d45e8a134
...
6390d40901
Author | SHA1 | Date |
---|---|---|
|
6390d40901 | |
|
08e992dae0 |
|
@ -98,6 +98,54 @@ namespace BLL
|
|||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据ProjectId、PersonId获取培训任务列表
|
||||
|
||||
/// <summary>
|
||||
/// 根据ProjectId、PersonId获取培训任务列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personId"></param>
|
||||
/// <param name="isRetakeCourse"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.TrainingRecordItemItem> getTrainingRecordItemListByProjectIdPersonId(string projectId, string personId, string isRetakeCourse)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TaskItem
|
||||
join t in db.Training_Task on x.TaskId equals t.TaskId
|
||||
join p in db.Training_Plan on x.PlanId equals p.PlanId
|
||||
join y in db.Training_CompanyTrainingItem on x.TrainingItemCode equals y.CompanyTrainingItemCode into temp
|
||||
//join z in db.Training_CompanyTraining on y.CompanyTrainingId equals z.CompanyTrainingId into temp
|
||||
from y in temp.DefaultIfEmpty()
|
||||
where t.ProjectId == projectId && t.UserId == personId
|
||||
orderby x.TrainingItemCode
|
||||
select new Model.TrainingRecordItemItem
|
||||
{
|
||||
TaskItemId = x.TaskItemId,
|
||||
TaskId = x.TaskId,
|
||||
PlanId = x.PlanId,
|
||||
StartTime = x.StartTime,
|
||||
EndTime = x.EndTime,
|
||||
LearningTime = x.LearnTime,
|
||||
AttachTime = y.LearningTime,
|
||||
VideoProgress = x.VideoProgress,
|
||||
PersonId = x.PersonId,
|
||||
TrainingItemCode = x.TrainingItemCode,
|
||||
TrainingItemName = x.TrainingItemName,
|
||||
AttachUrl = x.AttachUrl.Replace('\\', '/'),
|
||||
IsRetakeCourse = p.IsRetakeCourse == 1 ? 1 : 0,
|
||||
}).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(isRetakeCourse))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.IsRetakeCourse == int.Parse(isRetakeCourse)).ToList();
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据PlanId、PersonId将人员加入培训任务条件
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
</f:Button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="t-head-log flex-row flex-center" onclick="onHomeClick()" style="cursor:pointer;">HSE管理信息系统</div>
|
||||
<div class="t-head-log flex-row flex-center" onclick="onHomeClick()" style="cursor:pointer;">中油(新疆)石油工程管理数字化平台</div>
|
||||
<div class="t-head-navs flex-row flex-item-end flex-end">
|
||||
<div class="t-head-nav">
|
||||
<f:Button runat="server" CssClass="bgbtn" Text="通知管理" CssStyle="color: #ffffff;" OnClick="btnNotice_Click"
|
||||
|
|
|
@ -291,7 +291,7 @@
|
|||
</f:Button></div>--%>
|
||||
</div>
|
||||
<div class="logo flex-row flex-center">
|
||||
<h1><f:Button runat="server" CssClass="bgbtn2" EnablePostBack="true" CssStyle="color: #ffffff;" Text="HSE管理信息系统" OnClick="btnHome_Click"
|
||||
<h1><f:Button runat="server" CssClass="bgbtn2" EnablePostBack="true" CssStyle="color: #ffffff;" Text="中油(新疆)石油工程管理数字化平台" OnClick="btnHome_Click"
|
||||
EnableDefaultState="true" EnableDefaultCorner="false" ID="btnHome">
|
||||
</f:Button></h1>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
public class TrainingRecordItemItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 培训任务教材明细ID
|
||||
/// </summary>
|
||||
public string TaskItemId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 培训任务ID
|
||||
/// </summary>
|
||||
public string TaskId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 培训计划ID
|
||||
/// </summary>
|
||||
public string PlanId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 培训计划名称
|
||||
/// </summary>
|
||||
public string PlanName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 培训计划编号
|
||||
/// </summary>
|
||||
public string PlanCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 培训人员ID
|
||||
/// </summary>
|
||||
public string PersonId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 教材编号
|
||||
/// </summary>
|
||||
public string TrainingItemCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 教材名称
|
||||
/// </summary>
|
||||
public string TrainingItemName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
///// <summary>
|
||||
///// 培训类型名称
|
||||
///// </summary>
|
||||
//public string TrainTypeName
|
||||
//{
|
||||
// get;
|
||||
// set;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 教材附件
|
||||
/// </summary>
|
||||
public string AttachUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 学习时长(秒)
|
||||
/// </summary>
|
||||
public int? LearningTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 教材时长(秒)
|
||||
/// </summary>
|
||||
public int? AttachTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public DateTime? EndTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 视频进度(秒)
|
||||
/// </summary>
|
||||
public int? VideoProgress
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否是重修任务
|
||||
/// </summary>
|
||||
public int IsRetakeCourse
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -133,6 +133,7 @@
|
|||
<Compile Include="APIItem\HSSE\RoutingInspectionItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\SeDinMonthReport4OtherItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\BonusScoreSelfManagementItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\TrainingRecordItemItem.cs" />
|
||||
<Compile Include="APIItem\OperationReportDto.cs" />
|
||||
<Compile Include="APIItem\ProjectGpsPointItem.cs" />
|
||||
<Compile Include="APIItem\ProjectItem.cs" />
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
||||
}
|
|
@ -176,6 +176,7 @@
|
|||
<Compile Include="Controllers\HSSE\HazardRealTimeController.cs" />
|
||||
<Compile Include="Controllers\HSSE\MaterialController.cs" />
|
||||
<Compile Include="Controllers\HSSE\BonusScoreSelfManagementController.cs" />
|
||||
<Compile Include="Controllers\HSSE\TrainingRecordController.cs" />
|
||||
<Compile Include="Controllers\HSSE\TrainTestRecordController.cs" />
|
||||
<Compile Include="Controllers\Person\PersonCheckController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CheckEquipmentController.cs" />
|
||||
|
|
Loading…
Reference in New Issue