三级安全教育 签到 不考试 优化(之前也处理过 本次内部矿山处理的再次合并)
This commit is contained in:
parent
e538406a8d
commit
780e66a0c3
@ -61,8 +61,6 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
item.Nav_User = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
var listCodeCheck = Nav_NewUserDetail.Where(e => !e.IS_DELETED && e.CODE != null && e.CODE.Length > 0).Select(e => e.CODE);
|
||||
@ -428,21 +426,21 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
var currUser = GetEntity<T_FM_USER>(t => t.ID == userID);
|
||||
var currUserDeail = GetEntity<T_SE_NEW_USER_DETAIL>(t => t.ID == currID);
|
||||
var currPerson = GetEntity<T_FM_PERSON>(t => t.ID == currUser.PERSON_ID);
|
||||
T_FM_DEPARTMENT departInfo = null;
|
||||
|
||||
T_FM_DEPARTMENT departInfo = this.GetEntity<T_FM_DEPARTMENT>(currUserDeail.USER_DEPARTMENT_ID.ToString());
|
||||
if (departInfo != null && departInfo.MineType != null)
|
||||
{
|
||||
var enumList = this.GetEntity<T_FM_ENUMS>(t => t.CODE == "BSMineTypeEnum" && t.VALUE == departInfo.MineType);
|
||||
currUser.MineType = departInfo.MineType.ToString();
|
||||
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
||||
unit.ORG_ID = orgId;
|
||||
unit.USER_ID = (Guid)userID;
|
||||
unit.ENUMS_ID = enumList?.ID;
|
||||
unit.Nav_Enums = null;
|
||||
units.Add(unit);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(currUserDeail.CODE))//不一样才进行 修改 比如一开始 是手机号码 配置的是工号
|
||||
{
|
||||
departInfo = this.GetEntity<T_FM_DEPARTMENT>(currUserDeail.USER_DEPARTMENT_ID.ToString());
|
||||
if (departInfo != null && departInfo.MineType != null)
|
||||
{
|
||||
var enumList = this.GetEntity<T_FM_ENUMS>(t => t.CODE == "BSMineTypeEnum" && t.VALUE == departInfo.MineType);
|
||||
currUser.MineType = departInfo.MineType.ToString();
|
||||
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
||||
unit.ORG_ID = orgId;
|
||||
unit.USER_ID = (Guid)userID;
|
||||
unit.ENUMS_ID = enumList?.ID;
|
||||
unit.Nav_Enums = null;
|
||||
units.Add(unit);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(currUserDeail.CODE) && currUserDeail.CODE != currUser.CODE)
|
||||
{
|
||||
var userCodeCheck = GetEntity<T_FM_USER>(e => e.CODE == currUserDeail.CODE && e.ID != currUser.ID);
|
||||
@ -467,6 +465,17 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
UpdateEntity(currUser);
|
||||
UpdateEntity(currPerson);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((currUserDeail.USER_DEPARTMENT_ID.HasValue && !currUser.DEPARTMENT_ID.HasValue) || (currUserDeail.USER_POST_ID.HasValue && !currPerson.POST_ID.HasValue))
|
||||
{
|
||||
currUser.DEPARTMENT_ID = currUserDeail.USER_DEPARTMENT_ID;
|
||||
currPerson.DEPARTMENT_ID = currUserDeail.USER_DEPARTMENT_ID;
|
||||
currPerson.POST_ID = currUserDeail.USER_POST_ID;
|
||||
UpdateEntity(currUser);
|
||||
UpdateEntity(currPerson);
|
||||
}
|
||||
}
|
||||
T_SE_NEW_USERS eduCardRef = null;
|
||||
T_SE_NEW_USERS newEduCard = null;
|
||||
List<T_SE_NEW_USER_DETAIL> userDetailList = null;
|
||||
@ -968,17 +977,37 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
var basefilter = new BaseFilter(orgId);
|
||||
var userDetails = GetEntities<T_SE_NEW_USER_DETAIL>(t => t.EDU_CARD_ID == eduCardID, basefilter);
|
||||
var currDetailT = userDetails.FirstOrDefault(t => t.ID == currID);//不能直接用 故定义中间参数
|
||||
eduCard = GetEntity<T_SE_NEW_USERS>(eduCardID);
|
||||
if (currDetailT != null)
|
||||
{
|
||||
if (score != null)
|
||||
{
|
||||
currDetailT.SCORE = score;
|
||||
currDetailT.EXAMINATION_RESULTS = SEExaminationResultsEnum.合格;
|
||||
if (!currDetailT.EXAMINATION_RESULTS.HasValue)
|
||||
currDetailT.EXAMINATION_RESULTS = SEExaminationResultsEnum.合格;
|
||||
}
|
||||
switch (eduCard.TRAIN_STATUS)
|
||||
{
|
||||
case SEThreeLevelSafeTrainType.公司级:
|
||||
currDetailT.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
|
||||
break;
|
||||
case SEThreeLevelSafeTrainType.部门级:
|
||||
currDetailT.STATUS = SEThreeLevelSafeTrainStatus.部门培训;
|
||||
break;
|
||||
case SEThreeLevelSafeTrainType.车间级:
|
||||
case SEThreeLevelSafeTrainType.班组级:
|
||||
currDetailT.STATUS = SEThreeLevelSafeTrainStatus.班组培训;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (currDetail != null && currDetailT.ID == currDetail.ID)
|
||||
{
|
||||
currDetail = currDetailT;
|
||||
}
|
||||
currDetailT.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
|
||||
}
|
||||
var isFinish = userDetails.Count(t => t.NEXT_DEPARTMENT_ID == currDetailT.NEXT_DEPARTMENT_ID && t.ID != currID && t.STATUS == 0);
|
||||
eduCard = GetEntity<T_SE_NEW_USERS>(eduCardID);
|
||||
var currSattus = SEThreeLevelSafeTrainType.公司级;
|
||||
if (isFinish == 0 && eduCard.TRAIN_STATUS != SEThreeLevelSafeTrainType.班组级)
|
||||
{
|
||||
@ -1169,26 +1198,6 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//public enum SEThreeLevelSafeTrainStatus
|
||||
//{
|
||||
// 草稿 = 0,
|
||||
// 公司培训 = 1,
|
||||
// 部门培训 = 2,
|
||||
// 班组培训 = 3,
|
||||
// 员工签到 = 4,
|
||||
// 审阅中 = 5,
|
||||
// 归档 = 6,
|
||||
//}
|
||||
|
||||
// <summary>培训组织部门类型</summary>
|
||||
//public enum SEThreeLevelSafeTrainType
|
||||
//{
|
||||
// 公司级 = 0,
|
||||
// 部门级 = 1,
|
||||
// 车间级 = 2,
|
||||
// 班组级 = 3,
|
||||
//}
|
||||
}
|
||||
}
|
||||
//private void CreateNextLevel(Guid ORG_ID, Guid RECORD_ID, Guid TaskID, Guid EDU_CARD_ID, string score)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user