แจ้งเตือนเครื่องราช
This commit is contained in:
parent
70e59fb04c
commit
6ad93161c8
10 changed files with 33094 additions and 265 deletions
|
|
@ -5858,259 +5858,261 @@ namespace BMA.EHR.Application.Repositories
|
|||
Status = h.Status,
|
||||
RequestNote = h.ReasonReject,
|
||||
Reason = h.Reason,
|
||||
MarkALert = h.MarkALert == null ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(h.MarkALert),
|
||||
MarkDiscipline = h.MarkDiscipline,
|
||||
MarkLeave = h.MarkLeave,
|
||||
MarkRate = h.MarkRate,
|
||||
// Docs = GetDocFile(h.Profile.Id),
|
||||
MatchingConditions = h.MatchingConditions == null ? null : JsonConvert.DeserializeObject<List<MatchingCondition>>(h.MatchingConditions)
|
||||
})).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
// เช็คข้อมูลนำเข้า กับข้อมูลที่อยู่ใน database
|
||||
// public async List<InsigniaRequestProfile> GetDuplicate(List<InsigniaRequestProfile> income, Guid period, Guid ocId, bool Duplicate = false)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var id = GetRequestId(period, ocId);
|
||||
// เช็คข้อมูลนำเข้า กับข้อมูลที่อยู่ใน database
|
||||
// public async List<InsigniaRequestProfile> GetDuplicate(List<InsigniaRequestProfile> income, Guid period, Guid ocId, bool Duplicate = false)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var id = GetRequestId(period, ocId);
|
||||
|
||||
// var req = await _dbContext.Set<InsigniaRequests>().FirstOrDefault(x => x.Id == id);
|
||||
// var req = await _dbContext.Set<InsigniaRequests>().FirstOrDefault(x => x.Id == id);
|
||||
|
||||
// if (req == null)
|
||||
// throw new Exception(GlobalMessages.InsigniaNotFound);
|
||||
// if (req == null)
|
||||
// throw new Exception(GlobalMessages.InsigniaNotFound);
|
||||
|
||||
// var profile = await _dbContext.Set<InsigniaRequestsProfiles>().AsQueryable()
|
||||
// .Include(x => x.RequestInsignia)
|
||||
// .ThenInclude(x => x.InsigniaType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Insignias)
|
||||
// .Where(x => x.Request.Id == id)
|
||||
// .Select(h => new DuplicateProfile
|
||||
// {
|
||||
// ProfileId = h.Profile.Id,
|
||||
// IsApprove = h.IsApprove,
|
||||
// RequestQualificationStatus = h.QualificationStatus,
|
||||
// RequestDocumentStatus = h.DocumentStatus,
|
||||
// Special = h.Special
|
||||
// });
|
||||
// var profile = await _dbContext.Set<InsigniaRequestsProfiles>().AsQueryable()
|
||||
// .Include(x => x.RequestInsignia)
|
||||
// .ThenInclude(x => x.InsigniaType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Insignias)
|
||||
// .Where(x => x.Request.Id == id)
|
||||
// .Select(h => new DuplicateProfile
|
||||
// {
|
||||
// ProfileId = h.Profile.Id,
|
||||
// IsApprove = h.IsApprove,
|
||||
// RequestQualificationStatus = h.QualificationStatus,
|
||||
// RequestDocumentStatus = h.DocumentStatus,
|
||||
// Special = h.Special
|
||||
// });
|
||||
|
||||
// var newIncome = income.GroupJoin(profile,
|
||||
// pdb => pdb.Profile.Id,
|
||||
// dp => dp.ProfileId,
|
||||
// (pdb, dp) => new
|
||||
// {
|
||||
// Profile = pdb.Profile,
|
||||
// pdb.Profile.Insignias,
|
||||
// pdb.RequestInsignia,
|
||||
// //pdb.RequestInsignia.InsigniaType,
|
||||
// pdb.Salary,
|
||||
// pdb.RequestDate,
|
||||
// ProfileDB = dp
|
||||
// })
|
||||
// .ToList()
|
||||
// .Where(d => !Duplicate ? d.ProfileDB.Count() == 0 : d.ProfileDB.Count() != 0)
|
||||
// .Select(d => !Duplicate ? new InsigniaRequestProfile
|
||||
// {
|
||||
// Request = req,
|
||||
// Profile = d.Profile,
|
||||
// RequestInsignia = d.RequestInsignia,
|
||||
// Salary = d.Salary,
|
||||
// RequestDate = d.RequestDate,
|
||||
// } : new InsigniaRequestProfile
|
||||
// {
|
||||
// Request = req,
|
||||
// Profile = d.Profile,
|
||||
// RequestInsignia = d.RequestInsignia,
|
||||
// Salary = d.Salary,
|
||||
// RequestDate = d.RequestDate,
|
||||
// IsApprove = d.ProfileDB.First().IsApprove,
|
||||
// QualificationStatus = d.ProfileDB.First().RequestQualificationStatus,
|
||||
// DocumentStatus = d.ProfileDB.First().RequestDocumentStatus,
|
||||
// Special = d.ProfileDB.First().Special
|
||||
// })
|
||||
// .ToList();
|
||||
// var newIncome = income.GroupJoin(profile,
|
||||
// pdb => pdb.Profile.Id,
|
||||
// dp => dp.ProfileId,
|
||||
// (pdb, dp) => new
|
||||
// {
|
||||
// Profile = pdb.Profile,
|
||||
// pdb.Profile.Insignias,
|
||||
// pdb.RequestInsignia,
|
||||
// //pdb.RequestInsignia.InsigniaType,
|
||||
// pdb.Salary,
|
||||
// pdb.RequestDate,
|
||||
// ProfileDB = dp
|
||||
// })
|
||||
// .ToList()
|
||||
// .Where(d => !Duplicate ? d.ProfileDB.Count() == 0 : d.ProfileDB.Count() != 0)
|
||||
// .Select(d => !Duplicate ? new InsigniaRequestProfile
|
||||
// {
|
||||
// Request = req,
|
||||
// Profile = d.Profile,
|
||||
// RequestInsignia = d.RequestInsignia,
|
||||
// Salary = d.Salary,
|
||||
// RequestDate = d.RequestDate,
|
||||
// } : new InsigniaRequestProfile
|
||||
// {
|
||||
// Request = req,
|
||||
// Profile = d.Profile,
|
||||
// RequestInsignia = d.RequestInsignia,
|
||||
// Salary = d.Salary,
|
||||
// RequestDate = d.RequestDate,
|
||||
// IsApprove = d.ProfileDB.First().IsApprove,
|
||||
// QualificationStatus = d.ProfileDB.First().RequestQualificationStatus,
|
||||
// DocumentStatus = d.ProfileDB.First().RequestDocumentStatus,
|
||||
// Special = d.ProfileDB.First().Special
|
||||
// })
|
||||
// .ToList();
|
||||
|
||||
// return newIncome;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
// return newIncome;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// ลบข้อมูลใน db ที่ไม่เท่ากับ income
|
||||
// public async List<InsigniaRequestProfile> DeleteProfile(List<InsigniaRequestProfile> income, Guid period, Guid ocId)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var id = GetRequestId(period, ocId);
|
||||
// ลบข้อมูลใน db ที่ไม่เท่ากับ income
|
||||
// public async List<InsigniaRequestProfile> DeleteProfile(List<InsigniaRequestProfile> income, Guid period, Guid ocId)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var id = GetRequestId(period, ocId);
|
||||
|
||||
// var incomProfileId = income.Select(i => i.Profile.Id).ToList();
|
||||
// var incomProfileId = income.Select(i => i.Profile.Id).ToList();
|
||||
|
||||
// var arrayData = await _dbContext.Set<InsigniaRequestsProfiles>().AsQueryable()
|
||||
// .Where(i => !(incomProfileId.Contains(i.Profile.Id)) && i.Request.Id == id)
|
||||
// .ToList();
|
||||
// var arrayData = await _dbContext.Set<InsigniaRequestsProfiles>().AsQueryable()
|
||||
// .Where(i => !(incomProfileId.Contains(i.Profile.Id)) && i.Request.Id == id)
|
||||
// .ToList();
|
||||
|
||||
// return arrayData;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
// return arrayData;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// insert candidate list
|
||||
public async Task InsertCandidate(Guid periodId, Guid ocId, List<InsigniaResultSet> items)
|
||||
{
|
||||
try
|
||||
// insert candidate list
|
||||
public async Task InsertCandidate(Guid periodId, Guid ocId, List<InsigniaResultSet> items)
|
||||
{
|
||||
var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId);
|
||||
|
||||
if (period == null)
|
||||
throw new Exception(GlobalMessages.CoinPeriodNotFound);
|
||||
|
||||
var periodOlds = await _dbContext.Set<InsigniaPeriod>().Where(p => p.Year == period.Year).ToListAsync();
|
||||
foreach (var periodOld in periodOlds)
|
||||
try
|
||||
{
|
||||
var requestOlds = await _dbContext.Set<InsigniaRequest>().Where(p => p.Period == periodOld).ToListAsync();
|
||||
foreach (var requestOld in requestOlds)
|
||||
var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId);
|
||||
|
||||
if (period == null)
|
||||
throw new Exception(GlobalMessages.CoinPeriodNotFound);
|
||||
|
||||
var periodOlds = await _dbContext.Set<InsigniaPeriod>().Where(p => p.Year == period.Year).ToListAsync();
|
||||
foreach (var periodOld in periodOlds)
|
||||
{
|
||||
var profileOlds = await _dbContext.Set<InsigniaRequestProfile>().Where(p => p.Request == requestOld).Select(x => x.Profile.Id).ToListAsync();
|
||||
items = items.Where(x => !profileOlds.Contains(x.ProfileId)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
var oc = await _dbContext.Set<OrganizationEntity>().FirstOrDefaultAsync(x => x.Id == ocId);
|
||||
|
||||
if (oc == null)
|
||||
throw new Exception(GlobalMessages.OCNotFound);
|
||||
|
||||
var req = new InsigniaRequest
|
||||
{
|
||||
Period = period,
|
||||
Organization = oc,
|
||||
RequestStatus = "st1",
|
||||
RequestNote = "",
|
||||
CreatedUserId = UserId ?? "System Administrator",
|
||||
CreatedFullName = FullName ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
var pf = await _dbContext.Set<Profile>().FirstOrDefaultAsync(p => p.Id == item.ProfileId);
|
||||
var req_insignia = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(i => i.Id == item.RequestInsignia.Id);
|
||||
|
||||
if (pf != null)
|
||||
{
|
||||
req.RequestProfiles.Add(new InsigniaRequestProfile
|
||||
var requestOlds = await _dbContext.Set<InsigniaRequest>().Where(p => p.Period == periodOld).ToListAsync();
|
||||
foreach (var requestOld in requestOlds)
|
||||
{
|
||||
Status = "PENDING",
|
||||
Profile = pf,
|
||||
RequestInsignia = req_insignia,
|
||||
Salary = item.Salary == null ? null : item.Salary,
|
||||
RequestDate = DateTime.Now,
|
||||
MatchingConditions = System.Text.Json.JsonSerializer.Serialize(item.MatchingConditions), // serialize to string
|
||||
CreatedUserId = UserId ?? "System Administrator",
|
||||
CreatedFullName = FullName ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
var profileOlds = await _dbContext.Set<InsigniaRequestProfile>().Where(p => p.Request == requestOld).Select(x => x.Profile.Id).ToListAsync();
|
||||
items = items.Where(x => !profileOlds.Contains(x.ProfileId)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
var oc = await _dbContext.Set<OrganizationEntity>().FirstOrDefaultAsync(x => x.Id == ocId);
|
||||
|
||||
if (oc == null)
|
||||
throw new Exception(GlobalMessages.OCNotFound);
|
||||
|
||||
var req = new InsigniaRequest
|
||||
{
|
||||
Period = period,
|
||||
Organization = oc,
|
||||
RequestStatus = "st1",
|
||||
RequestNote = "",
|
||||
CreatedUserId = UserId ?? "System Administrator",
|
||||
CreatedFullName = FullName ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
var pf = await _dbContext.Set<Profile>().FirstOrDefaultAsync(p => p.Id == item.ProfileId);
|
||||
var req_insignia = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(i => i.Id == item.RequestInsignia.Id);
|
||||
|
||||
if (pf != null)
|
||||
{
|
||||
req.RequestProfiles.Add(new InsigniaRequestProfile
|
||||
{
|
||||
Status = "PENDING",
|
||||
Profile = pf,
|
||||
RequestInsignia = req_insignia,
|
||||
Salary = item.Salary == null ? null : item.Salary,
|
||||
RequestDate = DateTime.Now,
|
||||
MatchingConditions = System.Text.Json.JsonSerializer.Serialize(item.MatchingConditions), // serialize to string
|
||||
CreatedUserId = UserId ?? "System Administrator",
|
||||
CreatedFullName = FullName ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await _dbContext.Set<InsigniaRequest>().AddAsync(req);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
await _dbContext.Set<InsigniaRequest>().AddAsync(req);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
// เช็คข้อมูลใน kp7insignia
|
||||
// public async ProfileInsignia ListKp7Insignia(string name, string profile, int year)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var item = await _dbContext.Set<ProfileInsignias>().AsQueryable()
|
||||
// .Include(x => x.Insignia)
|
||||
// .Include(x => x.Profile)
|
||||
// .FirstOrDefault(x => x.Profile.Id == profile &&
|
||||
// x.Year == year &&
|
||||
// x.Insignia.Name.Contains(name));
|
||||
|
||||
// return item;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// บันทึกข้อมูลลง กพ.7
|
||||
// public async ProfileInsignia InsertKp7Insignia(InsigniaKp7Item kp7, InsigniaProfile profile)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var pf = await _dbContext.Set<Profiles>().FirstOrDefault(x => x.Id == profile.FkProfileId);
|
||||
// var insignia = await _dbContext.Set<Insignias>().FirstOrDefault(x => x.Name == profile.InsigniaName);
|
||||
|
||||
// var kp7Insignia = new ProfileInsignia
|
||||
// {
|
||||
// Profile = pf,
|
||||
// Year = DateTime.Now.Year,
|
||||
// DateReceive = kp7.InsigniaDatereceive.Value,
|
||||
// Insignia = insignia,
|
||||
// Level = kp7.InsigniaLevel,
|
||||
// No = profile.InsigniaNo,
|
||||
// Issue = kp7.InsigniaIssue,
|
||||
// VolumeNo = kp7.InsigniaVolumeno.Value.ToString(),
|
||||
// Volume = kp7.InsigniaVolume,
|
||||
// Section = kp7.InsigniaSection,
|
||||
// DateStamp = DateTime.Now,
|
||||
// DateAnnounce = kp7.InsigniaDateannounce.Value,
|
||||
// Page = profile.InsigniaPage,
|
||||
// };
|
||||
|
||||
// return kp7Insignia;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// update กพ.7
|
||||
// public async ProfileInsignia UpdateKp7Insignia(Guid id)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var item = await _dbContext.Set<ProfileInsignias>().FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
// return item;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
// เช็คข้อมูลใน kp7insignia
|
||||
// public async ProfileInsignia ListKp7Insignia(string name, string profile, int year)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var item = await _dbContext.Set<ProfileInsignias>().AsQueryable()
|
||||
// .Include(x => x.Insignia)
|
||||
// .Include(x => x.Profile)
|
||||
// .FirstOrDefault(x => x.Profile.Id == profile &&
|
||||
// x.Year == year &&
|
||||
// x.Insignia.Name.Contains(name));
|
||||
|
||||
// return item;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// บันทึกข้อมูลลง กพ.7
|
||||
// public async ProfileInsignia InsertKp7Insignia(InsigniaKp7Item kp7, InsigniaProfile profile)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var pf = await _dbContext.Set<Profiles>().FirstOrDefault(x => x.Id == profile.FkProfileId);
|
||||
// var insignia = await _dbContext.Set<Insignias>().FirstOrDefault(x => x.Name == profile.InsigniaName);
|
||||
|
||||
// var kp7Insignia = new ProfileInsignia
|
||||
// {
|
||||
// Profile = pf,
|
||||
// Year = DateTime.Now.Year,
|
||||
// DateReceive = kp7.InsigniaDatereceive.Value,
|
||||
// Insignia = insignia,
|
||||
// Level = kp7.InsigniaLevel,
|
||||
// No = profile.InsigniaNo,
|
||||
// Issue = kp7.InsigniaIssue,
|
||||
// VolumeNo = kp7.InsigniaVolumeno.Value.ToString(),
|
||||
// Volume = kp7.InsigniaVolume,
|
||||
// Section = kp7.InsigniaSection,
|
||||
// DateStamp = DateTime.Now,
|
||||
// DateAnnounce = kp7.InsigniaDateannounce.Value,
|
||||
// Page = profile.InsigniaPage,
|
||||
// };
|
||||
|
||||
// return kp7Insignia;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
// update กพ.7
|
||||
// public async ProfileInsignia UpdateKp7Insignia(Guid id)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var item = await _dbContext.Set<ProfileInsignias>().FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
// return item;
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@
|
|||
public string Status { get; set; }
|
||||
public bool IsApprove { get; set; }
|
||||
public DateTime? RequestDate { get; set; }
|
||||
public List<string> MarkALert { get; set; }
|
||||
public string? RequestNote { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
public bool? MarkDiscipline { get; set; }
|
||||
public bool? MarkLeave { get; set; }
|
||||
public bool? MarkRate { get; set; }
|
||||
public List<InsigniaRequestDoc>? Docs { get; set; }
|
||||
|
||||
public List<MatchingCondition> MatchingConditions { get; set; } = new List<MatchingCondition>();
|
||||
|
|
|
|||
|
|
@ -40,8 +40,14 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
[Comment("เหตุผลการได้รับเครื่องราชฯ")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
[Comment("มาร์คแจ้งเตือนความผิด")]
|
||||
public string? MarkALert { get; set; }
|
||||
[Comment("แจ้งเตือน มีโทษทางวินัย")]
|
||||
public bool? MarkDiscipline { get; set; } = false;
|
||||
|
||||
[Comment("แจ้งเตือน ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน")]
|
||||
public bool? MarkLeave { get; set; } = false;
|
||||
|
||||
[Comment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)")]
|
||||
public bool? MarkRate { get; set; } = false;
|
||||
|
||||
public Profile Profile { get; set; }
|
||||
|
||||
|
|
|
|||
16380
BMA.EHR.Infrastructure/Migrations/20230927071559_update table insignianoteprofile add alert1.Designer.cs
generated
Normal file
16380
BMA.EHR.Infrastructure/Migrations/20230927071559_update table insignianoteprofile add alert1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,63 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableinsignianoteprofileaddalert1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarkALert",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MarkDiscipline",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "tinyint(1)",
|
||||
nullable: true,
|
||||
comment: "แจ้งเตือน มีโทษทางวินัย");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MarkLeave",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "tinyint(1)",
|
||||
nullable: true,
|
||||
comment: "แจ้งเตือน ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MarkRate",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "tinyint(1)",
|
||||
nullable: true,
|
||||
comment: "แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarkDiscipline",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarkLeave",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarkRate",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "MarkALert",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "มาร์คแจ้งเตือนความผิด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
}
|
||||
}
|
||||
16380
BMA.EHR.Infrastructure/Migrations/20230927073012_update table insignianoteprofile add alert2.Designer.cs
generated
Normal file
16380
BMA.EHR.Infrastructure/Migrations/20230927073012_update table insignianoteprofile add alert2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,22 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableinsignianoteprofileaddalert2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6004,9 +6004,17 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("MarkALert")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("มาร์คแจ้งเตือนความผิด");
|
||||
b.Property<bool>("MarkDiscipline")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("แจ้งเตือน มีโทษทางวินัย");
|
||||
|
||||
b.Property<bool>("MarkLeave")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("แจ้งเตือน ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน");
|
||||
|
||||
b.Property<bool>("MarkRate")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)");
|
||||
|
||||
b.Property<string>("MatchingConditions")
|
||||
.HasColumnType("text")
|
||||
|
|
|
|||
|
|
@ -866,30 +866,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
// }
|
||||
// #endregion
|
||||
|
||||
/// <summary>
|
||||
/// Mark แจ้งเตือนเงื่อนไขได้รับเครื่องราช
|
||||
/// </summary>
|
||||
/// <param name="insigniaRequestProfileId">Id รายชื่อคนที่ยื่นของในรอบ</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("alert/{insigniaRequestProfileId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> MarkAlertProfileInsignia([FromBody] InsigniaMarkAlertRequest req, Guid insigniaRequestProfileId)
|
||||
{
|
||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Id == insigniaRequestProfileId);
|
||||
if (insigniaRequestProfile == null)
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
||||
insigniaRequestProfile.MarkALert = JsonConvert.SerializeObject(req.Alert);
|
||||
insigniaRequestProfile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
insigniaRequestProfile.LastUpdateUserId = UserId ?? "";
|
||||
insigniaRequestProfile.LastUpdatedAt = DateTime.Now;
|
||||
_context.SaveChanges();
|
||||
return Success();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ย้ายขอมูลไปเป็น คนที่ไม่ยื่นขอ
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Insignia.Service.Requests
|
||||
{
|
||||
public class InsigniaMarkAlertRequest
|
||||
{
|
||||
public string[] Alert { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue