ออกคำสี่ง สรุปผลวินัย
This commit is contained in:
parent
d5a78f2d0f
commit
36395c20f2
9 changed files with 10493 additions and 8953 deletions
|
|
@ -194,38 +194,38 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates;
|
||||
_context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates);
|
||||
if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
{
|
||||
foreach (var item in req.persons)
|
||||
{
|
||||
var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault();
|
||||
data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add(
|
||||
new DisciplineDisciplinary_ProfileComplaintInvestigate
|
||||
{
|
||||
CitizenId = item.idcard,
|
||||
Prefix = item.prefix,
|
||||
FirstName = item.firstName,
|
||||
LastName = item.lastName,
|
||||
Organization = item.organization,
|
||||
Position = item.position,
|
||||
PositionLevel = item.positionLevel,
|
||||
Salary = item.salary,
|
||||
PersonId = item.personId,
|
||||
PosNo = item.posNo,
|
||||
Status = "NEW",
|
||||
IsReport = isReport == null ? false : isReport.IsReport,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
// var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates;
|
||||
// _context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates);
|
||||
// if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
// {
|
||||
// foreach (var item in req.persons)
|
||||
// {
|
||||
// var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault();
|
||||
// data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add(
|
||||
// new DisciplineDisciplinary_ProfileComplaintInvestigate
|
||||
// {
|
||||
// CitizenId = item.idcard,
|
||||
// Prefix = item.prefix,
|
||||
// FirstName = item.firstName,
|
||||
// LastName = item.lastName,
|
||||
// Organization = item.organization,
|
||||
// Position = item.position,
|
||||
// PositionLevel = item.positionLevel,
|
||||
// Salary = item.salary,
|
||||
// PersonId = item.personId,
|
||||
// PosNo = item.posNo,
|
||||
// Status = "NEW",
|
||||
// IsReport = isReport == null ? false : isReport.IsReport,
|
||||
// CreatedFullName = FullName ?? "System Administrator",
|
||||
// CreatedUserId = UserId ?? "",
|
||||
// CreatedAt = DateTime.Now,
|
||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
||||
// LastUpdateUserId = UserId ?? "",
|
||||
// LastUpdatedAt = DateTime.Now,
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
|
|
@ -459,6 +459,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
PosNo = p.PosNo,
|
||||
Organization = p.Organization,
|
||||
IsSend = p.IsReport,
|
||||
Status = p.Status,
|
||||
StatusDiscard = p.StatusDiscard,
|
||||
Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false,
|
||||
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
|
|
@ -676,7 +678,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
Salary = item.salary,
|
||||
PersonId = item.personId,
|
||||
PosNo = item.posNo,
|
||||
Status = "NEW",
|
||||
Status = isReport == null ? "NEW" : isReport.Status,
|
||||
StatusDiscard = isReport == null ? "NEW" : isReport.StatusDiscard,
|
||||
IsReport = isReport == null ? false : isReport.IsReport,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
|
|
@ -1460,8 +1463,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("suspend/{id:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id)
|
||||
[HttpPut("suspend/{id:length(36)}/{commandTypeId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id, Guid commandTypeId)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||
|
|
@ -1474,7 +1477,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId).FirstOrDefault();
|
||||
var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId && x.Status == "NEW").FirstOrDefault();
|
||||
if (personIdDupicate == null)
|
||||
continue;
|
||||
if (personIdDupicate.DisciplineReport_Profiles.Count() > 0)
|
||||
|
|
@ -1500,7 +1503,43 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
item.Status = "SUSPEND";
|
||||
item.CommandTypeId = commandTypeId;
|
||||
item.Status = "REPORT";
|
||||
item.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
item.LastUpdateUserId = UserId ?? "";
|
||||
item.LastUpdatedAt = DateTime.Now;
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// สั่งรายชื่อไปออกคำสั่งงดโทษ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("discard/{id:length(36)}/{commandTypeId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PostToDiscard([FromBody] DisciplinePersonIdRequest req, Guid id, Guid commandTypeId)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
var personIdDupicate = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.PersonId == item.PersonId && x.Status == "REPORT" && x.StatusDiscard == "NEW").FirstOrDefault();
|
||||
if (personIdDupicate == null)
|
||||
continue;
|
||||
item.CommandTypeDiscardId = commandTypeId;
|
||||
item.StatusDiscard = "REPORT";
|
||||
item.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
item.LastUpdateUserId = UserId ?? "";
|
||||
item.LastUpdatedAt = DateTime.Now;
|
||||
|
|
|
|||
|
|
@ -571,6 +571,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
Position = item.Position,
|
||||
PositionLevel = item.PositionLevel,
|
||||
Status = "NEW",
|
||||
StatusDiscard = "NEW",
|
||||
IsReport = false,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public string? Status { get; set; }
|
||||
[Comment("ประเภทออกคำสั่ง")]
|
||||
public Guid? CommandTypeId { get; set; }
|
||||
[Comment("สถานะออกคำสั่งงดโทด")]
|
||||
public string? StatusDiscard { get; set; }
|
||||
[Comment("ประเภทออกคำสั่งงดโทด")]
|
||||
public Guid? CommandTypeDiscardId { get; set; }
|
||||
[Comment("ส่งไปยุติเรื่อง")]
|
||||
public bool IsReport { get; set; } = false;
|
||||
[Required, Comment("Id เรื่องสอบสวน")]
|
||||
|
|
|
|||
2964
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.Designer.cs
generated
Normal file
2964
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231219171600_delete tavle metadata.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableDisciplineDisciplinarysaddStatusDiscard : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "CommandTypeDiscardId",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
comment: "ประเภทออกคำสั่งงดโทด",
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "StatusDiscard",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สถานะออกคำสั่งงดโทด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CommandTypeDiscardId",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StatusDiscard",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -50,107 +50,107 @@ namespace BMA.EHR.Infrastructure.Persistence
|
|||
|
||||
#endregion
|
||||
|
||||
#region " Meta Data "
|
||||
// #region " Meta Data "
|
||||
|
||||
public DbSet<Prefix> Prefixes { get; set; }
|
||||
// public DbSet<Prefix> Prefixes { get; set; }
|
||||
|
||||
public DbSet<BloodGroup> BloodGroups { get; set; }
|
||||
// public DbSet<BloodGroup> BloodGroups { get; set; }
|
||||
|
||||
public DbSet<Gender> Genders { get; set; }
|
||||
// public DbSet<Gender> Genders { get; set; }
|
||||
|
||||
public DbSet<PhysicalStatus> PhysicalStatuses { get; set; }
|
||||
// public DbSet<PhysicalStatus> PhysicalStatuses { get; set; }
|
||||
|
||||
public DbSet<Religion> Religions { get; set; }
|
||||
// public DbSet<Religion> Religions { get; set; }
|
||||
|
||||
public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
// public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
|
||||
public DbSet<PositionPath> PositionPaths { get; set; }
|
||||
// public DbSet<PositionPath> PositionPaths { get; set; }
|
||||
|
||||
public DbSet<PositionType> PositionTypes { get; set; }
|
||||
// public DbSet<PositionType> PositionTypes { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeePosition> PositionEmployeePositions { get; set; }
|
||||
// public DbSet<PositionEmployeePosition> PositionEmployeePositions { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeePositionSide> PositionEmployeePositionSides { get; set; }
|
||||
// public DbSet<PositionEmployeePositionSide> PositionEmployeePositionSides { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeGroup> PositionEmployeeGroups { get; set; }
|
||||
// public DbSet<PositionEmployeeGroup> PositionEmployeeGroups { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeLine> PositionEmployeeLines { get; set; }
|
||||
// public DbSet<PositionEmployeeLine> PositionEmployeeLines { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeLevel> PositionEmployeeLevels { get; set; }
|
||||
// public DbSet<PositionEmployeeLevel> PositionEmployeeLevels { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeStatus> PositionEmployeeStatuses { get; set; }
|
||||
// public DbSet<PositionEmployeeStatus> PositionEmployeeStatuses { get; set; }
|
||||
|
||||
public DbSet<PositionLine> PositionLines { get; set; }
|
||||
// public DbSet<PositionLine> PositionLines { get; set; }
|
||||
|
||||
public DbSet<PositionExecutive> PositionExecutives { get; set; }
|
||||
// public DbSet<PositionExecutive> PositionExecutives { get; set; }
|
||||
|
||||
public DbSet<PositionStatus> PositionStatuss { get; set; }
|
||||
// public DbSet<PositionStatus> PositionStatuss { get; set; }
|
||||
|
||||
public DbSet<PositionLevel> PositionLevels { get; set; }
|
||||
// public DbSet<PositionLevel> PositionLevels { get; set; }
|
||||
|
||||
public DbSet<Relationship> Relationships { get; set; }
|
||||
// public DbSet<Relationship> Relationships { get; set; }
|
||||
|
||||
public DbSet<Position> Positions { get; set; }
|
||||
// public DbSet<Position> Positions { get; set; }
|
||||
|
||||
public DbSet<PositionPathSide> PositionPathSides { get; set; }
|
||||
// public DbSet<PositionPathSide> PositionPathSides { get; set; }
|
||||
|
||||
public DbSet<PositionExecutiveSide> PositionExecutiveSides { get; set; }
|
||||
// public DbSet<PositionExecutiveSide> PositionExecutiveSides { get; set; }
|
||||
|
||||
public DbSet<InsigniaType> InsigniaTypes { get; set; }
|
||||
// public DbSet<InsigniaType> InsigniaTypes { get; set; }
|
||||
|
||||
public DbSet<Insignia> Insignias { get; set; }
|
||||
// public DbSet<Insignia> Insignias { get; set; }
|
||||
|
||||
public DbSet<Province> Provinces { get; set; }
|
||||
// public DbSet<Province> Provinces { get; set; }
|
||||
|
||||
public DbSet<District> Districts { get; set; }
|
||||
// public DbSet<District> Districts { get; set; }
|
||||
|
||||
public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
// public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
|
||||
public DbSet<Holiday> Holidays { get; set; }
|
||||
// public DbSet<Holiday> Holidays { get; set; }
|
||||
|
||||
public DbSet<OrganizationType> OrganizationTypes { get; set; }
|
||||
// public DbSet<OrganizationType> OrganizationTypes { get; set; }
|
||||
|
||||
public DbSet<OrganizationLevel> OrganizationLevels { get; set; }
|
||||
// public DbSet<OrganizationLevel> OrganizationLevels { get; set; }
|
||||
|
||||
public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
|
||||
// public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
|
||||
|
||||
public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
|
||||
// public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
|
||||
|
||||
public DbSet<OrganizationStatus> OrganizationStatuses { get; set; }
|
||||
// public DbSet<OrganizationStatus> OrganizationStatuses { get; set; }
|
||||
|
||||
public DbSet<OrganizationAgency> OrganizationAgencys { get; set; }
|
||||
// public DbSet<OrganizationAgency> OrganizationAgencys { get; set; }
|
||||
|
||||
public DbSet<OrganizationGovernmentAgency> OrganizationGovernmentAgencys { get; set; }
|
||||
// public DbSet<OrganizationGovernmentAgency> OrganizationGovernmentAgencys { get; set; }
|
||||
|
||||
public DbSet<OrganizationTelExternal> OrganizationTelExternals { get; set; }
|
||||
// public DbSet<OrganizationTelExternal> OrganizationTelExternals { get; set; }
|
||||
|
||||
public DbSet<OrganizationTelInternal> OrganizationTelInternals { get; set; }
|
||||
// public DbSet<OrganizationTelInternal> OrganizationTelInternals { get; set; }
|
||||
|
||||
public DbSet<OrganizationFax> OrganizationFaxs { get; set; }
|
||||
// public DbSet<OrganizationFax> OrganizationFaxs { get; set; }
|
||||
|
||||
public DbSet<RoyalHierarchy> RoyalHierarchys { get; set; }
|
||||
// public DbSet<RoyalHierarchy> RoyalHierarchys { get; set; }
|
||||
|
||||
public DbSet<RoyalType> RoyalTypes { get; set; }
|
||||
// public DbSet<RoyalType> RoyalTypes { get; set; }
|
||||
|
||||
public DbSet<Royal> Royals { get; set; }
|
||||
// public DbSet<Royal> Royals { get; set; }
|
||||
|
||||
#endregion
|
||||
// #endregion
|
||||
|
||||
#region " Organizations "
|
||||
// #region " Organizations "
|
||||
|
||||
public DbSet<AvailablePositionLevelEntity> AvailablePositionLevels { get; set; }
|
||||
// public DbSet<AvailablePositionLevelEntity> AvailablePositionLevels { get; set; }
|
||||
|
||||
public DbSet<PositionMasterEntity> PositionMasters { get; set; }
|
||||
// public DbSet<PositionMasterEntity> PositionMasters { get; set; }
|
||||
|
||||
public DbSet<OrganizationEntity> Organizations { get; set; }
|
||||
// public DbSet<OrganizationEntity> Organizations { get; set; }
|
||||
|
||||
public DbSet<PositionNumberEntity> PositionNumbers { get; set; }
|
||||
// public DbSet<PositionNumberEntity> PositionNumbers { get; set; }
|
||||
|
||||
public DbSet<OrganizationPositionEntity> OrganizationPositions { get; set; }
|
||||
// public DbSet<OrganizationPositionEntity> OrganizationPositions { get; set; }
|
||||
|
||||
public DbSet<ProfilePosition> ProfilePositions { get; set; }
|
||||
// public DbSet<ProfilePosition> ProfilePositions { get; set; }
|
||||
|
||||
#endregion
|
||||
// #endregion
|
||||
|
||||
public DisciplineDbContext(DbContextOptions<DisciplineDbContext> options) : base(options)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue