Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
078de1ef08
@ -34,6 +34,8 @@ namespace APT.BaseData.Data.Mapping.FM
|
|||||||
builder.Ignore(t => t.Team);
|
builder.Ignore(t => t.Team);
|
||||||
builder.Property(t => t.ID_CARD)
|
builder.Property(t => t.ID_CARD)
|
||||||
.HasMaxLength(50);
|
.HasMaxLength(50);
|
||||||
|
builder.Property(t => t.USER_TYPE_NAME)
|
||||||
|
.HasMaxLength(50);
|
||||||
builder.HasOne(t => t.Nav_ApproveRole).WithMany().HasForeignKey(t => t.APPROVE_ROLE_ID).OnDelete(DeleteBehavior.Restrict);
|
builder.HasOne(t => t.Nav_ApproveRole).WithMany().HasForeignKey(t => t.APPROVE_ROLE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
builder.Ignore(t => t.TEAM_ID);
|
builder.Ignore(t => t.TEAM_ID);
|
||||||
builder.Ignore(t => t.Tenant);
|
builder.Ignore(t => t.Tenant);
|
||||||
|
|||||||
@ -27,5 +27,11 @@ namespace APT.BaseData.Domain.Entities.FM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("导航:生产单元枚举")]
|
[Description("导航:生产单元枚举")]
|
||||||
public virtual T_FM_ENUMS Nav_Enums { get; set; }
|
public virtual T_FM_ENUMS Nav_Enums { get; set; }
|
||||||
|
|
||||||
|
[Description("生产单元")]
|
||||||
|
[DataFieldForeignKey("Nav_DepartUnit")]
|
||||||
|
public Guid? DEPART_UNIT_ID { get; set; }
|
||||||
|
[Description("导航属性:生产单元")]
|
||||||
|
public T_FM_USER_PRODUCTION_UNIT_SET Nav_DepartUnit { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,5 +305,12 @@ namespace APT.BaseData.Domain.Entities.FM
|
|||||||
[Description("证书")]
|
[Description("证书")]
|
||||||
[DataFieldIngore]
|
[DataFieldIngore]
|
||||||
public virtual ICollection<T_FM_PERSON_CERTIFICATE_FILE> Nav_CertificateFiles { get; set; }
|
public virtual ICollection<T_FM_PERSON_CERTIFICATE_FILE> Nav_CertificateFiles { get; set; }
|
||||||
|
|
||||||
|
[Description("人员类别")]
|
||||||
|
public Guid? USER_TYPE_ID { get; set; }
|
||||||
|
|
||||||
|
[Description("人员类别名称")]
|
||||||
|
[DataFieldLength(50)]
|
||||||
|
public string USER_TYPE_NAME { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,5 +27,11 @@ namespace APT.BaseData.Domain.Entities.FM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("导航:生产单元枚举")]
|
[Description("导航:生产单元枚举")]
|
||||||
public virtual T_FM_ENUMS Nav_Enums { get; set; }
|
public virtual T_FM_ENUMS Nav_Enums { get; set; }
|
||||||
|
|
||||||
|
[Description("生产单元")]
|
||||||
|
[DataFieldForeignKey("Nav_Unit")]
|
||||||
|
public Guid? PRODUCTION_UNIT_ID { get; set; }
|
||||||
|
[Description("导航属性:生产单元")]
|
||||||
|
public T_FM_USER_PRODUCTION_UNIT_SET Nav_Unit { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2453,6 +2453,104 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private bool BackUpdateNew_FOFireJob(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>(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;
|
||||||
|
}
|
||||||
|
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>
|
||||||
/// 关键许可工作票外包
|
/// 关键许可工作票外包
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -7454,6 +7552,12 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
case "FO/FOCrucialLicenseJob/BackUpdateNew":
|
case "FO/FOCrucialLicenseJob/BackUpdateNew":
|
||||||
result = BackUpdateNew_FOCrucialLicenseJob(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
result = BackUpdateNew_FOCrucialLicenseJob(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
break;
|
break;
|
||||||
|
case "FO/FOFireJob/BackUpdateNew":
|
||||||
|
result = BackUpdateNew_FOFireJob(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
|
break;
|
||||||
|
case "FO/FOFireJobWb/BackUpdateNew":
|
||||||
|
result = BackUpdateNew_FOFireJobWb(entityInt, modelApp, listAppDetail, taskFinish, listTaskNext, isLast);
|
||||||
|
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);
|
||||||
break;
|
break;
|
||||||
@ -12918,6 +13022,7 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
T_SK_RISK_IDENTIFY_RESULT_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_RESULT_DETAIL();
|
T_SK_RISK_IDENTIFY_RESULT_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_RESULT_DETAIL();
|
||||||
ideDetail.ORG_ID = entity.ORG_ID;
|
ideDetail.ORG_ID = entity.ORG_ID;
|
||||||
ideDetail.RISK_IDENTIFY_RESULT_ID = result.ID;
|
ideDetail.RISK_IDENTIFY_RESULT_ID = result.ID;
|
||||||
|
ideDetail.ENTERPRISE_LIBRARY_ID = item.ENTERPRISE_LIBRARY_ID;
|
||||||
ideDetail.PRODUCTION_UNIT_ID = item.PRODUCTION_UNIT_ID;
|
ideDetail.PRODUCTION_UNIT_ID = item.PRODUCTION_UNIT_ID;
|
||||||
ideDetail.MineType = item.MineType;
|
ideDetail.MineType = item.MineType;
|
||||||
ideDetail.AREA_ID = item.AREA_ID;
|
ideDetail.AREA_ID = item.AREA_ID;
|
||||||
@ -13289,6 +13394,8 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
ideDetail.IDENTIFY_DEPARTMENT = de.IDENTIFY_DEPARTMENT;
|
ideDetail.IDENTIFY_DEPARTMENT = de.IDENTIFY_DEPARTMENT;
|
||||||
ideDetail.IDENTIFY_POST = de.IDENTIFY_POST;
|
ideDetail.IDENTIFY_POST = de.IDENTIFY_POST;
|
||||||
ideDetail.MARK = de.MARK;
|
ideDetail.MARK = de.MARK;
|
||||||
|
ideDetail.ENTERPRISE_LIBRARY_ID = de.ENTERPRISE_LIBRARY_ID;
|
||||||
|
ideDetail.ENABLE_STATUS = de.ENABLE_STATUS;
|
||||||
summaryDetails.Add(ideDetail);
|
summaryDetails.Add(ideDetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13486,6 +13593,8 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
detail.EVALUATE_SCORE = departTemp == null ? 0 : departTemp.EVALUATE_SCORE;
|
detail.EVALUATE_SCORE = departTemp == null ? 0 : departTemp.EVALUATE_SCORE;
|
||||||
detail.EVALUATE_LEVEL = departTemp == null ? SKEvaluateLevelEnum.低风险 : departTemp.EVALUATE_LEVEL;
|
detail.EVALUATE_LEVEL = departTemp == null ? SKEvaluateLevelEnum.低风险 : departTemp.EVALUATE_LEVEL;
|
||||||
detail.MARK = de.MARK;
|
detail.MARK = de.MARK;
|
||||||
|
detail.ENTERPRISE_LIBRARY_ID = de.ENTERPRISE_LIBRARY_ID;
|
||||||
|
detail.ENABLE_STATUS = de.ENABLE_STATUS;
|
||||||
detail.MEASURE = de.MEASURE;
|
detail.MEASURE = de.MEASURE;
|
||||||
if (departTemp != null)
|
if (departTemp != null)
|
||||||
{
|
{
|
||||||
@ -13889,6 +13998,8 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
detail.EMERGENCY = de.EMERGENCY;
|
detail.EMERGENCY = de.EMERGENCY;
|
||||||
detail.EVALUATE_LEVEL = de.EVALUATE_LEVEL;
|
detail.EVALUATE_LEVEL = de.EVALUATE_LEVEL;
|
||||||
detail.MARK = de.MARK;
|
detail.MARK = de.MARK;
|
||||||
|
detail.ENTERPRISE_LIBRARY_ID = de.ENTERPRISE_LIBRARY_ID;
|
||||||
|
detail.ENABLE_STATUS = de.ENABLE_STATUS;
|
||||||
detail.MEASURE = de.MEASURE;
|
detail.MEASURE = de.MEASURE;
|
||||||
resultDetails.Add(detail);
|
resultDetails.Add(detail);
|
||||||
if (de.Nav_DetailMeasures != null && de.Nav_DetailMeasures.Any())
|
if (de.Nav_DetailMeasures != null && de.Nav_DetailMeasures.Any())
|
||||||
@ -14030,6 +14141,8 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
detail.EVALUATE_LEVEL = item.EVALUATE_LEVEL;
|
detail.EVALUATE_LEVEL = item.EVALUATE_LEVEL;
|
||||||
detail.EMERGENCY = item.EMERGENCY;
|
detail.EMERGENCY = item.EMERGENCY;
|
||||||
detail.MARK = item.MARK;
|
detail.MARK = item.MARK;
|
||||||
|
detail.ENTERPRISE_LIBRARY_ID = item.ENTERPRISE_LIBRARY_ID;
|
||||||
|
detail.ENABLE_STATUS = item.ENABLE_STATUS;
|
||||||
douDetails.Add(detail);
|
douDetails.Add(detail);
|
||||||
var ldeparts = detailDeparts.Where(t => t.RISK_EVALUATION_SUMMARY_DETAIL_ID == item.ID).ToList();
|
var ldeparts = detailDeparts.Where(t => t.RISK_EVALUATION_SUMMARY_DETAIL_ID == item.ID).ToList();
|
||||||
if (ldeparts.Any())
|
if (ldeparts.Any())
|
||||||
@ -14352,6 +14465,8 @@ namespace APT.BaseData.Services.DomainServices
|
|||||||
detail.EVALUATE_LEVEL = item.EVALUATE_LEVEL;
|
detail.EVALUATE_LEVEL = item.EVALUATE_LEVEL;
|
||||||
detail.EMERGENCY = item.EMERGENCY;
|
detail.EMERGENCY = item.EMERGENCY;
|
||||||
detail.MARK = item.MARK;
|
detail.MARK = item.MARK;
|
||||||
|
detail.ENTERPRISE_LIBRARY_ID = item.ENTERPRISE_LIBRARY_ID;
|
||||||
|
detail.ENABLE_STATUS = item.ENABLE_STATUS;
|
||||||
details.Add(detail);
|
details.Add(detail);
|
||||||
var ldeparts = sumDetailDeparts.Where(t => t.RISK_EVALUATION_SUMMARY_DETAIL_ID == item.ID).ToList();
|
var ldeparts = sumDetailDeparts.Where(t => t.RISK_EVALUATION_SUMMARY_DETAIL_ID == item.ID).ToList();
|
||||||
if (ldeparts.Any())
|
if (ldeparts.Any())
|
||||||
|
|||||||
135479
APT.Data.Migrations/Migrations/20251113064111_hmr2025111301.Designer.cs
generated
Normal file
135479
APT.Data.Migrations/Migrations/20251113064111_hmr2025111301.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
191
APT.Data.Migrations/Migrations/20251113064111_hmr2025111301.cs
Normal file
191
APT.Data.Migrations/Migrations/20251113064111_hmr2025111301.cs
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class hmr2025111301 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_RESULT_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_RISK_EVALUATION_SUMMARY_DETAIL",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_EVALUATION_SUMMARY_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_RISK_EVALUATION_DETAIL",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_EVALUATION_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "FIRE_STATUS",
|
||||||
|
table: "T_FO_FIRE_JOB_WB",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "FIRE_STATUS",
|
||||||
|
table: "T_FO_FIRE_JOB",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_T_FM_USER_PRODUCTION_UNIT_PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT",
|
||||||
|
column: "PRODUCTION_UNIT_ID");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_T_FM_DEPARTMENT_PRODUCTION_UNIT_DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT",
|
||||||
|
column: "DEPART_UNIT_ID");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FM_DEPARTMENT_PRODUCTION_UNIT_T_FM_USER_PRODUCTION_UNIT_SET_DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT",
|
||||||
|
column: "DEPART_UNIT_ID",
|
||||||
|
principalTable: "T_FM_USER_PRODUCTION_UNIT_SET",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FM_USER_PRODUCTION_UNIT_T_FM_USER_PRODUCTION_UNIT_SET_PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT",
|
||||||
|
column: "PRODUCTION_UNIT_ID",
|
||||||
|
principalTable: "T_FM_USER_PRODUCTION_UNIT_SET",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FM_DEPARTMENT_PRODUCTION_UNIT_T_FM_USER_PRODUCTION_UNIT_SET_DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FM_USER_PRODUCTION_UNIT_T_FM_USER_PRODUCTION_UNIT_SET_PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_T_FM_USER_PRODUCTION_UNIT_PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_T_FM_DEPARTMENT_PRODUCTION_UNIT_DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_RESULT_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_IDENTIFY_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_RISK_EVALUATION_SUMMARY_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_EVALUATION_SUMMARY_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_RISK_EVALUATION_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_RISK_EVALUATION_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENABLE_STATUS",
|
||||||
|
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ENTERPRISE_LIBRARY_ID",
|
||||||
|
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "FIRE_STATUS",
|
||||||
|
table: "T_FO_FIRE_JOB_WB");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "FIRE_STATUS",
|
||||||
|
table: "T_FO_FIRE_JOB");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PRODUCTION_UNIT_ID",
|
||||||
|
table: "T_FM_USER_PRODUCTION_UNIT");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DEPART_UNIT_ID",
|
||||||
|
table: "T_FM_DEPARTMENT_PRODUCTION_UNIT");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
135485
APT.Data.Migrations/Migrations/20251113072500_hmr2025111302.Designer.cs
generated
Normal file
135485
APT.Data.Migrations/Migrations/20251113072500_hmr2025111302.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,82 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class hmr2025111302 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_USER_T_FO_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_USER");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_WB_USER_T_FO_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_WB_USER");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "USER_TYPE_ID",
|
||||||
|
table: "T_FM_USER",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "USER_TYPE_NAME",
|
||||||
|
table: "T_FM_USER",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_USER_T_OG_RELATED_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_USER",
|
||||||
|
column: "USER_TYPE_ID",
|
||||||
|
principalTable: "T_OG_RELATED_USER_TYPE",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_WB_USER_T_OG_RELATED_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_WB_USER",
|
||||||
|
column: "USER_TYPE_ID",
|
||||||
|
principalTable: "T_OG_RELATED_USER_TYPE",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_USER_T_OG_RELATED_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_USER");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_WB_USER_T_OG_RELATED_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_WB_USER");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "USER_TYPE_ID",
|
||||||
|
table: "T_FM_USER");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "USER_TYPE_NAME",
|
||||||
|
table: "T_FM_USER");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_USER_T_FO_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_USER",
|
||||||
|
column: "USER_TYPE_ID",
|
||||||
|
principalTable: "T_FO_USER_TYPE",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_FO_FIRE_JOB_WB_USER_T_FO_USER_TYPE_USER_TYPE_ID",
|
||||||
|
table: "T_FO_FIRE_JOB_WB_USER",
|
||||||
|
column: "USER_TYPE_ID",
|
||||||
|
principalTable: "T_FO_USER_TYPE",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
135486
APT.Data.Migrations/Migrations/20251113073022_hmr2025111303.Designer.cs
generated
Normal file
135486
APT.Data.Migrations/Migrations/20251113073022_hmr2025111303.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,33 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class hmr2025111303 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "USER_TYPE_NAME",
|
||||||
|
table: "T_FM_USER",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)",
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "USER_TYPE_NAME",
|
||||||
|
table: "T_FM_USER",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(50)",
|
||||||
|
oldMaxLength: 50,
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2122,6 +2122,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<Guid>("DEPARTMENT_ID")
|
b.Property<Guid>("DEPARTMENT_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DEPART_UNIT_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -2157,6 +2160,8 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
|
|
||||||
b.HasIndex("DEPARTMENT_ID");
|
b.HasIndex("DEPARTMENT_ID");
|
||||||
|
|
||||||
|
b.HasIndex("DEPART_UNIT_ID");
|
||||||
|
|
||||||
b.HasIndex("ENUMS_ID");
|
b.HasIndex("ENUMS_ID");
|
||||||
|
|
||||||
b.HasIndex("ORG_ID");
|
b.HasIndex("ORG_ID");
|
||||||
@ -6847,6 +6852,13 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<Guid?>("T_BI_AREA_TREEID")
|
b.Property<Guid?>("T_BI_AREA_TREEID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("USER_TYPE_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("USER_TYPE_NAME")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
b.Property<int>("WORKINGYEAR")
|
b.Property<int>("WORKINGYEAR")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -8225,6 +8237,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("PRODUCTION_UNIT_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<Guid>("USER_ID")
|
b.Property<Guid>("USER_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
@ -8234,6 +8249,8 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ORG_ID");
|
b.HasIndex("ORG_ID");
|
||||||
|
|
||||||
|
b.HasIndex("PRODUCTION_UNIT_ID");
|
||||||
|
|
||||||
b.HasIndex("USER_ID");
|
b.HasIndex("USER_ID");
|
||||||
|
|
||||||
b.ToTable("T_FM_USER_PRODUCTION_UNIT");
|
b.ToTable("T_FM_USER_PRODUCTION_UNIT");
|
||||||
@ -32972,6 +32989,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<Guid?>("FIRE_DEPARTMENT_ID")
|
b.Property<Guid?>("FIRE_DEPARTMENT_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<int>("FIRE_STATUS")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<Guid?>("FIRE_USER_ID")
|
b.Property<Guid?>("FIRE_USER_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
@ -33618,6 +33638,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<int>("EVALUATE_LEVEL")
|
b.Property<int>("EVALUATE_LEVEL")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("FIRE_STATUS")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<Guid?>("FLOW_ID")
|
b.Property<Guid?>("FLOW_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
@ -76988,6 +77011,12 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.HasColumnType("nvarchar(500)");
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
|
b.Property<int>("ENABLE_STATUS")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -82779,6 +82808,12 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.HasColumnType("nvarchar(500)");
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
|
b.Property<int>("ENABLE_STATUS")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -83365,6 +83400,12 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
.HasColumnType("nvarchar(500)");
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
|
b.Property<int>("ENABLE_STATUS")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -83962,6 +84003,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<int>("ENABLE_STATUS")
|
b.Property<int>("ENABLE_STATUS")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -84532,6 +84576,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<int>("ENABLE_STATUS")
|
b.Property<int>("ENABLE_STATUS")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -84926,6 +84973,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<int>("ENABLE_STATUS")
|
b.Property<int>("ENABLE_STATUS")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ENTERPRISE_LIBRARY_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("ENTITY_ORG_TPYE")
|
b.Property<int>("ENTITY_ORG_TPYE")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -97819,6 +97869,11 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_USER_PRODUCTION_UNIT_SET", "Nav_DepartUnit")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("DEPART_UNIT_ID")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_ENUMS", "Nav_Enums")
|
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_ENUMS", "Nav_Enums")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ENUMS_ID")
|
.HasForeignKey("ENUMS_ID")
|
||||||
@ -97832,6 +97887,8 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
|
|
||||||
b.Navigation("Nav_Department");
|
b.Navigation("Nav_Department");
|
||||||
|
|
||||||
|
b.Navigation("Nav_DepartUnit");
|
||||||
|
|
||||||
b.Navigation("Nav_Enums");
|
b.Navigation("Nav_Enums");
|
||||||
|
|
||||||
b.Navigation("Nav_Org");
|
b.Navigation("Nav_Org");
|
||||||
@ -99576,6 +99633,11 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_USER_PRODUCTION_UNIT_SET", "Nav_Unit")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PRODUCTION_UNIT_ID")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_USER", "Nav_User")
|
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_USER", "Nav_User")
|
||||||
.WithMany("Nav_ProdutionUnit")
|
.WithMany("Nav_ProdutionUnit")
|
||||||
.HasForeignKey("USER_ID")
|
.HasForeignKey("USER_ID")
|
||||||
@ -99586,6 +99648,8 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
|
|
||||||
b.Navigation("Nav_Org");
|
b.Navigation("Nav_Org");
|
||||||
|
|
||||||
|
b.Navigation("Nav_Unit");
|
||||||
|
|
||||||
b.Navigation("Nav_User");
|
b.Navigation("Nav_User");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -107908,7 +107972,7 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.HasForeignKey("USER_ID")
|
.HasForeignKey("USER_ID")
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne("APT.MS.Domain.Entities.FO.T_FO_USER_TYPE", "Nav_UserType")
|
b.HasOne("APT.MS.Domain.Entities.OG.T_OG_RELATED_USER_TYPE", "Nav_UserType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("USER_TYPE_ID")
|
.HasForeignKey("USER_TYPE_ID")
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
@ -108176,7 +108240,7 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.HasForeignKey("USER_ID")
|
.HasForeignKey("USER_ID")
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.HasOne("APT.MS.Domain.Entities.FO.T_FO_USER_TYPE", "Nav_UserType")
|
b.HasOne("APT.MS.Domain.Entities.OG.T_OG_RELATED_USER_TYPE", "Nav_UserType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("USER_TYPE_ID")
|
.HasForeignKey("USER_TYPE_ID")
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|||||||
@ -15315,6 +15315,7 @@ builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelet
|
|||||||
base.Configure(builder);
|
base.Configure(builder);
|
||||||
builder.HasOne(t => t.Nav_Department).WithMany(t=>t.Nav_ProdutionUnit).HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
builder.HasOne(t => t.Nav_Department).WithMany(t=>t.Nav_ProdutionUnit).HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
builder.HasOne(t => t.Nav_Enums).WithMany().HasForeignKey(t => t.ENUMS_ID).OnDelete(DeleteBehavior.Restrict);
|
builder.HasOne(t => t.Nav_Enums).WithMany().HasForeignKey(t => t.ENUMS_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
|
builder.HasOne(t => t.Nav_DepartUnit).WithMany().HasForeignKey(t => t.DEPART_UNIT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -15783,6 +15784,7 @@ builder.Property(t => t.REMARK).HasMaxLength(500);
|
|||||||
base.Configure(builder);
|
base.Configure(builder);
|
||||||
builder.HasOne(t => t.Nav_User).WithMany(t=>t.Nav_ProdutionUnit).HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
builder.HasOne(t => t.Nav_User).WithMany(t=>t.Nav_ProdutionUnit).HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
builder.HasOne(t => t.Nav_Enums).WithMany().HasForeignKey(t => t.ENUMS_ID).OnDelete(DeleteBehavior.Restrict);
|
builder.HasOne(t => t.Nav_Enums).WithMany().HasForeignKey(t => t.ENUMS_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
|
builder.HasOne(t => t.Nav_Unit).WithMany().HasForeignKey(t => t.PRODUCTION_UNIT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -241,5 +241,9 @@ namespace APT.MS.Domain.Entities.FO
|
|||||||
[Description("提交并通知")]
|
[Description("提交并通知")]
|
||||||
[DataFieldIngore]
|
[DataFieldIngore]
|
||||||
public string PUBLISH { get; set; }
|
public string PUBLISH { get; set; }
|
||||||
|
|
||||||
|
[Description("动火流程状态")]
|
||||||
|
[EnumName("FOFireStatus")]
|
||||||
|
public FOFireStatus FIRE_STATUS { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ namespace APT.MS.Domain.Entities.FO
|
|||||||
public Guid? USER_TYPE_ID { get; set; }
|
public Guid? USER_TYPE_ID { get; set; }
|
||||||
|
|
||||||
[Description("导航属性:人员类别")]
|
[Description("导航属性:人员类别")]
|
||||||
public virtual T_FO_USER_TYPE Nav_UserType { get; set; }
|
public virtual T_OG_RELATED_USER_TYPE Nav_UserType { get; set; }
|
||||||
|
|
||||||
[Description("证件名称")]
|
[Description("证件名称")]
|
||||||
[DataFieldLength(100)]
|
[DataFieldLength(100)]
|
||||||
|
|||||||
@ -232,6 +232,8 @@ namespace APT.MS.Domain.Entities.FO
|
|||||||
[DataFieldIngore]
|
[DataFieldIngore]
|
||||||
public string PUBLISH { get; set; }
|
public string PUBLISH { get; set; }
|
||||||
|
|
||||||
|
[Description("动火流程状态")]
|
||||||
|
[EnumName("FOFireStatus")]
|
||||||
|
public FOFireStatus FIRE_STATUS { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using APT.BaseData.Domain.Entities.FM;
|
using APT.BaseData.Domain.Entities.FM;
|
||||||
using APT.Infrastructure.Core;
|
using APT.Infrastructure.Core;
|
||||||
|
using APT.MS.Domain.Entities.OG;
|
||||||
using APT.MS.Domain.Enums;
|
using APT.MS.Domain.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -28,7 +29,7 @@ namespace APT.MS.Domain.Entities.FO
|
|||||||
public Guid? USER_TYPE_ID { get; set; }
|
public Guid? USER_TYPE_ID { get; set; }
|
||||||
|
|
||||||
[Description("导航属性:人员类别")]
|
[Description("导航属性:人员类别")]
|
||||||
public virtual T_FO_USER_TYPE Nav_UserType { get; set; }
|
public virtual T_OG_RELATED_USER_TYPE Nav_UserType { get; set; }
|
||||||
|
|
||||||
[Description("证件名称")]
|
[Description("证件名称")]
|
||||||
[DataFieldLength(100)]
|
[DataFieldLength(100)]
|
||||||
|
|||||||
@ -151,5 +151,15 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("标识")]
|
[Description("标识")]
|
||||||
public SKMarkEnum MARK { get; set; }
|
public SKMarkEnum MARK { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否有效
|
||||||
|
/// </summary>
|
||||||
|
[Description("是否有效")]
|
||||||
|
[EnumName("SKEnableStatusEnum")]
|
||||||
|
public SKEnableStatusEnum ENABLE_STATUS { get; set; }
|
||||||
|
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,5 +156,15 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("标识")]
|
[Description("标识")]
|
||||||
public SKMarkEnum MARK { get; set; }
|
public SKMarkEnum MARK { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否有效
|
||||||
|
/// </summary>
|
||||||
|
[Description("是否有效")]
|
||||||
|
[EnumName("SKEnableStatusEnum")]
|
||||||
|
public SKEnableStatusEnum ENABLE_STATUS { get; set; }
|
||||||
|
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,10 +157,20 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("标识")]
|
[Description("标识")]
|
||||||
public SKMarkEnum MARK { get; set; }
|
public SKMarkEnum MARK { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否有效
|
||||||
|
/// </summary>
|
||||||
|
[Description("是否有效")]
|
||||||
|
[EnumName("SKEnableStatusEnum")]
|
||||||
|
public SKEnableStatusEnum ENABLE_STATUS { get; set; }
|
||||||
|
|
||||||
[Description("辨识部门")]
|
[Description("辨识部门")]
|
||||||
public string EVALUATION_DEPARTMENT { get; set; }
|
public string EVALUATION_DEPARTMENT { get; set; }
|
||||||
[Description("辨识岗位")]
|
[Description("辨识岗位")]
|
||||||
public string EVALUATION_POST { get; set; }
|
public string EVALUATION_POST { get; set; }
|
||||||
|
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,5 +104,9 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
public string MEASURE { get; set; }
|
public string MEASURE { get; set; }
|
||||||
[Description("应急处置")]
|
[Description("应急处置")]
|
||||||
public string EMERGENCY { get; set; }
|
public string EMERGENCY { get; set; }
|
||||||
|
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,5 +117,9 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
public string IDENTIFY_DEPARTMENT { get; set; }
|
public string IDENTIFY_DEPARTMENT { get; set; }
|
||||||
[Description("辨识岗位")]
|
[Description("辨识岗位")]
|
||||||
public string IDENTIFY_POST { get; set; }
|
public string IDENTIFY_POST { get; set; }
|
||||||
|
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,5 +117,8 @@ namespace APT.MS.Domain.Entities.SK
|
|||||||
public string IDENTIFY_DEPARTMENT { get; set; }
|
public string IDENTIFY_DEPARTMENT { get; set; }
|
||||||
[Description("辨识岗位")]
|
[Description("辨识岗位")]
|
||||||
public string IDENTIFY_POST { get; set; }
|
public string IDENTIFY_POST { get; set; }
|
||||||
|
[Description("企业库ID")]
|
||||||
|
|
||||||
|
public Guid? ENTERPRISE_LIBRARY_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,4 +227,54 @@ namespace APT.MS.Domain.Enums
|
|||||||
[Description("作业后")]
|
[Description("作业后")]
|
||||||
After = 10,
|
After = 10,
|
||||||
}
|
}
|
||||||
|
public enum FOFireStatus
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 草稿 0
|
||||||
|
/// </summary>
|
||||||
|
[Description("草稿")]
|
||||||
|
Draft = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 审核中
|
||||||
|
/// </summary>
|
||||||
|
[Description("审核中")]
|
||||||
|
Approving = 5,
|
||||||
|
/// <summary>
|
||||||
|
/// 审核完成
|
||||||
|
/// </summary>
|
||||||
|
[Description("审核完成")]
|
||||||
|
ApprovingFinish = 6,
|
||||||
|
/// <summary>
|
||||||
|
/// 动火人员确认 10
|
||||||
|
/// </summary>
|
||||||
|
[Description("动火人员确认")]
|
||||||
|
Sign = 10,
|
||||||
|
/// <summary>
|
||||||
|
/// 审阅中 15
|
||||||
|
/// </summary>
|
||||||
|
[Description("审阅中")]
|
||||||
|
Reading = 15,
|
||||||
|
/// <summary>
|
||||||
|
/// 监护人 18
|
||||||
|
/// </summary>
|
||||||
|
[Description("监护人")]
|
||||||
|
Monitor = 18,
|
||||||
|
/// <summary>
|
||||||
|
/// 完工审阅 21
|
||||||
|
/// </summary>
|
||||||
|
[Description("完工审阅")]
|
||||||
|
ReadingFinish = 21,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已归档 30
|
||||||
|
/// </summary>
|
||||||
|
[Description("已归档")]
|
||||||
|
Archived = 30,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 已驳回 40
|
||||||
|
/// </summary>
|
||||||
|
[Description("已驳回")]
|
||||||
|
Rejected = 40
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -428,9 +428,10 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
|||||||
departmentList.ForEach(t =>
|
departmentList.ForEach(t =>
|
||||||
{
|
{
|
||||||
t.MineType = entity.MineType;
|
t.MineType = entity.MineType;
|
||||||
|
t.PRODUCTION_UNIT_ID = entity.PRODUCTION_UNIT_ID;
|
||||||
T_FM_DEPARTMENT_PRODUCTION_UNIT unit = new T_FM_DEPARTMENT_PRODUCTION_UNIT();
|
T_FM_DEPARTMENT_PRODUCTION_UNIT unit = new T_FM_DEPARTMENT_PRODUCTION_UNIT();
|
||||||
unit.ORG_ID = t.ORG_ID; unit.DEPARTMENT_ID = t.ID; unit.ENUMS_ID = enumList?.ID;
|
unit.ORG_ID = t.ORG_ID; unit.DEPARTMENT_ID = t.ID; unit.ENUMS_ID = enumList?.ID;
|
||||||
unit.Nav_Enums = null;
|
unit.Nav_Enums = null;unit.DEPART_UNIT_ID = entity.PRODUCTION_UNIT_ID;
|
||||||
unitList.Add(unit);
|
unitList.Add(unit);
|
||||||
if (t.Nav_ProdutionUnit != null && t.Nav_ProdutionUnit.Any())
|
if (t.Nav_ProdutionUnit != null && t.Nav_ProdutionUnit.Any())
|
||||||
{
|
{
|
||||||
@ -456,7 +457,7 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
|||||||
t.MineType = entity.MineType.ToString();
|
t.MineType = entity.MineType.ToString();
|
||||||
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
||||||
unit.ORG_ID = t.ORG_ID; unit.USER_ID = t.ID; unit.ENUMS_ID = enumList?.ID;
|
unit.ORG_ID = t.ORG_ID; unit.USER_ID = t.ID; unit.ENUMS_ID = enumList?.ID;
|
||||||
unit.Nav_Enums = null;
|
unit.Nav_Enums = null;unit.PRODUCTION_UNIT_ID = entity.PRODUCTION_UNIT_ID;
|
||||||
userUnitList.Add(unit);
|
userUnitList.Add(unit);
|
||||||
if (t.Nav_ProdutionUnit != null && t.Nav_ProdutionUnit.Any())
|
if (t.Nav_ProdutionUnit != null && t.Nav_ProdutionUnit.Any())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -660,13 +660,14 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var departInfo = this.GetEntity<T_FM_DEPARTMENT>(entity.DEPARTMENT_ID.ToString());
|
var departInfo = this.GetEntity<T_FM_DEPARTMENT>(entity.DEPARTMENT_ID.ToString());
|
||||||
if (departInfo != null && departInfo.MineType != null && !isAdd.Any())
|
if (departInfo != null && departInfo.PRODUCTION_UNIT_ID != null && departInfo.MineType != null && !isAdd.Any())
|
||||||
{
|
{
|
||||||
var enumList = this.GetEntity<T_FM_ENUMS>(t => t.CODE == "BSMineTypeEnum" && t.VALUE == departInfo.MineType);
|
var enumList = this.GetEntity<T_FM_ENUMS>(t => t.CODE == "BSMineTypeEnum" && t.VALUE == departInfo.MineType);
|
||||||
entity.MineType = departInfo.MineType.ToString();
|
entity.MineType = departInfo.MineType.ToString();
|
||||||
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
T_FM_USER_PRODUCTION_UNIT unit = new T_FM_USER_PRODUCTION_UNIT();
|
||||||
unit.ORG_ID = entity.ORG_ID; unit.USER_ID = entity.ID; unit.ENUMS_ID = enumList?.ID;
|
unit.ORG_ID = entity.ORG_ID; unit.USER_ID = entity.ID; unit.ENUMS_ID = enumList?.ID;
|
||||||
unit.Nav_Enums = null;
|
unit.Nav_Enums = null;
|
||||||
|
unit.PRODUCTION_UNIT_ID = departInfo.PRODUCTION_UNIT_ID;
|
||||||
entity.Nav_ProdutionUnit = new List<T_FM_USER_PRODUCTION_UNIT>();
|
entity.Nav_ProdutionUnit = new List<T_FM_USER_PRODUCTION_UNIT>();
|
||||||
entity.Nav_ProdutionUnit.Add(unit);
|
entity.Nav_ProdutionUnit.Add(unit);
|
||||||
}
|
}
|
||||||
@ -904,7 +905,7 @@ namespace APT.FM.WebApi.Controllers.Api.FM
|
|||||||
var enumValues = new List<string>();
|
var enumValues = new List<string>();
|
||||||
productionUnit.ForEach(t =>
|
productionUnit.ForEach(t =>
|
||||||
{
|
{
|
||||||
t.USER_ID = entity.ID; t.Nav_Enums = null;
|
t.USER_ID = entity.ID; t.Nav_Enums = null;t.Nav_Unit = null;
|
||||||
var value = enumList.FirstOrDefault(m => m.ID == t.ENUMS_ID)?.VALUE.ToString();
|
var value = enumList.FirstOrDefault(m => m.ID == t.ENUMS_ID)?.VALUE.ToString();
|
||||||
enumValues.Add(value);
|
enumValues.Add(value);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,5 +1,13 @@
|
|||||||
using APT.Infrastructure.Core;
|
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.Entities.FO;
|
||||||
|
using APT.MS.Domain.Enums;
|
||||||
using APT.Utility;
|
using APT.Utility;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
@ -14,6 +22,21 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
[Route("api/FO/FOFireJob")]
|
[Route("api/FO/FOFireJob")]
|
||||||
public partial class FireJobController : AuthorizeApiController<T_FO_FIRE_JOB>
|
public partial class FireJobController : AuthorizeApiController<T_FO_FIRE_JOB>
|
||||||
{
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
[HttpPost, Route("GetEdit")]
|
[HttpPost, Route("GetEdit")]
|
||||||
public JsonActionResult<T_FO_FIRE_JOB> GetEdit([FromBody] KeywordFilter filter)
|
public JsonActionResult<T_FO_FIRE_JOB> GetEdit([FromBody] KeywordFilter filter)
|
||||||
{
|
{
|
||||||
@ -23,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)
|
||||||
{
|
{
|
||||||
@ -124,6 +147,47 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
var userList = new List<T_FO_FIRE_JOB_USER>();
|
var userList = new List<T_FO_FIRE_JOB_USER>();
|
||||||
if (users != null && users.Any())
|
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)
|
foreach (var item in users)
|
||||||
{
|
{
|
||||||
item.ORG_ID = entity.ORG_ID;
|
item.ORG_ID = entity.ORG_ID;
|
||||||
@ -144,6 +208,10 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
userList.Add(item);
|
userList.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("作业人员不能为空");
|
||||||
|
}
|
||||||
var fireFiles = entity.Nav_FireFiles;
|
var fireFiles = entity.Nav_FireFiles;
|
||||||
if (fireFiles != null && fireFiles.Any())
|
if (fireFiles != null && fireFiles.Any())
|
||||||
{
|
{
|
||||||
@ -180,6 +248,63 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
monitorFileList.Add(item);
|
monitorFileList.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||||
|
{
|
||||||
|
//触发审批
|
||||||
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Approving;
|
||||||
|
entity.FIRE_STATUS = FOFireStatus.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], "FO043", param, entity.ID, "FO043_SHOWPRINT", entity.TaskID, true, () =>
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}, null, null, null, null, null, "FO043_SHOWPRINT", null, "动火作业工作票", FMTASKTYPE.JobSite);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
this.UnifiedCommit(() =>
|
this.UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
if (detailFileIds != null && detailFileIds.Any())
|
if (detailFileIds != null && detailFileIds.Any())
|
||||||
@ -220,5 +345,69 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
return true;
|
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/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,
|
||||||
|
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO043");
|
||||||
|
//当前节点其他审核人待办消除
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
427
APT.MicroApi/APT.FO.WebApi/Controllers/FireJobWbController.cs
Normal file
427
APT.MicroApi/APT.FO.WebApi/Controllers/FireJobWbController.cs
Normal file
@ -0,0 +1,427 @@
|
|||||||
|
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 dhCers = users.FirstOrDefault(t => t.USER_TYPE_ID == dhUser.ID && t.CERTIFICATE_CODE == null);
|
||||||
|
if (dhCers != null)
|
||||||
|
{
|
||||||
|
throw new Exception("动火操作人员必须填写证书编号");
|
||||||
|
}
|
||||||
|
var dhfiles = users.FirstOrDefault(t => t.USER_TYPE_ID == dhUser.ID &&(t.Nav_UserFiles == null || !t.Nav_UserFiles.Any()));
|
||||||
|
if (dhfiles != null)
|
||||||
|
{
|
||||||
|
throw new Exception("动火操作人员必须上传附件");
|
||||||
|
}
|
||||||
|
if (dhfiles != 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;
|
||||||
|
entity.FIRE_STATUS = FOFireStatus.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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -223,7 +223,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
//当班人员不等于自己的,触发签字确认单
|
//当班人员不等于自己的,触发签字确认单
|
||||||
var sendUserNames = allUsers.Where(t => sendUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => sendUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-交班人签字确认", entity.ID, entity.ORG_ID, sendUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-交班人签字确认", entity.ID, entity.ORG_ID, sendUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
entity.STATUS = FOStatusEnum.PreSign;
|
entity.STATUS = FOStatusEnum.PreSign;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -233,7 +233,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (detailUserIds != null && detailUserIds.Any())
|
if (detailUserIds != null && detailUserIds.Any())
|
||||||
{
|
{
|
||||||
var sendUserNames = allUsers.Where(t => detailUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => detailUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-现场责任人签字确认", entity.ID, entity.ORG_ID, detailUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-现场责任人签字确认", entity.ID, entity.ORG_ID, detailUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
entity.STATUS = FOStatusEnum.Sign;
|
entity.STATUS = FOStatusEnum.Sign;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -243,7 +243,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
//触发给接班人签字确认
|
//触发给接班人签字确认
|
||||||
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, entity.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, entity.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, entity.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
entity.STATUS = FOStatusEnum.SignAccept;
|
entity.STATUS = FOStatusEnum.SignAccept;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (detailUserIds != null && detailUserIds.Any())
|
if (detailUserIds != null && detailUserIds.Any())
|
||||||
{
|
{
|
||||||
var sendUserNames = allUsers.Where(t => detailUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => detailUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-现场责任人签字确认", entity.ID, record.ORG_ID, detailUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-现场责任人签字确认", entity.ID, record.ORG_ID, detailUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
record.STATUS = FOStatusEnum.Sign;
|
record.STATUS = FOStatusEnum.Sign;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -341,7 +341,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
//触发给接班人签字确认
|
//触发给接班人签字确认
|
||||||
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, record.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, record.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
record.STATUS = FOStatusEnum.SignAccept;
|
record.STATUS = FOStatusEnum.SignAccept;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -368,7 +368,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
//触发给接班人签字确认
|
//触发给接班人签字确认
|
||||||
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
var sendUserNames = allUsers.Where(t => afterUserIds.Contains(t.ID)).Select(m => m.NAME).ToList();
|
||||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, record.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO037_SHOWPRINT");
|
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels("领导带班下井记录-接班人签字确认", entity.ID, record.ORG_ID, afterUserIds, sendUserNames, DateTime.Now, record.JOB_END_DATE.Value, 1, "FO041_SHOWPRINT");
|
||||||
record.STATUS = FOStatusEnum.SignAccept;
|
record.STATUS = FOStatusEnum.SignAccept;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -400,7 +400,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (entity.TaskID != Guid.Empty)
|
if (entity.TaskID != Guid.Empty)
|
||||||
{
|
{
|
||||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||||
task.SOURCE_FORMCODE = "FO037_SHOWPRINT";
|
task.SOURCE_FORMCODE = "FO041_SHOWPRINT";
|
||||||
}
|
}
|
||||||
this.UnifiedCommit(() =>
|
this.UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,6 +73,10 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("交底内容必需填写");
|
throw new Exception("交底内容必需填写");
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(entity.CODE))
|
||||||
|
{
|
||||||
|
entity.CODE = "AQJD" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999);
|
||||||
|
}
|
||||||
entity.DisclosureContent = entity.DisclosureContent.Trim().Replace(" ", "");
|
entity.DisclosureContent = entity.DisclosureContent.Trim().Replace(" ", "");
|
||||||
if (persons != null && persons.Any())
|
if (persons != null && persons.Any())
|
||||||
{
|
{
|
||||||
@ -107,7 +111,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
//发消息
|
//发消息
|
||||||
DateTime dtEnd = NotificationTaskService.GetTaskEndTime(FMTASKTYPE.JobSite, entity.ORG_ID.Value, DateTime.Now, null, null);
|
DateTime dtEnd = NotificationTaskService.GetTaskEndTime(FMTASKTYPE.JobSite, entity.ORG_ID.Value, DateTime.Now, null, null);
|
||||||
notices = NotificationTaskService.InsertUserNoticeTaskModels("安全交底表确认" + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0'), entity.ID, entity.ORG_ID, userIds, UserNames, DateTime.Now,
|
notices = NotificationTaskService.InsertUserNoticeTaskModels("安全交底表确认" + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0'), entity.ID, entity.ORG_ID, userIds, UserNames, DateTime.Now,
|
||||||
dtEnd, (int)FMNoticeTypeEnum.消息, "FO033_SHOWPRINT");
|
dtEnd, (int)FMNoticeTypeEnum.消息, "FO037_SHOWPRINT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -161,7 +165,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (entity.TaskID != Guid.Empty)
|
if (entity.TaskID != Guid.Empty)
|
||||||
{
|
{
|
||||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||||
task.SOURCE_FORMCODE = "FO033_SHOWPRINT";
|
task.SOURCE_FORMCODE = "FO037_SHOWPRINT";
|
||||||
}
|
}
|
||||||
this.UnifiedCommit(() =>
|
this.UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@ -75,6 +75,10 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("交底内容必需填写");
|
throw new Exception("交底内容必需填写");
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(entity.CODE))
|
||||||
|
{
|
||||||
|
entity.CODE = "JSJD" + DateTime.Now.ToShortDateString().Replace("/", "") + new Random().Next(1, 999);
|
||||||
|
}
|
||||||
entity.DisclosureContent = entity.DisclosureContent.Trim().Replace(" ", "");
|
entity.DisclosureContent = entity.DisclosureContent.Trim().Replace(" ", "");
|
||||||
if (persons != null && persons.Any())
|
if (persons != null && persons.Any())
|
||||||
{
|
{
|
||||||
@ -109,7 +113,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
//发消息
|
//发消息
|
||||||
DateTime dtEnd = NotificationTaskService.GetTaskEndTime(FMTASKTYPE.JobSite, entity.ORG_ID.Value, DateTime.Now, null, null);
|
DateTime dtEnd = NotificationTaskService.GetTaskEndTime(FMTASKTYPE.JobSite, entity.ORG_ID.Value, DateTime.Now, null, null);
|
||||||
notices = NotificationTaskService.InsertUserNoticeTaskModels("技术交底表确认"+DateTime.Now.Month.ToString().PadLeft(2,'0') + DateTime.Now.Day.ToString().PadLeft(2, '0'), entity.ID, entity.ORG_ID, userIds, UserNames, DateTime.Now,
|
notices = NotificationTaskService.InsertUserNoticeTaskModels("技术交底表确认"+DateTime.Now.Month.ToString().PadLeft(2,'0') + DateTime.Now.Day.ToString().PadLeft(2, '0'), entity.ID, entity.ORG_ID, userIds, UserNames, DateTime.Now,
|
||||||
dtEnd, (int)FMNoticeTypeEnum.消息, "FO031_SHOWPRINT");
|
dtEnd, (int)FMNoticeTypeEnum.消息, "FO035_SHOWPRINT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -163,7 +167,7 @@ namespace APT.FO.WebApi.Controllers
|
|||||||
if (entity.TaskID != Guid.Empty)
|
if (entity.TaskID != Guid.Empty)
|
||||||
{
|
{
|
||||||
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||||
task.SOURCE_FORMCODE = "FO031_SHOWPRINT";
|
task.SOURCE_FORMCODE = "FO035_SHOWPRINT";
|
||||||
}
|
}
|
||||||
this.UnifiedCommit(() =>
|
this.UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1895,6 +1895,74 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 动火作业开始前半小时触发工作票给动火人员
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageFilter"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("FireJobSync")]
|
||||||
|
public JsonActionResult<bool> FireJobSync([FromBody] KeywordFilter filter)
|
||||||
|
{
|
||||||
|
return SafeExecute<bool>(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var notices = new List<T_FM_NOTIFICATION_TASK>();
|
||||||
|
var dt = DateTime.Now.AddMinutes(-30);
|
||||||
|
var userType = this.GetEntity<T_FO_USER_TYPE>(t => t.NAME == "动火操作人员");
|
||||||
|
var steps = this.GetEntities<T_HM_OPERATION_STEP>(t =>t.IS_DELETED ==false, new BaseFilter(filter.OrgId));
|
||||||
|
var users = this.GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0 && !t.CODE.Contains("admin"), new BaseFilter(filter.OrgId));
|
||||||
|
var jobs = this.GetEntities<T_FO_FIRE_JOB>(t => t.STATUS == BaseData.Domain.Enums.PF.PFStandardStatus.Archived && t.JOB_DATE <= dt, new BaseFilter(filter.OrgId), "Nav_Users");
|
||||||
|
if (userType!=null &&jobs != null && jobs.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in jobs)
|
||||||
|
{
|
||||||
|
var step = steps.FirstOrDefault(t => t.ID == item.OPERATION_STEP_ID);
|
||||||
|
if (item.Nav_Users != null && item.Nav_Users.Any())
|
||||||
|
{
|
||||||
|
var sendUser = item.Nav_Users.FirstOrDefault(t => t.USER_TYPE_ID == userType.ID);
|
||||||
|
if (sendUser != null)
|
||||||
|
{
|
||||||
|
var userName = users.FirstOrDefault(t => t.ID == sendUser.USER_ID)?.NAME;
|
||||||
|
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票" + step?.NAME, item.ID, item.ORG_ID, (Guid)sendUser.USER_ID, userName, DateTime.Now,
|
||||||
|
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO043");
|
||||||
|
notices.Add(notice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var jobWbs = this.GetEntities<T_FO_FIRE_JOB_WB>(t => t.STATUS == BaseData.Domain.Enums.PF.PFStandardStatus.Archived && t.JOB_DATE <= dt, new BaseFilter(filter.OrgId), "Nav_Users");
|
||||||
|
if (userType != null && jobWbs != null && jobWbs.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in jobs)
|
||||||
|
{
|
||||||
|
var step = steps.FirstOrDefault(t => t.ID == item.OPERATION_STEP_ID);
|
||||||
|
if (item.APPLY_USER_ID != null )
|
||||||
|
{
|
||||||
|
var userName = users.FirstOrDefault(t => t.ID == item.APPLY_USER_ID)?.NAME;
|
||||||
|
var notice = NotificationTaskService.InsertUserNoticeTaskModel("动火作业工作票(外包)" + step?.NAME, item.ID, item.ORG_ID, (Guid)item.APPLY_USER_ID, userName, DateTime.Now,
|
||||||
|
DateTime.Now.AddHours(24), (int)FMNoticeTypeEnum.消息, "FO045");
|
||||||
|
notices.Add(notice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UnifiedCommit(() =>
|
||||||
|
{
|
||||||
|
if (notices != null && notices.Any())
|
||||||
|
BantchSaveEntityNoCommit(notices);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(ex.StackTrace))
|
||||||
|
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
|
||||||
|
else
|
||||||
|
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1100,6 +1100,7 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
T_SK_RISK_IDENTIFY_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_DETAIL();
|
T_SK_RISK_IDENTIFY_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_DETAIL();
|
||||||
ideDetail.ORG_ID = filter.OrgId;
|
ideDetail.ORG_ID = filter.OrgId;
|
||||||
ideDetail.RISK_IDENTIFY_ID = ide.ID;
|
ideDetail.RISK_IDENTIFY_ID = ide.ID;
|
||||||
|
ideDetail.ENTERPRISE_LIBRARY_ID = library?.ID;
|
||||||
ideDetail.PRODUCTION_UNIT_ID = library?.PRODUCTION_UNIT_ID;
|
ideDetail.PRODUCTION_UNIT_ID = library?.PRODUCTION_UNIT_ID;
|
||||||
ideDetail.MineType = library == null ? SKProductionUnit.Mine : library.MineType;
|
ideDetail.MineType = library == null ? SKProductionUnit.Mine : library.MineType;
|
||||||
ideDetail.AREA_ID = library?.AREA_ID;
|
ideDetail.AREA_ID = library?.AREA_ID;
|
||||||
@ -1354,6 +1355,7 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
T_SK_RISK_IDENTIFY_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_DETAIL();
|
T_SK_RISK_IDENTIFY_DETAIL ideDetail = new T_SK_RISK_IDENTIFY_DETAIL();
|
||||||
ideDetail.ORG_ID = filter.OrgId;
|
ideDetail.ORG_ID = filter.OrgId;
|
||||||
ideDetail.RISK_IDENTIFY_ID = ide.ID;
|
ideDetail.RISK_IDENTIFY_ID = ide.ID;
|
||||||
|
ideDetail.ENTERPRISE_LIBRARY_ID = library?.ID;
|
||||||
ideDetail.PRODUCTION_UNIT_ID = library?.PRODUCTION_UNIT_ID;
|
ideDetail.PRODUCTION_UNIT_ID = library?.PRODUCTION_UNIT_ID;
|
||||||
ideDetail.MineType = library == null ? SKProductionUnit.Mine : library.MineType;
|
ideDetail.MineType = library == null ? SKProductionUnit.Mine : library.MineType;
|
||||||
ideDetail.AREA_ID = library?.AREA_ID;
|
ideDetail.AREA_ID = library?.AREA_ID;
|
||||||
@ -1524,6 +1526,10 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安环部负责人"));
|
user = users.FirstOrDefault(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安环部负责人"));
|
||||||
}
|
}
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
user = users.FirstOrDefault(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("总经理"));
|
||||||
|
}
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
//判断是否已触发过
|
//判断是否已触发过
|
||||||
@ -1651,31 +1657,18 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
//负责人
|
//负责人
|
||||||
var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
var departUser = departs.FirstOrDefault(t => t.ID == de);
|
||||||
var departUser = departs.FirstOrDefault(t => t.ID == parentId);
|
|
||||||
if (departUser != null && departUser.USER_ID != null)
|
if (departUser != null && departUser.USER_ID != null)
|
||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
//当前层级安全员和负责人都找不到,找一次上级安全员和负责人
|
|
||||||
if (user == null)
|
|
||||||
{
|
{
|
||||||
var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
//找公司
|
||||||
if (parentId != null)
|
var companyInfo = departs.FirstOrDefault(t => t.ID == departUser?.PARENT_ID);
|
||||||
|
if (companyInfo != null && companyInfo.USER_ID != null)
|
||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.DEPARTMENT_ID == parentId && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全员"));
|
user = users.FirstOrDefault(t => t.ID == companyInfo.USER_ID);
|
||||||
if (user == null)
|
|
||||||
{
|
|
||||||
//负责人
|
|
||||||
var departUser = departs.FirstOrDefault(t => t.ID == parentId);
|
|
||||||
if (departUser != null)
|
|
||||||
{
|
|
||||||
if (departUser.USER_ID != null)
|
|
||||||
{
|
|
||||||
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1807,12 +1800,13 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
//每个车间汇总班组和车间
|
//每个车间汇总班组和车间
|
||||||
foreach (var de in tempIds)
|
foreach (var de in tempIds)
|
||||||
{
|
{
|
||||||
|
//车间
|
||||||
var user = users.FirstOrDefault(t => t.DEPARTMENT_ID == de && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全员"));
|
var user = users.FirstOrDefault(t => t.DEPARTMENT_ID == de && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全员"));
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
//负责人
|
//负责人
|
||||||
var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
//var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
||||||
var departUser = departs.FirstOrDefault(t => t.ID == parentId);
|
var departUser = departs.FirstOrDefault(t => t.ID == de);
|
||||||
if (departUser != null && departUser.USER_ID!=null)
|
if (departUser != null && departUser.USER_ID!=null)
|
||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
||||||
@ -1821,21 +1815,31 @@ namespace APT.PP.WebApi.Controllers.Api
|
|||||||
//当前层级安全员和负责人都找不到,找一次上级安全员和负责人
|
//当前层级安全员和负责人都找不到,找一次上级安全员和负责人
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
|
//找部门
|
||||||
var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
var parentId = departs.FirstOrDefault(t => t.ID == de)?.PARENT_ID;
|
||||||
if (parentId != null)
|
if (parentId != null)
|
||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.DEPARTMENT_ID == parentId && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全员"));
|
user = users.FirstOrDefault(t => t.DEPARTMENT_ID == parentId && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("安全员"));
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
//负责人
|
//部门负责人
|
||||||
var departUser = departs.FirstOrDefault(t => t.ID == parentId);
|
var departUser = departs.FirstOrDefault(t => t.ID == parentId);
|
||||||
if (departUser != null)
|
if (departUser != null && departUser.USER_ID!=null)
|
||||||
{
|
{
|
||||||
if (departUser.USER_ID != null)
|
if (departUser.USER_ID != null)
|
||||||
{
|
{
|
||||||
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
user = users.FirstOrDefault(t => t.ID == departUser.USER_ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//找公司
|
||||||
|
var companyInfo = departs.FirstOrDefault(t => t.ID == parentId);
|
||||||
|
if (companyInfo != null && companyInfo.USER_ID != null)
|
||||||
|
{
|
||||||
|
user = users.FirstOrDefault(t => t.ID == companyInfo.USER_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1293,6 +1293,15 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
item.Rules.Remove(value);
|
item.Rules.Remove(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var rules = pageFilter.FilterGroup.Rules.ToList();
|
||||||
|
foreach (var item in rules)
|
||||||
|
{
|
||||||
|
if (item.Field == "DEPARTMENT_ID")
|
||||||
|
{
|
||||||
|
filterValue = item.Value.ToString();
|
||||||
|
pageFilter.FilterGroup.Rules.Remove(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(filterValue))
|
if (!string.IsNullOrEmpty(filterValue))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -78,7 +78,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
foreach (var item in details)
|
foreach (var item in details)
|
||||||
{
|
{
|
||||||
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
||||||
&& t.EMERGENCY == item.EMERGENCY);
|
&& t.EMERGENCY == item.EMERGENCY && t.ENABLE_STATUS == item.ENABLE_STATUS);
|
||||||
if (temp == null && item.MARK != SKMarkEnum.Add)
|
if (temp == null && item.MARK != SKMarkEnum.Add)
|
||||||
{
|
{
|
||||||
item.MARK = SKMarkEnum.Update;
|
item.MARK = SKMarkEnum.Update;
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
foreach (var item in details)
|
foreach (var item in details)
|
||||||
{
|
{
|
||||||
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
||||||
&& t.EMERGENCY == item.EMERGENCY);
|
&& t.EMERGENCY == item.EMERGENCY && t.ENABLE_STATUS == item.ENABLE_STATUS);
|
||||||
if (temp == null && item.MARK != SKMarkEnum.Add)
|
if (temp == null && item.MARK != SKMarkEnum.Add)
|
||||||
{
|
{
|
||||||
item.MARK = SKMarkEnum.Update;
|
item.MARK = SKMarkEnum.Update;
|
||||||
|
|||||||
@ -94,7 +94,7 @@ namespace APT.SK.WebApi.Controllers.Api
|
|||||||
foreach (var item in details)
|
foreach (var item in details)
|
||||||
{
|
{
|
||||||
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
var temp = record.Nav_Details.FirstOrDefault(t => t.PRODUCTION_UNIT_ID == item.PRODUCTION_UNIT_ID && t.AREA_ID == item.AREA_ID && t.TYPE_ID == item.TYPE_ID && t.RISK_NAME == item.RISK_NAME && t.RISK_DESCRIPTION == item.RISK_DESCRIPTION && t.MEASURE == item.MEASURE
|
||||||
&& t.EMERGENCY == item.EMERGENCY && t.DEPARTMENT_TYPE == item.DEPARTMENT_TYPE && t.IDENTIFY_DEPARTMENT == item.IDENTIFY_DEPARTMENT && t.IDENTIFY_POST == item.IDENTIFY_POST);
|
&& t.EMERGENCY == item.EMERGENCY && t.DEPARTMENT_TYPE == item.DEPARTMENT_TYPE && t.IDENTIFY_DEPARTMENT == item.IDENTIFY_DEPARTMENT && t.IDENTIFY_POST == item.IDENTIFY_POST && t.ENABLE_STATUS == item.ENABLE_STATUS);
|
||||||
if (temp == null && item.MARK != SKMarkEnum.Add)
|
if (temp == null && item.MARK != SKMarkEnum.Add)
|
||||||
{
|
{
|
||||||
item.MARK = SKMarkEnum.Update;
|
item.MARK = SKMarkEnum.Update;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user