This commit is contained in:
wyw 2026-04-08 16:04:27 +08:00
commit 2c43cc8a88
2 changed files with 37 additions and 2 deletions

View File

@ -53,6 +53,7 @@ using System.Reflection;
using System.Security.Cryptography;
using static Google.Protobuf.WireFormat;
using static IdentityModel.OidcConstants;
using static NPOI.HSSF.UserModel.HeaderFooter;
namespace APT.BaseData.Services.DomainServices
{
@ -12298,6 +12299,8 @@ namespace APT.BaseData.Services.DomainServices
var user = this.GetEntity<T_FM_USER>(t => t.ENABLE_STATUS == 0 && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全总监"));
T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE major = null;
T_FM_NOTIFICATION_TASK notice = null;
var majorUserIds = new List<Guid>();
var majorFileIds = new List<Guid>();
if (entity.HIDDEN_LEVEL == SKHiddenLevel.Major && user != null)
{
//先查下销号表是否已经触发过
@ -12306,6 +12309,19 @@ namespace APT.BaseData.Services.DomainServices
{
//直接触发原来那张销号表
major.STATUS = PFStandardStatus.Draft;
major.HIDDEN_DANGER_RECTIFY_RECORD_ID = entity.ID;
major.HIDDEN_DESCRIPTION = entity.Nav_Question?.DESCREPTION;
major.APPLY_USER_ID = user.ID;
major.APPLY_DEPARTMENT_ID = user.DEPARTMENT_ID;
major.HIDDEN_REASON = null;
major.CHARGE_USER_ID = null;
major.REVIEW_DESCRIPTION = null;
major.REVIEW_RESULT = null;
major.REPORT_DATE = null;
major.MONITOR_DEPART_ID = null;
major.MONITOR_OPINION = null;
majorUserIds = this.GetEntities<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_USER>(t => t.MAJOR_ACCIDENT_HAZARD_MANAGE_ID == major.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
majorFileIds = this.GetEntities<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_FILE>(t => t.MAJOR_ACCIDENT_HAZARD_MANAGE_ID == major.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
}
else
{
@ -12318,6 +12334,7 @@ namespace APT.BaseData.Services.DomainServices
major.APPLY_DEPARTMENT_ID = user.DEPARTMENT_ID;
major.CODE = "YHXH" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999);
major.HIDDEN_DESCRIPTION = entity.Nav_Question?.DESCREPTION;
major.NOTICE_CODE = entity.NOTICE_CODE;
}
notice = NotificationTaskService.InsertUserNoticeTaskModel("重大事故隐患治理销号表"+ DateTime.Now.ToShortDateString().Replace("/", ""), major.ID, major.ORG_ID, user.ID, user.NAME, DateTime.Now,
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum., "SK080");
@ -12334,6 +12351,10 @@ namespace APT.BaseData.Services.DomainServices
BantchSaveEntityNoCommit(listTaskNext);
if (entity != null)
this.UpdateEntityNoCommit(entity);
if (majorUserIds != null && majorUserIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_USER>(majorUserIds);
if (majorFileIds != null && majorFileIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_FILE>(majorFileIds);
if (major != null)
this.UpdateEntityNoCommit(major);
if (notice != null)

View File

@ -98,7 +98,7 @@ namespace APT.SK.WebApi.Controllers.Api
}
if (files != null && files.Any())
{
foreach (var file in files)
foreach (var file in files.Where(t => !t.IS_DELETED))
{
T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_FILE item = new T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE_FILE();
item.ORG_ID = entity.ORG_ID;
@ -110,6 +110,7 @@ namespace APT.SK.WebApi.Controllers.Api
List<T_FM_NOTIFICATION_TASK> notices = new List<T_FM_NOTIFICATION_TASK>();
T_FM_NOTIFICATION_TASK task = null;
T_SK_HIDDEN_DANGER_RECTIFY_RECORD record = null;
var recordFileIds = new List<Guid>();
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
{
//同意销号触发审批
@ -148,6 +149,13 @@ namespace APT.SK.WebApi.Controllers.Api
if (record != null)
{
record.STATUS = PFStandardStatus.Rejected;
record.ACCEPT_DATE = null;
record.ACCEPT_OPINION = null;
record.ACCEPT_USER_ID = null;
record.RECTIFICATION_DESCRIPTION = null;
record.RECTIFICATION_MONEY = null;
record.COMPLETE_DATE = null;
recordFileIds = this.GetEntities<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOB>(t => t.HIDDEN_DANGER_RECTIFY_RECORD_ID == record.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
if (record.IMPLEMENT_USER_ID != null)
{
var user = this.GetEntity<T_FM_USER>(t => t.ID == record.IMPLEMENT_USER_ID);
@ -194,6 +202,10 @@ namespace APT.SK.WebApi.Controllers.Api
BantchSaveEntityNoCommit(fileList);
if (notices != null && notices.Any())
BantchSaveEntityNoCommit(notices);
if (record != null)
UpdateEntityNoCommit(record);
if (recordFileIds != null && recordFileIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOB>(recordFileIds);
});
return true;
});
@ -212,7 +224,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (string.IsNullOrEmpty(id))
this.ThrowError("060010");
filter.IgnoreDataRule = true;
var result = this.GetEntity<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE>(id, new string[] { "Nav_ApplyUser", "Nav_ChargeUser", "Nav_ApplyDepartment","Nav_RectifyRecord","Nav_Users.Nav_User","Nav_MonitorDepart", "Nav_Files.Nav_ImgFile"});
var result = this.GetEntity<T_SK_MAJOR_ACCIDENT_HAZARD_MANAGE>(id, new string[] { "Nav_ApplyUser", "Nav_ChargeUser", "Nav_ApplyDepartment", "Nav_RectifyRecord.Nav_ProductionUnit",
"Nav_RectifyRecord.Nav_RiskArea", "Nav_RectifyRecord.Nav_RectifyPhotoas.Nav_ImgFile","Nav_RectifyRecord.Nav_RectifyPhotobs.Nav_ImgFile",
"Nav_Users.Nav_User","Nav_MonitorDepart", "Nav_Files.Nav_ImgFile"});
if (result != null && result.STATUS == PFStandardStatus.Rejected)
{
result.CONTEXT = ApproveCallBackService.RejectContent(result.ID);