This commit is contained in:
wyw 2026-03-26 14:08:44 +08:00
commit 1747f162ca
9 changed files with 187 additions and 11 deletions

View File

@ -241,7 +241,7 @@ namespace APT.SK.WebApi.Controllers.Api
var first = oldContents.FirstOrDefault(x => x.CHECKCONTENT == dtSource.Rows[i][0].ToString().Trim()); var first = oldContents.FirstOrDefault(x => x.CHECKCONTENT == dtSource.Rows[i][0].ToString().Trim());
if (first != null)//旧表已存在数据 if (first != null)//旧表已存在数据
{ {
checkId = first.ID; Msg = Msg + ("第" + (i + 2) + "行,检查内容已存在,请勿重复导入");
} }
else//不存在 else//不存在
{ {
@ -273,7 +273,7 @@ namespace APT.SK.WebApi.Controllers.Api
methods.Add(ite); methods.Add(ite);
} }
if (items.Count != scores.Count || items.Count != methods.Count) if (items.Count != scores.Count || items.Count != methods.Count)
throw new Exception("第" + (i + 2) + "行,隐患描述与隐患等级与整改措施不匹配"); Msg= Msg+("第" + (i + 2) + "行,隐患描述与隐患等级与整改措施不匹配");
else else
{ {
if (items != null && items.Any()) if (items != null && items.Any())
@ -313,7 +313,7 @@ namespace APT.SK.WebApi.Controllers.Api
question.QUESTION_LEVEL = item == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General; question.QUESTION_LEVEL = item == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General;
} }
else else
throw new Exception("隐患对应序号的层级未填写"); Msg= Msg+("隐患对应序号的层级未填写");
} }
else else
{ {
@ -321,7 +321,7 @@ namespace APT.SK.WebApi.Controllers.Api
if (question != null) if (question != null)
question.QUESTION_LEVEL = itemArr[1] == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General; question.QUESTION_LEVEL = itemArr[1] == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General;
else else
throw new Exception("隐患对应序号的层级未填写"); Msg= Msg+("隐患对应序号的层级未填写");
} }
NO++; NO++;
} }
@ -338,7 +338,7 @@ namespace APT.SK.WebApi.Controllers.Api
if (question != null) if (question != null)
question.DEMAND = item; question.DEMAND = item;
else else
throw new Exception("隐患对应序号的整改措施未填写"); Msg= Msg+("隐患对应序号的整改措施未填写");
} }
else else
{ {
@ -346,7 +346,7 @@ namespace APT.SK.WebApi.Controllers.Api
if (question != null) if (question != null)
question.DEMAND = itemArr[1]; question.DEMAND = itemArr[1];
else else
throw new Exception("隐患对应序号的整改措施未填写"); Msg= Msg+("隐患对应序号的整改措施未填写");
} }
NO++; NO++;
} }

View File

@ -47,6 +47,28 @@ namespace APT.SK.WebApi.Controllers.Api
entity.APPLY_DEPARTMENT_ID = departId; entity.APPLY_DEPARTMENT_ID = departId;
if (entity.RECITIFY_USER_ID == null) if (entity.RECITIFY_USER_ID == null)
throw new Exception("整改责任人必须填写"); throw new Exception("整改责任人必须填写");
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK018");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK018_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK018_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
var photos = entity.Nav_Photos; var photos = entity.Nav_Photos;
entity.Nav_Photos = null; entity.Nav_Photos = null;
var files = entity.Nav_Files; var files = entity.Nav_Files;

View File

@ -43,6 +43,28 @@ namespace APT.SK.WebApi.Controllers.Api
entity.APPLY_DEPARTMENT_ID = departId; entity.APPLY_DEPARTMENT_ID = departId;
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;
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK024");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK024_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK024_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify")) if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
{ {
var record = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(t => t.ID == entity.HIDDEN_DANGER_RECTIFY_RECORD_ID); var record = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(t => t.ID == entity.HIDDEN_DANGER_RECTIFY_RECORD_ID);

View File

@ -45,6 +45,28 @@ namespace APT.SK.WebApi.Controllers.Api
entity.APPLY_USER_ID = userId; entity.APPLY_USER_ID = userId;
if (entity.APPLY_DEPARTMENT_ID == null) if (entity.APPLY_DEPARTMENT_ID == null)
entity.APPLY_DEPARTMENT_ID = departId; entity.APPLY_DEPARTMENT_ID = departId;
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK020");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK020_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK020_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
var details = entity.Nav_RectifyDetails; var details = entity.Nav_RectifyDetails;
entity.Nav_RectifyDetails = null; entity.Nav_RectifyDetails = null;
var files = entity.Nav_RectifyFiles; var files = entity.Nav_RectifyFiles;

View File

@ -58,6 +58,28 @@ namespace APT.SK.WebApi.Controllers
{ {
throw new Exception("不合格验收意见必须填写"); throw new Exception("不合格验收意见必须填写");
} }
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK022");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK022_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK022_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
if (string.IsNullOrEmpty(entity.CODE)) if (string.IsNullOrEmpty(entity.CODE))
entity.CODE = "YHZG" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999); entity.CODE = "YHZG" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999);
var record = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(entity.ID); var record = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(entity.ID);

View File

@ -64,6 +64,28 @@ 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;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID; var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK014");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK014_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK014_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
List<Guid> userIds = new List<Guid>(); List<Guid> userIds = 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>();

View File

@ -162,6 +162,28 @@ namespace APT.SK.WebApi.Controllers.Api
throw new Exception("检查类型不能为空"); throw new Exception("检查类型不能为空");
if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue) if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue)
throw new Exception("检查时间必须填写"); throw new Exception("检查时间必须填写");
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK006");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK006_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK006_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
if (string.IsNullOrEmpty(entity.NOTICE_CODE)) if (string.IsNullOrEmpty(entity.NOTICE_CODE))
{ {
entity.NOTICE_CODE = "JCSD" + DateTime.Now.ToString("yyyyMMddHH") + new Random().Next(1, 9999); entity.NOTICE_CODE = "JCSD" + DateTime.Now.ToString("yyyyMMddHH") + new Random().Next(1, 9999);

View File

@ -460,6 +460,28 @@ namespace APT.SK.WebApi.Controllers.Api
throw new Exception("检查类型不能为空"); throw new Exception("检查类型不能为空");
if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue) if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue)
throw new Exception("检查时间必须填写"); throw new Exception("检查时间必须填写");
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK010");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK010_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK010_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
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;
var details = entity.Nav_CheckRecordDetails; var details = entity.Nav_CheckRecordDetails;

View File

@ -53,6 +53,28 @@ namespace APT.SK.WebApi.Controllers.Api
throw new Exception("检查类型不能为空"); throw new Exception("检查类型不能为空");
if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue) if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue)
throw new Exception("检查时间必须填写"); throw new Exception("检查时间必须填写");
T_FM_NOTIFICATION_TASK finishNotice = null;
if (entity.STATUS != PFStandardStatus.Draft)
{
var taskId = entity.TaskID;
if (taskId == Guid.Empty)
{
var taskTemp = GetEntity<T_FM_NOTIFICATION_TASK>(i => i.SOURCE_DATA_ID == entity.ID && i.USER_ID == userId
&& i.NOTICE_STATUS == FMNoticeStatusEnum..GetInt() && i.SOURCE_FORMCODE == "SK012");
if (taskTemp != null)
{
taskTemp.NOTICE_STATUS = 1;
taskTemp.SOURCE_FORMCODE = "SK012_SHOWPRINT";
finishNotice = taskTemp;
}
}
if (taskId != Guid.Empty)
{
finishNotice = NotificationTaskService.FOGetTaskFinishModel(taskId, entity.ID, "SK012_SHOWPRINT");
}
UpdateEntity(finishNotice);
throw new Exception("你已提交,请勿重复提交!");
}
var details = entity.Nav_CheckRecordDetails; var details = entity.Nav_CheckRecordDetails;
entity.Nav_CheckRecordDetails = null; entity.Nav_CheckRecordDetails = null;
var files = entity.Nav_CheckRecordFiles; var files = entity.Nav_CheckRecordFiles;