外包动火作业
This commit is contained in:
parent
c803175496
commit
793bab2f53
@ -2501,6 +2501,55 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
private bool BackUpdateNew_FOFireJobWb(T_PF_APPROVE entityInt, T_PF_APPROVE modelApp, List<T_PF_APPROVE_DETAIL> listAppDetail, T_FM_NOTIFICATION_TASK taskFinish, List<T_FM_NOTIFICATION_TASK> listTaskNext, bool isLast = false)
|
||||||
|
{
|
||||||
|
#region 审批公用
|
||||||
|
|
||||||
|
if (modelApp == null)
|
||||||
|
{
|
||||||
|
string taskCodeCheck = String.Empty;
|
||||||
|
bool result = GetApproject2(entityInt, ref modelApp, ref listAppDetail, ref taskFinish, ref taskCodeCheck, ref isLast, ref listTaskNext);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
throw new Exception("审批失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
if (!isLast)
|
||||||
|
{
|
||||||
|
this.UnifiedCommit(() =>
|
||||||
|
{
|
||||||
|
if (modelApp != null)
|
||||||
|
UpdateEntityNoCommit(modelApp); //保存主表
|
||||||
|
if (listAppDetail != null && listAppDetail.Count > 0)//添加组合数据 修改的安全库、隐患库
|
||||||
|
BantchSaveEntityNoCommit(listAppDetail);
|
||||||
|
if (taskFinish != null)
|
||||||
|
UpdateEntityNoCommit(taskFinish);
|
||||||
|
if (listTaskNext != null && listTaskNext.Count > 0)
|
||||||
|
BantchSaveEntityNoCommit(listTaskNext);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var entity = this.GetEntity<T_FO_FIRE_JOB_WB>(modelApp.DATA_ID);
|
||||||
|
entity.STATUS = PFStandardStatus.Archived;
|
||||||
|
UnifiedCommit(() =>
|
||||||
|
{
|
||||||
|
if (modelApp != null)
|
||||||
|
UpdateEntityNoCommit(modelApp); //保存主表
|
||||||
|
if (listAppDetail != null && listAppDetail.Count > 0)//添加组合数据 修改的安全库、隐患库
|
||||||
|
BantchSaveEntityNoCommit(listAppDetail);
|
||||||
|
if (taskFinish != null)
|
||||||
|
UpdateEntityNoCommit(taskFinish);
|
||||||
|
if (listTaskNext != null && listTaskNext.Count > 0)
|
||||||
|
BantchSaveEntityNoCommit(listTaskNext);
|
||||||
|
if (entity != null)
|
||||||
|
this.UpdateEntityNoCommit(entity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关键许可工作票外包
|
/// 关键许可工作票外包
|
||||||
@ -7505,6 +7554,9 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
break;
|
break;
|
||||||
case "FO/FOFireJob/BackUpdateNew":
|
case "FO/FOFireJob/BackUpdateNew":
|
||||||
result = BackUpdateNew_FOFireJob(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
result = BackUpdateNew_FOFireJob(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
|
break;
|
||||||
|
case "FO/FOFireJobWb/BackUpdateNew":
|
||||||
|
result = BackUpdateNew_FOFireJobWb(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
break;
|
break;
|
||||||
case "FO/FOJobEventRecord/BackUpdateNew":
|
case "FO/FOJobEventRecord/BackUpdateNew":
|
||||||
result = BackUpdateNew_FOJobEventRecord(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
result = BackUpdateNew_FOJobEventRecord(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
this.ThrowError("060010");
|
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",
|
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_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_User", "Nav_Users.Nav_UserFiles.Nav_ImgFile.Nav_File",
|
||||||
"Nav_FireFiles.Nav_ImgFile.Nav_File", "Nav_MonitorFiles.Nav_ImgFile.Nav_File", "Nav_DispatchUser");
|
"Nav_FireFiles.Nav_ImgFile.Nav_File", "Nav_MonitorFiles.Nav_ImgFile.Nav_File", "Nav_DispatchUser");
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
{
|
{
|
||||||
|
|||||||
412
APT.MicroApi/APT.FO.WebApi/Controllers/FireJobWbController.cs
Normal file
412
APT.MicroApi/APT.FO.WebApi/Controllers/FireJobWbController.cs
Normal file
@ -0,0 +1,412 @@
|
|||||||
|
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;
|
||||||
|
using APT.MS.Domain.Entities.FO;
|
||||||
|
using APT.MS.Domain.Enums;
|
||||||
|
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/FOFireJobWb")]
|
||||||
|
public partial class FireJobWbController : AuthorizeApiController<T_FO_FIRE_JOB_WB>
|
||||||
|
{
|
||||||
|
IFMFlowPermitService MFlowPermitService { get; set; }
|
||||||
|
IPFCodeRuleService CodeRuleService { get; set; }
|
||||||
|
IPFApproveCallBackService ApproveCallBackService { get; set; }
|
||||||
|
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// FOPreOperSch
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codeRuleService"></param>
|
||||||
|
public FireJobWbController(IPFCodeRuleService codeRuleService, IFMFlowPermitService mFlowPermitService, IPFApproveCallBackService approveCallBackService, IFMNotificationTaskService notificationTaskService)
|
||||||
|
{
|
||||||
|
CodeRuleService = codeRuleService;
|
||||||
|
MFlowPermitService = mFlowPermitService;
|
||||||
|
ApproveCallBackService = approveCallBackService;
|
||||||
|
NotificationTaskService = notificationTaskService;
|
||||||
|
}
|
||||||
|
[HttpPost, Route("GetEdit")]
|
||||||
|
public JsonActionResult<T_FO_FIRE_JOB_WB> 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_WB>(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_User", "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_WB_DETAIL>(t => t.FIRE_JOB_WB_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_WB 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_WB_DETAIL>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var detailFileIds = this.GetEntities<T_FO_FIRE_JOB_WB_DETAIL_FILE>(t => detailIds.Contains(t.FIRE_JOB_WB_DETAIL_ID), new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var detailList = new List<T_FO_FIRE_JOB_WB_DETAIL>();
|
||||||
|
var detailFileList = new List<T_FO_FIRE_JOB_WB_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_WB_DETAIL_ID = item.ID;
|
||||||
|
item2.Nav_ImgFile = null;
|
||||||
|
detailFileList.Add(item2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_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_WB_FILE>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var fileList = new List<T_FO_FIRE_JOB_WB_FILE>();
|
||||||
|
if (files != null && files.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in files)
|
||||||
|
{
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_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_WB_RISK>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var riskList = new List<T_FO_FIRE_JOB_WB_RISK>();
|
||||||
|
if (risks != null && risks.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in risks)
|
||||||
|
{
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_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_WB_USER>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var userFileIds = this.GetEntities<T_FO_FIRE_JOB_WB_USER_FILE>(t => userIds.Contains(t.FIRE_JOB_WB_USER_ID), new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var userFileList = new List<T_FO_FIRE_JOB_WB_USER_FILE>();
|
||||||
|
var userList = new List<T_FO_FIRE_JOB_WB_USER>();
|
||||||
|
if (users != null && users.Any())
|
||||||
|
{
|
||||||
|
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("作业人员必须要有喷水人员,请到用户列表配置对应人员类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var item in users)
|
||||||
|
{
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_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_WB_USER_ID = item.ID;
|
||||||
|
item2.Nav_ImgFile = null;
|
||||||
|
userFileList.Add(item2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item.Nav_UserFiles = null;
|
||||||
|
userList.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("作业人员不能为空");
|
||||||
|
}
|
||||||
|
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_WB_FIRE_FILE>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var fireFileList = new List<T_FO_FIRE_JOB_WB_FIRE_FILE>();
|
||||||
|
if (fireFiles != null && fireFiles.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in fireFiles)
|
||||||
|
{
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_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_WB_MONITOR_FILE>(t => t.FIRE_JOB_WB_ID == entity.ID, new BaseFilter(entity.ORG_ID)).Select(m => m.ID).ToList();
|
||||||
|
var monitorFileList = new List<T_FO_FIRE_JOB_WB_MONITOR_FILE>();
|
||||||
|
if (monitorFiles != null && monitorFiles.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in monitorFiles)
|
||||||
|
{
|
||||||
|
item.ORG_ID = entity.ORG_ID;
|
||||||
|
item.FIRE_JOB_WB_ID = entity.ID;
|
||||||
|
item.Nav_ImgFile = null;
|
||||||
|
monitorFileList.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 = "公司";
|
||||||
|
}
|
||||||
|
MFlowPermitService.InsertApprove(serialCode[0], "FO045", param, entity.ID, "FO045_SHOWPRINT", entity.TaskID, true, () =>
|
||||||
|
{
|
||||||
|
if (detailFileIds != null && detailFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_DETAIL_FILE>(detailFileIds);
|
||||||
|
if (detailIds != null && detailIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_DETAIL>(detailIds);
|
||||||
|
if (userFileIds != null && userFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_USER_FILE>(userFileIds);
|
||||||
|
if (userIds != null && userIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_USER>(userIds);
|
||||||
|
if (fileIds != null && fileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_FILE>(fileIds);
|
||||||
|
if (fireFileIds != null && fireFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_FIRE_FILE>(fireFileIds);
|
||||||
|
if (monitorFileIds != null && monitorFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_MONITOR_FILE>(monitorFileIds);
|
||||||
|
if (riskIds != null && riskIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_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);
|
||||||
|
}, null, null, null, null, null, "FO045_SHOWPRINT", null, "动火作业工作票(外包)", FMTASKTYPE.JobSite);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
this.UnifiedCommit(() =>
|
||||||
|
{
|
||||||
|
if (detailFileIds != null && detailFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_DETAIL_FILE>(detailFileIds);
|
||||||
|
if (detailIds != null && detailIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_DETAIL>(detailIds);
|
||||||
|
if (userFileIds != null && userFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_USER_FILE>(userFileIds);
|
||||||
|
if (userIds != null && userIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_USER>(userIds);
|
||||||
|
if (fileIds != null && fileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_FILE>(fileIds);
|
||||||
|
if (fireFileIds != null && fireFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_FIRE_FILE>(fireFileIds);
|
||||||
|
if (monitorFileIds != null && monitorFileIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_MONITOR_FILE>(monitorFileIds);
|
||||||
|
if (riskIds != null && riskIds.Any())
|
||||||
|
this.BantchDeleteEntityNoCommit<T_FO_FIRE_JOB_WB_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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/// <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/FOFireJobWb/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_WB>(model.DATA_ID, new string[] { "Nav_ApplyUser" });
|
||||||
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Rejected;
|
||||||
|
var persons = this.GetEntities<T_FO_FIRE_JOB_WB_USER>(t => t.FIRE_JOB_WB_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,
|
||||||
|
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO045");
|
||||||
|
//当前节点其他审核人待办消除
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user