优化
This commit is contained in:
parent
af762f0ebc
commit
87075f44cd
@ -241,7 +241,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
var first = oldContents.FirstOrDefault(x => x.CHECKCONTENT == dtSource.Rows[i][0].ToString().Trim());
|
||||
if (first != null)//旧表已存在数据
|
||||
{
|
||||
checkId = first.ID;
|
||||
Msg = Msg + ("第" + (i + 2) + "行,检查内容已存在,请勿重复导入");
|
||||
}
|
||||
else//不存在
|
||||
{
|
||||
@ -273,7 +273,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
methods.Add(ite);
|
||||
}
|
||||
if (items.Count != scores.Count || items.Count != methods.Count)
|
||||
throw new Exception("第" + (i + 2) + "行,隐患描述与隐患等级与整改措施不匹配");
|
||||
Msg= Msg+("第" + (i + 2) + "行,隐患描述与隐患等级与整改措施不匹配");
|
||||
else
|
||||
{
|
||||
if (items != null && items.Any())
|
||||
@ -313,7 +313,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
question.QUESTION_LEVEL = item == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General;
|
||||
}
|
||||
else
|
||||
throw new Exception("隐患对应序号的层级未填写");
|
||||
Msg= Msg+("隐患对应序号的层级未填写");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -321,7 +321,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (question != null)
|
||||
question.QUESTION_LEVEL = itemArr[1] == "重大" ? SKHiddenLevel.Major : SKHiddenLevel.General;
|
||||
else
|
||||
throw new Exception("隐患对应序号的层级未填写");
|
||||
Msg= Msg+("隐患对应序号的层级未填写");
|
||||
}
|
||||
NO++;
|
||||
}
|
||||
@ -338,7 +338,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (question != null)
|
||||
question.DEMAND = item;
|
||||
else
|
||||
throw new Exception("隐患对应序号的整改措施未填写");
|
||||
Msg= Msg+("隐患对应序号的整改措施未填写");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -346,7 +346,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (question != null)
|
||||
question.DEMAND = itemArr[1];
|
||||
else
|
||||
throw new Exception("隐患对应序号的整改措施未填写");
|
||||
Msg= Msg+("隐患对应序号的整改措施未填写");
|
||||
}
|
||||
NO++;
|
||||
}
|
||||
|
||||
@ -46,7 +46,29 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (entity.APPLY_DEPARTMENT_ID == null)
|
||||
entity.APPLY_DEPARTMENT_ID = departId;
|
||||
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;
|
||||
entity.Nav_Photos = null;
|
||||
var files = entity.Nav_Files;
|
||||
|
||||
@ -42,7 +42,29 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (entity.APPLY_DEPARTMENT_ID == null)
|
||||
entity.APPLY_DEPARTMENT_ID = departId;
|
||||
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"))
|
||||
{
|
||||
var record = this.GetEntity<T_SK_HIDDEN_DANGER_RECTIFY_RECORD>(t => t.ID == entity.HIDDEN_DANGER_RECTIFY_RECORD_ID);
|
||||
|
||||
@ -44,7 +44,29 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (entity.APPLY_USER_ID == null)
|
||||
entity.APPLY_USER_ID = userId;
|
||||
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;
|
||||
entity.Nav_RectifyDetails = null;
|
||||
var files = entity.Nav_RectifyFiles;
|
||||
|
||||
@ -57,6 +57,28 @@ namespace APT.SK.WebApi.Controllers
|
||||
if (entity.ACCEPT_RESULTE == SKAcceptResultEnum.No && string.IsNullOrEmpty(entity.ACCEPT_OPINION))
|
||||
{
|
||||
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))
|
||||
entity.CODE = "YHZG" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999);
|
||||
|
||||
@ -63,7 +63,29 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
entity.Nav_ReportFiles = null;
|
||||
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;
|
||||
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> deleteFileIds = new List<Guid>();
|
||||
List<Guid> deleteBasicIds = new List<Guid>();
|
||||
|
||||
@ -162,6 +162,28 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
throw new Exception("检查类型不能为空");
|
||||
if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue)
|
||||
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))
|
||||
{
|
||||
entity.NOTICE_CODE = "JCSD" + DateTime.Now.ToString("yyyyMMddHH") + new Random().Next(1, 9999);
|
||||
|
||||
@ -460,6 +460,28 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
throw new Exception("检查类型不能为空");
|
||||
if (entity.CHECK_TIME == null || entity.CHECK_TIME == DateTime.MinValue)
|
||||
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.ApplyPostName = this.GetEntity<T_FM_USER>(t => t.ID == userId, "Nav_Person.Nav_Post")?.Nav_Person?.Nav_Post?.NAME;
|
||||
var details = entity.Nav_CheckRecordDetails;
|
||||
|
||||
@ -52,7 +52,29 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
if (entity.CHECK_TYPE_ID == null)
|
||||
throw new Exception("检查类型不能为空");
|
||||
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;
|
||||
entity.Nav_CheckRecordDetails = null;
|
||||
var files = entity.Nav_CheckRecordFiles;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user