2025-11-12 18:51:10 +08:00
|
|
|
|
using APT.BaseData.Domain.Entities;
|
|
|
|
|
|
using APT.BaseData.Domain.Entities.FM;
|
|
|
|
|
|
using APT.BaseData.Domain.Enums;
|
|
|
|
|
|
using APT.BaseData.Domain.IServices;
|
|
|
|
|
|
using APT.BaseData.Domain.IServices.FM;
|
|
|
|
|
|
using APT.BaseData.Services.DomainServices;
|
|
|
|
|
|
using APT.BaseData.Services.Services.FM;
|
|
|
|
|
|
using APT.Infrastructure.Core;
|
2025-11-10 23:23:15 +08:00
|
|
|
|
using APT.MS.Domain.Entities.FO;
|
2025-11-12 18:51:10 +08:00
|
|
|
|
using APT.MS.Domain.Enums;
|
2025-11-10 23:23:15 +08:00
|
|
|
|
using APT.Utility;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace APT.FO.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 动火作业
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Route("api/FO/FOFireJob")]
|
|
|
|
|
|
public partial class FireJobController : AuthorizeApiController<T_FO_FIRE_JOB>
|
|
|
|
|
|
{
|
2025-11-12 18:51:10 +08:00
|
|
|
|
IFMFlowPermitService MFlowPermitService { get; set; }
|
|
|
|
|
|
IPFCodeRuleService CodeRuleService { get; set; }
|
|
|
|
|
|
IPFApproveCallBackService ApproveCallBackService { get; set; }
|
|
|
|
|
|
IFMNotificationTaskService NotificationTaskService { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// FOPreOperSch
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="codeRuleService"></param>
|
|
|
|
|
|
public FireJobController(IPFCodeRuleService codeRuleService, IFMFlowPermitService mFlowPermitService, IPFApproveCallBackService approveCallBackService, IFMNotificationTaskService notificationTaskService)
|
|
|
|
|
|
{
|
|
|
|
|
|
CodeRuleService = codeRuleService;
|
|
|
|
|
|
MFlowPermitService = mFlowPermitService;
|
|
|
|
|
|
ApproveCallBackService = approveCallBackService;
|
|
|
|
|
|
NotificationTaskService = notificationTaskService;
|
|
|
|
|
|
}
|
2025-11-10 23:23:15 +08:00
|
|
|
|
[HttpPost, Route("GetEdit")]
|
|
|
|
|
|
public JsonActionResult<T_FO_FIRE_JOB> GetEdit([FromBody] KeywordFilter filter)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SafeExecute(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var id = filter.FilterGroup.Rules.FirstOrDefault(t => t.Field == "ID").Value.ToString();
|
|
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
|
|
|
this.ThrowError("060010");
|
|
|
|
|
|
var entity = this.GetEntity<T_FO_FIRE_JOB>(id, "Nav_ApplyUser", "Nav_Company", "Nav_ApplyDepartment", "Nav_OperationStep", "Nav_ProductionUnit", "Nav_FireUser.Nav_ImgFile.Nav_File", "Nav_FireDepartment",
|
|
|
|
|
|
"Nav_SafeUser.Nav_ImgFile.Nav_File", "Nav_Area", "Nav_Type", "Nav_MonitorUser", "Nav_Risks", "Nav_Files.Nav_ImgFile.Nav_File", "Nav_Users.Nav_UserType", "Nav_Users.Nav_UserType", "Nav_Users.Nav_UserFiles.Nav_ImgFile.Nav_File",
|
|
|
|
|
|
"Nav_FireFiles.Nav_ImgFile.Nav_File", "Nav_MonitorFiles.Nav_ImgFile.Nav_File", "Nav_DispatchUser");
|
|
|
|
|
|
if (entity != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var details = this.GetEntities<T_FO_FIRE_JOB_DETAIL>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID), "Nav_DetailFiles.Nav_ImgFile.Nav_File").ToList();
|
|
|
|
|
|
entity.Nav_Details = details.OrderBy(t => t.JOB_STEP).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
return entity;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 新增修改
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="entity"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost, Route("FullUpdate")]
|
|
|
|
|
|
public JsonActionResult<bool> FullUpdate([FromBody] T_FO_FIRE_JOB entity)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SafeExecute<bool>(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
|
|
|
|
|
var departmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
|
|
|
|
|
|
entity.APPLY_USER_ID = loginUserId;
|
|
|
|
|
|
entity.APPLY_DEPARTMENT_ID = departmentId;
|
|
|
|
|
|
var details = entity.Nav_Details;
|
|
|
|
|
|
if (details != null && details.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
details = details.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_Details = null;
|
|
|
|
|
|
var detailIds = this.GetEntities<T_FO_FIRE_JOB_DETAIL>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var detailFileIds = this.GetEntities<T_FO_FIRE_JOB_DETAIL_FILE>(t => detailIds.Contains(t.FIRE_JOB_DETAIL_ID), new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var detailList = new List<T_FO_FIRE_JOB_DETAIL>();
|
|
|
|
|
|
var detailFileList = new List<T_FO_FIRE_JOB_DETAIL_FILE>();
|
|
|
|
|
|
if (details != null && details.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in details)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item.Nav_DetailFiles != null && item.Nav_DetailFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item2 in item.Nav_DetailFiles)
|
|
|
|
|
|
{
|
|
|
|
|
|
item2.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item2.FIRE_JOB_DETAIL_ID = item.ID;
|
|
|
|
|
|
item2.Nav_ImgFile = null;
|
|
|
|
|
|
detailFileList.Add(item2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_ID = entity.ID;
|
|
|
|
|
|
item.Nav_DetailFiles = null;
|
|
|
|
|
|
detailList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var files = entity.Nav_Files;
|
|
|
|
|
|
if (files != null && files.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
files = files.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_Files = null;
|
|
|
|
|
|
var fileIds = this.GetEntities<T_FO_FIRE_JOB_FILE>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var fileList = new List<T_FO_FIRE_JOB_FILE>();
|
|
|
|
|
|
if (files != null && files.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in files)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_ID = entity.ID;
|
|
|
|
|
|
item.Nav_ImgFile = null;
|
|
|
|
|
|
fileList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var risks = entity.Nav_Risks;
|
|
|
|
|
|
if (risks != null && risks.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
risks = risks.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_Risks = null;
|
|
|
|
|
|
var riskIds = this.GetEntities<T_FO_FIRE_JOB_RISK>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var riskList = new List<T_FO_FIRE_JOB_RISK>();
|
|
|
|
|
|
if (risks != null && risks.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in risks)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_ID = entity.ID;
|
|
|
|
|
|
riskList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var users = entity.Nav_Users;
|
|
|
|
|
|
if (users != null && users.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
users = users.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_Users = null;
|
|
|
|
|
|
var userIds = this.GetEntities<T_FO_FIRE_JOB_USER>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var userFileIds = this.GetEntities<T_FO_FIRE_JOB_USER_FILE>(t => userIds.Contains(t.FIRE_JOB_USER_ID), new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var userFileList = new List<T_FO_FIRE_JOB_USER_FILE>();
|
|
|
|
|
|
var userList = new List<T_FO_FIRE_JOB_USER>();
|
|
|
|
|
|
if (users != null && users.Any())
|
|
|
|
|
|
{
|
2025-11-12 18:51:10 +08:00
|
|
|
|
var userTypes = this.GetEntities<T_FO_USER_TYPE>(t => t.NAME == "动火操作人员" || t.NAME == "瓦检员" || t.NAME == "喷水人员", new BaseFilter(entity.ORG_ID));
|
|
|
|
|
|
var userTypeIds = userTypes.Select(m => m.ID).ToList();
|
|
|
|
|
|
var dhUser = userTypes.FirstOrDefault(t => t.NAME == "动火操作人员");
|
|
|
|
|
|
if (dhUser == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("人员类别未维护动火操作人员,请到系统管理添加名称为动火操作人员的人员类别");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var dhUserHas = users.FirstOrDefault(t => t.USER_TYPE_ID == dhUser.ID);
|
|
|
|
|
|
if (dhUserHas == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("作业人员必须要有动火操作人员,请到用户列表配置对应人员类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var wjUser = userTypes.FirstOrDefault(t => t.NAME == "瓦检员");
|
|
|
|
|
|
if (wjUser == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("人员类别未维护瓦检员,请到系统管理添加名称为瓦检员的人员类别");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var wjUserHas = users.FirstOrDefault(t => t.USER_TYPE_ID == wjUser.ID);
|
|
|
|
|
|
if (wjUserHas == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("作业人员必须要有瓦检员,请到用户列表配置对应人员类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var psUser = userTypes.FirstOrDefault(t => t.NAME == "喷水人员");
|
|
|
|
|
|
if (psUser == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("人员类别未维护喷水人员,请到系统管理添加名称为喷水人员的人员类别");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var psUserHas = users.FirstOrDefault(t => t.USER_TYPE_ID == psUser.ID);
|
|
|
|
|
|
if (psUserHas == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("作业人员必须要有喷水人员,请到用户列表配置对应人员类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-10 23:23:15 +08:00
|
|
|
|
foreach (var item in users)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_ID = entity.ID;
|
|
|
|
|
|
item.Nav_User = null;
|
|
|
|
|
|
item.Nav_UserType = null;
|
|
|
|
|
|
if (item.Nav_UserFiles != null && item.Nav_UserFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item2 in item.Nav_UserFiles)
|
|
|
|
|
|
{
|
|
|
|
|
|
item2.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item2.FIRE_JOB_USER_ID = item.ID;
|
|
|
|
|
|
item2.Nav_ImgFile = null;
|
|
|
|
|
|
userFileList.Add(item2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
item.Nav_UserFiles = null;
|
|
|
|
|
|
userList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-12 18:51:10 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("作业人员不能为空");
|
|
|
|
|
|
}
|
2025-11-10 23:23:15 +08:00
|
|
|
|
var fireFiles = entity.Nav_FireFiles;
|
|
|
|
|
|
if (fireFiles != null && fireFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
fireFiles = fireFiles.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_FireFiles = null;
|
|
|
|
|
|
var fireFileIds = this.GetEntities<T_FO_FIRE_JOB_FIRE_FILE>(t => t.FIRE_JOB_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var fireFileList = new List<T_FO_FIRE_JOB_FIRE_FILE>();
|
|
|
|
|
|
if (fireFiles != null && fireFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in fireFiles)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_JOB_ID = entity.ID;
|
|
|
|
|
|
item.Nav_ImgFile = null;
|
|
|
|
|
|
fireFileList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
var monitorFiles = entity.Nav_MonitorFiles;
|
|
|
|
|
|
if (monitorFiles != null && monitorFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
monitorFiles = monitorFiles.Where(t => !t.IS_DELETED).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
entity.Nav_MonitorFiles = null;
|
|
|
|
|
|
var monitorFileIds = this.GetEntities<T_FO_FIRE_JOB_MONITOR_FILE>(t => t.FIRE_JOB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
|
|
|
|
|
var monitorFileList = new List<T_FO_FIRE_JOB_MONITOR_FILE>();
|
|
|
|
|
|
if (monitorFiles != null && monitorFiles.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in monitorFiles)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ORG_ID = entity.ORG_ID;
|
|
|
|
|
|
item.FIRE_JOB_ID = entity.ID;
|
|
|
|
|
|
item.Nav_ImgFile = null;
|
|
|
|
|
|
monitorFileList.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-12 18:51:10 +08:00
|
|
|
|
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
|
|
|
|
|
{
|
|
|
|
|
|
//触发审批
|
|
|
|
|
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Approving;
|
|
|
|
|
|
//取审批流水码
|
|
|
|
|
|
var sysFilter = new SystemCodeFilter();
|
|
|
|
|
|
sysFilter.CodeType = (int)PFCodeRuleType.审批流编码;
|
|
|
|
|
|
sysFilter.Count = 1;
|
|
|
|
|
|
sysFilter.OrgId = entity.ORG_ID;
|
|
|
|
|
|
var codes = CodeRuleService.NewGenSerial(sysFilter);
|
|
|
|
|
|
var serialCode = codes.Split(new char[] { ',' });
|
|
|
|
|
|
var department = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == departmentId);
|
|
|
|
|
|
var param = Enum.GetName(typeof(FMDepartmentType), department.DEPARTMENT_TYPE);
|
|
|
|
|
|
if (department.DEPARTMENT_STATUS == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
param = "公司";
|
|
|
|
|
|
}
|
2025-11-12 19:00:06 +08:00
|
|
|
|
MFlowPermitService.InsertApprove(serialCode[0], "FO043", param, entity.ID, "FO043_SHOWPRINT", entity.TaskID, true, () =>
|
2025-11-12 18:51:10 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (detailFileIds != null && detailFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_DETAIL_FILE>(detailFileIds);
|
|
|
|
|
|
if (detailIds != null && detailIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_DETAIL>(detailIds);
|
|
|
|
|
|
if (userFileIds != null && userFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_USER_FILE>(userFileIds);
|
|
|
|
|
|
if (userIds != null && userIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_USER>(userIds);
|
|
|
|
|
|
if (fileIds != null && fileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_FILE>(fileIds);
|
|
|
|
|
|
if (fireFileIds != null && fireFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_FIRE_FILE>(fireFileIds);
|
|
|
|
|
|
if (monitorFileIds != null && monitorFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_MONITOR_FILE>(monitorFileIds);
|
|
|
|
|
|
if (riskIds != null && riskIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_RISK>(riskIds);
|
|
|
|
|
|
if (entity != null)
|
|
|
|
|
|
UpdateEntityNoCommit(entity);
|
|
|
|
|
|
if (detailList != null && detailList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(detailList);
|
|
|
|
|
|
if (detailFileList != null && detailFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(detailFileList);
|
|
|
|
|
|
if (userList != null && userList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(userList);
|
|
|
|
|
|
if (userFileList != null && userFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(userFileList);
|
|
|
|
|
|
if (riskList != null && riskList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(riskList);
|
|
|
|
|
|
if (monitorFileList != null && monitorFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(monitorFileList);
|
|
|
|
|
|
if (fireFileList != null && fireFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(fireFileList);
|
|
|
|
|
|
if (fileList != null && fileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(fileList);
|
2025-11-12 19:00:06 +08:00
|
|
|
|
}, null, null, null, null, null, "FO043_SHOWPRINT", null, "动火作业工作票", FMTASKTYPE.JobSite);
|
2025-11-12 18:51:10 +08:00
|
|
|
|
return true;
|
|
|
|
|
|
}
|
2025-11-10 23:23:15 +08:00
|
|
|
|
this.UnifiedCommit(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
if (detailFileIds != null && detailFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_DETAIL_FILE>(detailFileIds);
|
|
|
|
|
|
if (detailIds != null && detailIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_DETAIL>(detailIds);
|
|
|
|
|
|
if (userFileIds != null && userFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_USER_FILE>(userFileIds);
|
|
|
|
|
|
if (userIds != null && userIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_USER>(userIds);
|
|
|
|
|
|
if (fileIds != null && fileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_FILE>(fileIds);
|
|
|
|
|
|
if (fireFileIds != null && fireFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_FIRE_FILE>(fireFileIds);
|
|
|
|
|
|
if (monitorFileIds != null && monitorFileIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_MONITOR_FILE>(monitorFileIds);
|
|
|
|
|
|
if (riskIds != null && riskIds.Any())
|
|
|
|
|
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_RISK>(riskIds);
|
|
|
|
|
|
if (entity != null)
|
|
|
|
|
|
UpdateEntityNoCommit(entity);
|
|
|
|
|
|
if (detailList != null && detailList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(detailList);
|
|
|
|
|
|
if (detailFileList != null && detailFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(detailFileList);
|
|
|
|
|
|
if (userList != null && userList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(userList);
|
|
|
|
|
|
if (userFileList != null && userFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(userFileList);
|
|
|
|
|
|
if (riskList != null && riskList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(riskList);
|
|
|
|
|
|
if (monitorFileList != null && monitorFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(monitorFileList);
|
|
|
|
|
|
if (fireFileList != null && fireFileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(fireFileList);
|
|
|
|
|
|
if (fileList != null && fileList.Any())
|
|
|
|
|
|
this.BantchSaveEntityNoCommit(fileList);
|
|
|
|
|
|
});
|
|
|
|
|
|
return true;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2025-11-12 18:51:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 回调函数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost, Route("BackUpdateNew")]
|
|
|
|
|
|
public JsonActionResult<bool> BackUpdateNew([FromBody] T_PF_APPROVE entity)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SafeExecute(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
return ApproveCallBackService.CallBackNew("FO/FOFireJob/BackUpdateNew", entity);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 驳回
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost, Route("RejectUpdate")]
|
|
|
|
|
|
public JsonActionResult<bool> RejectUpdate([FromBody] T_PF_APPROVE model)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SafeExecute(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
//公共 获取审批流信息
|
|
|
|
|
|
T_PF_APPROVE modelApp = null;
|
|
|
|
|
|
List<T_PF_APPROVE_DETAIL> listAppDetail = null;
|
|
|
|
|
|
T_FM_NOTIFICATION_TASK taskFinish = null;
|
|
|
|
|
|
string Msg = string.Empty;
|
|
|
|
|
|
bool ResultGetInfo = ApproveCallBackService.GetApproject(model, ref modelApp, ref listAppDetail, ref taskFinish, ref Msg);
|
|
|
|
|
|
if (!ResultGetInfo)
|
|
|
|
|
|
throw new Exception("驳回失败!");
|
|
|
|
|
|
|
|
|
|
|
|
if (modelApp == null || listAppDetail == null)
|
|
|
|
|
|
throw new Exception("获取驳回信息失败!");
|
|
|
|
|
|
var entity = this.GetEntity<T_FO_FIRE_JOB>(model.DATA_ID, new string[] { "Nav_ApplyUser" });
|
|
|
|
|
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Rejected;
|
|
|
|
|
|
var persons = this.GetEntities<T_FO_FIRE_JOB_USER>(t => t.FIRE_JOB_ID == model.DATA_ID, new BaseFilter(entity.ORG_ID));
|
|
|
|
|
|
if (persons.Any())
|
|
|
|
|
|
persons.ForEach(t => { t.DEAL_STATUS = 0; t.Nav_User = null; });
|
|
|
|
|
|
//直接驳回给申请人
|
|
|
|
|
|
T_FM_NOTIFICATION_TASK notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票已被驳回", entity.ID, entity.ORG_ID, (Guid)entity.APPLY_USER_ID, entity.Nav_ApplyUser.NAME, DateTime.Now,
|
2025-11-12 19:00:06 +08:00
|
|
|
|
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO043");
|
2025-11-12 18:51:10 +08:00
|
|
|
|
//当前节点其他审核人待办消除
|
|
|
|
|
|
var taskOtherIds = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => t.SOURCE_DATA_ID == model.ID && t.NOTICE_STATUS == 0, new BaseFilter(entity.ORG_ID)).Select(t => t.ID).ToList();
|
|
|
|
|
|
UnifiedCommit(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
if (entity != null)
|
|
|
|
|
|
this.UpdateEntityNoCommit(entity);
|
|
|
|
|
|
if (notice != null)
|
|
|
|
|
|
this.UpdateEntityNoCommit(notice);
|
|
|
|
|
|
if (modelApp != null)
|
|
|
|
|
|
UpdateEntityNoCommit(modelApp);
|
|
|
|
|
|
if (listAppDetail != null && listAppDetail.Count > 0)
|
|
|
|
|
|
BantchUpdateEntityNoCommit(listAppDetail);
|
|
|
|
|
|
if (persons != null && persons.Any())
|
|
|
|
|
|
BantchUpdateEntityNoCommit(persons);
|
|
|
|
|
|
if (taskOtherIds != null && taskOtherIds.Any())
|
|
|
|
|
|
BantchDeleteEntityNoCommit<T_FM_NOTIFICATION_TASK>(taskOtherIds);
|
|
|
|
|
|
if (taskFinish != null)
|
|
|
|
|
|
UpdateEntityNoCommit(taskFinish);
|
|
|
|
|
|
});
|
|
|
|
|
|
return true;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2025-11-10 23:23:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|