This commit is contained in:
何美荣 2025-10-26 01:54:19 +08:00
parent 634a3d0e8b
commit 1ce70315b0
4 changed files with 144 additions and 21 deletions

View File

@ -53,6 +53,8 @@ namespace APT.SK.WebApi.Controllers.Api
entity.Nav_Files = null; entity.Nav_Files = null;
var basics = entity.Nav_Basics; var basics = entity.Nav_Basics;
entity.Nav_Basics = null; entity.Nav_Basics = null;
var reasons = entity.Nav_Reasons;
entity.Nav_Reasons = null;
entity.ApplyDepartmentName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == departId).NAME; entity.ApplyDepartmentName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == departId).NAME;
entity.ApplyPostName = this.GetEntity<T_FM_USER>(t => t.ID == userId, "Nav_Person.Nav_Post")?.Nav_Person?.Nav_Post?.NAME; entity.ApplyPostName = this.GetEntity<T_FM_USER>(t => t.ID == userId, "Nav_Person.Nav_Post")?.Nav_Person?.Nav_Post?.NAME;
if (string.IsNullOrEmpty(entity.HIDDEN_DESCRIPTION)) if (string.IsNullOrEmpty(entity.HIDDEN_DESCRIPTION))
@ -85,6 +87,15 @@ namespace APT.SK.WebApi.Controllers.Api
item.HIDDEN_DANGER_CONFIRM_ID = entity.ID; item.HIDDEN_DANGER_CONFIRM_ID = entity.ID;
item.Nav_Law = null; item.Nav_Law = null;
} }
}
if (reasons != null && reasons.Any())
{
foreach (var item in reasons)
{
item.ORG_ID = entity.ORG_ID;
item.HIDDEN_DANGER_CONFIRM_ID = entity.ID;
item.Nav_Reason = null;
}
} }
if (entity.RECITIFY_TIME.HasValue && entity.RECITIFY_TIME.Value.Date < DateTime.Now.Date) if (entity.RECITIFY_TIME.HasValue && entity.RECITIFY_TIME.Value.Date < DateTime.Now.Date)
{ {
@ -137,7 +148,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (files != null && files.Any()) if (files != null && files.Any())
BantchSaveEntityNoCommit(files); BantchSaveEntityNoCommit(files);
if (basics != null && basics.Any()) if (basics != null && basics.Any())
BantchSaveEntityNoCommit(basics); BantchSaveEntityNoCommit(basics);
if (reasons != null && reasons.Any())
BantchSaveEntityNoCommit(reasons);
}, null, null, null, null, null, "SK018_SHOWPRINT", null, level + "隐患确认单审批"); }, null, null, null, null, null, "SK018_SHOWPRINT", null, level + "隐患确认单审批");
return true; return true;
} }
@ -150,7 +163,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (files != null && files.Any()) if (files != null && files.Any())
BantchSaveEntityNoCommit(files); BantchSaveEntityNoCommit(files);
if (basics != null && basics.Any()) if (basics != null && basics.Any())
BantchSaveEntityNoCommit(basics); BantchSaveEntityNoCommit(basics);
if (reasons != null && reasons.Any())
BantchSaveEntityNoCommit(reasons);
}); });
return true; return true;
}); });

View File

@ -52,10 +52,12 @@ namespace APT.SK.WebApi.Controllers.Api
entity.ApplyDepartmentName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == departId).NAME; entity.ApplyDepartmentName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == departId).NAME;
entity.ApplyPostName = this.GetEntity<T_FM_USER>(t => t.ID == userId, "Nav_Person.Nav_Post")?.Nav_Person?.Nav_Post?.NAME; entity.ApplyPostName = this.GetEntity<T_FM_USER>(t => t.ID == userId, "Nav_Person.Nav_Post")?.Nav_Person?.Nav_Post?.NAME;
List<Guid> deleteFileIds = new List<Guid>(); List<Guid> deleteFileIds = new List<Guid>();
List<Guid> deleteBasicIds = new List<Guid>(); List<Guid> deleteBasicIds = new List<Guid>();
List<Guid> deleteReasonIds = new List<Guid>();
List<Guid> deleteDetailIds = new List<Guid>(); List<Guid> deleteDetailIds = new List<Guid>();
List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_FILE> fileList = new List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_FILE>(); List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_FILE> fileList = new List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_FILE>();
List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC> basicList = new List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC>(); List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC> basicList = new List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC>();
List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON> reasonList = new List<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON>();
if (details != null && details.Any()) if (details != null && details.Any())
{ {
var evaluationIsExist = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE>(t => t.ID == entity.ID, new string[] { "Nav_RectifyDetails", "Nav_RectifyDetails.Nav_RectifyDetailFiles", "Nav_RectifyDetails.Nav_RectifyDetailBasics" }); var evaluationIsExist = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE>(t => t.ID == entity.ID, new string[] { "Nav_RectifyDetails", "Nav_RectifyDetails.Nav_RectifyDetailFiles", "Nav_RectifyDetails.Nav_RectifyDetailBasics" });
@ -72,6 +74,11 @@ namespace APT.SK.WebApi.Controllers.Api
{ {
var tempIds = t.Nav_RectifyDetailBasics.Select(m => m.ID).ToList(); var tempIds = t.Nav_RectifyDetailBasics.Select(m => m.ID).ToList();
deleteBasicIds.AddRange(tempIds); deleteBasicIds.AddRange(tempIds);
}
if (t.Nav_RectifyDetailReasons != null && t.Nav_RectifyDetailReasons.Any())
{
var tempIds = t.Nav_RectifyDetailReasons.Select(m => m.ID).ToList();
deleteReasonIds.AddRange(tempIds);
} }
deleteDetailIds.Add(t.ID); deleteDetailIds.Add(t.ID);
}); });
@ -113,9 +120,25 @@ namespace APT.SK.WebApi.Controllers.Api
basicList.Add(basic); basicList.Add(basic);
} }
} }
}
if (item.Nav_RectifyDetailReasons != null && item.Nav_RectifyDetailReasons.Any())
{
foreach (var item2 in item.Nav_RectifyDetailReasons)
{
if (!item2.IS_DELETED)
{
T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON basic = new T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON();
basic.ORG_ID = entity.ORG_ID;
basic.HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_ID = item.ID;
basic.REASON_ID = item2.REASON_ID;
basic.Nav_Reason = null;
reasonList.Add(basic);
}
}
} }
item.Nav_RectifyDetailBasics = null; item.Nav_RectifyDetailBasics = null;
item.Nav_RectifyDetailFiles = null; item.Nav_RectifyDetailFiles = null;
item.Nav_RectifyDetailReasons = null;
item.Nav_Contents = null; item.Nav_Contents = null;
item.Nav_RecitifyUser = null; item.Nav_RecitifyUser = null;
item.Nav_AcceptUser = null; item.Nav_AcceptUser = null;
@ -160,6 +183,8 @@ namespace APT.SK.WebApi.Controllers.Api
} }
this.UnifiedCommit(() => this.UnifiedCommit(() =>
{ {
if (deleteReasonIds != null && deleteReasonIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON>(deleteReasonIds);
if (deleteBasicIds != null && deleteBasicIds.Any()) if (deleteBasicIds != null && deleteBasicIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC>(deleteBasicIds); this.BantchDeleteEntityNoCommit<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_BASIC>(deleteBasicIds);
if (deleteFileIds != null && deleteFileIds.Any()) if (deleteFileIds != null && deleteFileIds.Any())
@ -179,7 +204,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (fileList != null && fileList.Any()) if (fileList != null && fileList.Any())
BantchSaveEntityNoCommit(fileList); BantchSaveEntityNoCommit(fileList);
if (basicList != null && basicList.Any()) if (basicList != null && basicList.Any())
BantchSaveEntityNoCommit(basicList); BantchSaveEntityNoCommit(basicList);
if (reasonList != null && reasonList.Any())
BantchSaveEntityNoCommit(reasonList);
}); });
return true; return true;
}); });
@ -524,7 +551,7 @@ namespace APT.SK.WebApi.Controllers.Api
userId = currTask.USER_ID; userId = currTask.USER_ID;
} }
} }
var details = this.GetEntities<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL>(t => t.HIDDEN_DANGER_RECTIFY_NOTICE_ID == notice.ID && t.ACCEPT_USER_ID == userId, new BaseFilter(notice.ORG_ID), "Nav_RectifyDetailFiles").ToList(); var details = this.GetEntities<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL>(t => t.HIDDEN_DANGER_RECTIFY_NOTICE_ID == notice.ID && t.ACCEPT_USER_ID == userId, new BaseFilter(notice.ORG_ID), "Nav_RectifyDetailFiles", "Nav_RectifyDetailReasons").ToList();
details.ForEach(t => details.ForEach(t =>
{ {
t.ISCHECK = true; t.ISCHECK = true;
@ -532,7 +559,8 @@ namespace APT.SK.WebApi.Controllers.Api
}); });
List<T_FM_NOTIFICATION_TASK> sendNotices = new List<T_FM_NOTIFICATION_TASK>(); List<T_FM_NOTIFICATION_TASK> sendNotices = new List<T_FM_NOTIFICATION_TASK>();
List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD> records = new List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(); List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD> records = new List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>();
List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOA> photoList = new List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOA>(); List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOA> photoList = new List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_PHOTOA>();
List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON> reasonList = new List<T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON>();
var todoCount = this.GetCount<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL>(t => notice.ID == t.HIDDEN_DANGER_RECTIFY_NOTICE_ID && t.ACCEPT_USER_ID != userId && t.ISCHECK == false, new BaseFilter(notice.ORG_ID)); var todoCount = this.GetCount<T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL>(t => notice.ID == t.HIDDEN_DANGER_RECTIFY_NOTICE_ID && t.ACCEPT_USER_ID != userId && t.ISCHECK == false, new BaseFilter(notice.ORG_ID));
if (todoCount == 0) if (todoCount == 0)
{ {
@ -585,6 +613,17 @@ namespace APT.SK.WebApi.Controllers.Api
file.HIDDEN_DANGER_RECTIFY_RECORD_ID = record.ID; file.HIDDEN_DANGER_RECTIFY_RECORD_ID = record.ID;
photoList.Add(file); photoList.Add(file);
} }
}
if (detail.Nav_RectifyDetailReasons != null && detail.Nav_RectifyDetailReasons.Any())
{
foreach (var item in detail.Nav_RectifyDetailReasons)
{
T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON file = new T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON();
file.ORG_ID = item.ORG_ID;
file.REASON_ID = item.REASON_ID;
file.HIDDEN_DANGER_RECTIFY_RECORD_ID = record.ID;
reasonList.Add(file);
}
} }
var endtime = DateTime.Now.AddDays(3); var endtime = DateTime.Now.AddDays(3);
if (record.RECITIFY_TIME != null && record.RECITIFY_TIME != DateTime.MinValue) if (record.RECITIFY_TIME != null && record.RECITIFY_TIME != DateTime.MinValue)
@ -614,7 +653,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (records != null && records.Any()) if (records != null && records.Any())
this.BantchSaveEntityNoCommit(records); this.BantchSaveEntityNoCommit(records);
if (photoList != null && photoList.Any()) if (photoList != null && photoList.Any())
this.BantchSaveEntityNoCommit(photoList); this.BantchSaveEntityNoCommit(photoList);
if (reasonList != null && reasonList.Any())
this.BantchSaveEntityNoCommit(reasonList);
if (sendNotices != null && sendNotices.Any()) if (sendNotices != null && sendNotices.Any())
this.BantchSaveEntityNoCommit(sendNotices); this.BantchSaveEntityNoCommit(sendNotices);
}); });

View File

@ -81,7 +81,9 @@ namespace APT.SK.WebApi.Controllers
var files = entity.Nav_RectifyFiles; var files = entity.Nav_RectifyFiles;
entity.Nav_RectifyFiles = null; entity.Nav_RectifyFiles = null;
var basics = entity.Nav_RectifyBasics; var basics = entity.Nav_RectifyBasics;
entity.Nav_RectifyBasics = null; entity.Nav_RectifyBasics = null;
var reasons = entity.Nav_RectifyReasons;
entity.Nav_RectifyReasons = null;
if (photoas != null && photoas.Any()) if (photoas != null && photoas.Any())
{ {
foreach (var item in photoas) foreach (var item in photoas)
@ -117,6 +119,15 @@ namespace APT.SK.WebApi.Controllers
item.HIDDEN_DANGER_RECTIFY_RECORD_ID = entity.ID; item.HIDDEN_DANGER_RECTIFY_RECORD_ID = entity.ID;
item.Nav_Law = null; item.Nav_Law = null;
} }
}
if (reasons != null && reasons.Any())
{
foreach (var item in reasons)
{
item.ORG_ID = entity.ORG_ID;
item.HIDDEN_DANGER_RECTIFY_RECORD_ID = entity.ID;
item.Nav_Reason = null;
}
} }
T_FM_NOTIFICATION_TASK notice = null; T_FM_NOTIFICATION_TASK notice = null;
T_FM_NOTIFICATION_TASK task = null; T_FM_NOTIFICATION_TASK task = null;
@ -202,7 +213,9 @@ namespace APT.SK.WebApi.Controllers
if (files != null && files.Any()) if (files != null && files.Any())
BantchSaveEntityNoCommit(files); BantchSaveEntityNoCommit(files);
if (basics != null && basics.Any()) if (basics != null && basics.Any())
BantchSaveEntityNoCommit(basics); BantchSaveEntityNoCommit(basics);
if (reasons != null && reasons.Any())
BantchSaveEntityNoCommit(reasons);
if (notice != null) if (notice != null)
UpdateEntityNoCommit(notice); UpdateEntityNoCommit(notice);
}, null, null, null, null, null, "SK022_SHOWPRINT", null); }, null, null, null, null, null, "SK022_SHOWPRINT", null);
@ -229,7 +242,9 @@ namespace APT.SK.WebApi.Controllers
if (files != null && files.Any()) if (files != null && files.Any())
BantchSaveEntityNoCommit(files); BantchSaveEntityNoCommit(files);
if (basics != null && basics.Any()) if (basics != null && basics.Any())
BantchSaveEntityNoCommit(basics); BantchSaveEntityNoCommit(basics);
if (reasons != null && reasons.Any())
BantchSaveEntityNoCommit(reasons);
if (notice != null) if (notice != null)
UpdateEntityNoCommit(notice); UpdateEntityNoCommit(notice);
}); });

View File

@ -54,10 +54,12 @@ namespace APT.SK.WebApi.Controllers.Api
List<Guid> userIds = new List<Guid>(); List<Guid> userIds = new List<Guid>();
List<Guid> deleteUserIds = new List<Guid>(); List<Guid> deleteUserIds = new List<Guid>();
List<Guid> deleteFileIds = new List<Guid>(); List<Guid> deleteFileIds = new List<Guid>();
List<Guid> deleteBasicIds = new List<Guid>(); List<Guid> deleteBasicIds = new List<Guid>();
List<Guid> deleteReasonIds = new List<Guid>();
List<Guid> deleteDetailIds = new List<Guid>(); List<Guid> deleteDetailIds = new List<Guid>();
List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER> userList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER>(); List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER> userList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER>();
List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC> basicList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC>(); List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC> basicList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC>();
List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON> reasonList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON>();
List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_FILE> fileList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_FILE>(); List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_FILE> fileList = new List<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_FILE>();
if (details != null && details.Any()) if (details != null && details.Any())
{ {
@ -89,6 +91,11 @@ namespace APT.SK.WebApi.Controllers.Api
{ {
var tempIds = t.Nav_CheckRecordDetailBasics.Select(m => m.ID).ToList(); var tempIds = t.Nav_CheckRecordDetailBasics.Select(m => m.ID).ToList();
deleteBasicIds.AddRange(tempIds); deleteBasicIds.AddRange(tempIds);
}
if (t.Nav_CheckRecordDetailReasons != null && t.Nav_CheckRecordDetailReasons.Any())
{
var tempIds = t.Nav_CheckRecordDetailReasons.Select(m => m.ID).ToList();
deleteReasonIds.AddRange(tempIds);
} }
deleteDetailIds.Add(t.ID); deleteDetailIds.Add(t.ID);
}); });
@ -146,6 +153,16 @@ namespace APT.SK.WebApi.Controllers.Api
item2.Nav_Law = null; item2.Nav_Law = null;
basicList.Add(item2); basicList.Add(item2);
} }
}
if (item.Nav_CheckRecordDetailReasons != null && item.Nav_CheckRecordDetailReasons.Any())
{
foreach (var item2 in item.Nav_CheckRecordDetailReasons)
{
item2.ORG_ID = entity.ORG_ID;
item2.SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_ID = item.ID;
item2.Nav_Reason = null;
reasonList.Add(item2);
}
} }
item.ORG_ID = entity.ORG_ID; item.ORG_ID = entity.ORG_ID;
item.SECURITY_INSPECTION_RECORD_SUMMARY_ID = entity.ID; item.SECURITY_INSPECTION_RECORD_SUMMARY_ID = entity.ID;
@ -172,7 +189,8 @@ namespace APT.SK.WebApi.Controllers.Api
List<T_SK_HIDDEN_DANGER_REPORT_FILE> reportFiles = new List<T_SK_HIDDEN_DANGER_REPORT_FILE>(); List<T_SK_HIDDEN_DANGER_REPORT_FILE> reportFiles = new List<T_SK_HIDDEN_DANGER_REPORT_FILE>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL> reportDetails = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL> reportDetails = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE> reportDetailFiles = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE> reportDetailFiles = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC> reportDetailBasics = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC> reportDetailBasics = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON> reportDetailReasons = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON>();
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify")) if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
{ {
userIds = userIds.Distinct().ToList(); userIds = userIds.Distinct().ToList();
@ -266,6 +284,18 @@ namespace APT.SK.WebApi.Controllers.Api
reportDetailBasics.Add(file); reportDetailBasics.Add(file);
} }
} }
if (item.Nav_CheckRecordDetailReasons != null && item.Nav_CheckRecordDetailReasons.Any())
{
foreach (var item2 in item.Nav_CheckRecordDetailReasons)
{
T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON file = new T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON();
file.ORG_ID = item2.ORG_ID;
file.HIDDEN_DANGER_REPORT_DETAIL_ID = detail.ID;
file.REASON_ID = item2.REASON_ID;
file.Nav_Reason = null;
reportDetailReasons.Add(file);
}
}
} }
var departName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == entity.APPLY_DEPARTMENT_ID && t.ENABLE_STATUS == 0)?.NAME; var departName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == entity.APPLY_DEPARTMENT_ID && t.ENABLE_STATUS == 0)?.NAME;
//发消息 //发消息
@ -285,6 +315,7 @@ namespace APT.SK.WebApi.Controllers.Api
t.Nav_CheckRecordDetailFiles = null; t.Nav_CheckRecordDetailFiles = null;
t.Nav_CheckRecordDetailBasics = null; t.Nav_CheckRecordDetailBasics = null;
t.Nav_CheckRecordDetailUsers = null; t.Nav_CheckRecordDetailUsers = null;
t.Nav_CheckRecordDetailReasons = null;
}); });
this.UnifiedCommit(() => this.UnifiedCommit(() =>
{ {
@ -293,7 +324,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (entity != null) if (entity != null)
UpdateEntityNoCommit(entity); UpdateEntityNoCommit(entity);
if (deleteUserIds != null && deleteUserIds.Any()) if (deleteUserIds != null && deleteUserIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER>(deleteUserIds); this.BantchDeleteEntityNoCommit<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_USER>(deleteUserIds);
if (deleteReasonIds != null && deleteReasonIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON>(deleteReasonIds);
if (deleteBasicIds != null && deleteBasicIds.Any()) if (deleteBasicIds != null && deleteBasicIds.Any())
this.BantchDeleteEntityNoCommit<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC>(deleteBasicIds); this.BantchDeleteEntityNoCommit<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_BASIC>(deleteBasicIds);
if (deleteFileIds != null && deleteFileIds.Any()) if (deleteFileIds != null && deleteFileIds.Any())
@ -307,7 +340,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (userList != null && userList.Any()) if (userList != null && userList.Any())
BantchSaveEntityNoCommit(userList); BantchSaveEntityNoCommit(userList);
if (basicList != null && basicList.Any()) if (basicList != null && basicList.Any())
BantchSaveEntityNoCommit(basicList); BantchSaveEntityNoCommit(basicList);
if (reasonList != null && reasonList.Any())
BantchSaveEntityNoCommit(reasonList);
if (fileList != null && fileList.Any()) if (fileList != null && fileList.Any())
BantchSaveEntityNoCommit(fileList); BantchSaveEntityNoCommit(fileList);
if (files != null && files.Any()) if (files != null && files.Any())
@ -319,7 +354,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (reportDetailFiles != null && reportDetailFiles.Any()) if (reportDetailFiles != null && reportDetailFiles.Any())
this.BantchSaveEntityNoCommit(reportDetailFiles); this.BantchSaveEntityNoCommit(reportDetailFiles);
if (reportDetailBasics != null && reportDetailBasics.Any()) if (reportDetailBasics != null && reportDetailBasics.Any())
this.BantchSaveEntityNoCommit(reportDetailBasics); this.BantchSaveEntityNoCommit(reportDetailBasics);
if (reportDetailReasons != null && reportDetailReasons.Any())
this.BantchSaveEntityNoCommit(reportDetailReasons);
if (notices != null && notices.Any()) if (notices != null && notices.Any())
BantchSaveEntityNoCommit(notices); BantchSaveEntityNoCommit(notices);
}); });
@ -342,8 +379,9 @@ namespace APT.SK.WebApi.Controllers.Api
List<T_SK_HIDDEN_DANGER_REPORT_FILE> reportFiles = new List<T_SK_HIDDEN_DANGER_REPORT_FILE>(); List<T_SK_HIDDEN_DANGER_REPORT_FILE> reportFiles = new List<T_SK_HIDDEN_DANGER_REPORT_FILE>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL> reportDetails = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL> reportDetails = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE> reportDetailFiles = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE> reportDetailFiles = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_FILE>();
List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC> reportDetailBasics = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC>(); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC> reportDetailBasics = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_BASIC>();
var record = this.GetEntity<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY>(entity.ID, "Nav_CheckRecordFiles", "Nav_ApplyUser", "Nav_CheckRecordDetails", "Nav_CheckRecordDetails.Nav_CheckRecordDetailUsers.Nav_User", "Nav_CheckRecordDetails.Nav_CheckRecordDetailFiles", "Nav_CheckRecordDetails.Nav_CheckRecordDetailBasics"); List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON> reportDetailReasons = new List<T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON>();
var record = this.GetEntity<T_SK_SECURITY_INSPECTION_RECORD_SUMMARY>(entity.ID, "Nav_CheckRecordFiles", "Nav_ApplyUser", "Nav_CheckRecordDetails", "Nav_CheckRecordDetails.Nav_CheckRecordDetailUsers.Nav_User", "Nav_CheckRecordDetails.Nav_CheckRecordDetailFiles", "Nav_CheckRecordDetails.Nav_CheckRecordDetailBasics", "Nav_CheckRecordDetails.Nav_CheckRecordDetailReasons");
var userId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID; var userId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
if (entity.TaskID != Guid.Empty) if (entity.TaskID != Guid.Empty)
{ {
@ -437,6 +475,18 @@ namespace APT.SK.WebApi.Controllers.Api
file.Nav_Law = null; file.Nav_Law = null;
reportDetailBasics.Add(file); reportDetailBasics.Add(file);
} }
}
if (item.Nav_CheckRecordDetailReasons != null && item.Nav_CheckRecordDetailReasons.Any())
{
foreach (var item2 in item.Nav_CheckRecordDetailReasons)
{
T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON file = new T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON();
file.ORG_ID = item2.ORG_ID;
file.HIDDEN_DANGER_REPORT_DETAIL_ID = detail.ID;
file.REASON_ID = item2.REASON_ID;
file.Nav_Reason = null;
reportDetailReasons.Add(file);
}
} }
} }
var departName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == record.APPLY_DEPARTMENT_ID && t.ENABLE_STATUS == 0)?.NAME; var departName = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == record.APPLY_DEPARTMENT_ID && t.ENABLE_STATUS == 0)?.NAME;
@ -469,7 +519,9 @@ namespace APT.SK.WebApi.Controllers.Api
if (reportDetailFiles != null && reportDetailFiles.Any()) if (reportDetailFiles != null && reportDetailFiles.Any())
this.BantchSaveEntityNoCommit(reportDetailFiles); this.BantchSaveEntityNoCommit(reportDetailFiles);
if (reportDetailBasics != null && reportDetailBasics.Any()) if (reportDetailBasics != null && reportDetailBasics.Any())
this.BantchSaveEntityNoCommit(reportDetailBasics); this.BantchSaveEntityNoCommit(reportDetailBasics);
if (reportDetailReasons != null && reportDetailReasons.Any())
this.BantchSaveEntityNoCommit(reportDetailReasons);
if (notices != null && notices.Any()) if (notices != null && notices.Any())
this.BantchSaveEntityNoCommit(notices); this.BantchSaveEntityNoCommit(notices);
}); });