แก้บันทึกพ้นราชการ (ยังไม่เสร็จ)
This commit is contained in:
parent
e55c0f746b
commit
2e7abdb60a
13 changed files with 12478 additions and 189 deletions
|
|
@ -550,10 +550,29 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("pass/disclaim")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePersonDisclaim([FromBody] PersonDisclaimRequest req)
|
||||
{
|
||||
var person = await _context.PlacementProfiles.FindAsync(req.PersonalId);
|
||||
var person = await _context.PlacementProfiles
|
||||
.Include(x => x.OrganizationPosition)
|
||||
.Include(x => x.PositionNumber)
|
||||
.Include(x => x.PositionPath)
|
||||
.Include(x => x.PositionLevel)
|
||||
.Include(x => x.PositionLine)
|
||||
.Include(x => x.PositionPathSide)
|
||||
.Include(x => x.PositionType)
|
||||
.FirstOrDefaultAsync(x => x.Id == req.PersonalId);
|
||||
if (person == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
person.OrganizationPosition = null;
|
||||
person.PositionNumber = null;
|
||||
person.PositionPath = null;
|
||||
person.PositionLevel = null;
|
||||
person.PositionLine = null;
|
||||
person.PositionPathSide = null;
|
||||
person.PositionType = null;
|
||||
person.Amount = null;
|
||||
person.MouthSalaryAmount = null;
|
||||
person.PositionSalaryAmount = null;
|
||||
person.RecruitDate = null;
|
||||
person.RejectReason = req.Note;
|
||||
person.PlacementStatus = "DISCLAIM";
|
||||
person.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
|
|
@ -1046,11 +1065,11 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success(position);
|
||||
}
|
||||
|
||||
[HttpPut("position/{placementId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePositionDraft([FromBody] List<Guid> items, Guid placementId)
|
||||
[HttpPut("position/{personalId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePositionDraft([FromBody] List<Guid> items, Guid personalId)
|
||||
{
|
||||
var placement = await _context.Placements
|
||||
.FirstOrDefaultAsync(x => x.Id == placementId);
|
||||
.FirstOrDefaultAsync(x => x.Id == personalId);
|
||||
if (placement == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
|
|
@ -1066,5 +1085,35 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("position/clear/{personalId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePositionDraft(Guid personalId)
|
||||
{
|
||||
var profile = await _context.PlacementProfiles
|
||||
.Include(x => x.OrganizationPosition)
|
||||
.Include(x => x.PositionNumber)
|
||||
.Include(x => x.PositionPath)
|
||||
.Include(x => x.PositionLevel)
|
||||
.Include(x => x.PositionLine)
|
||||
.Include(x => x.PositionPathSide)
|
||||
.Include(x => x.PositionType)
|
||||
.FirstOrDefaultAsync(x => x.Id == personalId);
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
profile.OrganizationPosition = null;
|
||||
profile.PositionNumber = null;
|
||||
profile.PositionPath = null;
|
||||
profile.PositionLevel = null;
|
||||
profile.PositionLine = null;
|
||||
profile.PositionPathSide = null;
|
||||
profile.PositionType = null;
|
||||
profile.Amount = null;
|
||||
profile.MouthSalaryAmount = null;
|
||||
profile.PositionSalaryAmount = null;
|
||||
profile.RecruitDate = null;
|
||||
_context.SaveChanges();
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue