noti วินัย
This commit is contained in:
parent
9e513d3f1a
commit
ae990c0c5f
21 changed files with 244 additions and 1508 deletions
|
|
@ -28,10 +28,12 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
private readonly DisciplineDbContext _context;
|
||||
private readonly MinIODisciplineService _documentService;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly NotificationRepository _repositoryNoti;
|
||||
private readonly PermissionRepository _permission;
|
||||
|
||||
public DisciplineDisciplinaryController(DisciplineDbContext context,
|
||||
MinIODisciplineService documentService,
|
||||
NotificationRepository repositoryNoti,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
PermissionRepository permission)
|
||||
{
|
||||
|
|
@ -39,6 +41,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
_context = context;
|
||||
_documentService = documentService;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_repositoryNoti = repositoryNoti;
|
||||
_permission = permission;
|
||||
}
|
||||
|
||||
|
|
@ -97,309 +100,6 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
return Success(new { data, total = data_search.Count() });
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// get รายการวินัยเรื่องร้องเรียน
|
||||
// /// </summary>
|
||||
// /// <returns></returns>
|
||||
// /// <response code="200"></response>
|
||||
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
// [HttpGet("complaint/{id:guid}")]
|
||||
// public async Task<ActionResult<ResponseObject>> GetByDisciplineDisciplinaryComplaint(Guid id)
|
||||
// {
|
||||
// var _data = await _context.DisciplineDisciplinarys
|
||||
// .Select(x => new
|
||||
// {
|
||||
// Id = x.Id,//id ข้อมูลเรื่องสอบสวน
|
||||
// IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
// IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
// RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
// Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new
|
||||
// {
|
||||
// Id = p.Id,
|
||||
// Idcard = p.CitizenId,
|
||||
// Name = $"{p.Prefix}{p.FirstName} {p.LastName}",
|
||||
// Prefix = p.Prefix,
|
||||
// FirstName = p.FirstName,
|
||||
// LastName = p.LastName,
|
||||
// Position = p.Position,
|
||||
// PositionLevel = p.PositionLevel,
|
||||
// Salary = p.Salary,
|
||||
// PersonId = p.PersonId,
|
||||
// PosNo = p.PosNo,
|
||||
// Organization = p.Organization,
|
||||
// IsSend = p.IsReport,
|
||||
// }),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
// OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
// ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง
|
||||
// Title = x.Title,//ชื่อเรื่อง
|
||||
// Description = x.Description,//รายละเอียด
|
||||
// DateReceived = x.DateReceived,//วันที่รับเรื่อง
|
||||
// LevelConsideration = x.LevelConsideration,//ระดับการพัฒนา
|
||||
// DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา
|
||||
// OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
// DateNotification = x.DateNotification,//วันแจ้งเตือนล่วงหน้า
|
||||
// ComplaintFrom = x.ComplaintFrom,//รับเรื่องสืบสวนจาก
|
||||
// Appellant = x.Appellant,//ผู้ถูกสืบสวน
|
||||
// Result = x.ResultComplaint,//ผลการตรวจสอบ
|
||||
// Status = x.Status,//สถานะเรื่องสืบสวน
|
||||
// DisciplineDisciplinaryDocComplaintInvestigates = x.DisciplineDisciplinary_DocComplaintInvestigates.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
// })
|
||||
// .Where(x => x.Id == id)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (_data == null)
|
||||
// return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
// var disciplineDisciplinaryDocComplaintInvestigates = new List<dynamic>();
|
||||
// foreach (var doc in _data.DisciplineDisciplinaryDocComplaintInvestigates)
|
||||
// {
|
||||
// var _doc = new
|
||||
// {
|
||||
// doc.Id,
|
||||
// doc.FileName,
|
||||
// PathName = await _documentService.ImagesPath(doc.Id)
|
||||
// };
|
||||
// disciplineDisciplinaryDocComplaintInvestigates.Add(_doc);
|
||||
// }
|
||||
// var data = new
|
||||
// {
|
||||
// _data.Id,
|
||||
// _data.IdInvestigate,
|
||||
// _data.IdComplaint,
|
||||
// _data.RespondentType,
|
||||
// _data.Persons,
|
||||
// _data.OrganizationId,
|
||||
// _data.ConsideredAgency,
|
||||
// _data.Title,
|
||||
// _data.Description,
|
||||
// _data.DateReceived,
|
||||
// _data.LevelConsideration,
|
||||
// _data.DateConsideration,
|
||||
// _data.OffenseDetails,
|
||||
// _data.DateNotification,
|
||||
// _data.ComplaintFrom,
|
||||
// _data.Appellant,
|
||||
// _data.Result,
|
||||
// _data.Status,
|
||||
// disciplineDisciplinaryDocComplaintInvestigates,
|
||||
// };
|
||||
// return Success(data);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// แก้ไขรายการวินัยเรื่องร้องเรียน
|
||||
// /// </summary>
|
||||
// /// <returns></returns>
|
||||
// /// <response code="200"></response>
|
||||
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
// [HttpPut("complaint/{id:guid}")]
|
||||
// public async Task<ActionResult<ResponseObject>> UpdateDisciplineDisciplinaryComplaint([FromBody] DisciplineDisciplinaryComplaintRequest req, Guid id)
|
||||
// {
|
||||
// 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), (int)StatusCodes.Status404NotFound);
|
||||
// if (data.Status.Trim().ToUpper() != "NEW")
|
||||
// return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
|
||||
// data.Title = req.title;
|
||||
// data.Description = req.description;
|
||||
// data.OffenseDetails = req.offenseDetails.Trim().ToUpper();
|
||||
// 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,
|
||||
// // }
|
||||
// // );
|
||||
// // }
|
||||
// // }
|
||||
// await _context.SaveChangesAsync();
|
||||
// return Success(data.Id);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// get รายการวินัยเรื่องสืบสวน
|
||||
// /// </summary>
|
||||
// /// <returns></returns>
|
||||
// /// <response code="200"></response>
|
||||
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
// [HttpGet("investigate/{id:guid}")]
|
||||
// public async Task<ActionResult<ResponseObject>> GetByDisciplineDisciplinaryInvestigate(Guid id)
|
||||
// {
|
||||
// var _data = await _context.DisciplineDisciplinarys
|
||||
// .Select(x => new
|
||||
// {
|
||||
// Id = x.Id,//id ข้อมูลเรื่องสอบสวน
|
||||
// IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
// IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
// InvestigationDetail = x.InvestigationDetail,
|
||||
// InvestigationDetailOther = x.InvestigationDetailOther,
|
||||
// InvestigationDateStart = x.InvestigationDateStart,
|
||||
// InvestigationDateEnd = x.InvestigationDateEnd,
|
||||
// InvestigationDescription = x.InvestigationDescription,
|
||||
// InvestigationStatusResult = x.InvestigationStatusResult,
|
||||
// InvestigationCauseText = x.InvestigationCauseText,
|
||||
// InvestigationExtendStatus = x.InvestigationExtendStatus,
|
||||
// InvestigationDaysExtend = x.InvestigationDaysExtend,
|
||||
// Status = x.Status,//สถานะเรื่องสืบสวน
|
||||
// Result = x.Result,//ผลการตรวจสอบ
|
||||
// Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new
|
||||
// {
|
||||
// DirectorId = d.Id,
|
||||
// Id = d.DisciplineDirector.Id,
|
||||
// Prefix = d.DisciplineDirector.Prefix,
|
||||
// FirstName = d.DisciplineDirector.FirstName,
|
||||
// LastName = d.DisciplineDirector.LastName,
|
||||
// Position = d.DisciplineDirector.Position,
|
||||
// Email = d.DisciplineDirector.Email,
|
||||
// Duty = "",
|
||||
// Phone = d.DisciplineDirector.Phone,
|
||||
// // Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
// }).ToList(),
|
||||
// DisciplineDisciplinaryDocInvestigates = x.DisciplineDisciplinary_DocInvestigates.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
// DisciplineDisciplinaryDocInvestigateRelevants = x.DisciplineDisciplinary_DocInvestigateRelevants.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
// })
|
||||
// .Where(x => x.Id == id)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (_data == null)
|
||||
// return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
// var disciplineDisciplinaryDocInvestigates = new List<dynamic>();
|
||||
// foreach (var doc in _data.DisciplineDisciplinaryDocInvestigates)
|
||||
// {
|
||||
// var _doc = new
|
||||
// {
|
||||
// doc.Id,
|
||||
// doc.FileName,
|
||||
// PathName = await _documentService.ImagesPath(doc.Id)
|
||||
// };
|
||||
// disciplineDisciplinaryDocInvestigates.Add(_doc);
|
||||
// }
|
||||
|
||||
// var disciplineDisciplinaryDocInvestigateRelevants = new List<dynamic>();
|
||||
// foreach (var doc in _data.DisciplineDisciplinaryDocInvestigateRelevants)
|
||||
// {
|
||||
// var _doc = new
|
||||
// {
|
||||
// doc.Id,
|
||||
// doc.FileName,
|
||||
// PathName = await _documentService.ImagesPath(doc.Id)
|
||||
// };
|
||||
// disciplineDisciplinaryDocInvestigateRelevants.Add(_doc);
|
||||
// }
|
||||
// var data = new
|
||||
// {
|
||||
// _data.Id,
|
||||
// _data.IdInvestigate,
|
||||
// _data.IdComplaint,
|
||||
// _data.InvestigationDetail,
|
||||
// _data.InvestigationDetailOther,
|
||||
// _data.InvestigationDateStart,
|
||||
// _data.InvestigationDateEnd,
|
||||
// _data.InvestigationDescription,
|
||||
// _data.InvestigationStatusResult,
|
||||
// _data.InvestigationCauseText,
|
||||
// _data.InvestigationExtendStatus,
|
||||
// _data.InvestigationDaysExtend,
|
||||
// _data.Status,
|
||||
// _data.Result,
|
||||
// _data.Director,
|
||||
// disciplineDisciplinaryDocInvestigates,
|
||||
// disciplineDisciplinaryDocInvestigateRelevants,
|
||||
// };
|
||||
// return Success(data);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// แก้ไขรายการวินัยเรื่องสืบสวน
|
||||
// /// </summary>
|
||||
// /// <returns></returns>
|
||||
// /// <response code="200"></response>
|
||||
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
// [HttpPut("investigate/{id:guid}")]
|
||||
// public async Task<ActionResult<ResponseObject>> UpdateDisciplineDisciplinaryInvestigate([FromBody] DisciplineDisciplinaryInvestigateRequest req, Guid id)
|
||||
// {
|
||||
// var data = await _context.DisciplineDisciplinarys
|
||||
// .Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
|
||||
// .ThenInclude(x => x.DisciplineDirector)
|
||||
// .Where(x => x.Id == id)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (data == null)
|
||||
// return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
// if (data.Status.Trim().ToUpper() != "NEW")
|
||||
// return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
|
||||
// data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
||||
// data.InvestigationDetailOther = req.investigationDetailOther;
|
||||
// data.InvestigationDateStart = req.investigationDateStart;
|
||||
// data.InvestigationDateEnd = req.investigationDateEnd;
|
||||
// data.InvestigationDescription = req.investigationDescription;
|
||||
// data.InvestigationStatusResult = req.investigationStatusResult.Trim().ToUpper();
|
||||
// data.InvestigationCauseText = req.investigationCauseText.Trim().ToUpper();
|
||||
// data.InvestigationExtendStatus = req.investigationExtendStatus;
|
||||
// data.InvestigationDaysExtend = req.investigationDaysExtend;
|
||||
// data.Result = req.result;
|
||||
// data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
// data.LastUpdateUserId = UserId ?? "";
|
||||
// data.LastUpdatedAt = DateTime.Now;
|
||||
// _context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates);
|
||||
// foreach (var item in req.directors)
|
||||
// {
|
||||
// var director = await _context.DisciplineDirectors.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.Id == item);
|
||||
// if (director != null)
|
||||
// {
|
||||
// data.DisciplineDisciplinary_DirectorInvestigates.Add(
|
||||
// new DisciplineDisciplinary_DirectorInvestigate
|
||||
// {
|
||||
// DisciplineDirector = director,
|
||||
// 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);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// get รายการวินัยเรื่องสอบสวน
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue