自主管理加分项
This commit is contained in:
@@ -0,0 +1,342 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EmitMapper;
|
||||
using EmitMapper.MappingConfiguration;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 自主管理加分项
|
||||
/// </summary>
|
||||
public static class APIBonusScoreSelfManagementService
|
||||
{
|
||||
#region 根据projectId、trainTypeId、TrainStates获取培训计划列表
|
||||
/// <summary>
|
||||
/// 根据projectId、trainTypeId、TrainStates获取培训计划列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.TrainingPlanItem> getTrainingPlanListByProjectIdTrainTypeIdTrainStates(string projectId, string trainTypeId, string states)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_Plan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null) && x.TrainTypeId == trainTypeId
|
||||
orderby x.TrainStartDate descending
|
||||
select new Model.TrainingPlanItem
|
||||
{
|
||||
PlanId = x.PlanId,
|
||||
PlanCode = x.PlanCode,
|
||||
PlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TrainTypeId = x.TrainTypeId,
|
||||
TrainTypeName = db.Base_TrainType.First(y => y.TrainTypeId == x.TrainTypeId).TrainTypeName,
|
||||
TrainLevelId = x.TrainLevelId,
|
||||
TrainLevelName = db.Base_TrainLevel.First(y => y.TrainLevelId == x.TrainLevelId).TrainLevelName,
|
||||
DesignerName = db.Sys_User.First(y => y.UserId == x.DesignerId).UserName,
|
||||
DesignerId = x.DesignerId,
|
||||
DesignerDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.DesignerDate),
|
||||
TeachHour = x.TeachHour ?? 0,
|
||||
TeachAddress = x.TeachAddress,
|
||||
TeachMan = x.TeachMan,
|
||||
TrainStartDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TrainStartDate),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据培训ID获取培训计划详细
|
||||
/// <summary>
|
||||
/// 根据培训ID获取培训计划详细
|
||||
/// </summary>
|
||||
/// <param name="planId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.TrainingPlanItem getTrainingPlanByTrainingId(string planId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = from x in db.Training_Plan
|
||||
where x.PlanId == planId
|
||||
select new Model.TrainingPlanItem
|
||||
{
|
||||
PlanId = x.PlanId,
|
||||
PlanCode = x.PlanCode,
|
||||
PlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TrainTypeId = x.TrainTypeId,
|
||||
TrainTypeName = db.Base_TrainType.First(y => y.TrainTypeId == x.TrainTypeId).TrainTypeName,
|
||||
TrainLevelId = x.TrainLevelId,
|
||||
TrainLevelName = db.Base_TrainLevel.First(y => y.TrainLevelId == x.TrainLevelId).TrainLevelName,
|
||||
TeachHour = x.TeachHour ?? 0,
|
||||
TeachAddress = x.TeachAddress,
|
||||
TrainStartDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TrainStartDate),
|
||||
TeachMan = x.TeachMan,
|
||||
UnitIds = x.UnitIds,
|
||||
WorkPostId = x.WorkPostId,
|
||||
TrainContent = x.TrainContent,
|
||||
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId),
|
||||
DesignerId = x.DesignerId,
|
||||
DesignerName = db.Sys_User.First(y => y.UserId == x.DesignerId).UserName,
|
||||
DesignerDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TrainStartDate),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
};
|
||||
return getDataLists.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据TrainingPlanId获取培训教材类型列表
|
||||
/// <summary>
|
||||
/// 根据TrainingPlanId获取培训教材类型列表
|
||||
/// </summary>
|
||||
/// <param name="trainingPlanId"></param>
|
||||
/// <returns>培训计划人员</returns>
|
||||
public static List<Model.TrainingPlanItemItem> getTrainingPlanItemListByTrainingPlanId(string trainingPlanId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_PlanItem
|
||||
join y in db.Training_CompanyTraining on x.CompanyTrainingId equals y.CompanyTrainingId
|
||||
join z in db.Training_CompanyTrainingItem on x.CompanyTrainingItemId equals z.CompanyTrainingItemId
|
||||
where x.PlanId == trainingPlanId
|
||||
orderby y.CompanyTrainingCode
|
||||
select new Model.TrainingPlanItemItem
|
||||
{
|
||||
PlanItemId = x.PlanItemId,
|
||||
PlanId = x.PlanId,
|
||||
CompanyTrainingId = x.CompanyTrainingId,
|
||||
CompanyTrainingName = y.CompanyTrainingName,
|
||||
CompanyTrainingCode = y.CompanyTrainingCode,
|
||||
CompanyTrainingItemId = x.CompanyTrainingItemId,
|
||||
CompanyTrainingItemCode = z.CompanyTrainingItemCode,
|
||||
CompanyTrainingItemName = z.CompanyTrainingItemName,
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存培训计划
|
||||
/// <summary>
|
||||
/// 保存TrainingPlan
|
||||
/// </summary>
|
||||
/// <param name="trainingPlan">培训计划记录</param>
|
||||
/// <param name="trainingTasks">培训人员list</param>
|
||||
/// <param name="trainingPlanItems">培训教材类型list</param>
|
||||
public static void SaveTrainingPlan(Model.TrainingPlanItem trainingPlan)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Training_Plan newTrainingPlan = new Model.Training_Plan
|
||||
{
|
||||
PlanId = trainingPlan.PlanId,
|
||||
PlanCode = trainingPlan.PlanCode,
|
||||
ProjectId = trainingPlan.ProjectId,
|
||||
DesignerId = trainingPlan.DesignerId,
|
||||
PlanName = trainingPlan.PlanName,
|
||||
TrainContent = trainingPlan.TrainContent,
|
||||
TrainStartDate = Funs.GetNewDateTime(trainingPlan.TrainStartDate),
|
||||
TeachHour = trainingPlan.TeachHour,
|
||||
TeachMan = trainingPlan.TeachMan,
|
||||
TeachAddress = trainingPlan.TeachAddress,
|
||||
TrainTypeId = trainingPlan.TrainTypeId,
|
||||
UnitIds = trainingPlan.UnitIds,
|
||||
WorkPostId = trainingPlan.WorkPostId,
|
||||
States = trainingPlan.States,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(trainingPlan.TrainLevelId))
|
||||
{
|
||||
newTrainingPlan.TrainLevelId = trainingPlan.TrainLevelId;
|
||||
}
|
||||
|
||||
if (newTrainingPlan.TrainStartDate.HasValue && newTrainingPlan.TeachHour.HasValue)
|
||||
{
|
||||
double dd = (double)((decimal)newTrainingPlan.TeachHour.Value);
|
||||
newTrainingPlan.TrainEndDate = newTrainingPlan.TrainStartDate.Value.AddHours(dd);
|
||||
}
|
||||
|
||||
List<Model.TrainingTaskItem> trainingTasks = trainingPlan.TrainingTasks;
|
||||
List<Model.TrainingPlanItemItem> trainingPlanItems = trainingPlan.TrainingPlanItems;
|
||||
|
||||
var isUpdate = db.Training_Plan.FirstOrDefault(x => x.PlanId == newTrainingPlan.PlanId);
|
||||
if (isUpdate == null)
|
||||
{
|
||||
newTrainingPlan.DesignerDate = DateTime.Now;
|
||||
string unitId = string.Empty;
|
||||
var user = UserService.GetUserByUserId(newTrainingPlan.DesignerId);
|
||||
if (user != null)
|
||||
{
|
||||
unitId = user.UnitId;
|
||||
}
|
||||
newTrainingPlan.PlanCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTrainingPlanMenuId, newTrainingPlan.ProjectId, unitId);
|
||||
if (string.IsNullOrEmpty(newTrainingPlan.PlanId))
|
||||
{
|
||||
newTrainingPlan.PlanId = SQLHelper.GetNewID();
|
||||
}
|
||||
db.Training_Plan.InsertOnSubmit(newTrainingPlan);
|
||||
db.SubmitChanges();
|
||||
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTrainingPlanMenuId, newTrainingPlan.ProjectId, null, newTrainingPlan.PlanId, newTrainingPlan.DesignerDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (newTrainingPlan.States == "0" || newTrainingPlan.States == "1")
|
||||
{
|
||||
isUpdate.PlanName = newTrainingPlan.PlanName;
|
||||
isUpdate.TrainContent = newTrainingPlan.TrainContent;
|
||||
isUpdate.TrainStartDate = newTrainingPlan.TrainStartDate;
|
||||
isUpdate.TeachHour = newTrainingPlan.TeachHour;
|
||||
isUpdate.TrainEndDate = newTrainingPlan.TrainEndDate;
|
||||
isUpdate.TeachMan = newTrainingPlan.TeachMan;
|
||||
isUpdate.TeachAddress = newTrainingPlan.TeachAddress;
|
||||
isUpdate.TrainTypeId = newTrainingPlan.TrainTypeId;
|
||||
isUpdate.TrainLevelId = newTrainingPlan.TrainLevelId;
|
||||
isUpdate.UnitIds = newTrainingPlan.UnitIds;
|
||||
isUpdate.WorkPostId = newTrainingPlan.WorkPostId;
|
||||
isUpdate.States = newTrainingPlan.States;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
////删除培训任务
|
||||
var tasks = from x in db.Training_Task where x.PlanId == newTrainingPlan.PlanId select x;
|
||||
if (tasks.Count() > 0)
|
||||
{
|
||||
var taskItems = from x in db.Training_TaskItem where x.PlanId == newTrainingPlan.PlanId select x;
|
||||
if (tasks.Count() > 0)
|
||||
{
|
||||
db.Training_TaskItem.DeleteAllOnSubmit(taskItems);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
db.Training_Task.DeleteAllOnSubmit(tasks);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
////删除培训教材类型
|
||||
var planItem = (from x in db.Training_PlanItem where x.PlanId == newTrainingPlan.PlanId select x).ToList();
|
||||
if (planItem.Count() > 0)
|
||||
{
|
||||
db.Training_PlanItem.DeleteAllOnSubmit(planItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
if (trainingTasks.Count() > 0)
|
||||
{
|
||||
////新增培训人员明细
|
||||
foreach (var item in trainingTasks)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.PersonId))
|
||||
{
|
||||
Model.Training_Task newTrainDetail = new Model.Training_Task
|
||||
{
|
||||
TaskId = SQLHelper.GetNewID(),
|
||||
ProjectId = newTrainingPlan.ProjectId,
|
||||
PlanId = newTrainingPlan.PlanId,
|
||||
UserId = item.PersonId,
|
||||
TaskDate = DateTime.Now,
|
||||
States = Const.State_0, ////未生成培训教材明细
|
||||
};
|
||||
db.Training_Task.InsertOnSubmit(newTrainDetail);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trainingPlanItems.Count() > 0)
|
||||
{
|
||||
////新增培训教材类型明细
|
||||
foreach (var item in trainingPlanItems)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingId) || !string.IsNullOrEmpty(item.CompanyTrainingItemId))
|
||||
{
|
||||
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
|
||||
{
|
||||
PlanItemId = SQLHelper.GetNewID(),
|
||||
PlanId = newTrainingPlan.PlanId,
|
||||
|
||||
};
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingId))
|
||||
{
|
||||
newPlanItem.CompanyTrainingId = item.CompanyTrainingId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingItemId))
|
||||
{
|
||||
newPlanItem.CompanyTrainingItemId = item.CompanyTrainingItemId;
|
||||
}
|
||||
db.Training_PlanItem.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增 培训人员明细
|
||||
/// </summary>
|
||||
public static void AddTraining_Task(List<Model.TrainingTaskItem> trainingTasks, string planId, string projectId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in trainingTasks)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.PersonId))
|
||||
{
|
||||
Model.Training_Task newTrainDetail = new Model.Training_Task
|
||||
{
|
||||
TaskId = SQLHelper.GetNewID(),
|
||||
ProjectId = projectId,
|
||||
PlanId = planId,
|
||||
UserId = item.PersonId,
|
||||
TaskDate = DateTime.Now,
|
||||
States = Const.State_0, ////未生成培训教材明细
|
||||
};
|
||||
|
||||
db.Training_Task.InsertOnSubmit(newTrainDetail);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增 培训教材类型 明细
|
||||
/// </summary>
|
||||
public static void AddTraining_PlanItem(List<Model.TrainingPlanItemItem> trainingPlanItems, string planId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in trainingPlanItems)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingId) || !string.IsNullOrEmpty(item.CompanyTrainingItemId))
|
||||
{
|
||||
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
|
||||
{
|
||||
PlanItemId = SQLHelper.GetNewID(),
|
||||
PlanId = planId,
|
||||
|
||||
};
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingId))
|
||||
{
|
||||
newPlanItem.CompanyTrainingId = item.CompanyTrainingId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(item.CompanyTrainingItemId))
|
||||
{
|
||||
newPlanItem.CompanyTrainingItemId = item.CompanyTrainingItemId;
|
||||
}
|
||||
db.Training_PlanItem.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,8 @@ namespace BLL
|
||||
TrainTypeName = db.Base_TrainType.FirstOrDefault(b => b.TrainTypeId == y.TrainTypeId).TrainTypeName,
|
||||
TrainLevelName = db.Base_TrainLevel.FirstOrDefault(b => b.TrainLevelId == y.TrainLevelId).TrainLevelName,
|
||||
PlanStatesName = y.States == "3" ? "已完成" : "培训中",
|
||||
|
||||
}).ToList();
|
||||
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
@@ -66,14 +66,14 @@ namespace BLL
|
||||
TaskId = x.TaskId,
|
||||
PlanId = x.PlanId,
|
||||
PersonId = x.PersonId,
|
||||
StartTime = x.StartTime,
|
||||
EndTime = x.EndTime,
|
||||
LearnTime = x.LearnTime,
|
||||
VideoProgress = x.VideoProgress,
|
||||
TrainingItemCode = x.TrainingItemCode,
|
||||
StartTime = x.StartTime,
|
||||
EndTime = x.EndTime,
|
||||
LearnTime = x.LearnTime,
|
||||
VideoProgress = x.VideoProgress,
|
||||
TrainingItemCode = x.TrainingItemCode,
|
||||
TrainingItemName = x.TrainingItemName,
|
||||
AttachUrl = x.AttachUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace BLL
|
||||
if (person != null && plan.ProjectId == person.ProjectId && plan.UnitIds.Contains(person.UnitId)
|
||||
&& (string.IsNullOrEmpty(plan.WorkPostId) || plan.WorkPostId.Contains(person.WorkPostId)))
|
||||
{
|
||||
var trainType = db.Base_TrainType.FirstOrDefault(e => e.TrainTypeId == plan.TrainTypeId);
|
||||
var trainType = db.Base_TrainType.FirstOrDefault(e => e.TrainTypeId == plan.TrainTypeId);
|
||||
if (trainType != null)
|
||||
{
|
||||
if (!trainType.IsRepeat.HasValue || trainType.IsRepeat == false)
|
||||
@@ -212,50 +212,50 @@ namespace BLL
|
||||
PersonId = x.UserId,
|
||||
PersonName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.UserId).PersonName,
|
||||
TaskDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TaskDate),
|
||||
States = x.States,
|
||||
States = x.States,
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 根据TrainingPlanId获取培训任务教材明细列表
|
||||
/// <summary>
|
||||
/// 根据TrainingPlanId获取培训任务教材明细列表
|
||||
/// </summary>
|
||||
/// <param name="trainingPlanId"></param>
|
||||
/// <returns>培训计划人员</returns>
|
||||
public static Model.Training_TaskItem updateTaskItemLearnTime(string taskItemId, DateTime startTime, DateTime endTime, string VideoProgress)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Training_TaskItem
|
||||
where x.TaskItemId == taskItemId
|
||||
select x;
|
||||
var item = q.FirstOrDefault();
|
||||
if (!item.StartTime.HasValue)
|
||||
{
|
||||
item.StartTime = startTime;
|
||||
}
|
||||
#region 根据TrainingPlanId获取培训任务教材明细列表
|
||||
/// <summary>
|
||||
/// 根据TrainingPlanId获取培训任务教材明细列表
|
||||
/// </summary>
|
||||
/// <param name="trainingPlanId"></param>
|
||||
/// <returns>培训计划人员</returns>
|
||||
public static Model.Training_TaskItem updateTaskItemLearnTime(string taskItemId, DateTime startTime, DateTime endTime, string VideoProgress)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Training_TaskItem
|
||||
where x.TaskItemId == taskItemId
|
||||
select x;
|
||||
var item = q.FirstOrDefault();
|
||||
if (!item.StartTime.HasValue)
|
||||
{
|
||||
item.StartTime = startTime;
|
||||
}
|
||||
|
||||
if (!item.LearnTime.HasValue)
|
||||
{
|
||||
item.LearnTime = 0;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(VideoProgress))
|
||||
{
|
||||
item.VideoProgress = int.Parse(VideoProgress);
|
||||
}
|
||||
var span = endTime.Subtract(startTime);
|
||||
item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes;
|
||||
item.EndTime = endTime;
|
||||
db.SubmitChanges();
|
||||
return item;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
if (!item.LearnTime.HasValue)
|
||||
{
|
||||
item.LearnTime = 0;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(VideoProgress))
|
||||
{
|
||||
item.VideoProgress = int.Parse(VideoProgress);
|
||||
}
|
||||
var span = endTime.Subtract(startTime);
|
||||
item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes;
|
||||
item.EndTime = endTime;
|
||||
db.SubmitChanges();
|
||||
return item;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -219,6 +219,7 @@
|
||||
<Compile Include="API\HSSE\APIServerTestRecordService.cs" />
|
||||
<Compile Include="API\HSSE\APITestPlanService.cs" />
|
||||
<Compile Include="API\HSSE\APITestRecordService.cs" />
|
||||
<Compile Include="API\HSSE\APIBonusScoreSelfManagementService.cs" />
|
||||
<Compile Include="API\HSSE\APITrainingPlanService.cs" />
|
||||
<Compile Include="API\HSSE\APITrainingTaskService.cs" />
|
||||
<Compile Include="API\HSSE\APITrainTestRecordService.cs" />
|
||||
@@ -265,6 +266,7 @@
|
||||
<Compile Include="Common\Captcha.cs" />
|
||||
<Compile Include="Common\CodeRecordsService.cs" />
|
||||
<Compile Include="Common\CommonService.cs" />
|
||||
<Compile Include="Common\Enums.cs" />
|
||||
<Compile Include="Common\CreateQRCodeService.cs" />
|
||||
<Compile Include="Common\FastReportService.cs" />
|
||||
<Compile Include="Common\IDCardValid.cs" />
|
||||
@@ -553,13 +555,10 @@
|
||||
<Compile Include="HSSE\Environmental\EnvironmentalMonitoringService.cs" />
|
||||
<Compile Include="HSSE\Environmental\UnexpectedEnvironmentalService.cs" />
|
||||
<Compile Include="HSSE\Epidemic\Epidemic_MaterialService.cs" />
|
||||
<Compile Include="HSSE\Examine\BonusScoreSelfManagementService.cs" />
|
||||
<Compile Include="HSSE\Examine\MinusScoreSituationService.cs" />
|
||||
<Compile Include="HSSE\Examine\LeadershipJoinHomeworkAnalysisMeetingService.cs" />
|
||||
<Compile Include="HSSE\Examine\CoConstructionActivitiesService.cs" />
|
||||
<Compile Include="HSSE\Examine\BehavioralSafetyObservationService.cs" />
|
||||
<Compile Include="HSSE\Examine\BonusScoreSituationService.cs" />
|
||||
<Compile Include="HSSE\Examine\SharingOfSafetyExperienceService.cs" />
|
||||
<Compile Include="HSSE\Examine\PersonalSafetyActionPlanService.cs" />
|
||||
<Compile Include="HSSE\Examine\BonusScoreTypeService.cs" />
|
||||
<Compile Include="HSSE\FinalFileManage\FinalFileListService.cs" />
|
||||
<Compile Include="HSSE\FinalFileManage\HSEFinalFileListService.cs" />
|
||||
<Compile Include="HSSE\FinalFileManage\OtherDocumentListService.cs" />
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BLL
|
||||
var project = ProjectService.GetProjectByProjectId(list[0].ProjectId);
|
||||
if (project != null)
|
||||
{
|
||||
proindex = project.ProjectCode + "-QC-TCC-XJ-";
|
||||
proindex = project.ProjectCode + "-QC-XJYJ-XJ-";
|
||||
}
|
||||
}
|
||||
for (int i = list.Count; i > 0; i--)
|
||||
|
||||
@@ -199,6 +199,60 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断文件类型是否支持的预览
|
||||
/// </summary>
|
||||
/// <param name="FiletExtension"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSupportFileType(string FiletExtension)
|
||||
{
|
||||
bool result = false;
|
||||
List<String> list = new List<string>();
|
||||
list.Add(".doc");
|
||||
list.Add(".docx");
|
||||
list.Add(".pdf");
|
||||
list.Add(".txt");
|
||||
list.Add(".xlsx");
|
||||
list.Add(".xls");
|
||||
list.Add(".png");
|
||||
list.Add(".jpg");
|
||||
list.Add(".jpeg");
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item == FiletExtension)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断文件类型是否是图片
|
||||
/// </summary>
|
||||
/// <param name="FiletExtension"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsImage(string FiletExtension)
|
||||
{
|
||||
bool result = false;
|
||||
List<String> list = new List<string>();
|
||||
list.Add(".png");
|
||||
list.Add(".jpg");
|
||||
list.Add(".jpeg");
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item == FiletExtension)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
+15
-21
@@ -770,12 +770,16 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 默认用户密码
|
||||
/// </summary>
|
||||
public const string Password = "TCC.1234";
|
||||
public const string Password = "XJYJ.1234";
|
||||
|
||||
/// <summary>
|
||||
/// 入场培训类型ID
|
||||
/// 培训类型——入场培训类型ID
|
||||
/// </summary>
|
||||
public const string EntryTrainTypeId = "dfb6a37e-4412-4ba9-ad59-3bc505bc21f7";
|
||||
/// <summary>
|
||||
/// 培训类型——检查重修培训
|
||||
/// </summary>
|
||||
public const string RetakeCourseTrainTypeId = "2F687916-5E31-4DF3-97A3-E33E108C8070";
|
||||
|
||||
/// <summary>
|
||||
/// 微信订阅模板ID
|
||||
@@ -783,6 +787,11 @@ namespace BLL
|
||||
//public const string WX_TemplateID = "rG2tJ2ByE9I4SziW-zKglA56Ux1q0sZF0WCFLfK70Cs";
|
||||
public const string WX_TemplateID = "rG2tJ2ByE9I4SziW-zKglF9s6bk6eyV0WVrT5tqFq8I";
|
||||
|
||||
/// <summary>
|
||||
/// 培训级别——其它
|
||||
/// </summary>
|
||||
public const string OtherTrainLevelId = "de14948e-d3cb-436b-a962-80f1490ee9a9";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 按钮描述
|
||||
@@ -1779,29 +1788,14 @@ namespace BLL
|
||||
public const string MinusScoreSituationMenuId = "0BCE76EA-319F-47BF-913A-A32735641F5C";
|
||||
|
||||
/// <summary>
|
||||
/// 个人安全行动计划
|
||||
/// 自主管理加分项
|
||||
/// </summary>
|
||||
public const string PersonalSafetyActionPlanMenuId = "7DD00BEF-821D-4996-ADF8-695139F201B4";
|
||||
public const string BonusScoreSelfManagementMenuId = "9667D2CB-8AAE-4799-8C94-A051F9846ECE";
|
||||
|
||||
/// <summary>
|
||||
/// 安全经验分享
|
||||
/// 自主管理加分项类型
|
||||
/// </summary>
|
||||
public const string SharingOfSafetyExperienceMenuId = "D5FC7B12-0E81-482C-8B29-A9F43DF05D1F";
|
||||
|
||||
/// <summary>
|
||||
/// 领导人员参加班组作业分析会
|
||||
/// </summary>
|
||||
public const string LeadershipJoinHomeworkAnalysisMeetingMenuId = "05F4AC73-1BA2-4FF2-AAED-292DF5E44412";
|
||||
|
||||
/// <summary>
|
||||
/// 一线党员联系班组共建活动
|
||||
/// </summary>
|
||||
public const string CoConstructionActivitiesMenuId = "D3BADACC-3DA6-4B09-8BD0-1E2DF7B04B6E";
|
||||
|
||||
/// <summary>
|
||||
/// 行为安全观察与沟通
|
||||
/// </summary>
|
||||
public const string BehavioralSafetyObservationMenuId = "5049BB69-A75F-47D4-ABF3-DAA719D05C74";
|
||||
public const string BonusScoreTypeMenuId = "8526FC57-F2A8-483F-A7EF-724785B9B676";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Web.UI.WebControls;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Enums
|
||||
{
|
||||
#region 培训考试
|
||||
|
||||
/// <summary>
|
||||
/// 培训效果
|
||||
/// </summary>
|
||||
public enum Outcome
|
||||
{
|
||||
掌握 = 0,
|
||||
熟悉 = 1,
|
||||
了解 = 2,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 培训效果
|
||||
/// </summary>
|
||||
public static Dictionary<string, int> OutcomeMap = new Dictionary<string, int>
|
||||
{
|
||||
{ "掌握" ,(int)Outcome.掌握},
|
||||
{ "熟悉" ,(int)Outcome.熟悉},
|
||||
{ "了解" ,(int)Outcome.了解}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 培训效果下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitOutcomeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Key";
|
||||
dropName.DataSource = OutcomeMap;
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查重修计划类型
|
||||
/// </summary>
|
||||
public enum RetakeCourseType
|
||||
{
|
||||
日常巡检 = 1,
|
||||
专项检查 = 2,
|
||||
领导带班检查 = 3,
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -140,6 +140,8 @@ namespace BLL
|
||||
IsHoldMeet = ProjectLeaderCheck.IsHoldMeet,
|
||||
Requirement = ProjectLeaderCheck.Requirement,
|
||||
LeaderNames = ProjectLeaderCheck.LeaderNames,
|
||||
ResponsibleMan = ProjectLeaderCheck.ResponsibleMan,
|
||||
CompanyTrainingItemId = ProjectLeaderCheck.CompanyTrainingItemId,
|
||||
CompileMan = ProjectLeaderCheck.CompileMan,
|
||||
CompileDate = ProjectLeaderCheck.CompileDate,
|
||||
};
|
||||
@@ -166,6 +168,8 @@ namespace BLL
|
||||
newProjectLeaderCheck.IsHoldMeet = ProjectLeaderCheck.IsHoldMeet;
|
||||
newProjectLeaderCheck.Requirement = ProjectLeaderCheck.Requirement;
|
||||
newProjectLeaderCheck.LeaderNames = ProjectLeaderCheck.LeaderNames;
|
||||
newProjectLeaderCheck.ResponsibleMan = ProjectLeaderCheck.ResponsibleMan;
|
||||
newProjectLeaderCheck.CompanyTrainingItemId = ProjectLeaderCheck.CompanyTrainingItemId;
|
||||
newProjectLeaderCheck.CompileMan = ProjectLeaderCheck.CompileMan;
|
||||
newProjectLeaderCheck.CompileDate = ProjectLeaderCheck.CompileDate;
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 公司培训明细表
|
||||
/// 公司培训明细表——教材库
|
||||
/// </summary>
|
||||
public class CompanyTrainingItemService
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace BLL
|
||||
{
|
||||
return db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加公司培训明细
|
||||
/// </summary>
|
||||
@@ -35,6 +36,9 @@ namespace BLL
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
newModel.WorkPostIds = model.WorkPostIds;
|
||||
newModel.WorkPostNames = model.WorkPostNames;
|
||||
newModel.Outcome = model.Outcome;
|
||||
newModel.LearningTime = model.LearningTime;
|
||||
newModel.TestTrainingIds = model.TestTrainingIds;
|
||||
db.Training_CompanyTrainingItem.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -55,6 +59,9 @@ namespace BLL
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
newModel.WorkPostIds = model.WorkPostIds;
|
||||
newModel.WorkPostNames = model.WorkPostNames;
|
||||
newModel.Outcome = model.Outcome;
|
||||
newModel.LearningTime = model.LearningTime;
|
||||
newModel.TestTrainingIds = model.TestTrainingIds;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -72,5 +79,40 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="workPostId">职务Id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitCompanyTrainingItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "CompanyTrainingItemId";
|
||||
dropName.DataTextField = "CompanyTrainingItemName";
|
||||
dropName.DataSource = GetCompanyTrainingItemList(workPostId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取教材库下拉项
|
||||
/// </summary>
|
||||
/// <param name="workPostId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_CompanyTrainingItem> GetCompanyTrainingItemList(string workPostId)
|
||||
{
|
||||
var lst = (from x in Funs.DB.Training_CompanyTrainingItem orderby x.CompanyTrainingItemCode select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(workPostId))
|
||||
{
|
||||
lst = lst.Where(x => x.WorkPostIds == null || x.WorkPostIds.Contains(workPostId)).ToList();
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,33 @@ namespace BLL
|
||||
{
|
||||
PlanItemId = planItem.PlanItemId,
|
||||
PlanId = planItem.PlanId,
|
||||
TrainingEduId = planItem.TrainingEduId
|
||||
TrainingEduId = planItem.TrainingEduId,
|
||||
TrainingEduItemId = planItem.TrainingEduItemId,
|
||||
CompanyTrainingId = planItem.CompanyTrainingId,
|
||||
CompanyTrainingItemId = planItem.CompanyTrainingItemId
|
||||
};
|
||||
db.Training_PlanItem.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改培训任务
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdatePlanItem(Model.Training_PlanItem model)
|
||||
{
|
||||
Model.Training_PlanItem newItem = db.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == model.PlanItemId);
|
||||
if (newItem != null)
|
||||
{
|
||||
newItem.PlanId = model.PlanId;
|
||||
newItem.TrainingEduId = model.TrainingEduId;
|
||||
newItem.TrainingEduItemId = model.TrainingEduItemId;
|
||||
newItem.CompanyTrainingId = model.CompanyTrainingId;
|
||||
newItem.CompanyTrainingItemId = model.CompanyTrainingItemId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据明细键删除培训计划明细
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -19,65 +22,81 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Training_Plan GetPlanById(string planId)
|
||||
{
|
||||
return Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
|
||||
return db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查Id获取培训计划
|
||||
/// </summary>
|
||||
/// <param name="checkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Training_Plan GetPlanByCheckId(string checkId)
|
||||
{
|
||||
return db.Training_Plan.FirstOrDefault(e => e.CheckId == checkId && e.IsRetakeCourse == 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加培训计划
|
||||
/// </summary>
|
||||
/// <param name="plan"></param>
|
||||
public static void AddPlan(Model.Training_Plan trainingPlan)
|
||||
/// <param name="model"></param>
|
||||
public static void AddPlan(Model.Training_Plan model)
|
||||
{
|
||||
Model.Training_Plan newPlan = new Model.Training_Plan
|
||||
Model.Training_Plan newModel = new Model.Training_Plan
|
||||
{
|
||||
PlanId = trainingPlan.PlanId,
|
||||
PlanCode = trainingPlan.PlanCode,
|
||||
ProjectId = trainingPlan.ProjectId,
|
||||
DesignerId = trainingPlan.DesignerId,
|
||||
PlanName = trainingPlan.PlanName,
|
||||
TrainContent = trainingPlan.TrainContent,
|
||||
TrainStartDate = trainingPlan.TrainStartDate,
|
||||
TeachHour = trainingPlan.TeachHour,
|
||||
TeachMan = trainingPlan.TeachMan,
|
||||
TeachAddress = trainingPlan.TeachAddress,
|
||||
TrainTypeId = trainingPlan.TrainTypeId,
|
||||
TrainLevelId = trainingPlan.TrainLevelId,
|
||||
DesignerDate =trainingPlan.DesignerDate,
|
||||
UnitIds = trainingPlan.UnitIds,
|
||||
WorkPostId = trainingPlan.WorkPostId,
|
||||
States = trainingPlan.States,
|
||||
Cycle=trainingPlan.Cycle
|
||||
PlanId = model.PlanId,
|
||||
PlanCode = model.PlanCode,
|
||||
ProjectId = model.ProjectId,
|
||||
DesignerId = model.DesignerId,
|
||||
PlanName = model.PlanName,
|
||||
TrainContent = model.TrainContent,
|
||||
TrainStartDate = model.TrainStartDate,
|
||||
TeachHour = model.TeachHour,
|
||||
TeachMan = model.TeachMan,
|
||||
TeachAddress = model.TeachAddress,
|
||||
TrainTypeId = model.TrainTypeId,
|
||||
TrainLevelId = model.TrainLevelId,
|
||||
DesignerDate = model.DesignerDate,
|
||||
UnitIds = model.UnitIds,
|
||||
WorkPostId = model.WorkPostId,
|
||||
States = model.States,
|
||||
Cycle = model.Cycle,
|
||||
IsRetakeCourse = model.IsRetakeCourse,
|
||||
CheckType = model.CheckType,
|
||||
CheckId = model.CheckId
|
||||
};
|
||||
db.Training_Plan.InsertOnSubmit(newPlan);
|
||||
db.Training_Plan.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改培训计划
|
||||
/// </summary>
|
||||
/// <param name="plan"></param>
|
||||
public static void UpdatePlan(Model.Training_Plan newTrainingPlan)
|
||||
/// <param name="model"></param>
|
||||
public static void UpdatePlan(Model.Training_Plan model)
|
||||
{
|
||||
Model.Training_Plan isUpdate = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == newTrainingPlan.PlanId);
|
||||
Model.Training_Plan isUpdate = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == model.PlanId);
|
||||
if (isUpdate != null)
|
||||
{
|
||||
isUpdate.PlanName = newTrainingPlan.PlanName;
|
||||
isUpdate.TrainContent = newTrainingPlan.TrainContent;
|
||||
isUpdate.TrainStartDate = newTrainingPlan.TrainStartDate;
|
||||
isUpdate.TeachHour = newTrainingPlan.TeachHour;
|
||||
isUpdate.TrainEndDate = newTrainingPlan.TrainEndDate;
|
||||
isUpdate.TeachMan = newTrainingPlan.TeachMan;
|
||||
isUpdate.TeachAddress = newTrainingPlan.TeachAddress;
|
||||
isUpdate.TrainTypeId = newTrainingPlan.TrainTypeId;
|
||||
isUpdate.TrainLevelId = newTrainingPlan.TrainLevelId;
|
||||
isUpdate.DesignerDate = newTrainingPlan.DesignerDate;
|
||||
isUpdate.UnitIds = newTrainingPlan.UnitIds;
|
||||
isUpdate.WorkPostId = newTrainingPlan.WorkPostId;
|
||||
isUpdate.States = newTrainingPlan.States;
|
||||
isUpdate.Cycle = newTrainingPlan.Cycle;
|
||||
Funs.DB.SubmitChanges();
|
||||
isUpdate.PlanName = model.PlanName;
|
||||
isUpdate.TrainContent = model.TrainContent;
|
||||
isUpdate.TrainStartDate = model.TrainStartDate;
|
||||
isUpdate.TeachHour = model.TeachHour;
|
||||
isUpdate.TrainEndDate = model.TrainEndDate;
|
||||
isUpdate.TeachMan = model.TeachMan;
|
||||
isUpdate.TeachAddress = model.TeachAddress;
|
||||
isUpdate.TrainTypeId = model.TrainTypeId;
|
||||
isUpdate.TrainLevelId = model.TrainLevelId;
|
||||
isUpdate.DesignerDate = model.DesignerDate;
|
||||
isUpdate.UnitIds = model.UnitIds;
|
||||
isUpdate.WorkPostId = model.WorkPostId;
|
||||
isUpdate.States = model.States;
|
||||
isUpdate.Cycle = model.Cycle;
|
||||
isUpdate.IsRetakeCourse = model.IsRetakeCourse;
|
||||
isUpdate.CheckType = model.CheckType;
|
||||
isUpdate.CheckId = model.CheckId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,11 +106,11 @@ namespace BLL
|
||||
/// <param name="planId"></param>
|
||||
public static void DeletePlanById(string planId)
|
||||
{
|
||||
Model.Training_Plan plan = Funs.DB.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
|
||||
Model.Training_Plan plan = db.Training_Plan.FirstOrDefault(e => e.PlanId == planId);
|
||||
if (plan != null)
|
||||
{
|
||||
Funs.DB.Training_Plan.DeleteOnSubmit(plan);
|
||||
Funs.DB.SubmitChanges();
|
||||
db.Training_Plan.DeleteOnSubmit(plan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,5 +122,122 @@ namespace BLL
|
||||
{
|
||||
return (from x in db.Training_Plan orderby x.PlanCode select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查重修,并生成培训计划、任务
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
public static void RetakeCourseProducePlan(RetakeCourseProducePlanInfo info)
|
||||
{
|
||||
var plan = GetPlanByCheckId(info.CheckId);
|
||||
var person = PersonService.GetPersonById(info.PersonId);
|
||||
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
|
||||
var teachHour = companyTrainingItem.LearningTime / 3600;
|
||||
|
||||
string planId = string.Empty;
|
||||
if (plan != null)
|
||||
{//编辑培训计划
|
||||
planId = plan.PlanId;
|
||||
Model.Training_Plan planModel = new Model.Training_Plan
|
||||
{
|
||||
ProjectId = info.CurrProjectId,
|
||||
PlanName = info.CheckTypeName,
|
||||
TrainContent = info.CheckTypeName,
|
||||
TeachHour = teachHour,
|
||||
UnitIds = person.UnitId,
|
||||
WorkPostId = person.WorkPostId,
|
||||
TrainStartDate = plan.TrainStartDate,
|
||||
TrainEndDate = info.TrainEndDate,
|
||||
TeachMan = plan.TeachMan,
|
||||
TeachAddress = plan.TeachAddress,
|
||||
TrainTypeId = Const.RetakeCourseTrainTypeId,
|
||||
TrainLevelId = Const.OtherTrainLevelId,
|
||||
States = "1",
|
||||
Cycle = "",
|
||||
IsRetakeCourse = 1,
|
||||
CheckType = plan.CheckType,
|
||||
CheckId = plan.CheckId
|
||||
};
|
||||
UpdatePlan(planModel);
|
||||
}
|
||||
else
|
||||
{//生成培训计划
|
||||
planId = SQLHelper.GetNewID();
|
||||
string code = ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode + "-";
|
||||
string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", info.CurrProjectId, code);
|
||||
|
||||
Model.Training_Plan planModel = new Model.Training_Plan
|
||||
{
|
||||
PlanId = planId,
|
||||
PlanCode = planCode,
|
||||
ProjectId = info.CurrProjectId,
|
||||
DesignerId = info.CurrUserId,
|
||||
DesignerDate = DateTime.Now,
|
||||
PlanName = info.CheckTypeName,
|
||||
TrainContent = info.CheckTypeName,
|
||||
TrainStartDate = DateTime.Now,
|
||||
TrainEndDate = info.TrainEndDate,
|
||||
TeachHour = teachHour,
|
||||
//TeachMan = model.TeachMan,
|
||||
//TeachAddress = model.TeachAddress,
|
||||
TrainTypeId = Const.RetakeCourseTrainTypeId,
|
||||
TrainLevelId = Const.OtherTrainLevelId,
|
||||
UnitIds = person.UnitId,
|
||||
WorkPostId = person.WorkPostId,
|
||||
States = "1",
|
||||
Cycle = "",
|
||||
IsRetakeCourse = 1,
|
||||
CheckType = info.CheckType.ToString(),
|
||||
CheckId = info.CheckId
|
||||
};
|
||||
AddPlan(planModel);
|
||||
}
|
||||
|
||||
//删除培训明细
|
||||
TrainingPlanItemService.DeletePlanItemByPlanId(planId);
|
||||
//删除任务
|
||||
TrainingTaskService.DeleteTaskByPlanId(planId);
|
||||
|
||||
string taskId = SQLHelper.GetNewID();
|
||||
//新增培训任务
|
||||
Model.Training_Task newTrainDetail = new Model.Training_Task
|
||||
{
|
||||
TaskId = taskId,
|
||||
ProjectId = info.CurrProjectId,
|
||||
PlanId = planId,
|
||||
UserId = info.PersonId,
|
||||
TaskDate = DateTime.Now,
|
||||
States = Const.State_1,
|
||||
};
|
||||
TrainingTaskService.AddTask(newTrainDetail);
|
||||
|
||||
//新增培训任务明细
|
||||
Model.Training_TaskItem newTaskItem = new Model.Training_TaskItem
|
||||
{
|
||||
TaskItemId = SQLHelper.GetNewID(),
|
||||
TaskId = taskId,
|
||||
PlanId = planId,
|
||||
PersonId = info.PersonId,
|
||||
TrainingItemCode = companyTrainingItem.CompanyTrainingItemCode,
|
||||
TrainingItemName = companyTrainingItem.CompanyTrainingItemName,
|
||||
AttachUrl = companyTrainingItem.AttachUrl,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId,
|
||||
//LearnTime = trainingItem.LearningTime,
|
||||
//VideoProgress = 0,
|
||||
};
|
||||
db.Training_TaskItem.InsertOnSubmit(newTaskItem);
|
||||
db.SubmitChanges();
|
||||
|
||||
//新增培训明细
|
||||
Model.Training_PlanItem newPlanItem = new Model.Training_PlanItem
|
||||
{
|
||||
PlanItemId = SQLHelper.GetNewID(),
|
||||
PlanId = planId,
|
||||
CompanyTrainingItemId = info.CompanyTrainingItemId,
|
||||
CompanyTrainingId = companyTrainingItem.CompanyTrainingId
|
||||
};
|
||||
TrainingPlanItemService.AddPlanItem(newPlanItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -41,6 +42,7 @@ namespace BLL
|
||||
Model.Training_Task newTask = new Model.Training_Task
|
||||
{
|
||||
TaskId = task.TaskId,
|
||||
ProjectId = task.ProjectId,
|
||||
PlanId = task.PlanId,
|
||||
UserId = task.UserId,
|
||||
TaskDate = task.TaskDate,
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 行为安全观察与沟通
|
||||
/// </summary>
|
||||
public static class BehavioralSafetyObservationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取行为安全观察与沟通信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_BehavioralSafetyObservation GetBehavioralSafetyObservationById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加行为安全观察与沟通
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddBehavioralSafetyObservation(Model.Examine_BehavioralSafetyObservation model)
|
||||
{
|
||||
Model.Examine_BehavioralSafetyObservation newModel = new Model.Examine_BehavioralSafetyObservation
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
UserId = model.UserId,
|
||||
DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_BehavioralSafetyObservation.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateBehavioralSafetyObservation(Model.Examine_BehavioralSafetyObservation model)
|
||||
{
|
||||
Model.Examine_BehavioralSafetyObservation newModel = Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.UserId = model.UserId;
|
||||
newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteBehavioralSafetyObservationById(string Id)
|
||||
{
|
||||
Model.Examine_BehavioralSafetyObservation model = Funs.DB.Examine_BehavioralSafetyObservation.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_BehavioralSafetyObservation.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 自主管理加分项
|
||||
/// </summary>
|
||||
public static class BonusScoreSelfManagementService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取自主管理加分项信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_BonusScoreSelfManagement GetBonusScoreSelfManagementById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加自主管理加分项
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddBonusScoreSelfManagement(Model.Examine_BonusScoreSelfManagement model)
|
||||
{
|
||||
Model.Examine_BonusScoreSelfManagement newModel = new Model.Examine_BonusScoreSelfManagement
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
BonusScoreTypeId = model.BonusScoreTypeId,
|
||||
BonusScoreTypeName = model.BonusScoreTypeName,
|
||||
Score = model.Score,
|
||||
PersonId = model.PersonId,
|
||||
//DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_BonusScoreSelfManagement.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateBonusScoreSelfManagement(Model.Examine_BonusScoreSelfManagement model)
|
||||
{
|
||||
Model.Examine_BonusScoreSelfManagement newModel = Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
//newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.BonusScoreTypeId = model.BonusScoreTypeId;
|
||||
newModel.BonusScoreTypeName = model.BonusScoreTypeName;
|
||||
newModel.Score = model.Score;
|
||||
newModel.PersonId = model.PersonId;
|
||||
//newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteBonusScoreSelfManagementById(string Id)
|
||||
{
|
||||
Model.Examine_BonusScoreSelfManagement model = Funs.DB.Examine_BonusScoreSelfManagement.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_BonusScoreSelfManagement.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有List
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Examine_BonusScoreSelfManagement> GetBonusScoreSelfManagementList(string projectId, string personId, string typeId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Examine_BonusScoreSelfManagement orderby x.Code descending select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(projectId))
|
||||
{
|
||||
list = list.Where(x => x.ProjectId == projectId).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(personId))
|
||||
{
|
||||
list = list.Where(x => x.PersonId == personId).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(typeId))
|
||||
{
|
||||
list = list.Where(x => x.BonusScoreTypeId == typeId).ToList();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 自主管理加分项类型
|
||||
/// </summary>
|
||||
public static class BonusScoreTypeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取自主管理加分项类型信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_BonusScoreType GetBonusScoreTypeById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据名称获取自主管理加分项类型信息
|
||||
/// </summary>
|
||||
/// <param name="Name"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_BonusScoreType GetBonusScoreTypeByName(string Name)
|
||||
{
|
||||
return Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Name == Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加自主管理加分项类型
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddBonusScoreType(Model.Examine_BonusScoreType model)
|
||||
{
|
||||
Model.Examine_BonusScoreType newModel = new Model.Examine_BonusScoreType
|
||||
{
|
||||
Id = model.Id,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
Score = model.Score,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark
|
||||
};
|
||||
Funs.DB.Examine_BonusScoreType.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateBonusScoreType(Model.Examine_BonusScoreType model)
|
||||
{
|
||||
Model.Examine_BonusScoreType newModel = Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.Score = model.Score;
|
||||
newModel.Remark = model.Remark;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteBonusScoreTypeById(string Id)
|
||||
{
|
||||
Model.Examine_BonusScoreType model = Funs.DB.Examine_BonusScoreType.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_BonusScoreType.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有类型List
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Examine_BonusScoreType> GetBonusScoreTypeList()
|
||||
{
|
||||
return (from x in Funs.DB.Examine_BonusScoreType orderby x.Code select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitBonusScoreTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Id";
|
||||
dropName.DataTextField = "Name";
|
||||
dropName.DataSource = GetBonusScoreTypeList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 一线党员联系班组共建活动
|
||||
/// </summary>
|
||||
public static class CoConstructionActivitiesService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取一线党员联系班组共建活动信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_CoConstructionActivities GetCoConstructionActivitiesById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加一线党员联系班组共建活动
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddCoConstructionActivities(Model.Examine_CoConstructionActivities model)
|
||||
{
|
||||
Model.Examine_CoConstructionActivities newModel = new Model.Examine_CoConstructionActivities
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
UserId = model.UserId,
|
||||
DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_CoConstructionActivities.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateCoConstructionActivities(Model.Examine_CoConstructionActivities model)
|
||||
{
|
||||
Model.Examine_CoConstructionActivities newModel = Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.UserId = model.UserId;
|
||||
newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteCoConstructionActivitiesById(string Id)
|
||||
{
|
||||
Model.Examine_CoConstructionActivities model = Funs.DB.Examine_CoConstructionActivities.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_CoConstructionActivities.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 领导人员参加班组作业分析会
|
||||
/// </summary>
|
||||
public static class LeadershipJoinHomeworkAnalysisMeetingService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取领导人员参加班组作业分析会信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_LeadershipJoinHomeworkAnalysisMeeting GetLeadershipJoinHomeworkAnalysisMeetingById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加领导人员参加班组作业分析会
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddLeadershipJoinHomeworkAnalysisMeeting(Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model)
|
||||
{
|
||||
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting newModel = new Model.Examine_LeadershipJoinHomeworkAnalysisMeeting
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
UserId = model.UserId,
|
||||
DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateLeadershipJoinHomeworkAnalysisMeeting(Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model)
|
||||
{
|
||||
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting newModel = Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.UserId = model.UserId;
|
||||
newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteLeadershipJoinHomeworkAnalysisMeetingById(string Id)
|
||||
{
|
||||
Model.Examine_LeadershipJoinHomeworkAnalysisMeeting model = Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_LeadershipJoinHomeworkAnalysisMeeting.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 个人安全行动计划
|
||||
/// </summary>
|
||||
public static class PersonalSafetyActionPlanService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取个人安全行动计划信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_PersonalSafetyActionPlan GetPersonalSafetyActionPlanById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加个人安全行动计划
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddPersonalSafetyActionPlan(Model.Examine_PersonalSafetyActionPlan model)
|
||||
{
|
||||
Model.Examine_PersonalSafetyActionPlan newModel = new Model.Examine_PersonalSafetyActionPlan
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
UserId = model.UserId,
|
||||
DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_PersonalSafetyActionPlan.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdatePersonalSafetyActionPlan(Model.Examine_PersonalSafetyActionPlan model)
|
||||
{
|
||||
Model.Examine_PersonalSafetyActionPlan newModel = Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.UserId = model.UserId;
|
||||
newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeletePersonalSafetyActionPlanById(string Id)
|
||||
{
|
||||
Model.Examine_PersonalSafetyActionPlan model = Funs.DB.Examine_PersonalSafetyActionPlan.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_PersonalSafetyActionPlan.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全经验分享
|
||||
/// </summary>
|
||||
public static class SharingOfSafetyExperienceService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全经验分享信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Examine_SharingOfSafetyExperience GetSharingOfSafetyExperienceById(string Id)
|
||||
{
|
||||
return Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全经验分享
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddSharingOfSafetyExperience(Model.Examine_SharingOfSafetyExperience model)
|
||||
{
|
||||
Model.Examine_SharingOfSafetyExperience newModel = new Model.Examine_SharingOfSafetyExperience
|
||||
{
|
||||
Id = model.Id,
|
||||
ProjectId = model.ProjectId,
|
||||
Code = model.Code,
|
||||
Name = model.Name,
|
||||
UserId = model.UserId,
|
||||
DateTime = model.DateTime,
|
||||
CompileDate = model.CompileDate,
|
||||
CompileMan = model.CompileMan,
|
||||
Remark = model.Remark,
|
||||
Content = model.Content
|
||||
};
|
||||
Funs.DB.Examine_SharingOfSafetyExperience.InsertOnSubmit(newModel);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateSharingOfSafetyExperience(Model.Examine_SharingOfSafetyExperience model)
|
||||
{
|
||||
Model.Examine_SharingOfSafetyExperience newModel = Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == model.Id);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.Code = model.Code;
|
||||
newModel.Name = model.Name;
|
||||
newModel.UserId = model.UserId;
|
||||
newModel.DateTime = model.DateTime;
|
||||
newModel.Content = model.Content;
|
||||
newModel.Remark = model.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteSharingOfSafetyExperienceById(string Id)
|
||||
{
|
||||
Model.Examine_SharingOfSafetyExperience model = Funs.DB.Examine_SharingOfSafetyExperience.FirstOrDefault(e => e.Id == Id);
|
||||
if (model != null)
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Id);
|
||||
Funs.DB.Examine_SharingOfSafetyExperience.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,98 +37,100 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 增加危险观察登记信息
|
||||
/// </summary>
|
||||
/// <param name="hazardRegister">危险观察登记实体</param>
|
||||
public static void AddHazardRegister(Model.HSSE_Hazard_HazardRegister hazardRegister)
|
||||
/// <param name="model">危险观察登记实体</param>
|
||||
public static void AddHazardRegister(Model.HSSE_Hazard_HazardRegister model)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_Hazard_HazardRegister newHazardRegister = new Model.HSSE_Hazard_HazardRegister();
|
||||
newHazardRegister.HazardRegisterId = hazardRegister.HazardRegisterId;
|
||||
newHazardRegister.HazardCode = hazardRegister.HazardCode;
|
||||
newHazardRegister.RegisterDate = DateTime.Now;
|
||||
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
|
||||
newHazardRegister.RegisterTypesId = hazardRegister.RegisterTypesId;
|
||||
newHazardRegister.CheckCycle = hazardRegister.CheckCycle;
|
||||
newHazardRegister.Rectification = hazardRegister.Rectification;
|
||||
newHazardRegister.Place = hazardRegister.Place;
|
||||
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
|
||||
newHazardRegister.Observer = hazardRegister.Observer;
|
||||
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
|
||||
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
|
||||
newHazardRegister.ProjectId = hazardRegister.ProjectId;
|
||||
newHazardRegister.States = hazardRegister.States;
|
||||
newHazardRegister.IsEffective = hazardRegister.IsEffective;
|
||||
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
|
||||
newHazardRegister.CheckSpecialId = hazardRegister.CheckSpecialId;
|
||||
newHazardRegister.CheckManId = hazardRegister.CheckManId;
|
||||
newHazardRegister.CheckTime = hazardRegister.CheckTime;
|
||||
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
|
||||
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
|
||||
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
|
||||
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
|
||||
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
|
||||
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
|
||||
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
|
||||
newHazardRegister.CutPayment = hazardRegister.CutPayment;
|
||||
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
|
||||
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
|
||||
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
|
||||
newHazardRegister.Requirements = hazardRegister.Requirements;
|
||||
newHazardRegister.ControlId = hazardRegister.ControlId;
|
||||
Model.HSSE_Hazard_HazardRegister newModel = new Model.HSSE_Hazard_HazardRegister();
|
||||
newModel.HazardRegisterId = model.HazardRegisterId;
|
||||
newModel.HazardCode = model.HazardCode;
|
||||
newModel.RegisterDate = DateTime.Now;
|
||||
newModel.RegisterDef = model.RegisterDef;
|
||||
newModel.RegisterTypesId = model.RegisterTypesId;
|
||||
newModel.CheckCycle = model.CheckCycle;
|
||||
newModel.Rectification = model.Rectification;
|
||||
newModel.Place = model.Place;
|
||||
newModel.ResponsibleUnit = model.ResponsibleUnit;
|
||||
newModel.Observer = model.Observer;
|
||||
newModel.RectifiedDate = model.RectifiedDate;
|
||||
newModel.AttachUrl = model.AttachUrl;
|
||||
newModel.ProjectId = model.ProjectId;
|
||||
newModel.States = model.States;
|
||||
newModel.IsEffective = model.IsEffective;
|
||||
newModel.ResponsibleMan = model.ResponsibleMan;
|
||||
newModel.CheckSpecialId = model.CheckSpecialId;
|
||||
newModel.CheckManId = model.CheckManId;
|
||||
newModel.CheckTime = model.CheckTime;
|
||||
newModel.RectificationPeriod = model.RectificationPeriod;
|
||||
newModel.ImageUrl = model.ImageUrl;
|
||||
newModel.RectificationImageUrl = model.RectificationImageUrl;
|
||||
newModel.RectificationTime = model.RectificationTime;
|
||||
newModel.ConfirmMan = model.ConfirmMan;
|
||||
newModel.ConfirmDate = model.ConfirmDate;
|
||||
newModel.HandleIdea = model.HandleIdea;
|
||||
newModel.CutPayment = model.CutPayment;
|
||||
newModel.ProblemTypes = model.ProblemTypes;
|
||||
newModel.DIC_ID = model.DIC_ID;
|
||||
newModel.Risk_Level = model.Risk_Level;
|
||||
newModel.Requirements = model.Requirements;
|
||||
newModel.ControlId = model.ControlId;
|
||||
newModel.CheckItemDetailId = model.CheckItemDetailId;
|
||||
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
|
||||
|
||||
newHazardRegister.CheckItemDetailId = hazardRegister.CheckItemDetailId;
|
||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister);
|
||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改危险观察登记信息
|
||||
/// </summary>
|
||||
/// <param name="hazardRegister">危险观察登记实体</param>
|
||||
public static void UpdateHazardRegister(Model.HSSE_Hazard_HazardRegister hazardRegister)
|
||||
/// <param name="model">危险观察登记实体</param>
|
||||
public static void UpdateHazardRegister(Model.HSSE_Hazard_HazardRegister model)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_Hazard_HazardRegister newHazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegister.HazardRegisterId);
|
||||
if (newHazardRegister != null)
|
||||
Model.HSSE_Hazard_HazardRegister newModel = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == model.HazardRegisterId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newHazardRegister.HazardCode = hazardRegister.HazardCode;
|
||||
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
|
||||
newHazardRegister.Rectification = hazardRegister.Rectification;
|
||||
newHazardRegister.Place = hazardRegister.Place;
|
||||
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
|
||||
newHazardRegister.Observer = hazardRegister.Observer;
|
||||
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
|
||||
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
|
||||
newHazardRegister.ProjectId = hazardRegister.ProjectId;
|
||||
newHazardRegister.States = hazardRegister.States;
|
||||
newHazardRegister.IsEffective = hazardRegister.IsEffective;
|
||||
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
|
||||
newHazardRegister.CheckManId = hazardRegister.CheckManId;
|
||||
//newHazardRegister.CheckTime = hazardRegister.CheckTime;
|
||||
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
|
||||
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
|
||||
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
|
||||
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
|
||||
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
|
||||
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
|
||||
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
|
||||
newHazardRegister.CutPayment = hazardRegister.CutPayment;
|
||||
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
|
||||
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
|
||||
newHazardRegister.CheckItemDetailId = hazardRegister.CheckItemDetailId;
|
||||
newHazardRegister.RegisterTypesId = hazardRegister.RegisterTypesId;
|
||||
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
|
||||
newHazardRegister.Requirements = hazardRegister.Requirements;
|
||||
newModel.HazardCode = model.HazardCode;
|
||||
newModel.RegisterDef = model.RegisterDef;
|
||||
newModel.Rectification = model.Rectification;
|
||||
newModel.Place = model.Place;
|
||||
newModel.ResponsibleUnit = model.ResponsibleUnit;
|
||||
newModel.Observer = model.Observer;
|
||||
newModel.RectifiedDate = model.RectifiedDate;
|
||||
newModel.AttachUrl = model.AttachUrl;
|
||||
newModel.ProjectId = model.ProjectId;
|
||||
newModel.States = model.States;
|
||||
newModel.IsEffective = model.IsEffective;
|
||||
newModel.ResponsibleMan = model.ResponsibleMan;
|
||||
newModel.CheckManId = model.CheckManId;
|
||||
//newModel.CheckTime = model.CheckTime;
|
||||
newModel.RectificationPeriod = model.RectificationPeriod;
|
||||
newModel.ImageUrl = model.ImageUrl;
|
||||
newModel.RectificationImageUrl = model.RectificationImageUrl;
|
||||
newModel.RectificationTime = model.RectificationTime;
|
||||
newModel.ConfirmMan = model.ConfirmMan;
|
||||
newModel.ConfirmDate = model.ConfirmDate;
|
||||
newModel.HandleIdea = model.HandleIdea;
|
||||
newModel.CutPayment = model.CutPayment;
|
||||
newModel.ProblemTypes = model.ProblemTypes;
|
||||
newModel.DIC_ID = model.DIC_ID;
|
||||
newModel.CheckItemDetailId = model.CheckItemDetailId;
|
||||
newModel.RegisterTypesId = model.RegisterTypesId;
|
||||
newModel.Risk_Level = model.Risk_Level;
|
||||
newModel.Requirements = model.Requirements;
|
||||
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
|
||||
|
||||
//把附件表的路径复制过来
|
||||
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
|
||||
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(model.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
|
||||
if (file != null)
|
||||
{
|
||||
newHazardRegister.ImageUrl = file.AttachUrl;
|
||||
newModel.ImageUrl = file.AttachUrl;
|
||||
}
|
||||
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
|
||||
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(model.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
|
||||
if (fileR != null)
|
||||
{
|
||||
newHazardRegister.RectificationImageUrl = fileR.AttachUrl;
|
||||
newModel.RectificationImageUrl = fileR.AttachUrl;
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
@@ -142,18 +144,18 @@ namespace BLL
|
||||
public static void DeleteHazardRegisterByHazardRegisterId(string hazardRegisterId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_Hazard_HazardRegister hazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
|
||||
if (hazardRegister != null)
|
||||
Model.HSSE_Hazard_HazardRegister model = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
|
||||
if (model != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.ImageUrl);//删除整改前图片
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.RectificationImageUrl);//删除整改后图片
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.ImageUrl);//删除整改前图片
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.RectificationImageUrl);//删除整改后图片
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
|
||||
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ namespace BLL
|
||||
newPerson.DepartId = person.DepartId;
|
||||
newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl;
|
||||
newPerson.Password = GetPersonPassWord(person.IdentityCard);
|
||||
newPerson.ExchangeTime = null;
|
||||
newPerson.ExchangeTime = null;
|
||||
newPerson.ExchangeTime2 = null;
|
||||
newPerson.RealNameUpdateTime = null;
|
||||
if (!string.IsNullOrEmpty(person.AuditorId))
|
||||
@@ -654,6 +654,35 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitPersonByMultiProjectUnitDropDownList(FineUIPro.DropDownList dropName, string projectId, string unitIds, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "PersonId";
|
||||
dropName.DataTextField = "PersonName";
|
||||
var list = new List<Model.SitePerson_Person>();
|
||||
var lstUnitId = unitIds.Split(',');
|
||||
foreach (var item in lstUnitId)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(item))
|
||||
{
|
||||
var lst = GetPersonLitsByprojectIdUnitId(projectId, item);
|
||||
list.AddRange(lst);
|
||||
}
|
||||
}
|
||||
dropName.DataSource = list;
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
/// </summary>
|
||||
|
||||
@@ -1599,7 +1599,7 @@ namespace BLL
|
||||
|
||||
public static string getInitialPassword(string unitId, string idCard)
|
||||
{
|
||||
string prefixValue = "TCC";
|
||||
string prefixValue = "XJYJ";
|
||||
string suffixValue = "1234";
|
||||
var getUnit = UnitService.GetUnitByUnitId(unitId);
|
||||
if (getUnit != null)
|
||||
|
||||
Reference in New Issue
Block a user