Merge branch 'main' of http://47.122.43.22:3000/wjn/mh_sms
This commit is contained in:
commit
9c87290c43
@ -44,7 +44,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
throw new Exception("对应岗位人员已填写,请刷新确认!");
|
||||
}
|
||||
var userID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
var afterUsers = entity.Nav_AfterUsers;
|
||||
var afterUsers = entity.Nav_AfterUsers.Where(t=>t.IS_DELETED==false);
|
||||
if (afterUsers.Count() == 0)
|
||||
{
|
||||
throw new Exception("请选择接班人员!");
|
||||
|
||||
@ -147,7 +147,12 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
{
|
||||
entity.PRE_MEETING_STATUS = FOPreMeetingStatusEnum.归档;
|
||||
}
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(title, entity.ID, entity.ORG_ID, userIds, userNames, DateTime.Now, entity.START_TIME.AddHours(1), (int)FMNoticeTypeEnum.消息, "FO003_SHOWPRINT");
|
||||
var endTime = DateTime.Now.AddHours(1);
|
||||
if (entity.START_TIME != DateTime.MinValue)
|
||||
{
|
||||
endTime = entity.START_TIME.AddHours(1);
|
||||
}
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(title, entity.ID, entity.ORG_ID, userIds, userNames, DateTime.Now, endTime, (int)FMNoticeTypeEnum.消息, "FO003_SHOWPRINT");
|
||||
var taskId = entity.TaskID;
|
||||
if (taskId == Guid.Empty)
|
||||
{
|
||||
|
||||
@ -92,10 +92,10 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
|
||||
if (entity != null && entity.OpType == 0)
|
||||
{
|
||||
if (files==null||files.Count()==0)
|
||||
{
|
||||
throw new Exception("请上传附件!");
|
||||
}
|
||||
if (files == null || files.Count() == 0)
|
||||
{
|
||||
throw new Exception("请上传附件!");
|
||||
}
|
||||
//通知参会人员签到
|
||||
var userID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
var baseFilter = new BaseFilter(entity.ORG_ID);
|
||||
@ -154,7 +154,25 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新--已阅
|
||||
/// </summary>
|
||||
[HttpPost, Route("TeamActivityUserRead")]
|
||||
public JsonActionResult<bool> TeamActivityUserRead([FromBody] T_FO_TEAM_ACTIVITY entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
if (entity.TaskID == Guid.Empty)
|
||||
{
|
||||
throw new Exception("没有待办任务ID,请刷新重试!");
|
||||
}
|
||||
NotificationTaskService.NotificationTaskFinish(entity.TaskID, () =>
|
||||
{
|
||||
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新--保存签到
|
||||
/// </summary>
|
||||
@ -204,25 +222,6 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新--已阅
|
||||
/// </summary>
|
||||
[HttpPost, Route("TeamActivityUserRead")]
|
||||
public JsonActionResult<bool> TeamActivityUserRead([FromBody] T_FO_TEAM_ACTIVITY entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
if (entity.TaskID == Guid.Empty)
|
||||
{
|
||||
throw new Exception("没有待办任务ID,请刷新重试!");
|
||||
}
|
||||
NotificationTaskService.NotificationTaskFinish(entity.TaskID, () =>
|
||||
{
|
||||
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
|
||||
@ -76,7 +76,7 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
detail.Nav_Identifyings = null;
|
||||
}
|
||||
});
|
||||
if (entity.LIABLE_USER_ID == Guid.Empty||entity.LIABLE_USER_ID==null)
|
||||
if (entity.LIABLE_USER_ID == Guid.Empty || entity.LIABLE_USER_ID == null)
|
||||
{
|
||||
entity.LIABLE_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
}
|
||||
@ -97,18 +97,27 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
entity.APPROVECODE = null;
|
||||
//是否需要发审批流,false不发,true的时候默认只发当前审核人
|
||||
var isSendApprove = false;
|
||||
var isFinish = Guid.Empty;
|
||||
//var isFinish = Guid.Empty;
|
||||
T_FM_NOTIFICATION_TASK task = null;
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
entity.STATUS = FOPreMeetingStatusEnum.审核中;
|
||||
isSendApprove = true;
|
||||
entity.APPROVECODE = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
isFinish = entity.TaskID;
|
||||
//isFinish = entity.TaskID;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
task = NotificationTaskService.GetEntityTask(entity.TaskID, "HM101_SHOWPRINT");
|
||||
if (task.SOURCE_DATA_ID == null)
|
||||
task.SOURCE_DATA_ID = entity.ID;
|
||||
}
|
||||
}
|
||||
MFlowPermitService.InsertApprove(entity.APPROVECODE, "HM102", null, entity.ID, "HM101_SHOWPRINT", isFinish, isSendApprove, () =>
|
||||
MFlowPermitService.InsertApprove(entity.APPROVECODE, "HM102", null, entity.ID, "HM101_SHOWPRINT", null, isSendApprove, () =>
|
||||
{
|
||||
if (entity != null)
|
||||
UpdateEntityNoCommit(entity); //保存主表
|
||||
if (task != null)
|
||||
UpdateEntityNoCommit(task);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files); //保存子表
|
||||
if (riskDetail != null && riskDetail.Any())
|
||||
@ -234,10 +243,10 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
hazardRecord.ORG_ID = orgId;
|
||||
hazardRecord.LIABLE_USER_ID = entity.LIABLE_USER_ID;
|
||||
hazardRecord.PLAN_ID = entity.PLAN_ID;
|
||||
hazardRecord.AREAS = string.Join("、", entity.Nav_Areas.Select(t => t.Nav_Area.NAME));
|
||||
hazardRecord.AREAS = string.Join("、", entity.Nav_Areas.Select(t => t.Nav_Area.NAME));
|
||||
hazardRecord.IDENTIFYINGS = string.Join("、", entity.Nav_Identifyings.Select(t => t.Nav_Identifying.NAME));
|
||||
hazardRecords.Add(hazardRecord);
|
||||
noticeTitles.Add("职业危害辨识记录"+DateTime.Now.ToShortDateString());
|
||||
noticeTitles.Add("职业危害辨识记录" + DateTime.Now.ToShortDateString());
|
||||
noticeUserIds.Add((Guid)userID);
|
||||
noticeUserNames.Add(currDetail.FirstOrDefault().Nav_User.NAME);
|
||||
noticeDataIds.Add(hazardRecord.ID);
|
||||
@ -249,7 +258,7 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
var dangerDB = this.GetEntities<T_HM_EVALUATE_HAZARD>(t => areaList.Contains((Guid)t.AREA_ID) && t.STATUS == (int)HMOperationStepEnum.有效, baseFilter);
|
||||
foreach (var detail in currDetail)
|
||||
{
|
||||
var dangerDBAreas = dangerDB.Where(t => t.AREA_ID == detail.AREA_ID&& detail.Nav_Identifyings.Select(x=>x.ID).Contains(t.IDENTIFYING_ID));
|
||||
var dangerDBAreas = dangerDB.Where(t => t.AREA_ID == detail.AREA_ID && detail.Nav_Identifyings.Select(x => x.ID).Contains(t.IDENTIFYING_ID));
|
||||
if (dangerDBAreas.Any())
|
||||
{
|
||||
foreach (var danger in dangerDBAreas)
|
||||
@ -311,7 +320,7 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
}
|
||||
if (model.TaskID != null)
|
||||
{
|
||||
finishNotice = NotificationTaskService.FOGetTaskFinishModel(model.TaskID,model.ID);
|
||||
finishNotice = NotificationTaskService.FOGetTaskFinishModel(model.TaskID, model.ID);
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
var users = entity.Nav_Users;
|
||||
var users = GetEntities<T_HM_RISK_RECORD_USER>(t=>t.RECORD_ID==entity.ID,new BaseFilter(entity.ORG_ID));
|
||||
var identifyings = entity.Nav_Identifyings;
|
||||
var files = entity.Nav_Files;
|
||||
var details = entity.Nav_Details;
|
||||
|
||||
@ -44,104 +44,111 @@ namespace APT.HM.WebApi.Controllers.Api
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_HM_RISK_TASK entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
var files = entity.Nav_Files;
|
||||
var riskDetail = entity.Nav_Detail;
|
||||
var identifyings = entity.Nav_Identifyings;
|
||||
if (identifyings.Count == 0)
|
||||
{
|
||||
var files = entity.Nav_Files;
|
||||
var riskDetail = entity.Nav_Detail;
|
||||
var identifyings = entity.Nav_Identifyings;
|
||||
if (identifyings.Count == 0)
|
||||
throw new Exception("请选择辨识对象!");
|
||||
}
|
||||
var areas = entity.Nav_Areas;
|
||||
List<T_HM_RISK_TASK_USER> users = new List<T_HM_RISK_TASK_USER>();
|
||||
foreach (var detail in riskDetail)
|
||||
{
|
||||
if (detail.AREA_ID == Guid.Empty || detail.AREA_ID == null)
|
||||
{
|
||||
throw new Exception("请选择辨识对象!");
|
||||
throw new Exception("请填写区域!");
|
||||
}
|
||||
var areas = entity.Nav_Areas;
|
||||
List<T_HM_RISK_TASK_USER> users = new List<T_HM_RISK_TASK_USER>();
|
||||
foreach (var detail in riskDetail)
|
||||
if (detail.RECORD_USER_ID == Guid.Empty || detail.AREA_ID == null)
|
||||
{
|
||||
if (detail.AREA_ID == Guid.Empty || detail.AREA_ID == null)
|
||||
throw new Exception("请选择记录人员!");
|
||||
}
|
||||
if (detail.Nav_Users != null)
|
||||
{
|
||||
detail.Nav_Users.ForEach(user =>
|
||||
{
|
||||
throw new Exception("请填写区域!");
|
||||
}
|
||||
if (detail.RECORD_USER_ID == Guid.Empty || detail.AREA_ID == null)
|
||||
{
|
||||
throw new Exception("请选择记录人员!");
|
||||
}
|
||||
if (detail.Nav_Users != null)
|
||||
{
|
||||
detail.Nav_Users.ForEach(user =>
|
||||
if (user.USER_ID != detail.RECORD_USER_ID)
|
||||
{
|
||||
if (user.USER_ID != detail.RECORD_USER_ID)
|
||||
{
|
||||
user.ROW_NO = 999;
|
||||
}
|
||||
});
|
||||
users.AddRange(detail.Nav_Users);
|
||||
detail.Nav_Users = null;
|
||||
}
|
||||
};
|
||||
if (entity.LIABLE_USER_ID == Guid.Empty || entity.LIABLE_USER_ID == null)
|
||||
{
|
||||
entity.LIABLE_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
user.ROW_NO = 999;
|
||||
}
|
||||
});
|
||||
users.AddRange(detail.Nav_Users);
|
||||
detail.Nav_Users = null;
|
||||
}
|
||||
entity.Nav_Files = null;
|
||||
entity.Nav_Detail = null;
|
||||
entity.Nav_Identifyings = null;
|
||||
entity.Nav_Areas = null;
|
||||
identifyings?.ForEach(identifying => { identifying.Nav_Identifying = null; identifying.Nav_Task = null; });
|
||||
areas?.ForEach(areas => { areas.Nav_Area = null; areas.Nav_Task = null; });
|
||||
};
|
||||
if (entity.LIABLE_USER_ID == Guid.Empty || entity.LIABLE_USER_ID == null)
|
||||
{
|
||||
entity.LIABLE_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
}
|
||||
entity.Nav_Files = null;
|
||||
entity.Nav_Detail = null;
|
||||
entity.Nav_Identifyings = null;
|
||||
entity.Nav_Areas = null;
|
||||
identifyings?.ForEach(identifying => { identifying.Nav_Identifying = null; identifying.Nav_Task = null; });
|
||||
areas?.ForEach(areas => { areas.Nav_Area = null; areas.Nav_Task = null; });
|
||||
|
||||
if (entity.INITIATING_DEPARTMENT == null)
|
||||
{
|
||||
var user = GetEntity<T_FM_USER>(t => t.ID == APT.Infrastructure.Api.AppContext.CurrentSession.UserID);
|
||||
if (user != null)
|
||||
entity.INITIATING_DEPARTMENT = user.DEPARTMENT_ID;
|
||||
}
|
||||
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||
entity.STATUS = FOPreMeetingStatusEnum.草稿;
|
||||
entity.APPROVECODE = null;
|
||||
if (entity.INITIATING_DEPARTMENT == null)
|
||||
{
|
||||
var user = GetEntity<T_FM_USER>(t => t.ID == APT.Infrastructure.Api.AppContext.CurrentSession.UserID);
|
||||
if (user != null)
|
||||
entity.INITIATING_DEPARTMENT = user.DEPARTMENT_ID;
|
||||
}
|
||||
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||
entity.STATUS = FOPreMeetingStatusEnum.草稿;
|
||||
entity.APPROVECODE = null;
|
||||
//是否需要发审批流,false不发,true的时候默认只发当前审核人
|
||||
var isSendApprove = false;
|
||||
var isFinish = Guid.Empty;
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
//var isFinish = Guid.Empty;
|
||||
T_FM_NOTIFICATION_TASK task = null;
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
entity.STATUS = FOPreMeetingStatusEnum.审核中;
|
||||
isSendApprove = true;
|
||||
entity.APPROVECODE = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
//isFinish = entity.TaskID;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
entity.STATUS = FOPreMeetingStatusEnum.审核中;
|
||||
isSendApprove = true;
|
||||
entity.APPROVECODE = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
isFinish = entity.TaskID;
|
||||
task = NotificationTaskService.GetEntityTask(entity.TaskID, "HM061_SHOWPRINT");
|
||||
if (task.SOURCE_DATA_ID == null)
|
||||
task.SOURCE_DATA_ID = entity.ID;
|
||||
}
|
||||
var param = "";
|
||||
}
|
||||
var param = "";
|
||||
//0908 修改按最高层级触发审批
|
||||
if (entity.LEVEL.Contains("3"))
|
||||
{
|
||||
param = "GS";
|
||||
}
|
||||
else if (entity.LEVEL.Contains("0"))
|
||||
{
|
||||
param = "BM";
|
||||
}
|
||||
else
|
||||
{
|
||||
param = "CJ";
|
||||
}
|
||||
{
|
||||
param = "GS";
|
||||
}
|
||||
else if (entity.LEVEL.Contains("0"))
|
||||
{
|
||||
param = "BM";
|
||||
}
|
||||
else
|
||||
{
|
||||
param = "CJ";
|
||||
}
|
||||
|
||||
MFlowPermitService.InsertApprove(entity.APPROVECODE, "HM062", param, entity.ID, "HM061_SHOWPRINT", isFinish, isSendApprove, () =>
|
||||
{
|
||||
if (entity != null)
|
||||
UpdateEntityNoCommit(entity); //保存主表
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files); //保存子表
|
||||
MFlowPermitService.InsertApprove(entity.APPROVECODE, "HM062", param, entity.ID, "HM061_SHOWPRINT", null, isSendApprove, () =>
|
||||
{
|
||||
if (entity != null)
|
||||
UpdateEntityNoCommit(entity); //保存主表
|
||||
if (task != null)
|
||||
UpdateEntityNoCommit(task);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files); //保存子表
|
||||
if (identifyings != null && identifyings.Any())
|
||||
BantchSaveEntityNoCommit(identifyings);
|
||||
if (riskDetail != null && riskDetail.Any())
|
||||
BantchSaveEntityNoCommit(riskDetail);
|
||||
if (areas != null && areas.Any())
|
||||
BantchSaveEntityNoCommit(areas);
|
||||
if (users.Any())
|
||||
BantchSaveEntityNoCommit(users); //保存孙表
|
||||
BantchSaveEntityNoCommit(identifyings);
|
||||
if (riskDetail != null && riskDetail.Any())
|
||||
BantchSaveEntityNoCommit(riskDetail);
|
||||
if (areas != null && areas.Any())
|
||||
BantchSaveEntityNoCommit(areas);
|
||||
if (users.Any())
|
||||
BantchSaveEntityNoCommit(users); //保存孙表
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -46,7 +46,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
throw new Exception("通知发送,不可更改");
|
||||
}
|
||||
var Nav_TrainContentList = entity.Nav_TrainContentList;
|
||||
if (Nav_TrainContentList.Count()==0)
|
||||
if (Nav_TrainContentList.Count()==0)
|
||||
{
|
||||
throw new Exception("请选择培训内容");
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.BaseData.Domain.ApiModel;
|
||||
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user