1、培训计划 触发给安环安全员(之前负责人)

2、培训记录 获取 培训题目数量修改(之前有bug)
3、在线考试 添加 分数 是否合格 不合格的时候添加 今日 提醒 关注后续培训 同时 告诉培训组织者 培训未通过人员信息
4、培训效果评估 评估结果 默认可空,不然查看默认 “好”
This commit is contained in:
wyw 2025-11-21 19:25:02 +08:00
parent 7b8e4a5761
commit 628276a9f2
10 changed files with 272143 additions and 30 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025112101 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "EXAMINATION_RESULTS",
table: "T_SE_TRAIN_RECORD_USER",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SCORE",
table: "T_SE_TRAIN_RECORD_USER",
type: "int",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EXAMINATION_RESULTS",
table: "T_SE_TRAIN_RECORD_USER");
migrationBuilder.DropColumn(
name: "SCORE",
table: "T_SE_TRAIN_RECORD_USER");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025112102 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "EVALUATION_RESULT",
table: "T_SE_TRAINING_EFFECT_EVALUATION_SURVEY_RESULTS",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "EVALUATION_RESULT",
table: "T_SE_TRAINING_EFFECT_EVALUATION_SURVEY_RESULTS",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
}
}
}

View File

@ -73485,7 +73485,7 @@ namespace APT.Data.Migrations.Migrations
b.Property<int>("ENTITY_ORG_TPYE")
.HasColumnType("int");
b.Property<int>("EVALUATION_RESULT")
b.Property<int?>("EVALUATION_RESULT")
.HasColumnType("int");
b.Property<Guid?>("FLOW_ID")
@ -74623,6 +74623,9 @@ namespace APT.Data.Migrations.Migrations
b.Property<int>("ENTITY_ORG_TPYE")
.HasColumnType("int");
b.Property<int?>("EXAMINATION_RESULTS")
.HasColumnType("int");
b.Property<Guid?>("FLOW_ID")
.HasColumnType("uniqueidentifier");
@ -74658,6 +74661,9 @@ namespace APT.Data.Migrations.Migrations
b.Property<Guid>("RECORD_ID")
.HasColumnType("uniqueidentifier");
b.Property<int?>("SCORE")
.HasColumnType("int");
b.Property<int>("STATUS")
.HasColumnType("int");

View File

@ -51,6 +51,19 @@ namespace APT.MS.Domain.Entities.SE
[Description("岗位")]
[DataFieldLength(50)]
public string POST_NAME { get; set; }
/// <summary>
/// 考核结果
/// </summary>
[Description("考核结果")]
public SEExaminationResultsEnum? EXAMINATION_RESULTS { get; set; }
/// <summary>
/// 分数
/// </summary>
[Description("分数")]
public int? SCORE { get; set; }
/// <summary>
/// 状态
/// </summary>

View File

@ -14,7 +14,7 @@ namespace APT.MS.Domain.Entities.SE
/// 培训效果评估调查表
/// </summary>
[Description("培训效果评估调查表")]
[DataFieldForeignKey("Nav_TrainingEffectSurvey","Nav_ResultList")]
[DataFieldForeignKey("Nav_TrainingEffectSurvey", "Nav_ResultList")]
public Guid TRAINING_EFFECT_EVALUATION_SURVEY_ID { get; set; }
/// <summary>
/// 导航: 培训效果评估调查表
@ -39,7 +39,7 @@ namespace APT.MS.Domain.Entities.SE
[Description("评估结果")]
[EnumName("SEEvaluationResultEnum")]
[FormFieldEdit]
public SEEvaluationResultEnum EVALUATION_RESULT { get; set; }
public SEEvaluationResultEnum? EVALUATION_RESULT { get; set; }
}
}

View File

@ -86,7 +86,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
//部门培训计划
//CheckDepTrainPlan(filter, dtNow, config);
CreateYearTrainPlan(filter, dtNow, config);
CreateYearTrainPlan(filter, dtNow, config);//培训计划 (给安环部安全员)
//到时间触发年度培训计划,搜集完成的部门培训计划
//FinishYearTrainPlan(filter, dtNow, config); wyw 只触发给公司级 没必要添加结束时间 就一单 时间没到做归档也没意义
//CheckYearTrainPlan(filter, dtNow); //培训通知 旧模式 可废弃
@ -1361,6 +1361,14 @@ namespace APT.PP.WebApi.Controllers.Api.PP
return true;
});
}
/// <summary>
/// 培训计划 (给安环部安全员)
/// </summary>
/// <param name="filter"></param>
/// <param name="dtNow"></param>
/// <param name="config"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
private JsonActionResult<bool> CreateYearTrainPlan(KeywordFilter filter, DateTime dtNow, T_SE_SECONFIG config)
{
return SafeExecute<bool>(() =>
@ -1386,10 +1394,19 @@ namespace APT.PP.WebApi.Controllers.Api.PP
{
return true;
}
var approveRole = this.GetEntity<T_PF_APPROVAL_ROLE>(e => e.NAME.Contains("安环部负责人"));
T_FM_USER user = null;
var approveRole = this.GetEntity<T_PF_APPROVAL_ROLE>(e => e.NAME.Contains("安环部安全员"));
if (approveRole != null)
{
var user = GetEntity<T_FM_USER>(e => e.APPROVE_ROLE_ID.HasValue && e.APPROVE_ROLE_ID.Value == approveRole.ID && e.ENABLE_STATUS == 0);
user = GetEntity<T_FM_USER>(e => e.APPROVE_ROLE_ID.HasValue && e.APPROVE_ROLE_ID.Value == approveRole.ID && e.ENABLE_STATUS == 0);
}
if (user == null)
{
approveRole = this.GetEntity<T_PF_APPROVAL_ROLE>(e => e.NAME.Contains("安环部负责人"));
}
if (approveRole != null)
{
user = GetEntity<T_FM_USER>(e => e.APPROVE_ROLE_ID.HasValue && e.APPROVE_ROLE_ID.Value == approveRole.ID && e.ENABLE_STATUS == 0);
if (user == null)
{
approveRole = this.GetEntity<T_PF_APPROVAL_ROLE>(e => e.NAME.Contains("总监") && e.NAME.Contains("安"));

View File

@ -83,18 +83,29 @@ namespace APT.SC.WebApi.Controllers.Api.SE
var CCount = 1;
if (config != null)
{
if (config.M_TEST_COUNT > 0)
if (config.M_TEST_COUNT > 0 || config.S_TEST_COUNT > 0 || config.C_TEST_COUNT > 0)
{
//王永文 只要有配置 就获取
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
else
{
//保持原来的版本
if (config.M_TEST_COUNT > 0)
{
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
}
}
var pointIDS = data.Nav_Notify.Nav_TrainContentList.Select(t => t.POINT_ID).ToList();
var testidlist = new List<Guid>();
@ -230,6 +241,10 @@ namespace APT.SC.WebApi.Controllers.Api.SE
{
return SafeExecute(() =>
{
if (entity.TaskID == Guid.Empty)
{
throw new Exception("获取待办传参失败,请在首页待办进入考试!");
}
if (entity.Nav_Papers == null || entity.Nav_Papers.Count == 0)
{
throw new Exception("试卷不能为空");
@ -262,10 +277,25 @@ namespace APT.SC.WebApi.Controllers.Api.SE
item.SCORE = score;
}
var finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
T_SE_TRAIN_RECORD_USER RecordUser = null;
if (APT.Infrastructure.Api.AppContext.CurrentSession.UserID.HasValue)
{
RecordUser = GetEntity<T_SE_TRAIN_RECORD_USER>(e => e.RECORD_ID == finishNotice.SOURCE_DATA_ID && e.USER_ID == APT.Infrastructure.Api.AppContext.CurrentSession.UserID);
RecordUser.SCORE = score;
int PASS_MARK = entity.Nav_Config.PASS_MARK;
if (PASS_MARK == 0)
{
PASS_MARK = 60;
}
RecordUser.EXAMINATION_RESULTS = RecordUser.SCORE < PASS_MARK ? SEExaminationResultsEnum. : SEExaminationResultsEnum.;
}
UnifiedCommit(() =>
{
if (finishNotice != null)
UpdateEntityNoCommit(finishNotice);
if (RecordUser != null)
UpdateEntityNoCommit(RecordUser);
BantchSaveEntityNoCommit(entity.Nav_Papers);
});
@ -353,18 +383,29 @@ namespace APT.SC.WebApi.Controllers.Api.SE
var CCount = 1;
if (config != null)
{
if (config.M_TEST_COUNT > 0)
if (config.M_TEST_COUNT > 0 || config.S_TEST_COUNT > 0 || config.C_TEST_COUNT > 0)
{
//王永文 只要有配置 就获取
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
else
{
//保持原来的版本
if (config.M_TEST_COUNT > 0)
{
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
}
}
var pointIDS = record.Nav_Notify.Nav_TrainContentList.Select(t => t.POINT_ID).ToList();
var testidlist = new List<Guid>();
@ -549,7 +590,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
TRAIN_TEACHER = item.Nav_User.NAME,//默认带转训的人
TRAIN_MODEL = item.Nav_Notify.TRAIN_MODEL,
//CHECK_TYPE_ID = item.Nav_Notify.CHECK_TYPE_ID,
CHECKTYPE=item.Nav_Notify.CHECKTYPE,
CHECKTYPE = item.Nav_Notify.CHECKTYPE,
TRAIN_PLAN = item.Nav_Notify.TRAIN_PLAN,
CREATE_NOTIFY_RECORD = true,
ORIGINAL_NOTIFY_ID = item.Nav_Notify.ID,
@ -601,8 +642,9 @@ namespace APT.SC.WebApi.Controllers.Api.SE
var absentUsers = "";
var leaveUsers = data.Nav_Users.Where(t => t.STATUS == SETrainRecordUserStatusEnum.);
var missUsers = data.Nav_Users.Where(t => t.STATUS == SETrainRecordUserStatusEnum.);
var UnqualifiedUsers = data.Nav_Users.Where(t => t.STATUS == SETrainRecordUserStatusEnum. && t.EXAMINATION_RESULTS.HasValue && t.EXAMINATION_RESULTS.Value == SEExaminationResultsEnum.);
if (leaveUsers.Count() > 0 || missUsers.Count() > 0)
if (leaveUsers.Count() > 0 || missUsers.Count() > 0 || UnqualifiedUsers.Count() > 0)
{
foreach (var user in leaveUsers)
{
@ -620,7 +662,15 @@ namespace APT.SC.WebApi.Controllers.Api.SE
allSendUserNames.Add(user.Nav_User.NAME);
absentUsers += user.Nav_User.NAME + " ";
}
allSendUserTitles.Add("请假和缺席人员:" + absentUsers + "未参加" + data.Nav_Notify.TRAIN_START_TIME.ToString().Substring(0, 10) + "举办的《" + data.Nav_Notify.NAME + "》培训,请重新安排培训!");
foreach (var user in UnqualifiedUsers)
{
allSendUserTitles.Add("您未通过" + data.Nav_Notify.TRAIN_START_TIME.ToString().Substring(0, 10) + "举办的《" + data.Nav_Notify.NAME + "》培训考试,请关注下次培训!");
allSendDataIds.Add(Guid.Parse(filter.Keyword));
allSendUserIds.Add(user.USER_ID);
allSendUserNames.Add(user.Nav_User.NAME);
absentUsers += user.Nav_User.NAME + " ";
}
allSendUserTitles.Add("请假、缺席和未通过考核人员:" + absentUsers + "未参加/通过" + data.Nav_Notify.TRAIN_START_TIME.ToString().Substring(0, 10) + "举办的《" + data.Nav_Notify.NAME + "》培训,请重新安排培训!");
allSendDataIds.Add(Guid.Parse(filter.Keyword));
allSendUserIds.Add((Guid)data.Nav_Notify.LAUNCH_USER_ID);
allSendUserNames.Add(data.Nav_Notify.Nav_LaunchUser.NAME);

View File

@ -273,18 +273,29 @@ namespace APT.SC.WebApi.Controllers.Api.SE
var CCount = 1;
if (config != null)
{
if (config.M_TEST_COUNT > 0)
if (config.M_TEST_COUNT > 0 || config.S_TEST_COUNT > 0 || config.C_TEST_COUNT > 0)
{
//王永文 只要有配置 就获取
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
else
{
//保持原来的版本
if (config.M_TEST_COUNT > 0)
{
MCount = config.M_TEST_COUNT;
}
if (config.S_TEST_COUNT > 0)
{
SCount = config.S_TEST_COUNT;
}
if (config.C_TEST_COUNT > 0)
{
CCount = config.C_TEST_COUNT;
}
}
}
var testidlist = new List<Guid>();
var testFilter = new BaseFilter(filter.GetOrgId());