Merge branch 'develop' into working
This commit is contained in:
commit
6a789e0804
3 changed files with 983 additions and 4 deletions
|
|
@ -235,7 +235,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
RemarkHorizontal = p.RemarkHorizontal,
|
RemarkHorizontal = p.RemarkHorizontal,
|
||||||
RemarkVertical = p.RemarkVertical,
|
RemarkVertical = p.RemarkVertical,
|
||||||
|
|
@ -303,7 +303,73 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return report_data;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<CommandType03Response>> GetCommandType39AttachmentAsync(Guid id)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var raw_data = await _dbContext.Set<CommandReceiver>()
|
||||||
|
.Include(c => c.Command)
|
||||||
|
.Where(c => c.Command.Id == id)
|
||||||
|
.ToListAsync();
|
||||||
|
if (raw_data == null)
|
||||||
|
{
|
||||||
|
throw new Exception(GlobalMessages.CommandNotFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
var report_data = (from r in raw_data
|
||||||
|
join p in _dbContext.Set<PlacementProfile>()
|
||||||
|
.Include(x => x.PlacementEducations)
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.Include(x => x.OrganizationPosition)
|
||||||
|
.ThenInclude(x => x.Organization)
|
||||||
|
.Include(x => x.PositionPath)
|
||||||
|
.Include(x => x.PositionLevel)
|
||||||
|
.Include(x => x.PositionNumber)
|
||||||
|
.Include(x => x.PositionType)
|
||||||
|
on r.RefPlacementProfileId equals p.Id
|
||||||
|
orderby r.Sequence
|
||||||
|
select new CommandType03Response
|
||||||
|
{
|
||||||
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
|
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
|
||||||
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
|
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
||||||
|
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||||
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||||
|
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -144,9 +144,10 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
var inbox = await _context.Inboxes.FirstOrDefaultAsync(x => x.Id == id);
|
var inbox = await _context.Inboxes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
if (inbox == null)
|
if (inbox == null)
|
||||||
return Error(GlobalMessages.DataNotFound);
|
return Error(GlobalMessages.DataNotFound);
|
||||||
|
if (inbox.CreatedUserId == null || inbox.CreatedUserId == "")
|
||||||
|
return Error("ข้อความนี้เป็นการแจ้งเตือนจากระบบไม่สามารถตอบกลับได้");
|
||||||
|
|
||||||
|
var apiUrl = $"{_configuration["API"]}/org/profile/keycloakid/position/{inbox.CreatedUserId}";
|
||||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position/{inbox.CreatedUserId}";
|
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue