วินัยเพิ่มหมายเหตุ
Some checks failed
release-dev / release-dev (push) Failing after 10s

This commit is contained in:
moss 2025-04-17 15:54:19 +07:00
parent c6663b35c3
commit ccb183dc95
11 changed files with 20289 additions and 112 deletions

View file

@ -68,40 +68,40 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
# - name: Notify Discord Success
# if: success()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "✅ Deployment Success!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
# "color": 3066993,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/success-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Success
if: success()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/success-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}
# - name: Notify Discord Failure
# if: failure()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "❌ Deployment Failed!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
# "color": 15158332,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/failure-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Failure
if: failure()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}

View file

@ -68,40 +68,40 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
# - name: Notify Discord Success
# if: success()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "✅ Deployment Success!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
# "color": 3066993,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/success-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Success
if: success()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/success-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}
# - name: Notify Discord Failure
# if: failure()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "❌ Deployment Failed!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
# "color": 15158332,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/failure-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Failure
if: failure()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}

View file

@ -68,40 +68,40 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
# - name: Notify Discord Success
# if: success()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "✅ Deployment Success!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
# "color": 3066993,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/success-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Success
if: success()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/success-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}
# - name: Notify Discord Failure
# if: failure()
# run: |
# curl -H "Content-Type: application/json" \
# -X POST \
# -d '{
# "embeds": [{
# "title": "❌ Deployment Failed!",
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
# "color": 15158332,
# "footer": {
# "text": "Release Notification",
# "icon_url": "https://example.com/failure-icon.png"
# },
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
# }]
# }' \
# ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Failure
if: failure()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}

View file

@ -366,6 +366,8 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
posLevelName = p.posLevelName,
IsSend = p.IsReport,
// DocumentReject = p.DocumentReject,
RemarkReject = p.RemarkReject,
IsDisciplinary = p.IsDisciplinary,
profileType = p.profileType,
CreatedAt = p.CreatedAt,
@ -403,6 +405,18 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
};
disciplineInvestigateRelevantDocs.Add(_doc);
}
// var persons = new List<dynamic>();
// foreach (var doc in _data.Persons)
// {
// var _doc = new
// {
// doc.Id,
// doc.FileName,
// PathName = await _documentService.ImagesPath(doc.Id)
// };
// disciplineInvestigateRelevantDocs.Add(_doc);
// }
var data = new
{
_data.Id,
@ -1167,18 +1181,33 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
// [HttpPut("report/{commandTypeId:length(36)}")]
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] DisciplineProfileRequest req)
{
foreach (var item in req.Id)
foreach (var item in req.id)
{
var uppdated = await _context.DisciplineInvestigate_ProfileComplaints
.FirstOrDefaultAsync(x => x.Id == item);
if (uppdated == null)
continue;
// uppdated.CommandTypeId = commandTypeId;
uppdated.IsReport = "REPORT";
uppdated.IsReport = "DONE";
uppdated.RemarkReject = req.remark;
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
uppdated.LastUpdateUserId = UserId ?? "";
uppdated.LastUpdatedAt = DateTime.Now;
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
{
foreach (var file in Request.Form.Files)
{
var fileExtension = Path.GetExtension(file.FileName);
var doc = await _documentService.UploadFileAsync(file, file.FileName);
var _doc = await _context.Documents.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == doc.Id);
if (_doc != null)
{
uppdated.DocumentReject = _doc;
}
}
}
}
await _context.SaveChangesAsync();

View file

@ -194,6 +194,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
Status = p.Status,
StatusDiscard = p.StatusDiscard,
profileType = p.profileType,
Remark = p.Remark,
Offense = p.Offense,
CreatedAt = p.CreatedAt
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
@ -2141,5 +2143,35 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
return Success();
}
/// <summary>
/// แก้ไขฐานความผิดรายบุคคล
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPut("summary/{id:guid}")]
public async Task<ActionResult<ResponseObject>> UpdateSummaryDisciplineResult([FromBody] DisciplineResultSummaryRequest req, Guid id)
{
var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_DISCIPLINE_RESULT");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
if (jsonData["status"]?.ToString() != "200")
{
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
}
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.Id == id).FirstOrDefaultAsync();
if (data == null)
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
data.Remark = req.remark;
data.Offense = req.offense;
data.LastUpdateFullName = FullName ?? "System Administrator";
data.LastUpdateUserId = UserId ?? "";
data.LastUpdatedAt = DateTime.Now;
await _context.SaveChangesAsync();
return Success(data.Id);
}
}
}

View file

@ -0,0 +1,10 @@
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Discipline.Service.Requests
{
public class DisciplineResultSummaryRequest
{
public string? remark { get; set; }
public string? offense { get; set; }
}
}

View file

@ -5,6 +5,8 @@ namespace BMA.EHR.Discipline.Service.Requests
{
public class DisciplineProfileRequest
{
public List<Guid> Id { get; set; }
public List<Guid> id { get; set; }
public FormFile? file { get; set; }
public string? remark { get; set; }
}
}

View file

@ -100,6 +100,10 @@ namespace BMA.EHR.Domain.Models.Discipline
[Comment("สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)")]
public string? profileType { get; set; }
[Comment("ฐานความผิดรายบุคคลหมายเหตุ")]
public string? Remark { get; set; }
[Comment("ฐานความผิดรายบุคคล")]
public string? Offense { get; set; }
[Required, Comment("Id เรื่องสอบสวน")]
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }

View file

@ -81,6 +81,10 @@ namespace BMA.EHR.Domain.Models.Discipline
public double? Salary { get; set; }
[Comment("ส่งไปยุติเรื่อง")]
public string? IsReport { get; set; } = "NEW";
[Comment("หมายเหตุยุติเรื่อง")]
public string? RemarkReject { get; set; }
[Comment("อ้างอิงรหัสเอกสาร")]
public Document? DocumentReject { get; set; }
[Comment("ส่งไปสอบสวน")]
public bool? IsDisciplinary { get; set; } = false;
[Comment("รายการเก่า")]

View file

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class update_table_disciplineresult_add_remark : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}