Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
62c36967f3
@ -550,12 +550,12 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
||||
throw new Exception(message);
|
||||
}
|
||||
|
||||
var listDepChange = entityUpdateList;
|
||||
var listDepChange = new List<T_FM_DEPARTMENT>();
|
||||
if (entityUpdateList != null && entityUpdateList.Count() > 0)
|
||||
{
|
||||
var listDepID = entityUpdateList.Select(e => e.ID);
|
||||
entityUpdateList = GetEntities<T_FM_DEPARTMENT>(e => listDepID.Contains(e.ID), null).ToList();
|
||||
listDepChange = listDepChange.Where(e => !e.IS_DELETED).ToList();
|
||||
listDepChange = GetEntities<T_FM_DEPARTMENT>(e => listDepID.Contains(e.ID), null).ToList();
|
||||
//listDepChange = listDepChange.Where(e => !e.IS_DELETED).ToList();
|
||||
}
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
@ -578,10 +578,16 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
||||
this.BantchUpdateEntity_noneBase(departUpdateList);
|
||||
if (teamInfos != null && teamInfos.Any())
|
||||
this.BantchUpdateEntity_noneBase(teamInfos);
|
||||
if (entityUpdateList != null && entityUpdateList.Any())
|
||||
this.BantchUpdateEntity_noneBase(entityUpdateList);
|
||||
if (listDepChange != null && listDepChange.Any())
|
||||
BantchSaveEntityNoCommit(listDepChange);
|
||||
{
|
||||
this.BantchUpdateEntity_noneBase(entityUpdateList);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.UpdateEntityNoCommit(entity);
|
||||
}
|
||||
//if (listDepChange != null && listDepChange.Any())
|
||||
// BantchSaveEntityNoCommit(listDepChange);
|
||||
//if (entity != null)
|
||||
// this.UpdateEntityNoCommit(entity);
|
||||
});
|
||||
|
||||
@ -138,9 +138,14 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
{
|
||||
throw new Exception("请填写注意事项及防护措施");
|
||||
}
|
||||
if (users == null || users.Count(t => t.IS_DELETED == false) == 0)
|
||||
if (users == null)
|
||||
{
|
||||
throw new Exception("通知人员不能为空");
|
||||
throw new Exception("参会人员不能为空");
|
||||
}
|
||||
var userCount = users.Where(t => t.IS_DELETED == false).Count();
|
||||
if (userCount == 0)
|
||||
{
|
||||
throw new Exception("参会人员不能为空");
|
||||
}
|
||||
if (entity.CLASS_ID == null)
|
||||
{
|
||||
@ -246,20 +251,20 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
//meetingTime = DateTime.Parse("2023-06-15 06:30:00");
|
||||
if (entity.START_TIME != DateTime.MinValue)
|
||||
{
|
||||
if (entity.ORG_ID == Guid.Parse("8b3c41aa-51b1-7ce9-1879-248a038c1b5c"))
|
||||
{
|
||||
if (entity.START_TIME.AddMinutes(-30) >= meetingTime)
|
||||
{
|
||||
throw new Exception("班前会议需等到" + entity.START_TIME.AddMinutes(-30) + "后提交!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (entity.START_TIME.AddMinutes(-15) >= meetingTime)
|
||||
{
|
||||
throw new Exception("班前会议需等到" + entity.START_TIME.AddMinutes(-15) + "后提交!");
|
||||
}
|
||||
}
|
||||
//if (entity.ORG_ID == Guid.Parse("8b3c41aa-51b1-7ce9-1879-248a038c1b5c"))
|
||||
//{
|
||||
// if (entity.START_TIME.AddMinutes(-30) >= meetingTime)
|
||||
// {
|
||||
// throw new Exception("班前会议需等到" + entity.START_TIME.AddMinutes(-30) + "后提交!");
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (entity.START_TIME.AddMinutes(-15) >= meetingTime)
|
||||
// {
|
||||
// throw new Exception("班前会议需等到" + entity.START_TIME.AddMinutes(-15) + "后提交!");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -6781,6 +6781,90 @@ namespace APT.PP.WebApi.Controllers.Api
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 岗位风险辨识结束时间到,提醒本人及上级领导
|
||||
/// </summary>
|
||||
/// <param name="pageFilter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("IdentifyNoticeSync")]
|
||||
public JsonActionResult<bool> IdentifyNoticeSync([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var dt = DateTime.Now;
|
||||
if (filter.Parameter1 != null)
|
||||
{
|
||||
dt = DateTime.Parse(filter.Parameter1);
|
||||
}
|
||||
List<Guid> userIds = new List<Guid>();
|
||||
List<Guid> userLeaderIds = new List<Guid>();
|
||||
List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>();
|
||||
var users = GetEntities<T_FM_USER>(i => i.ENABLE_STATUS == 0, new BaseFilter(filter.OrgId)).ToList();
|
||||
var departs = GetEntities<T_FM_DEPARTMENT>(i => i.ENABLE_STATUS == 0, new BaseFilter(filter.OrgId)).ToList();
|
||||
var identifys = GetEntities<T_SK_RISK_IDENTIFY>(i => i.END_DATE <= dt, new BaseFilter(filter.OrgId)).ToList();
|
||||
var idetifyIds = identifys.Select(t => t.ID).ToList();
|
||||
var tasks=this.GetEntities<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID!=null &&idetifyIds.Contains((Guid)i.SOURCE_DATA_ID) && i.NOTICE_STATUS == 0, new BaseFilter(filter.OrgId)).ToList();
|
||||
userIds = tasks.Select(t => t.USER_ID).Distinct().ToList();
|
||||
if (userIds != null && userIds.Any())
|
||||
{
|
||||
//找负责人
|
||||
foreach (var user in userIds)
|
||||
{
|
||||
var userDepartId = users.FirstOrDefault(t => t.ID == user)?.DEPARTMENT_ID;
|
||||
var departUserId = departs.FirstOrDefault(t=>t.ID == userDepartId)?.USER_ID;
|
||||
if (departUserId != null)
|
||||
{
|
||||
userLeaderIds.Add((Guid)departUserId);
|
||||
}
|
||||
}
|
||||
}
|
||||
userIds = userIds.Where(t => t != null).Distinct().ToList();
|
||||
userLeaderIds = userLeaderIds.Where(t => t != null).Distinct().ToList();
|
||||
if (userIds!=null && userIds.Any() && dt.Hour == 8)//跑批设置每小时执行,每天8点触发一次
|
||||
{
|
||||
foreach (var id in userIds)
|
||||
{
|
||||
var user = users.FirstOrDefault(t => t.ID == id);
|
||||
if (user != null)
|
||||
{
|
||||
var sendNotice = NotificationTaskService.InsertUserNoticeTaskModel("你的岗位风险辨识表结束时间已到,请及时到待办处理!", user.ID, user.ORG_ID, user.ID, user.NAME, DateTime.Now, DateTime.Now.AddDays(1), (int)FMNoticeTypeEnum.今日提醒, "PF135");
|
||||
notices.Add(sendNotice);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (userLeaderIds != null && userLeaderIds.Any() && dt.Hour == 8)//跑批设置每小时执行,每天8点触发一次
|
||||
{
|
||||
foreach (var id in userIds)
|
||||
{
|
||||
var user = users.FirstOrDefault(t => t.ID == id);
|
||||
if (user != null)
|
||||
{
|
||||
//查出他组织下的没做的人
|
||||
var userList = users.Where(t => t.DEPARTMENT_ID == user.DEPARTMENT_ID && userIds.Contains(t.ID)).Select(m=>m.NAME).ToList();
|
||||
var userNames = string.Join(",", userList);
|
||||
var sendNotice = NotificationTaskService.InsertUserNoticeTaskModel("你组织下的成员"+ userNames + ",岗位风险辨识表已到期仍未处理,请及时提醒成员到待办处理!", user.ID, user.ORG_ID, user.ID, user.NAME, DateTime.Now, DateTime.Now.AddDays(1), (int)FMNoticeTypeEnum.今日提醒, "PF135");
|
||||
notices.Add(sendNotice);
|
||||
}
|
||||
}
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (notices != null && notices.Any())
|
||||
BantchSaveEntityNoCommit(notices);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ex.StackTrace))
|
||||
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
|
||||
else
|
||||
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,6 +152,10 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("当前组织没有安全员也没有负责人,请先到用户列表维护!");
|
||||
}
|
||||
}
|
||||
}
|
||||
var record = this.GetEntity<T_SK_CHECK_SET>(t => t.ID != entity.ID && t.PRODUCTION_UNIT_ID == entity.PRODUCTION_UNIT_ID && t.CHECK_TYPE == entity.CHECK_TYPE && t.CHECK_TYPE_ID == entity.CHECK_TYPE_ID && t.CHECK_CYCLE == entity.CHECK_CYCLE && t.DEPARTMENT_ID == entity.DEPARTMENT_ID && t.POST_ID == entity.POST_ID);
|
||||
@ -208,7 +212,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
}
|
||||
}
|
||||
//同步到企业库
|
||||
var checkUserIds = checkUsers.Select(t => t.USER_ID).Distinct().ToList();
|
||||
var checkUserIds = checkUsers?.Select(t => t.USER_ID).Distinct().ToList();
|
||||
var areaIds = details.Select(t => t.AREA_ID).Distinct().ToList();
|
||||
var riskNames = details.Select(t => t.RISK_NAME).Distinct().ToList();
|
||||
var measures = details.Select(t => t.MEASURES_NAME).Distinct().ToList();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,21 @@
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.BaseData.Domain.IServices;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.SK;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.BaseData.Domain.IServices;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.FO;
|
||||
using APT.MS.Domain.Entities.SK;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.MS.Domain.Enums.SK;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MySqlX.XDevAPI.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.SK.WebApi.Controllers.Api
|
||||
{
|
||||
@ -319,14 +321,39 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("SKGet")]
|
||||
public JsonActionResult<T_SK_HIDDEN_DANGER_CONFIRM> SKGet([FromBody] KeywordFilter filter)
|
||||
{
|
||||
filter.IgnoreDataRule = true;
|
||||
var result = WitEntity(null, filter);
|
||||
if (result != null && result.Data != null && result.Data.STATUS == PFStandardStatus.Rejected)
|
||||
{
|
||||
result.Data.CONTEXT = ApproveCallBackService.RejectContent(result.Data.ID);
|
||||
}
|
||||
return result;
|
||||
{
|
||||
return SafeExecute(() => {
|
||||
filter.IgnoreDataRule = true;
|
||||
var id = filter.FilterGroup.Rules.FirstOrDefault(t => t.Field == "ID").Value.ToString();
|
||||
if (string.IsNullOrEmpty(id))
|
||||
this.ThrowError("060010");
|
||||
var entity = this.GetEntity<T_SK_HIDDEN_DANGER_CONFIRM>(id, new string[] { "Nav_Report", "Nav_ApplyUser","Nav_ApplyDepartment",
|
||||
"Nav_ProductionUnit","Nav_RiskArea","Nav_Contents","Nav_CheckType","Nav_RecitifyUser","Nav_Question"});
|
||||
if (entity != null)
|
||||
{
|
||||
var newFilter = new BaseFilter(filter.OrgId);
|
||||
newFilter.SelectField = new List<string> { "ID", "HIDDEN_DANGER_CONFIRM_ID", "IMG_FILE_ID", "Nav_ImgFile.Nav_File", "Nav_ImgFile.FILE_NAME", "Nav_ImgFile.FILE_PATH" };
|
||||
var photos = this.GetEntities<T_SK_HIDDEN_DANGER_CONFIRM_PHOTO>(t => t.HIDDEN_DANGER_CONFIRM_ID == entity.ID, newFilter).ToList();
|
||||
entity.Nav_Photos = photos.ToList();
|
||||
newFilter.SelectField = new List<string> { "ID", "HIDDEN_DANGER_CONFIRM_ID", "IMG_FILE_ID", "Nav_ImgFile.Nav_File", "Nav_ImgFile.FILE_NAME", "Nav_ImgFile.FILE_PATH" };
|
||||
var files = this.GetEntities<T_SK_HIDDEN_DANGER_CONFIRM_FILE>(t => t.HIDDEN_DANGER_CONFIRM_ID == entity.ID, newFilter).ToList();
|
||||
entity.Nav_Files = files.ToList();
|
||||
newFilter.SelectField = new List<string> { "ID", "HIDDEN_DANGER_CONFIRM_ID", "LAW_ID", "Nav_Law.NAME" };
|
||||
var basics = this.GetEntities<T_SK_HIDDEN_DANGER_CONFIRM_BASIC>(t => t.HIDDEN_DANGER_CONFIRM_ID == entity.ID, newFilter).ToList();
|
||||
entity.Nav_Basics = basics.ToList();
|
||||
newFilter.SelectField = new List<string> { "ID", "HIDDEN_DANGER_CONFIRM_ID", "REASON_ID", "Nav_Reason.NAME" };
|
||||
var reasons = this.GetEntities<T_SK_HIDDEN_DANGER_CONFIRM_REASON>(t => t.HIDDEN_DANGER_CONFIRM_ID == entity.ID, newFilter).ToList();
|
||||
entity.Nav_Reasons = reasons.ToList();
|
||||
if (entity.STATUS == PFStandardStatus.Rejected)
|
||||
{
|
||||
entity.CONTEXT = ApproveCallBackService.RejectContent(entity.ID);
|
||||
}
|
||||
}
|
||||
|
||||
return entity;
|
||||
});
|
||||
//var result = WitEntity(null, filter);
|
||||
//return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -133,6 +133,13 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
de.MARK = item.MARK;
|
||||
de.EMERGENCY = item.EMERGENCY;
|
||||
de.ENTERPRISE_LIBRARY_ID = item.ENTERPRISE_LIBRARY_ID;
|
||||
de.SCOREL_ID = item.SCOREL_ID;
|
||||
de.SCOREE_ID = item.SCOREE_ID;
|
||||
de.SCOREC_ID = item.SCOREC_ID;
|
||||
if (item.SCOREL_ID == null || item.SCOREE_ID == null || item.SCOREC_ID == null)
|
||||
{
|
||||
throw new Exception("第" + item.NUM + "行,LEC都不能为空");
|
||||
}
|
||||
if (item.Nav_DetailMeasures != null && item.Nav_DetailMeasures.Any())
|
||||
{
|
||||
foreach (var mm in item.Nav_DetailMeasures)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user