加字段
This commit is contained in:
parent
c5c2e39ab1
commit
403cfeb4a8
136996
APT.Data.Migrations/Migrations/20251207110557_hmr2025120701.Designer.cs
generated
Normal file
136996
APT.Data.Migrations/Migrations/20251207110557_hmr2025120701.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace APT.Data.Migrations.Migrations
|
||||
{
|
||||
public partial class hmr2025120701 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IS_AUTO",
|
||||
table: "T_SK_CHECK_SET",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IS_HOLIDAY",
|
||||
table: "T_FO_FIRE_JOB_WB",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IS_HOLIDAY",
|
||||
table: "T_FO_FIRE_JOB",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "NEXT_CLASS_TEAM_ID",
|
||||
table: "T_FO_CURRENT_CLASS_RECORD",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "CLASS_TEAM_ID",
|
||||
table: "T_FO_CURRENT_CLASS_RECORD",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IS_AUTO",
|
||||
table: "T_SK_CHECK_SET");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IS_HOLIDAY",
|
||||
table: "T_FO_FIRE_JOB_WB");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IS_HOLIDAY",
|
||||
table: "T_FO_FIRE_JOB");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "NEXT_CLASS_TEAM_ID",
|
||||
table: "T_FO_CURRENT_CLASS_RECORD",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "CLASS_TEAM_ID",
|
||||
table: "T_FO_CURRENT_CLASS_RECORD",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32558,7 +32558,7 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<Guid?>("CLASS_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("CLASS_TEAM_ID")
|
||||
b.Property<Guid?>("CLASS_TEAM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CODE")
|
||||
@ -32648,7 +32648,7 @@ namespace APT.Data.Migrations.Migrations
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<Guid>("NEXT_CLASS_TEAM_ID")
|
||||
b.Property<Guid?>("NEXT_CLASS_TEAM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ORG_ID")
|
||||
@ -33013,6 +33013,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<int?>("IS_FIRE")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IS_HOLIDAY")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int?>("IS_LEAVE")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -33679,6 +33682,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<int?>("IS_FIRE")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IS_HOLIDAY")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int?>("IS_LEAVE")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -77105,6 +77111,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<Guid?>("FORM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IS_AUTO")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IS_DELETED")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@ -108602,8 +108611,7 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_TEAM", "Nav_Team")
|
||||
.WithMany()
|
||||
.HasForeignKey("CLASS_TEAM_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_DEPARTMENT", "Nav_Department")
|
||||
.WithMany()
|
||||
|
||||
@ -11,7 +11,7 @@ namespace APT.MS.Domain.Entities.FO
|
||||
/// 岗位当班工作记录表
|
||||
/// </summary>
|
||||
[Description("岗位当班工作记录表")]
|
||||
[DataRuleField("Nav_Team.DEPARTMENT_ID")]
|
||||
//[DataRuleField("Nav_Team.DEPARTMENT_ID")]
|
||||
public class T_FO_CURRENT_CLASS_RECORD : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
@ -292,14 +292,14 @@ namespace APT.MS.Domain.Entities.FO
|
||||
/// 下个排班排班表ID
|
||||
/// </summary>
|
||||
[Description("下个排班排班表ID")]
|
||||
public Guid NEXT_CLASS_TEAM_ID { get; set; }
|
||||
public Guid? NEXT_CLASS_TEAM_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 当前班组ID
|
||||
/// </summary>
|
||||
[Description("当前班组ID")]
|
||||
[FormFieldTable]
|
||||
[DataFieldForeignKey("Nav_Team")]
|
||||
public Guid CLASS_TEAM_ID { get; set; }
|
||||
public Guid? CLASS_TEAM_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 班组
|
||||
/// </summary>
|
||||
|
||||
@ -247,5 +247,8 @@ namespace APT.MS.Domain.Entities.FO
|
||||
public FOFireStatus FIRE_STATUS { get; set; }
|
||||
[Description("是否已触发")]
|
||||
public bool IS_RUN { get; set; } = false;
|
||||
|
||||
[Description("是否节假日")]
|
||||
public bool IS_HOLIDAY { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,5 +261,7 @@ namespace APT.MS.Domain.Entities.FO
|
||||
|
||||
[Description("是否已触发")]
|
||||
public bool IS_RUN { get; set; } = false;
|
||||
[Description("是否节假日")]
|
||||
public bool IS_HOLIDAY { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,5 +80,8 @@ namespace APT.MS.Domain.Entities.SK
|
||||
[Description("检查人")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_SK_CHECK_SET_USER> Nav_CheckUsers { get; set; }
|
||||
[Description("是否自动触发")]
|
||||
public bool IS_AUTO { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
entity.CLASS_TEAM_ID = team.ID;
|
||||
}
|
||||
}
|
||||
if (entity.CLASS_TEAM_ID == Guid.Empty || entity.DEPARTMENT_POST_ID == null)
|
||||
if (entity.DEPARTMENT_POST_ID == Guid.Empty || entity.DEPARTMENT_POST_ID == null)
|
||||
{
|
||||
entity.DEPARTMENT_POST_ID = currFMUser.Nav_Person.POST_ID;
|
||||
}
|
||||
|
||||
@ -2084,36 +2084,39 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
{
|
||||
dt = DateTime.Parse(filter.Parameter1);
|
||||
}
|
||||
var newFilter = new KeywordFilter();
|
||||
newFilter.OrgId = filter.OrgId;
|
||||
newFilter.IgnoreDataRule = true;
|
||||
var departs = this.GetEntities<T_FM_DEPARTMENT>(t => t.ENABLE_STATUS == 0, new BaseFilter(filter.OrgId));
|
||||
var fmClass = this.GetEntities<T_FM_CLASS>(t => t.ENABLE_STATUS == 0, new BaseFilter(filter.OrgId), "Nav_ClassDetail");
|
||||
var users = this.GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0 && !t.CODE.Contains("admin"), new BaseFilter(filter.OrgId), "Nav_Person.Nav_Post");
|
||||
var records = this.GetEntities<T_FO_CURRENT_CLASS_RECORD>(t => t.CREATE_TIME.Value.Date == DateTime.Now.Date, new BaseFilter(filter.OrgId));
|
||||
var preClass = this.GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD>(t => t.CREATE_TIME.Value.Date == DateTime.Now.Date && t.DEPARTMENT_SCHEDULING_ID == null, new BaseFilter(filter.OrgId));
|
||||
var records = this.GetEntities<T_FO_CURRENT_CLASS_RECORD>(t => t.RECORD_DATE.Date == dt.Date, newFilter);
|
||||
var preClass = this.GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD>(t => t.START_TIME.Date == dt.Date && t.DEPARTMENT_SCHEDULING_ID == null, newFilter);
|
||||
var preClassIds = preClass.Select(t => t.ID).ToList();
|
||||
var preClassUsers = this.GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(t => preClassIds.Contains(t.PRE_SHIFT_MEETING_RECORD_ID), new BaseFilter(filter.OrgId));
|
||||
var preClassUsers = this.GetEntities<T_FO_PRE_SHIFT_MEETING_RECORD_USER>(t => preClassIds.Contains(t.PRE_SHIFT_MEETING_RECORD_ID), newFilter);
|
||||
if (preClass != null && preClass.Any())
|
||||
{
|
||||
foreach (var item in preClass)
|
||||
{
|
||||
var classFisrt = fmClass.FirstOrDefault(t => t.ID == item.CLASS_ID);
|
||||
if (classFisrt != null && classFisrt.Nav_ClassDetail != null && classFisrt.Nav_ClassDetail.Any())
|
||||
{
|
||||
var firstRecord = records.FirstOrDefault(t => t.CLASS_ID == item.CLASS_ID);
|
||||
var firstTime = classFisrt.Nav_ClassDetail.OrderBy(t => t.NUM).FirstOrDefault();
|
||||
if (firstTime.ENDTIME.Hour == dt.AddHours(1).Hour && firstRecord == null)
|
||||
|
||||
|
||||
if (item.END_TIME != DateTime.MinValue && item.END_TIME.Hour == dt.AddHours(1).Hour)
|
||||
{
|
||||
var userIds = preClassUsers.Where(t => t.PRE_SHIFT_MEETING_RECORD_ID == item.ID).Select(m => m.USER_ID).Distinct().ToList();
|
||||
var sendUsers = users.Where(t => userIds.Contains(t.ID) && t.Nav_Person != null).ToList();
|
||||
if (sendUsers != null && sendUsers.Any())
|
||||
{
|
||||
foreach (var user in sendUsers)
|
||||
{
|
||||
var firstRecord = records.FirstOrDefault(t => t.EDITOR_ID == user.ID);
|
||||
if (firstRecord == null)
|
||||
{
|
||||
var depart = departs.FirstOrDefault(t => t.ID == user.DEPARTMENT_ID);
|
||||
T_FO_CURRENT_CLASS_RECORD record = new T_FO_CURRENT_CLASS_RECORD();
|
||||
record.ORG_ID = item.ORG_ID;
|
||||
record.NAME = dt.ToShortDateString() + depart?.NAME + "-" + user?.Nav_Person?.Nav_Post?.NAME + "当班工作记录";
|
||||
record.EDITOR_ID = user.ID;
|
||||
record.RECORD_DATE = Convert.ToDateTime(dt.Date.ToShortDateString() +" "+ firstTime.ENDTIME.ToShortTimeString());
|
||||
record.RECORD_DATE = Convert.ToDateTime(dt.Date.ToShortDateString() + " " + item.END_TIME.ToShortTimeString());
|
||||
record.CLASS_ID = item.CLASS_ID;
|
||||
record.DEPARTMENT_ID = user.DEPARTMENT_ID;
|
||||
record.DEPARTMENT_POST_ID = user?.Nav_Person?.POST_ID;
|
||||
|
||||
@ -81,6 +81,10 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
checkUsers = checkUsers.Where(t => !t.IS_DELETED).ToList();
|
||||
checkUsers.ForEach(t => t.Nav_User = null);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("检查人员必须填写");
|
||||
}
|
||||
if (details != null && details.Any())
|
||||
{
|
||||
foreach (var item in details)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user