Compare commits

...

1079 commits

Author SHA1 Message Date
harid
5021c00dd3 เก็บ lastUpdate หากมีเช็คออกคำสั่งย้อนหลัง
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m58s
Build & Deploy Retirement Service / build (push) Successful in 2m18s
2026-06-24 16:20:49 +07:00
harid
bf5dc2cf19 เก็บ lastUpdate หากมีเช็คออกคำสั่งย้อนหลัง
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 2m19s
2026-06-23 18:24:30 +07:00
Suphonchai Phoonsawat
f6c8b4f754 Change Dockerfile
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 24s
2026-06-23 11:45:28 +07:00
Suphonchai Phoonsawat
65ca175f98 fix Dockerfile
Some checks failed
Build & Deploy Checkin Service / build (push) Failing after 9s
2026-06-23 11:38:40 +07:00
Suphonchai Phoonsawat
5f678b2898 แก้ปัญหา RabbitMQ ประมวลผลในคิวช้า และรอคิวนาน
Some checks failed
Build & Deploy Checkin Service / build (push) Failing after 40s
2026-06-23 11:25:50 +07:00
Suphonchai Phoonsawat
ae417e4777 add API #1600
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m58s
2026-06-22 23:13:51 +07:00
Suphonchai Phoonsawat
a2dc4b5b82 fix param fiscalEndDate #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-06-22 22:41:21 +07:00
Suphonchai Phoonsawat
c55648a3cc Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m1s
2026-06-22 22:22:44 +07:00
Suphonchai Phoonsawat
bc29952e83 fix #2551 2026-06-22 22:22:11 +07:00
harid
f4f56b1c21 api ลบข้อความ noti #1599
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 2m2s
2026-06-22 16:36:06 +07:00
harid
baf828ac85 fix #2571
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m58s
2026-06-22 13:21:33 +07:00
Suphonchai Phoonsawat
be1f6dd84e #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m55s
2026-06-22 11:10:29 +07:00
Suphonchai Phoonsawat
fcea84bdb8 fix fiscal start and end date #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m57s
2026-06-22 10:54:59 +07:00
Suphonchai Phoonsawat
5d090fa7bd #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m51s
2026-06-22 10:18:21 +07:00
Suphonchai Phoonsawat
030098c0b9 fix fiscal Year #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m3s
2026-06-19 11:50:36 +07:00
Suphonchai Phoonsawat
6843e3ff3f fix #2551 Error
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m22s
2026-06-19 11:11:46 +07:00
Suphonchai Phoonsawat
2cdae3578e issue #2551
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m58s
2026-06-19 10:51:18 +07:00
harid
71966eb4e9 Linear Flow (RetirementService) #224
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 2m4s
2026-06-19 09:22:33 +07:00
harid
e926866918 Linear Flow (PlacementService) #224
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
2026-06-18 18:32:06 +07:00
harid
35179d8cfc Linear Flow (C-PM-01, C-PM-02, C-PM-14) #224
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 5m38s
2026-06-18 15:46:22 +07:00
harid
4a8d349415 Linear Flow (ทดสอบเฉพาะคำสั่ง C-PM-01) #224
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 2m57s
2026-06-18 11:47:11 +07:00
harid
7d2be029b6 api คำสั่งอนุญาตให้ลาออกไปรับราชการทหาร #248
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 3m4s
2026-06-11 11:42:18 +07:00
harid
d75cf39d7b update Job คนที่ลาออก clear profileId
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 2m2s
2026-06-05 17:35:59 +07:00
Suphonchai Phoonsawat
db3d531aa9 fix นับการลงเวลานอกสถานที่ [อื่นๆ] #2524
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m59s
2026-06-05 11:01:06 +07:00
Suphonchai Phoonsawat
e17895de81 Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m1s
2026-06-05 05:48:08 +07:00
Suphonchai Phoonsawat
e09a6d0ea6 fix : Add LeaveLastTotal เพื่อให้ไปใช้ในรายงาน ของเดิมไม่มี 2026-06-05 05:47:25 +07:00
harid
4c44bdf237 fix อัพเดทสถานะบุคคลภายนอก #2518
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m57s
2026-06-04 19:05:09 +07:00
6f1ca58f04 Merge branch 'dev' into adiDev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m45s
2026-06-04 16:54:17 +07:00
a956f0b0dd update 2026-06-04 16:53:14 +07:00
harid
f0c493a026 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m46s
2026-06-04 11:52:51 +07:00
harid
fe5c2cd7c1 fix #2547 2026-06-04 11:52:26 +07:00
harid
c4209400ff Merge branch 'develop-Bright' into dev
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m52s
2026-06-04 11:34:34 +07:00
harid
d6a7f1a5ca fix แก้ไขวันที่ยื่นขอลาออกแล้วข้อมูลไม่เปลี่ยน #2547 2026-06-04 11:34:06 +07:00
harid
f50efc632b Merge branch 'develop' into develop-Bright 2026-06-04 10:53:49 +07:00
5f9c49f479 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m45s
Build & Deploy Retirement Service / build (push) Successful in 1m45s
2026-06-04 10:19:11 +07:00
48aab28e04 Merge branch 'adiDev' into develop 2026-06-04 10:15:42 +07:00
1f7951dc4c update ลาออก admin 2026-06-04 10:15:33 +07:00
harid
d3a174faa0 log placementReceive 2026-06-04 10:10:31 +07:00
Suphonchai Phoonsawat
afa5c85393 fix #2545
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-06-04 10:01:11 +07:00
077b60b1c3 Merge branch 'develop' into adiDev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
Build & Deploy Retirement Service / build (push) Successful in 1m46s
2026-06-04 09:38:03 +07:00
efc96dfb6d แก้ format ฟิว posMasterNo (6) 2026-06-04 09:37:29 +07:00
Suphonchai Phoonsawat
4827906d1d Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-05-29 15:46:56 +07:00
Suphonchai Phoonsawat
8ae822d05b leave report #2524 2026-05-29 15:46:29 +07:00
harid
71a4748d39 Job: อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง ทำงานทุกวันเวลา 05:00 น. #2518
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
2026-05-29 15:32:26 +07:00
harid
ad70043264 กรองสถานะขอลาออกฝั่ง user #1586
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m52s
2026-05-29 14:56:16 +07:00
Suphonchai Phoonsawat
513956c861 Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m56s
2026-05-29 10:26:01 +07:00
Suphonchai Phoonsawat
a48f3fa804 fix issue #2534 2026-05-29 10:25:11 +07:00
harid
dc5ac329e2 API ลบรายการเฉพาะสิทธิ์ OWNER #1586
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m5s
Build & Deploy Placement Service / build (push) Successful in 1m43s
Build & Deploy Retirement Service / build (push) Successful in 1m47s
2026-05-28 14:53:32 +07:00
harid
3f98e07419 บันทึกข้อมูล CommandCode ใน DisciplineDisciplinary_ProfileComplaintInvestigates #2377
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 2m23s
2026-05-27 17:40:30 +07:00
ce4558c240 Merge branch 'develop' into adiDev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m42s
2026-05-25 18:17:47 +07:00
6a38f000ba #2505 2026-05-25 18:17:07 +07:00
harid
f50ad38503 เพิ่ม log api candidate/report/excecute
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m59s
2026-05-25 18:08:13 +07:00
aeb2ceea6f Merge branch 'develop' into adiDev 2026-05-25 17:20:46 +07:00
e96f606c85 แก้ format ฟิว posMasterNo (5) 2026-05-25 17:20:07 +07:00
Suphonchai Phoonsawat
81dc7f4544 ปรับ logic การส่งไฟล์ภาพ #2521
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
2026-05-25 16:28:15 +07:00
Suphonchai Phoonsawat
a16ef7ac55 Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m9s
2026-05-25 14:20:53 +07:00
Suphonchai Phoonsawat
f6bf1ab026 ปรับให้เก็บข้อมูลเพิ่มเติมใน CheckinJobStatus 2026-05-25 14:19:44 +07:00
harid
caa01088c6 เพิ่ม log api recruit/report/excecute
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m52s
2026-05-22 18:28:28 +07:00
harid
782d1526b5 fix คำสั่ง C-PM-08, C-PM-09 ให้ส่ง positionId เพิ่ม
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m50s
2026-05-22 13:58:55 +07:00
harid
04ac35c10b Merge branch 'develop' into develop-Bright
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m51s
Build & Deploy Retirement Service / build (push) Successful in 1m55s
2026-05-21 16:47:57 +07:00
harid
02abedc973 fix เลือกตำแหน่งในสายงานหาย เมื่อมีการเปลี่ยนแปลงข้อมูลตำแหน่งในโครงสร้าง #2505 2026-05-21 16:47:19 +07:00
8415ffc92d Merge branch 'develop' into adiDev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 2m2s
2026-05-21 16:38:49 +07:00
64c75cd9d5 แก้ format ฟิว posMasterNo (4) สำหรับบันทึกตอนทำรายกาขอโอน และรับโอน 2026-05-21 16:38:08 +07:00
harid
22e04d90fe Migrate เพิ่มฟิลด์ posExecutiveId ตาราง PlacementProfiles, PlacementReceives, PlacementAppointments, RetirementOthers 2026-05-21 16:00:07 +07:00
Suphonchai Phoonsawat
2146e0e0ca fix issue #2515
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
2026-05-21 15:49:51 +07:00
Suphonchai Phoonsawat
3f8ae1ede9 fix #2503
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m0s
2026-05-20 16:24:24 +07:00
harid
c2795d6891 fix ส่งขอลาออกจากทะเบียนประวัติ ต้องสามารถแก้ไขข้อมูลเงื่อนไขต่าง ๆ ได้ #2501
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 3m47s
2026-05-19 16:20:58 +07:00
harid
6e5284b3c7 fix ยศไม่แสดงในระบบทะเบียนประวัติหลังออกคำสั่งรับโอนเสร็จสิ้น #2469
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m52s
2026-05-15 17:14:50 +07:00
Suphonchai Phoonsawat
76697c4f63 แก้ไขข้อความ Notofication
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m55s
2026-05-15 16:14:50 +07:00
Suphonchai Phoonsawat
e5f6a44f5f เพิ่ม Call API GetProfileByCheckInAsync ใช้แทนของเดิม 2026-05-15 16:04:39 +07:00
Suphonchai Phoonsawat
583569682d register notification service
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-05-15 13:13:29 +07:00
Suphonchai Phoonsawat
9f756771cd เพิ่ม keycloak_id + token ลงใน Job AdditionalData เพื่อเอาไว้ตรวจสอบ
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m54s
2026-05-15 11:54:04 +07:00
Suphonchai Phoonsawat
219b172073 Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
2026-05-15 11:42:39 +07:00
Suphonchai Phoonsawat
ecf660e4cf send noti process-checkin 2026-05-15 11:41:59 +07:00
harid
0365fad723 Migrate add field PlacementReceives.rank #2469
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m44s
2026-05-12 14:59:22 +07:00
Suphonchai Phoonsawat
20e8dfddd6 นับวันหยุด ต้องตัดเสาร์ อาทิตย์ออก
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m39s
2026-05-12 12:02:45 +07:00
Suphonchai Phoonsawat
91c479ef9e fix addition checkin
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
2026-05-12 11:37:32 +07:00
Suphonchai Phoonsawat
80fcda61cf issue #1580
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m45s
2026-05-11 15:12:09 +07:00
Suphonchai Phoonsawat
f02413f2b2 หลังอนุมัติลา แก้สถานะการลงเวลาเป็น ปกติ
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m47s
2026-05-11 10:11:40 +07:00
Suphonchai Phoonsawat
1739aa8057 fix issue #1575
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-05-07 16:14:01 +07:00
Suphonchai Phoonsawat
bc3bba547f fix api
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m49s
2026-05-06 19:02:57 +07:00
Suphonchai Phoonsawat
4161fcc1cf fix
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
2026-05-06 18:53:53 +07:00
Suphonchai Phoonsawat
6d0921a76a #2466
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
2026-05-06 16:25:54 +07:00
Suphonchai Phoonsawat
df7bebe0ba api check-time แกะ profileId จาก token เพื่อไม่ต้องไป call เอาจาก org
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m42s
2026-05-05 21:23:46 +07:00
Suphonchai Phoonsawat
82a45b6811 remove default value
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m46s
2026-05-05 12:56:31 +07:00
Suphonchai Phoonsawat
63d983f831 fix issue #1572
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m49s
2026-05-05 12:37:38 +07:00
Suphonchai Phoonsawat
e326e43ae6 fix Issue #2458 2026-05-05 10:23:40 +07:00
Suphonchai Phoonsawat
4dab3c5cd9 fix report leaave
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-05-01 16:47:34 +07:00
Suphonchai Phoonsawat
4bd46d13e5 fix issue
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-05-01 16:38:47 +07:00
Suphonchai Phoonsawat
132a59b946 Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-05-01 11:39:11 +07:00
Suphonchai Phoonsawat
740a9984c9 fix #2456 2026-05-01 11:20:44 +07:00
harid
5b0fcd0680 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ #224
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m46s
Build & Deploy Placement Service / build (push) Successful in 1m56s
Build & Deploy Discipline Service / build (push) Successful in 1m55s
2026-05-01 11:20:15 +07:00
Suphonchai Phoonsawat
2bdb8bb733 กทม. ต้องการพิ่มรายการลงเวลานอกสถานะที่ "ปฏิบัติงานในจุดบริการด่วนมหานคร" กำหนดเวลา 10.30-18.30 น. #2458
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m41s
2026-05-01 10:23:27 +07:00
Suphonchai Phoonsawat
aed1e8a58d Merge branch 'develop' into working
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 20s
2026-04-30 22:03:33 +07:00
Suphonchai Phoonsawat
fb3cb2aa94 สิ่งที่แก้ไข:
autoAck: false - ไม่ ack อัตโนมัติ ต้องรอ process เสร็จก่อน
Manual Ack/Nack:
BasicAck เมื่อ API return success
BasicNack (reject) เมื่อ API return error (401, 500, etc.) หรือ exception
CallRestApi return bool - บอกว่าสำเร็จหรือล้มเหลว
Better logging - แสดง status code และ error message ชัดเจนขึ้น
ตอนนี้เมื่อ API return 401 หรือ error อื่น:

จะ log error พร้อม status code
Message จะถูก reject (ไม่ requeue)
Consumer จะทำงานต่อรับ message ถัดไปเลย (ไม่ค้าง)
2026-04-30 22:02:59 +07:00
harid
b5025c382f fix รายงานเกษียณแก้ให้แสดงสำนัก #2261
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 2m6s
2026-04-30 14:24:42 +07:00
Suphonchai Phoonsawat
4e2113eef2 fix consumer from Event to AsyncEvent
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 1m42s
2026-04-30 11:53:53 +07:00
Suphonchai Phoonsawat
ffcf95c210 change docker file
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 1m59s
2026-04-30 11:20:52 +07:00
Suphonchai Phoonsawat
e4bcfee80c fix issue #2448
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m47s
2026-04-29 11:45:46 +07:00
Suphonchai Phoonsawat
a173a7dc3c fix CheckInConsumer Memery Falult
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 1m27s
2026-04-29 09:57:26 +07:00
Suphonchai Phoonsawat
361ded2078 fix issue #2444
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m20s
2026-04-28 15:56:19 +07:00
Suphonchai Phoonsawat
1379dab556 fix issue #2441 2026-04-28 15:42:41 +07:00
Suphonchai Phoonsawat
d8039379ad change dc constr to use tunnel
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m33s
2026-04-28 11:32:04 +07:00
Suphonchai Phoonsawat
2d4116d79a BROHTER เปลี่ยนเป็น BROTHER 2026-04-28 11:14:40 +07:00
Suphonchai Phoonsawat
c65a4a04ac Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m44s
Build & Deploy Placement Service / build (push) Successful in 2m8s
2026-04-23 19:12:24 +07:00
Suphonchai Phoonsawat
d58c7dc07e Logic การคำนวนวันลา แบบร่าง และ นะหว่างพิจาณา #1567 2026-04-23 19:11:54 +07:00
Suphonchai Phoonsawat
bb329f86de เพิ่ม DateSendLeave และปรับ Logic การดึงค่าวันที่ยื่นลา #1567 2026-04-23 15:48:20 +07:00
harid
b3298e88c6 fix path separator
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m49s
2026-04-21 10:34:21 +07:00
harid
04d0067ee8 ถ้ามีรักษาการแก้สิทธิ์ BROTHER
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m58s
2026-04-20 16:38:58 +07:00
harid
c035c13405 check runtime
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m47s
2026-04-20 14:31:28 +07:00
harid
2e9db2d42c รายงานประกาศเกษียณ #2262, #2261
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m50s
2026-04-20 12:37:06 +07:00
Suphonchai Phoonsawat
1389df0225 แก้ไข
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m54s
ถ้าไม่ได้ Add สิทธิ์มา จะข้ามตำแหน่งนั้นไป
แก้บั้กการแสดงข้อมูล กรณี "ROOT"

#2431
2026-04-20 11:42:41 +07:00
Suphonchai Phoonsawat
058027ea29 เปลี่ยน DEFAULT สิทธิ์เป็น "CHILD" กรณีไม่ตั้งค่ามา #2431
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
2026-04-17 20:11:18 +07:00
Suphonchai Phoonsawat
ee2d16925a แก้ไข รักษาการ ถ้าไม่ได้ใส่ privilage มาจะให้ default = "PARENT" #2431
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m7s
2026-04-17 19:21:30 +07:00
Suphonchai Phoonsawat
42f3813a7a Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m2s
2026-04-17 15:42:36 +07:00
Suphonchai Phoonsawat
7bafbf5001 เพิ่มรายการรักษาการ #2431 2026-04-17 15:35:29 +07:00
harid
db99630e0d fix #2430
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m59s
2026-04-17 15:18:30 +07:00
Suphonchai Phoonsawat
34ec9bb77c Remove Check Pending Status For Cancel Leave #2432
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m54s
2026-04-17 10:31:09 +07:00
Suphonchai Phoonsawat
5606e8b50a Change GetProfileByKeycloakIdNewAsync To GetProfileByKeycloakIdNew2Async 2026-04-17 09:41:52 +07:00
Suphonchai Phoonsawat
ee4e9c3699 แก้ leave/detail เป็น leave-reject/detail สำหรับรายการยกเลิก #2432
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m51s
2026-04-16 21:30:17 +07:00
Suphonchai Phoonsawat
6efeec3f1f เพิ่ม List ของการเจ้หน้าที่ ส่ง noti ขอยกเลิกการลา #2432
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-04-16 19:05:26 +07:00
harid
c34fe35506 API ยกเลิกการส่งตัวบรรจุผู้สอบผ่าน
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m57s
2026-04-16 11:57:47 +07:00
adisak
678329b5df #2392 fix departmentName null
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 2m13s
2026-04-16 11:31:03 +07:00
Suphonchai Phoonsawat
057b51390e add some code
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
2026-04-09 12:07:11 +07:00
harid
8950073485 ส่งรายชื่อไปออกคำสั่ง C-PM-25, C-PM-26 ให้ปั๊ม commandCode #2377
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 1m56s
2026-04-03 16:03:01 +07:00
Suphonchai Phoonsawat
bf92f6933e Refactor user profile retrieval method in InsigniaRequestController #2390
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 1m41s
2026-04-03 12:17:39 +07:00
Suphonchai Phoonsawat
cea1c4b64e Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m39s
2026-04-03 12:09:32 +07:00
Suphonchai Phoonsawat
cef41506a8 Change Amount property to nullable int in GetProfileLeaveByKeycloakDto #2411 2026-04-03 12:09:00 +07:00
bceb4d3096 update emp status resign
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m41s
2026-04-03 11:45:52 +07:00
adisak
06956284d7 #2381
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 2m1s
2026-04-02 17:50:18 +07:00
Suphonchai Phoonsawat
6b8eddcbc0 Add Insignia launch configuration and improve null checks in InsigniaRequestController #2388
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 1m54s
2026-04-02 11:36:59 +07:00
Suphonchai Phoonsawat
a4a5d13203 Update InsigniaRequestController to use GetOcByNodeId and include RootDnaId in insigniaNoteProfile #2390
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 2m3s
2026-04-02 11:09:36 +07:00
Suphonchai Phoonsawat
69b89dfc90 Add GetOcByNodeId method to UserProfileRepository and update InsigniaManageController to use it #2389 2026-04-02 11:00:14 +07:00
Suphonchai Phoonsawat
ea694bfda2 Fix effective date retrieval in LeaveReportController by using ProfileId instead of Id #2400
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-04-02 09:51:45 +07:00
Suphonchai Phoonsawat
6691303ea7 Merge branch 'working' into develop
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s
2026-04-01 12:35:00 +07:00
Suphonchai Phoonsawat
8ea572d46c Refactor LeaveReportController to improve duty time retrieval and handle default round logic 2026-04-01 12:30:42 +07:00
Suphonchai Phoonsawat
2ecef0792c Merge branch 'working' into develop
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m46s
2026-04-01 12:24:45 +07:00
Suphonchai Phoonsawat
1cf780ecd0 Refactor LeaveController to streamline profile retrieval and duty time handling 2026-04-01 12:24:00 +07:00
harid
bf6ea555fc fix รายงานมาสาย ข้อมูลไม่แสดง #2395
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m44s
2026-03-31 14:23:51 +07:00
Suphonchai Phoonsawat
8fa105606b Refactor LeaveProcessJobStatusRepository to filter employee records by status and ensure proper task processing
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-03-31 11:45:48 +07:00
Suphonchai Phoonsawat
47c0cfc62a Refactor leave remark generation logic in LeaveReportController to handle single and multi-day leave requests more accurately 2026-03-31 11:32:17 +07:00
Suphonchai Phoonsawat
932d5e75c7 Refactor LeaveProcessJobStatusRepository to update API endpoint paths and comment out JSON file writing logic 2026-03-31 11:28:12 +07:00
Suphonchai Phoonsawat
a50153f32c Refactor LeaveProcessJobStatusRepository to enhance leave remark generation logic and update file export functionality with environment path handling 2026-03-31 11:26:28 +07:00
Suphonchai Phoonsawat
d85bab11b2 Add ProcessEmpTaskAsync method to handle employee task processing and integrate with external API for attendance reporting 2026-03-31 10:20:30 +07:00
Suphonchai Phoonsawat
82c31a0f57 Refactor GenericRepository and GenericLeaveRepository to expose PostExternalAPIAsync method and enhance LeaveProcessJobStatusRepository with API integration for processing employee records 2026-03-31 10:18:06 +07:00
Suphonchai Phoonsawat
2cd7798dd9 Add admin endpoints for processing leave tasks, including retrieval, deletion, and updates 2026-03-31 09:46:44 +07:00
Suphonchai Phoonsawat
759a51ab58 Enhance LeaveProcessJobStatusRepository with detailed processing logic and add new methods in UserProfileRepository for fetching officer and employee profiles by RootDnaId 2026-03-30 15:53:33 +07:00
Suphonchai Phoonsawat
3dee5f7166 Refactor LeaveProcessJobStatusRepository methods and update Hangfire configuration for improved job processing 2026-03-30 12:08:30 +07:00
Suphonchai Phoonsawat
8732c34564 Add scheduled job to process pending jobs in LeaveProcessJobStatusRepository 2026-03-30 10:06:21 +07:00
Suphonchai Phoonsawat
91e6b1b35b Add methods to process pending jobs and update their statuses in LeaveProcessJobStatusRepository 2026-03-30 10:02:57 +07:00
Suphonchai Phoonsawat
c1ac687101 Add CreateLeaveProcessJobDto and implement CreateProcessTaskAsync in LeaveController 2026-03-30 09:52:27 +07:00
Suphonchai Phoonsawat
de1773880b Add LeaveProcessJobStatusRepository and register it in ApplicationServicesRegistration 2026-03-30 09:31:19 +07:00
Suphonchai Phoonsawat
c91e6c8030 Add migration for LeaveProcessJobStatuses table
- Created a new migration to add the LeaveProcessJobStatuses table.
- The table includes fields for job status, timestamps, user information, and error messages.
- Supports tracking of leave process job statuses with relevant metadata.
2026-03-30 09:23:13 +07:00
harid
d8f1126764 fix ส่งรายชื่อผู้ถูกพักราชการไปออกคำสั่ง #2364
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 2m7s
2026-03-27 14:31:42 +07:00
Suphonchai Phoonsawat
7ba429bb64 Refactor checkout status logic in LeaveController for improved clarity and handling of check-in dates
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m46s
2026-03-27 09:48:10 +07:00
Suphonchai Phoonsawat
3e3bfff7ba Refactor leave date overlap check in LeaveRequestController for improved readability and performance
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m51s
2026-03-26 14:10:37 +07:00
Suphonchai Phoonsawat
19b79a162d Add leave subtype name and couple day level country to leave approval response (Employee)#2366
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m47s
2026-03-26 10:33:44 +07:00
Suphonchai Phoonsawat
a09d5937f9 Add leave subtype and couple day level country to leave approval response #2366 2026-03-26 10:33:00 +07:00
Suphonchai Phoonsawat
aef81e9f4e Add support for multiple child DNA IDs in leave processing and enhance batch creation of duty time changes
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m45s
2026-03-25 15:17:54 +07:00
Suphonchai Phoonsawat
6427cb4344 Comment out probation-related leave limit checks in LeaveRequestController and update appsettings.json to disable unused database connections
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m45s
2026-03-24 09:00:06 +07:00
Suphonchai Phoonsawat
252d8b5fa3 Update SearchProfile method parameters to use string for SelectedNodeId #1555
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m40s
2026-03-23 10:40:54 +07:00
Suphonchai Phoonsawat
58aca3a328 Add SelectedNode parameter to SearchProfile method for enhanced profile retrieval #1555
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m44s
2026-03-23 10:13:13 +07:00
Suphonchai Phoonsawat
818ff38e99 Add SelectedNodeId parameter to SearchProfile method and update related DTO #1555 2026-03-23 10:04:09 +07:00
Suphonchai Phoonsawat
23bbd9791e Add CreateChangeRoundMultipleAsync method for batch processing of duty time changes #1555
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m51s
Build & Deploy Placement Service / build (push) Successful in 1m54s
Build & Deploy Insignia Service / build (push) Successful in 1m51s
Build & Deploy Discipline Service / build (push) Successful in 1m51s
2026-03-23 09:49:17 +07:00
Suphonchai Phoonsawat
7e0f0485fd Add TokenUserInfo class and extend ClaimsPrincipal with methods for user claims retrieval
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m49s
2026-03-17 15:47:03 +07:00
harid
b1df33dc20 fix bug #2183
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m56s
2026-03-11 14:01:34 +07:00
Suphonchai Phoonsawat
6902236f48 Add GetTimeStampHistoryAsync2 method for fiscal year timestamp retrieval
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
2026-03-11 11:57:00 +07:00
Suphonchai Phoonsawat
4562029e6e Update GetTimeStampHistoryAsync call to include pagination and keyword filtering
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m8s
2026-03-10 14:10:35 +07:00
Suphonchai Phoonsawat
4650f7a2ab Refactor ScheduleUpdateDnaAsync to handle a list of ScheduleUpdateDnaDto and streamline profile updates #2341
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m59s
2026-02-26 20:36:48 +07:00
Suphonchai Phoonsawat
f866435897 Refactor LeaveBeginningController to simplify duplicate check and comment out LeaveYear property in EditLeaveBeginningDto #2341
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m41s
2026-02-25 16:26:28 +07:00
Suphonchai Phoonsawat
006cea048d Add ScheduleUpdateDna endpoint and DTO for updating DNA information in LeaveBeginningController
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m35s
2026-02-25 15:26:49 +07:00
Suphonchai Phoonsawat
9a74b690cd ทดสอบ
Some checks failed
Build & Deploy Leave Service / build (push) Has been cancelled
2026-02-25 10:13:27 +07:00
Suphonchai Phoonsawat
2ee36af763 Test 2026-02-24 19:43:58 +07:00
Suphonchai Phoonsawat
cd99179621 Enhance leave eligibility check in LeaveRequestController with detailed messaging 2026-02-24 10:24:24 +07:00
Suphonchai Phoonsawat
c20e1b48bd Add GetDifference method to DateTimeExtension and implement TimeCheck endpoint in LeaveRequestController
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m35s
2026-02-23 10:09:36 +07:00
Suphonchai Phoonsawat
5b054f9948 Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
2026-02-20 16:33:33 +07:00
Suphonchai Phoonsawat
3e34aaa178 Refactor file upload logic in LeaveController to handle check-in scenarios more effectively
#2328
2026-02-20 16:32:57 +07:00
harid
ddb35f525a Fix #2319
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m50s
2026-02-20 13:36:50 +07:00
harid
ecca345407 รายชื่อผู้สอบผ่าน กรณี OWNER ให้เห็นรายชื่อเหมือน สกจ. #2319
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m48s
2026-02-20 10:46:15 +07:00
Suphonchai Phoonsawat
7e613ab2e6 Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m43s
2026-02-19 17:34:10 +07:00
Suphonchai Phoonsawat
7eade164e9 Update LeaveRequestController to use GetLastLeaveRequestByTypeForUserAsync2 method with CreatedAt for fetching last leave request 2026-02-19 17:33:37 +07:00
harid
256da24caf แก้ไขสิทธิ์ PARENT ให้เห็นข้อมูลทั้งหมดทุกหน่วยงาน #54
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 1m55s
Build & Deploy Insignia Service / build (push) Successful in 1m48s
Build & Deploy Leave Service / build (push) Successful in 1m49s
Build & Deploy Placement Service / build (push) Successful in 1m46s
Build & Deploy Retirement Service / build (push) Successful in 1m50s
2026-02-19 17:01:44 +07:00
Suphonchai Phoonsawat
869defcc7e Update LeaveRequestRepository to order leave requests by creation date instead of start date #2305
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m44s
2026-02-19 15:19:41 +07:00
Suphonchai Phoonsawat
65feb994ee Add GetLastLeaveRequestByTypeForUserAsync2 method and update LeaveReportController to use new method for fetching last leave request #2305
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m0s
2026-02-19 15:10:44 +07:00
Suphonchai Phoonsawat
d748308419 Enhance LeaveController to implement check-out logic and status validation based on last check-in record 2026-02-19 15:07:04 +07:00
Suphonchai Phoonsawat
b8df2d4024 Add NodaTime package and update LeaveRequestController to use LocalDate for date calculations
#2324
2026-02-19 14:06:59 +07:00
Suphonchai Phoonsawat
c42aaa38f6 Fix API path in UserProfileRepository to remove redundant versioning
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m45s
2026-02-19 10:11:39 +07:00
Suphonchai Phoonsawat
ddaa339e9f Refactor LeaveRequestController and LeaveReportController to use GetSumApproveLeaveTotalByTypeAndRangeForUser2 method and update fiscal year end date calculation #2305
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m41s
2026-02-18 20:24:30 +07:00
Suphonchai Phoonsawat
d70ed254c0 Enhance LeaveRequestController to restore profile checks and implement officer notification logic #2164
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m34s
2026-02-18 16:56:48 +07:00
Suphonchai Phoonsawat
de91fd0fa2 Refactor LeaveBeginningController to restore profile checks and reset leave days to zero 2026-02-18 16:47:14 +07:00
Suphonchai Phoonsawat
7d3ec6c74e Refactor ScheduleUpdateLeaveBeginningAsync to use ScheduleEditLeaveBeginningDto and remove unused profile checks 2026-02-18 16:34:35 +07:00
1b7bdd82e6 #2313
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m10s
2026-02-13 13:04:29 +07:00
Suphonchai Phoonsawat
a8271c8d79 Update leave summary calculation to use BeginningLeaveDays instead of LeaveDaysUsed #2305
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-02-12 20:09:05 +07:00
Suphonchai Phoonsawat
14fd9d5262 Refactor leave limit logic to use IsProbation property instead of govAge check
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s
2026-02-11 12:14:44 +07:00
Suphonchai Phoonsawat
c81220a049 Remove unnecessary whitespace and comment out unused code in LeaveReportController
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m18s
2026-02-11 11:56:04 +07:00
Suphonchai Phoonsawat
e5e7c77880 Add GetProfileByProfileIdNoAuthAsync method and update related controller logic 2026-02-11 11:47:49 +07:00
Suphonchai Phoonsawat
a2ac05ed61 Add BeginningLeaveDays and BeginningLeaveCount to LeaveBeginning DTOs and update controller logic #2304 #2305 2026-02-11 11:11:19 +07:00
Suphonchai Phoonsawat
2410574d42 Fix typo in IsProbatin property name and update related condition check in LeaveRequestController #2306 2026-02-11 10:47:01 +07:00
Suphonchai Phoonsawat
682c88c2db Add BeginningLeaveCount and BeginningLeaveDays to LeaveBeginnings table
- Altered LeaveDays column to update its comment.
- Added BeginningLeaveCount column to track the number of leave occurrences.
- Added BeginningLeaveDays column to store the total days of leave carried over.
2026-02-11 09:44:18 +07:00
harid
05ec0cccce Fix Bug จำนวนคนลาไม่แสดงในรายงาน #2299
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m18s
2026-02-10 15:29:35 +07:00
harid
35310f7854 Fix ประกาศเกษียณลูกจ้าง บันทึกข้อมูลวันที่ประกาศ ระบบแจ้ง Error #2260
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m27s
2026-02-10 12:07:32 +07:00
harid
1d8ef79373 api อัพเดทสถานะเป็นบรรจุ เปลี่ยนสิทธิ์จาก super_admin เป็น owner
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m26s
2026-02-06 10:18:47 +07:00
Suphonchai Phoonsawat
c693364fe1 Refactor LeaveReportController to use LeaveCount instead of CountLeaveDay for leave types
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
2026-02-05 12:03:48 +07:00
Suphonchai Phoonsawat
4f18a97d0b Add GetOCStaffAsync method to UserProfileRepository and create GetOcStaff response models 2026-02-05 11:57:19 +07:00
Suphonchai Phoonsawat
d3cc0781cf Add UpdateLeaveCountAsync method to LeaveBeginningRepository and integrate it into leave request logic #2288
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s
2026-02-05 11:01:49 +07:00
Suphonchai Phoonsawat
639d41649c Add LeaveCount column to LeaveBeginnings table
- Introduced a new column 'LeaveCount' of type int to the LeaveBeginnings table.
- Set default value to 0 and added a comment for clarity in Thai: "จำนวนครั้งที่ลาสะสม".
2026-02-05 10:54:44 +07:00
Suphonchai Phoonsawat
358fd47b99 Add IsProbatin property to GetProfileByKeycloakIdDto and update leave request logic for probationary users #2266 2026-02-05 10:39:57 +07:00
harid
970319e8c2 API อัพเดทสถานะเป็นบรรจุ เฉพาะ Super_admin
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m57s
2026-02-04 11:05:02 +07:00
Suphonchai Phoonsawat
09a7208074 Update govAge calculation to use DateStart instead of DateAppoint in Leave repositories and controller
Some checks failed
Build & Deploy Leave Service / build (push) Failing after 1h5m56s
2026-02-04 10:49:13 +07:00
Suphonchai Phoonsawat
7775ea85c3 Refactor error handling in LeaveController to return appropriate error responses instead of throwing exceptions
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m18s
2026-02-04 10:32:44 +07:00
Suphonchai Phoonsawat
19000b2e42 Refactor check-out status logic to improve clarity and handle edge cases for same-day and next-day check-outs 2026-02-04 10:18:44 +07:00
Suphonchai Phoonsawat
1a0e712a1c Update leave limit logic and add GovAge property to user leave profile DTO
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m10s
2026-02-03 21:03:40 +07:00
Suphonchai Phoonsawat
c25bef0672 Update leave calculations to use DateAppoint and adjust leave limits based on government age #2266
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m35s
2026-02-03 20:46:20 +07:00
Suphonchai Phoonsawat
659e06a08d Add cancellation token support and extend timeout to 30 minutes for external API calls
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m19s
2026-01-30 13:35:58 +07:00
Suphonchai Phoonsawat
0a170fd259 Configure HttpClient to use a 10-minute timeout for long-running operations
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
2026-01-30 10:09:37 +07:00
Suphonchai Phoonsawat
5c05f1123a Increase HttpClient timeout for long-running operations
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m21s
2026-01-30 09:49:54 +07:00
harid
06b53ddeaa Fix Bug Leave Report Issue #2233
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m10s
2026-01-29 15:09:14 +07:00
harid
46504c9e30 Change Call Org
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m15s
2026-01-29 13:37:38 +07:00
harid
e80f89117c Change Call Org 2026-01-29 13:22:41 +07:00
Suphonchai Phoonsawat
4c189fdc4a Fix null reference for CheckIn and CheckOut location names in LeaveController
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m21s
2026-01-29 10:07:29 +07:00
harid
90eb94cee3 กรองค้นหาข้อมูลรายการลงเวลากรณีพิเศษ #2252
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s
2026-01-28 16:24:59 +07:00
harid
b10ff45d07 เปลี่ยนเส้น call api สำหรับเช็ค profileId
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m16s
Build & Deploy Placement Service / build (push) Successful in 1m17s
Build & Deploy Discipline Service / build (push) Successful in 1m32s
2026-01-28 15:06:55 +07:00
harid
02487d91ff เปลี่ยนเส้น api สำหรับเก็บ logs
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
Build & Deploy Discipline Service / build (push) Successful in 1m27s
Build & Deploy Insignia Service / build (push) Successful in 1m25s
Build & Deploy Placement Service / build (push) Successful in 1m17s
Build & Deploy Retirement Service / build (push) Successful in 1m23s
2026-01-28 13:27:25 +07:00
Suphonchai Phoonsawat
839c357842 Update LeaveController to use KeycloakUserId for profile retrieval #2253
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m38s
2026-01-28 11:47:10 +07:00
Suphonchai Phoonsawat
cbc2a1a88d Comment out profile retrieval in LeaveRequestController to prevent unnecessary calls #2250
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m29s
2026-01-27 17:05:07 +07:00
Suphonchai Phoonsawat
e8ffb82ead Comment out profile retrieval and error handling in LeaveRequestController #2250
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m16s
2026-01-27 17:00:22 +07:00
Suphonchai Phoonsawat
54c8152752 Refactor LeaveRequestController to improve filtering logic and update appsettings.json to modify connection strings
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-27 16:55:23 +07:00
Suphonchai Phoonsawat
4f28b4e9e0 Add LeaveTotal property to LeaveRequest DTOs for better leave tracking #2245
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m13s
2026-01-26 22:58:37 +07:00
Suphonchai Phoonsawat
982dfc33d1 Refactor LeaveReportController and LeaveRequestController to calculate leave days using repository methods #2246 #2247
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 11s
2026-01-26 22:35:24 +07:00
harid
2e6a81ff31 Task #2233 รายงานใบลา แสดงสำนักงาน ก.ก.
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m23s
2026-01-26 18:21:33 +07:00
Suphonchai Phoonsawat
22a7a8c17c Update LeaveController to refine check-in/check-out logic based on meeting location #2223
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s
2026-01-26 12:04:58 +07:00
Suphonchai Phoonsawat
c1d689ebfa Update LeaveController to adjust check-in/check-out times based on location for meetings
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
2026-01-23 21:25:34 +07:00
Suphonchai Phoonsawat
ecf5ada7ed Update LeaveController to conditionally set check-out time based on existing value and duty schedule
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
2026-01-23 20:55:21 +07:00
Suphonchai Phoonsawat
9bd6017ded Update LeaveController to adjust check-in/check-out times based on user duty schedule #2223
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m16s
2026-01-23 20:35:54 +07:00
Suphonchai Phoonsawat
e1c7688913 Update LeaveController to set end times based on duty schedule for check-in/check-out #2228 2026-01-23 20:27:22 +07:00
Suphonchai Phoonsawat
4e4eec3d84 Add job status check for pending or processing check-in/check-out requests
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m19s
2026-01-23 09:32:17 +07:00
Suphonchai Phoonsawat
2f366374fa Refactor user profile retrieval to use new method GetProfileByKeycloakIdNewAsync
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-22 12:43:52 +07:00
Suphonchai Phoonsawat
2b737de23b Update ElasticConfiguration URIs and IndexFormats in appsettings for Leave and Insignia
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-22 12:24:27 +07:00
Suphonchai Phoonsawat
d945deae4f Add error handling for permission API calls and enhance logging in middleware
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m15s
2026-01-22 11:58:26 +07:00
harid
d3501e831c fix กจ. ไม่เห็นรายชื่อผู้สอบผ่านหลังจากเผยแพร่โครงสร้าง Task #2219
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m11s
2026-01-21 17:00:45 +07:00
Suphonchai Phoonsawat
c3901d56b3 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2026-01-20 20:55:25 +07:00
Suphonchai Phoonsawat
27b3773c79 load test script 2026-01-20 20:54:47 +07:00
harid
5219934e05 fix #2207
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m19s
2026-01-20 17:30:11 +07:00
harid
15f5d7cae7 Task #2207 กรณีคนขอโอนอยู่ในสำนักปลัดกรุงเทพมหานคร
Some checks failed
Build & Deploy Placement Service / build (push) Failing after 36s
2026-01-20 16:41:22 +07:00
Suphonchai Phoonsawat
d7b257f0ce Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
Build & Deploy Checkin Service / build (push) Successful in 1m13s
2026-01-20 11:20:16 +07:00
Suphonchai Phoonsawat
e3a228773e Add scheduled job to clean up CheckIn Job Status older than 30 days 2026-01-20 11:14:30 +07:00
Suphonchai Phoonsawat
90eea1ac7f Enhance CombinedErrorHandlerAndLoggingMiddleware with caching and improved token handling 2026-01-20 11:09:13 +07:00
Suphonchai Phoonsawat
a463df5716 Add migration to create CheckInJobStatuses table for RMQ task control
- Introduced a new migration that creates the CheckInJobStatuses table.
- The table includes fields for tracking job statuses, timestamps, user information, and error messages.
- Supports various statuses such as PENDING, PROCESSING, COMPLETED, and FAILED.
2026-01-20 10:49:13 +07:00
harid
60602d99c4 api ขอโอน (admin) เพิ่มบันทึกฟิลล์ "ขอโอนตั้งแต่วันที่" #2196
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m23s
2026-01-20 09:54:15 +07:00
harid
9442d3b29f fix #2173
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m15s
2026-01-20 09:32:10 +07:00
Suphonchai Phoonsawat
3532df32fd Refactor message consumption to start after 8:10 AM and implement time checks for operating hours
All checks were successful
Build & Deploy Checkin Service / build (push) Successful in 1m20s
2026-01-20 05:38:42 +07:00
Suphonchai Phoonsawat
6c8e79b1bc Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m9s
Build & Deploy Checkin Service / build (push) Successful in 2m4s
2026-01-19 22:43:24 +07:00
Suphonchai Phoonsawat
0ab75b2a19 Add delay to start message consumption until 8:10 AM and implement time calculation 2026-01-19 22:42:39 +07:00
harid
1aab307f6a fix รายการให้ออกลูกจ้าง ระบบใช้สิทธิ์ API เส้นเดียวกับของขรก. #2173
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m21s
2026-01-19 18:17:11 +07:00
harid
93a83b34e6 ปรับแบบใบขอยกเลิกวันลา
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s
2026-01-19 17:15:17 +07:00
Suphonchai Phoonsawat
79e0fe7f1b Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m20s
2026-01-19 14:28:29 +07:00
Suphonchai Phoonsawat
21f82d69e1 Add load testing script for simulating 30,000 requests over 10 minutes 2026-01-19 14:27:43 +07:00
harid
b5c82f4243 ปรับรายงานลา #2195
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
2026-01-19 12:13:45 +07:00
Suphonchai Phoonsawat
b0715e3da6 refactor LeaveController to update check-out status logic based on morning end time #2187
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-16 16:19:49 +07:00
Suphonchai Phoonsawat
510f1cd78a fix sort order condition
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m15s
2026-01-16 16:09:23 +07:00
Suphonchai Phoonsawat
83a915f92c refactor LeaveReportController to sort employees by check-in time and remark #2193 2026-01-16 16:01:07 +07:00
harid
094789bfb1 API ขอลาออกและโอนออก ฝั่ง admin #2196
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m22s
Build & Deploy Retirement Service / build (push) Successful in 1m23s
2026-01-16 15:43:55 +07:00
harid
64c1021c52 Migrate เก็บฟิลด์ใช้แสดงในรายงานลาเพิ่ม #2195
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m18s
2026-01-16 09:25:22 +07:00
Suphonchai Phoonsawat
5ec7933b3c refactor LeaveController to correct end time parsing for seminar handling #2199
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m11s
2026-01-14 16:51:21 +07:00
Suphonchai Phoonsawat
9e529ed19b refactor LeaveController to update checkout-check endpoint to accept string for seminar handling #2199 2026-01-14 16:43:35 +07:00
Suphonchai Phoonsawat
3e8c3d998e refactor LeaveController to modify checkout-check endpoint for seminar handling #2199 2026-01-14 16:42:36 +07:00
Suphonchai Phoonsawat
3a6e4501fd refactor LeaveController to update start and end time logic for check-in and check-out #2199 2026-01-14 16:38:55 +07:00
Suphonchai Phoonsawat
5415019b3c refactor LeaveController to update image URL handling for check-in and check-out #2188
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-14 10:25:31 +07:00
Suphonchai Phoonsawat
86790cf9f3 refactor LeaveReportController to enhance employee sorting by remark and check-in/check-out times #2193
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m16s
2026-01-14 10:16:42 +07:00
Suphonchai Phoonsawat
127909d29d Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m23s
2026-01-13 17:02:31 +07:00
Suphonchai Phoonsawat
6907607a06 refactor LeaveController to improve sorting and pagination logic #2192 2026-01-13 17:01:20 +07:00
harid
0233d92931 Change function call Org Service
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2026-01-13 12:05:52 +07:00
harid
90ea986831 fix รายงานใบลา ข้อมูลแสดงในรายงานแสดงไม่ครบ #2184
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s
2026-01-12 17:23:08 +07:00
Suphonchai Phoonsawat
1c3ce46bcb update LeaveController to determine status based on leave request and range
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
#2187
2026-01-12 13:41:23 +07:00
398679cbcc rollback
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m15s
2026-01-11 21:10:24 +07:00
d831b208de Merge branch 'develop' into dev
* develop:
  update LeaveController to handle additional leave range options for check-in and check-out statuses
  update LeaveController to pass currentDate parameter to GetLastEffectRound method
  update LeaveReportController to pass date parameter to GetLastEffectRound method
  update GetLastEffectRound method to accept effectiveDate parameter and adjust usage in LeaveReportController
  add noti discord
  fix build report
  fix build report to v2 and add noti
  remove build forgejo, move to dev branch
2026-01-11 20:39:39 +07:00
kittapath
49cb60dee7 report leave api4
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m9s
2026-01-11 16:35:02 +07:00
kittapath
5cdef791f3 report leave 2026-01-11 15:17:02 +07:00
Suphonchai Phoonsawat
7b97cd09a3 update LeaveController to handle additional leave range options for check-in and check-out statuses
Some checks failed
DockerHub Release - Leave Service / release-to-dockerhub (push) Failing after 12s
2026-01-09 20:24:50 +07:00
Suphonchai Phoonsawat
3f13557b31 update LeaveController to pass currentDate parameter to GetLastEffectRound method 2026-01-09 19:11:52 +07:00
Suphonchai Phoonsawat
95cd49ecbc update LeaveReportController to pass date parameter to GetLastEffectRound method 2026-01-09 19:10:16 +07:00
kittapath
6e531e4d16 export report leave
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m8s
2026-01-09 18:59:11 +07:00
Suphonchai Phoonsawat
99accd44e3 update GetLastEffectRound method to accept effectiveDate parameter and adjust usage in LeaveReportController 2026-01-09 18:57:24 +07:00
a540912202 add noti discord 2026-01-09 18:43:59 +07:00
0690337422 fix build report
Some checks failed
DockerHub Release - Report Service / release-to-dockerhub (push) Failing after 10s
2026-01-09 16:35:33 +07:00
8c1a219084 fix build report to v2 and add noti
Some checks failed
DockerHub Release - Report Service / release-to-dockerhub (push) Failing after 12s
2026-01-09 16:29:43 +07:00
9dfd5efafc Merge branch 'develop'
Some checks failed
DockerHub Release - Leave Service / release-to-dockerhub (push) Failing after 11s
* develop:
  remove workflow integration from LeaveRequestController #2164
2026-01-09 11:05:53 +07:00
98adc74792 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m11s
* develop:
  remove workflow integration from LeaveRequestController #2164
2026-01-09 11:03:53 +07:00
Suphonchai Phoonsawat
14eb80a30e Merge branch 'develop' into working 2026-01-07 12:07:21 +07:00
Suphonchai Phoonsawat
e8dfe976a2 remove workflow integration from LeaveRequestController #2164 2026-01-07 12:06:49 +07:00
8f491c1b12 Merge branch 'main' of ssh://hrms-git.bangkok.go.th:6611/BMA-HRMS/hrms-api-backend
* 'main' of ssh://hrms-git.bangkok.go.th:6611/BMA-HRMS/hrms-api-backend:
2026-01-07 11:28:51 +07:00
a6de2791c4 Merge branch 'develop'
* develop:
  #2150
  fix รันเครื่องราชแต่หน่วยงานไม่ครบ #1831
  ปรับ query แบบใบขอยกเลิกวันลา
  find org v2
  change to v2
2026-01-07 11:28:39 +07:00
a739d52c46 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m9s
2026-01-05 16:39:57 +07:00
4865bab7e2 Merge branch 'develop' into adiDev 2026-01-05 16:39:14 +07:00
f9ca9b52af #2150 2026-01-05 16:38:30 +07:00
harid
be57524f1b Merge branch 'develop' into dev
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 1m10s
2026-01-05 16:22:05 +07:00
harid
517755d758 fix รันเครื่องราชแต่หน่วยงานไม่ครบ #1831 2026-01-05 16:12:11 +07:00
harid
05689b5338 ปรับ query แบบใบขอยกเลิกวันลา 2026-01-05 13:20:00 +07:00
kittapath
a381ff1528 Merge branch 'develop'
Some checks failed
DockerHub Release - Leave Service / release-to-dockerhub (push) Failing after 11s
2026-01-02 21:57:09 +07:00
kittapath
ed04bf8258 Merge branch 'develop' into dev 2026-01-02 21:47:40 +07:00
kittapath
909042445c find org v2
Some checks failed
release-dev / release-dev (push) Failing after 12s
2026-01-02 21:47:26 +07:00
kittapath
cb074e3e25 find org v2 2026-01-02 21:46:39 +07:00
kittapath
7e71f528ab Merge branch 'develop' into dev
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m6s
2026-01-02 10:22:13 +07:00
kittapath
adb8e31308 Merge branch 'develop'
Some checks failed
DockerHub Release - Leave Service / release-to-dockerhub (push) Failing after 12s
2025-12-31 10:08:06 +07:00
kittapath
0b0cc53e07 change to v2 2025-12-31 10:07:01 +07:00
72b9c6e31e remove build forgejo, move to dev branch
Some checks failed
DockerHub Release - Leave Service / release-to-dockerhub (push) Failing after 15s
2025-12-31 08:02:16 +07:00
9fe3c82a9b Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m24s
* develop:
  leave v2
2025-12-31 07:45:50 +07:00
kittapath
8973e1b78f leave v2 2025-12-30 23:55:03 +07:00
Suphonchai Phoonsawat
4a94aae6e3 Merge branch 'develop' 2025-12-26 09:58:00 +07:00
Suphonchai Phoonsawat
7caf1cc8d6 add date range parameters to GetProfileByAdminRole and GetEmployeeByAdminRole methods 2025-12-26 09:51:51 +07:00
c87e467a6e change build to docker hub 2025-12-23 23:32:02 +07:00
d10c86e0cb add: build docker hub 2025-12-23 21:50:04 +07:00
2b1d6852c9 add build placement 2025-12-23 21:18:04 +07:00
bde1aa21c9 test build leave 2025-12-23 21:09:15 +07:00
8bb31b4e73 updated deploy 2025-12-23 20:30:37 +07:00
804a4cf85f add: build leave 2025-12-23 20:21:25 +07:00
harid
b03be82f7c Merge branch 'develop'
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 1m7s
2025-12-23 18:04:16 +07:00
harid
b2fcc4a5b9 fix #2082 2025-12-23 18:02:59 +07:00
ed26d8443c Merge branch 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend
* 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend:
2025-12-23 17:20:35 +07:00
b55e1d1f63 Merge branch 'develop'
* develop:
  กรองสิทธิ์หน้ารายชื่อผู้ถูกพักราชการ #2084
  #2146 and #2147
  add filter status #2083
  #2142
  fix: update image retrieval logic in LeaveController and adjust RabbitMQ configuration in appsettings
  #2132
  fix ลาติดตามคู่สมรส รายงานแสดง Null
  แก้เอกสารรายงานการลา #2109
  fix: enhance database context configuration with retry logic for resilience
  fix: update end time parsing and improve attendance status logic
  fix: update leave remark formatting for better clarity
  fix report leave12
  fix: improve approval step validation by checking for commanders
  feat: enhance leave request filtering and update configuration settings
  query leave report
  add permission brother
  migrate + api บันทึกผู้ตรวจสอบและส่งไปพิจาณา #2109
2025-12-23 17:20:13 +07:00
harid
99838ba1ff Merge branch 'develop'
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 1m22s
2025-12-22 16:16:41 +07:00
harid
fd8e0e78b6 กรองสิทธิ์หน้ารายชื่อผู้ถูกพักราชการ #2084 2025-12-22 16:16:07 +07:00
37281fc036 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m13s
2025-12-22 13:45:37 +07:00
fb282915d1 #2146 and #2147 2025-12-22 13:45:11 +07:00
harid
80dca3dfac Merge branch 'develop'
All checks were successful
Build & Deploy Discipline Service / build (push) Successful in 1m16s
2025-12-22 09:50:24 +07:00
harid
3b58d38eb1 add filter status #2083 2025-12-22 09:49:59 +07:00
121e605699 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m8s
2025-12-19 14:24:09 +07:00
97c9064ab5 #2142 2025-12-19 14:23:27 +07:00
harid
e0d253cc68 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m6s
2025-12-18 16:32:13 +07:00
Suphonchai Phoonsawat
d5c2c54eaa fix: update image retrieval logic in LeaveController and adjust RabbitMQ configuration in appsettings
Some checks failed
release-dev / release-dev (push) Failing after 13s
#2138
2025-12-18 14:08:05 +07:00
90cb343941 Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m10s
2025-12-17 16:08:43 +07:00
d6497a5d51 #2132
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-12-17 15:38:35 +07:00
harid
9becd892f5 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
2025-12-16 11:56:49 +07:00
harid
cc8cd77560 fix ลาติดตามคู่สมรส รายงานแสดง Null
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-16 10:37:27 +07:00
harid
7e039b798d Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m16s
2025-12-15 18:17:53 +07:00
harid
795502a93c แก้เอกสารรายงานการลา #2109
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-15 16:46:37 +07:00
harid
d703337b4b Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m10s
2025-12-15 14:29:42 +07:00
Suphonchai Phoonsawat
18ab28e335 fix: enhance database context configuration with retry logic for resilience
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-12-15 11:12:29 +07:00
Suphonchai Phoonsawat
ff66aebdfa fix: update end time parsing and improve attendance status logic
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-15 10:29:23 +07:00
Suphonchai Phoonsawat
e023ed65f7 fix: update leave remark formatting for better clarity
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-15 09:48:08 +07:00
harid
d7ebe9cdca Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m9s
2025-12-12 17:51:30 +07:00
harid
02a5eacd0f fix report leave12
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-12 17:51:04 +07:00
harid
199d0c90e3 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m3s
2025-12-12 16:17:37 +07:00
Suphonchai Phoonsawat
328f54b4e3 fix: improve approval step validation by checking for commanders
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-12 16:13:01 +07:00
harid
0e21e10d24 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m2s
2025-12-12 15:42:55 +07:00
Suphonchai Phoonsawat
88a48577e9 feat: enhance leave request filtering and update configuration settings
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-12 15:18:27 +07:00
harid
23a6058eba query leave report
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-12 12:27:52 +07:00
harid
07dd715e16 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m2s
Build & Deploy Discipline Service / build (push) Successful in 1m4s
Build & Deploy Placement Service / build (push) Successful in 1m6s
Build & Deploy Insignia Service / build (push) Successful in 1m6s
Build & Deploy Retirement Service / build (push) Successful in 1m12s
2025-12-12 09:41:07 +07:00
kittapath
ec04665f39 add permission brother
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-12 01:36:06 +07:00
harid
0a58075428 migrate + api บันทึกผู้ตรวจสอบและส่งไปพิจาณา #2109
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-11 21:27:18 +07:00
b6862b93bf Merge branch 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend
* 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend:
2025-12-11 17:41:00 +07:00
b51cf9a919 Merge branch 'develop'
* develop:
  fix: สิทธิ์ PARENTข้อมูลแต่ละสำนักไม่เท่ากัน
  feat: add DNA update functionality and enrich leave beginning data with profile details
  fix: skip approver check if no commander is assigned; update leave data retrieval logic
  rollback user/calendar & add api admin/calendar
  แก้กรองตามสิทธิ์ #2104
2025-12-11 17:40:42 +07:00
harid
14cc614864 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m6s
2025-12-09 15:02:25 +07:00
harid
59fd20c879 fix: สิทธิ์ PARENTข้อมูลแต่ละสำนักไม่เท่ากัน
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-09 15:00:18 +07:00
Suphonchai Phoonsawat
fc68cb0101 feat: add DNA update functionality and enrich leave beginning data with profile details
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-12-09 13:12:54 +07:00
Suphonchai Phoonsawat
6b9767449c fix: skip approver check if no commander is assigned; update leave data retrieval logic
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-12-09 10:36:06 +07:00
harid
51f1a4c563 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m11s
2025-12-08 17:42:56 +07:00
harid
2981f865b3 rollback user/calendar & add api admin/calendar
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-12-08 17:40:12 +07:00
harid
b4e303e0a7 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m10s
2025-12-08 12:12:48 +07:00
harid
08fb06ca84 แก้กรองตามสิทธิ์ #2104 2025-12-08 12:12:04 +07:00
ec3b267a6c Merge branch 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend
* 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend:
2025-12-08 10:11:18 +07:00
a047787fb4 Merge branch 'develop'
* develop:
  fix: skip notification if no commander is assigned; update connection strings in appsettings
  edit permission normal
  fix สิทธิ์เมนูจำนวนสิทธิ์การลาที่ใช้ไป #2094
  Fix รายงานใบสมัครสอบส่วนเนื้อหาคำรับรองเพี้ยน #2099
  migration files
  migrate to CM Server
  no message
  fix role
  แก้ไขข้อความให้ตรงกับฝั่ง ui (ทาง กทม. แจ้งให้แก้ไขข้อความค่ะ)
  แก้ไขข้อความให้ตรงกับฝั่ง ui (ทาง กทม. แจ้งให้แก้ไขข้อความค่ะ)
  no message
  fix bug เพิ่ม-แก้ไขข้อมูลประวัติการศึกษาไม่อัปเดต #2022, #2025
  fix #2016, #2017
  fix ใบสมัครสอบ
  fix ยืมคืนเครื่องราชย?มาใช้่ RootDnaId แทน rootId
  fix ใบสมัครสอบคัดเลือก #2016, #2017, #2018
  fix issue #2007
  fix issues 1972
  migrate
2025-12-08 10:11:10 +07:00
harid
21c10d66f5 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m11s
Build & Deploy Insignia Service / build (push) Successful in 1m10s
Build & Deploy Placement Service / build (push) Successful in 1m13s
Build & Deploy Discipline Service / build (push) Successful in 1m27s
2025-12-08 09:26:10 +07:00
Suphonchai Phoonsawat
7778f6cccd fix: skip notification if no commander is assigned; update connection strings in appsettings
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-12-08 05:32:32 +07:00
kittapath
436370312e edit permission normal 2025-12-06 18:03:33 +07:00
harid
5451c49dbe fix สิทธิ์เมนูจำนวนสิทธิ์การลาที่ใช้ไป #2094 2025-12-04 22:13:25 +07:00
harid
27112a060c Fix รายงานใบสมัครสอบส่วนเนื้อหาคำรับรองเพี้ยน #2099 2025-12-04 21:06:02 +07:00
Suphonchai Phoonsawat
f78d188979 migration files 2025-12-04 19:38:40 +07:00
Suphonchai Phoonsawat
f2d17c3a38 migrate to CM Server 2025-12-04 19:38:25 +07:00
harid
48792f0d31 no message 2025-12-04 16:15:38 +07:00
harid
d2569d8cef Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s
2025-12-03 17:22:14 +07:00
harid
db7626ce69 fix role 2025-12-03 17:21:34 +07:00
e9d48d1930 แก้ไขข้อความให้ตรงกับฝั่ง ui (ทาง กทม. แจ้งให้แก้ไขข้อความค่ะ) 2025-12-02 12:25:39 +07:00
62aa25793b แก้ไขข้อความให้ตรงกับฝั่ง ui (ทาง กทม. แจ้งให้แก้ไขข้อความค่ะ) 2025-12-02 12:19:39 +07:00
harid
a9bacdc6ae Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m4s
Build & Deploy Insignia Service / build (push) Successful in 1m7s
2025-11-24 16:22:06 +07:00
harid
cf9ae391a5 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-24 16:01:48 +07:00
harid
c1416a2a33 fix bug เพิ่ม-แก้ไขข้อมูลประวัติการศึกษาไม่อัปเดต #2022, #2025
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-11-24 10:37:26 +07:00
harid
84df3d4b86 Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m5s
2025-11-21 16:50:02 +07:00
harid
079641c7ad fix #2016, #2017
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-11-21 16:49:39 +07:00
harid
287c11dfd5 Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m13s
2025-11-21 15:00:19 +07:00
harid
b1afbe53ef fix ใบสมัครสอบ 2025-11-21 14:59:45 +07:00
harid
17259598c9 Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m3s
2025-11-21 10:41:00 +07:00
Suphonchai Phoonsawat
d1bda77fa9 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-21 09:46:17 +07:00
Suphonchai Phoonsawat
14fd93ae95 fix ยืมคืนเครื่องราชย?มาใช้่ RootDnaId แทน rootId 2025-11-21 09:45:55 +07:00
harid
842ed531f5 fix ใบสมัครสอบคัดเลือก #2016, #2017, #2018
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-20 18:11:09 +07:00
harid
223a78ce9e Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m12s
2025-11-19 18:10:09 +07:00
harid
65e85b7194 fix issue #2007
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-19 17:44:58 +07:00
harid
16cc6b5111 Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m11s
2025-11-19 13:48:21 +07:00
harid
7ee1477ee2 fix issues 1972
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-11-19 12:04:08 +07:00
harid
0065468568 migrate
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-11-17 18:20:29 +07:00
harid
ee0bb692ec Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m11s
2025-11-12 11:00:40 +07:00
kittapath
b4cc522fef update api key
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-11-12 01:56:06 +07:00
harid
b478b9eded แก้สละสิทธิ์ไม่ต้องเคลยีร์ข้อมูลราชการ Issue #1956
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-11 18:07:59 +07:00
5dab116166 Merge branch 'develop'
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m9s
2025-11-11 14:18:55 +07:00
a85749010a #1947
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-11-11 14:18:09 +07:00
b345091905 Merge branch 'develop'
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m10s
2025-11-11 12:05:33 +07:00
b1c0ab8266 Merge branch 'adiDev' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-11 12:03:28 +07:00
3fd9d05cd2 #1820 2025-11-11 12:03:14 +07:00
Suphonchai Phoonsawat
87c4f85bf6 fix การนับจำนวน ต้องแยก officer + employee
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-11-11 11:51:22 +07:00
Suphonchai Phoonsawat
f081034e36 fix hangfire แยก job ออกจากกัน และแก้เรื่องการส่ง token
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-11 10:40:49 +07:00
Suphonchai Phoonsawat
998ca38da8 change method
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-11-11 09:51:18 +07:00
Suphonchai Phoonsawat
2187142668 fix hangfire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-11 05:43:02 +07:00
Suphonchai Phoonsawat
36aea81d54 change to unauthorize api
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-11-10 15:02:44 +07:00
Suphonchai Phoonsawat
5fc3cfa3b4 fix #1831
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-11-09 09:58:41 +07:00
Suphonchai Phoonsawat
4375ca0da8 fix mange to manage.id
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-11-09 09:45:52 +07:00
2295aedc3a Merge branch 'develop'
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m9s
* develop:
  sort retire
  update order
  add order retirement
  update สิทธิ์
2025-11-04 09:09:27 +07:00
kittapath
54358ac845 sort retire
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-30 22:52:22 +07:00
kittapath
d65107ad40 update order 2025-10-30 22:13:39 +07:00
kittapath
755dd9d06e add order retirement 2025-10-30 21:59:33 +07:00
5007b6f10d update สิทธิ์
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-28 09:25:48 +07:00
harid
0f45792e74 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m5s
Build & Deploy Discipline Service / build (push) Successful in 1m7s
Build & Deploy Insignia Service / build (push) Successful in 1m8s
Build & Deploy Placement Service / build (push) Successful in 1m9s
Build & Deploy Retirement Service / build (push) Successful in 1m19s
2025-10-24 15:38:17 +07:00
Harid Promsri
451757be65
วุฒิการศึกษา default ปริญญาตรี (#1898)
Some checks failed
release-dev / release-dev (push) Failing after 10s
Co-authored-by: harid <harid_pr61@live.rmutl.com>
2025-10-24 14:55:48 +07:00
kittapath
503805b194 sort leave date 2025-10-22 23:43:19 +07:00
Suphonchai Phoonsawat
720027b26c
Update ssh-action version in release workflow (leave)
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-20 15:30:26 +07:00
Suphonchai Phoonsawat
cd3c356d02 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-20 15:12:24 +07:00
Suphonchai Phoonsawat
55f0dc6876 แก้ไข เวลาเปลี่ยนรอบเป็น isactive = false ให้ไปลบรายการที่เคยเอาไปผูกกับ user ด้วย 2025-10-20 15:12:01 +07:00
Harid Promsri
4fb82bf25a
ปรับให้เรียงตามปีงบล่าสุดก่อน (#1878)
Co-authored-by: harid <harid_pr61@live.rmutl.com>
2025-10-20 15:07:43 +07:00
kittapath
c0f4cd3bdf role insignia
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-17 00:07:08 +07:00
kittapath
f8a71f6624 error excel leave
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-16 23:47:27 +07:00
kittapath
85e1c95f97 แก้สิทธิ์
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-16 23:04:29 +07:00
7d9c3fa46b fix role normal
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-16 17:57:43 +07:00
d6e4426e08 fix insert dna #1480
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-16 14:38:15 +07:00
821c4614c3 #1480
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-16 11:48:01 +07:00
fbcd1b6984 Merge branch 'develop'
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m12s
Build & Deploy Discipline Service / build (push) Successful in 1m19s
* develop: (27 commits)
  แก้บรรจุ
  test parent
  แก้ search ช้า
  refactor code
  delete comment
  edit query
  ปรับให้จัด group ตามที่กรอง (#1858)
  ทำฟังก์ชันกลางคำนวณปีงบประมาณ
  fix sort api/v1/leave/search (#1852)
  fix sort /api/v1/leave/admin/edit (#1848)
  จัด Align (#1846)
  fix #1841, #1842
  fix timestamp report #1843 (#1844)
  add parent
  sort Discipline
  #1838
  sortBy #1814
  fix report
  fix #1835
  fix #24
  ...

# Conflicts:
#	BMA.EHR.Insignia/Services/InsigniaRequestProcessService.cs
2025-10-14 12:27:30 +07:00
kittapath
81658054f8 แก้บรรจุ
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-13 23:06:02 +07:00
kittapath
f97e643ac1 test parent 2025-10-12 16:51:51 +07:00
kittapath
84ab5e79d6 แก้ search ช้า 2025-10-12 16:11:31 +07:00
51962eea16
Merge pull request #1863 from Frappet/issue/#1859
Some checks failed
release-dev / release-dev (push) Failing after 10s
ทำฟังก์ชันกลางคำนวณปีงบประมาณ
2025-10-10 10:14:34 +07:00
kittapath
ed1bb838ce refactor code 2025-10-09 23:21:36 +07:00
kittapath
8ba9d349db delete comment 2025-10-09 22:16:19 +07:00
kittapath
559765dd86 Merge branch 'develop' into task/173
# Conflicts:
#	BMA.EHR.Leave/Controllers/LeaveController.cs
2025-10-09 21:44:58 +07:00
kittapath
4ba48d0e70 edit query 2025-10-09 21:43:25 +07:00
Harid Promsri
5f0a0b1a46
ปรับให้จัด group ตามที่กรอง (#1858)
Co-authored-by: harid <harid_pr61@live.rmutl.com>
2025-10-09 16:49:10 +07:00
harid
3d9f922fc9 ทำฟังก์ชันกลางคำนวณปีงบประมาณ 2025-10-09 16:43:37 +07:00
AdisakKanthawilang
fe4a174bf7
fix sort api/v1/leave/search (#1852)
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-08 17:23:10 +07:00
AdisakKanthawilang
f784205412
fix sort /api/v1/leave/admin/edit (#1848) 2025-10-08 11:01:57 +07:00
Harid Promsri
0dcabaa25d
จัด Align (#1846)
Co-authored-by: harid <harid_pr61@live.rmutl.com>
2025-10-07 17:15:32 +07:00
Suphonchai Phoonsawat
4494939c5f fix #1841, #1842
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-07 14:52:59 +07:00
Harid Promsri
7ddc1debfc
fix timestamp report #1843 (#1844)
Some checks failed
release-dev / release-dev (push) Failing after 12s
Co-authored-by: harid <harid_pr61@live.rmutl.com>
2025-10-07 13:17:58 +07:00
kittapath
9e8fe1b30a add parent 2025-10-07 11:13:28 +07:00
1ec8e51c37 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-10-06 16:28:42 +07:00
12c8bc5014 sort Discipline 2025-10-06 16:28:16 +07:00
Suphonchai Phoonsawat
ad6a458973 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-06 15:37:39 +07:00
Suphonchai Phoonsawat
f9d1dd9f38 #1838 2025-10-06 15:37:13 +07:00
harid
5efb1c99c6 sortBy #1814
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-06 15:12:40 +07:00
Suphonchai Phoonsawat
946721ffb2 fix report
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-06 12:30:48 +07:00
Suphonchai Phoonsawat
8529c3d801 fix #1835
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-06 11:30:06 +07:00
Suphonchai Phoonsawat
97dd104429 fix #24
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-03 20:28:49 +07:00
harid
d0599aedea comment เพราะไม่ได้ใช้แล้ว #1831
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-03 11:04:39 +07:00
Suphonchai Phoonsawat
ddf899ce5d Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-02 19:51:20 +07:00
Suphonchai Phoonsawat
1e275748a0 fix #26, #1832 2025-10-02 19:50:55 +07:00
harid
389adeec2f Fix Error #1815
Some checks failed
release-dev / release-dev (push) Failing after 12s
root || owner กรองตาม fe ส่ง
2025-10-02 17:11:22 +07:00
Suphonchai Phoonsawat
faf62f1985 #1831
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-01 20:06:32 +07:00
Suphonchai Phoonsawat
8d37024b6c #1832, 1830
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-10-01 19:57:13 +07:00
Suphonchai Phoonsawat
1f3632744d Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-10-01 15:24:46 +07:00
Suphonchai Phoonsawat
9de97f9d90 fix fiscal year in check leave 2025-10-01 15:24:33 +07:00
harid
2aa66acfd0 ประกาศเกษียณ ส่งวันที่ประกาศเพิ่ม
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-10-01 11:46:48 +07:00
95c62accef Merge branch 'develop'
Some checks failed
Build & Deploy Leave Service / build (push) Has been cancelled
2025-09-30 18:05:28 +07:00
harid
e51ca439f9 กำหนดให้ไฟล์ template ถูก copy ไป output ตอน build/publish
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-09-30 16:54:14 +07:00
harid
edbd337ab6 รายงานลงเวลา ปรับให้การแสดงผลเหมือนเดิมก่อนแก้ไข #1815
Some checks failed
release-dev / release-dev (push) Failing after 12s
เปลี่ยนจากโหลดโดยตรงเป็นผ่านโคลนจากtemplate
2025-09-30 15:00:02 +07:00
Bright
373e2a06d8 no message
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-09-29 15:00:02 +07:00
Bright
777f4d0930 no message
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-09-29 13:44:35 +07:00
Bright
be45cf58b8 #1409 แก้เป็นส่ง refId ของคำสั่งขอลาออกไปค้นที่ command ก่อนอัพ status = CANCEL
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-09-29 11:44:31 +07:00
Bright
081260a83b ยกเลิกลาออก ยิงกลับไปที่ command เปลี่ยนเป็น cancel
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-09-25 18:18:01 +07:00
kittapath
77eaca72b3 ออกคำสั่งยกเลิก 2025-09-25 02:30:33 +07:00
6fb574f9de fix cicd all service
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 1m19s
2025-09-16 19:13:14 +07:00
0dcd76c302 fix
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m29s
2025-09-16 18:52:04 +07:00
33e8bf5ab7 Revert "fix"
This reverts commit e52d6430b0.
2025-09-16 18:26:51 +07:00
6d42484297 Revert "fix"
This reverts commit f1c3163116.
2025-09-16 18:26:33 +07:00
f1c3163116 fix
Some checks failed
Build & Deploy Placement Service / build (push) Failing after 0s
2025-09-16 18:22:33 +07:00
9a4e49eb88 Revert "fix"
This reverts commit 69af557f95.
2025-09-16 18:16:35 +07:00
69af557f95 fix
Some checks failed
Build & Deploy Placement Service / build (push) Failing after 18s
2025-09-16 18:15:29 +07:00
e52d6430b0 fix
Some checks failed
Build & Deploy Placement Service / build (push) Failing after 1m41s
2025-09-16 17:57:57 +07:00
45f6c5626e fix cicd placement
Some checks failed
Build & Deploy Placement Service / build (push) Failing after 1m5s
2025-09-16 17:53:11 +07:00
063e54c4e0 Update .forgejo/workflows/build-placement.yml
Some checks failed
Build / build (push) Failing after 12s
2025-09-16 17:45:04 +07:00
7254b1ed87 Update .forgejo/workflows/deploy.yml 2025-09-16 17:40:51 +07:00
a892fe9ee3 Update .forgejo/workflows/build.yml 2025-09-16 17:37:26 +07:00
0fe60d3212 Update .forgejo/workflows/build.yml 2025-09-16 17:35:43 +07:00
cd7ac8de17 Update .forgejo/workflows/build-report_backup.yml 2025-09-16 15:45:23 +07:00
aa1708474b Update .forgejo/workflows/build-command_backup.yml 2025-09-16 15:45:10 +07:00
87e6f88cf6 Update .forgejo/workflows/build-report_bk.yml 2025-09-16 15:44:13 +07:00
d0c5bafdba fix cicd noti
All checks were successful
Build / build (push) Successful in 1m34s
2025-09-16 13:46:02 +07:00
643b6903d9 add noti
All checks were successful
Build / build (push) Successful in 1m39s
2025-09-16 13:30:24 +07:00
5c0f8877a4 Merge branch 'develop' 2025-09-16 12:13:24 +07:00
f1540de911 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-09-15 10:54:34 +07:00
2a02bdf9f7 sort api/v1/leave/user/table and api/v1/discipline/complaint_appeal/user/{id} 2025-09-15 10:48:47 +07:00
kittapath
463d439a1a add service 2025-09-14 22:01:39 +07:00
kittapath
e08dc350fe Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-09-14 21:03:12 +07:00
kittapath
aa904079a2 add holiday 2025-09-14 21:02:24 +07:00
c6c49ffaff Update BMA.EHR.Insignia/Services/InsigniaRequestProcessService.cs 2025-09-11 15:31:57 +07:00
51fc5c6395 Update BMA.EHR.Insignia/Services/InsigniaRequestProcessService.cs 2025-09-11 15:28:00 +07:00
Bright
a0cfb23350 แก้แนบท้ายคำสั่งคำสั่งบรรจุกลับ
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-09-10 16:41:41 +07:00
kittapath
9eae970ff3 แนบท้าย 2025-09-09 17:54:08 +07:00
6bba1b19ce fix error 2025-09-09 17:30:03 +07:00
777c9563ca Merge branch 'main' of https://192.168.1.60/hrms-bangkok/hrms-api-backend 2025-09-09 17:00:03 +07:00
62867d54c3 update build config 2025-09-09 16:59:55 +07:00
3c34245d1c Update .forgejo/workflows/build-retirement.yml 2025-09-09 16:50:57 +07:00
5561817fa4 reverse 2025-09-09 16:38:49 +07:00
ba7dae2bd8 test 2025-09-09 16:31:37 +07:00
829149a091 update build config 2025-09-09 16:16:00 +07:00
d4e0661964 build config 2025-09-09 14:45:35 +07:00
2abb32f74b Update .forgejo/workflows/build.yml 2025-09-09 14:23:58 +07:00
7d680658e4 Update .forgejo/workflows/build.yml 2025-09-09 14:06:01 +07:00
d0cad2de8b build and deploy config 2025-09-09 13:30:27 +07:00
b01031e919 Delete .forgejo/workflows/build.yaml 2025-09-09 13:25:42 +07:00
57a6d9a6c6 Add .forgejo/workflows/build.yaml 2025-09-09 13:25:27 +07:00
0516b289fe Delete .forgejo/workflows 2025-09-09 13:24:46 +07:00
fc26ab4064 Add .forgejo/workflows 2025-09-09 13:24:33 +07:00
223c891782 Delete .forgejo/deploy.yml 2025-09-09 13:24:07 +07:00
83926c534f Delete .forgejo/build.yml 2025-09-09 13:23:59 +07:00
bfe1caa984 Delete .forgejo/workflow 2025-09-09 13:23:26 +07:00
91a3aef5d7 Add .forgejo/workflow 2025-09-09 13:23:03 +07:00
cbd1e8029d Add .forgejo/deploy.yml 2025-09-09 13:21:03 +07:00
bdd613b40f Update .forgejo/build.yml 2025-09-09 13:20:15 +07:00
507d50dfe3 Add .forgejo/build.yml 2025-09-09 13:19:47 +07:00
fb6a82be14 Merge branch 'develop' into working 2025-09-02 14:55:47 +07:00
8001dd0c11 leave report 2025-09-02 14:55:07 +07:00
Bright
348edeff85 add flag check file in noti #1784
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-29 11:25:54 +07:00
3ae9be5869 add Background Task 2025-08-28 12:33:18 +07:00
Bright
75ddebba37 api report ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลาแล้ว #1778
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-08-25 20:13:31 +07:00
2d9f546023 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-25 14:37:53 +07:00
29b161bf76 update 2025-08-25 14:37:12 +07:00
Bright
f65dd53cec ทดสอบ generate ตรง ไม่ใช้เท็มเพลส
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-25 10:23:56 +07:00
8c2e4be638 Merge branch 'develop' into adiDev 2025-08-22 16:54:14 +07:00
711a8eeff6 report update 2025-08-22 16:53:00 +07:00
Bright
0da5907eba add package EPPlus 2025-08-22 16:06:19 +07:00
Bright
ef9fafecfc timeStamp report แบบ generate ตรง
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-08-21 17:33:19 +07:00
Bright
0ee17ef586 ปรับรายงานสถิติการลงเวลา #1730
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-08-14 16:43:19 +07:00
Kittapath
b89f394f1e
Merge pull request #1744 from Frappet/task/1728-ออกคำสั่งลาออก
1728-ยกเลิกคำสั่ง
2025-08-09 22:00:58 +07:00
kittapath
af45365920 1728-ยกเลิกคำสั่ง 2025-08-09 21:59:30 +07:00
kittapath
59a3aaa2d8 noti leave
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-08-06 21:37:35 +07:00
kittapath
8be20b1365 noti leave cancel 2025-08-05 21:01:21 +07:00
kittapath
f72d705101 noti insignia 2025-08-05 20:56:22 +07:00
Bright
4130604ca8 update สิทธิ์มองเห็นกรรมการ #1707
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-08-05 12:01:58 +07:00
kittapath
7af3618287 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-08-04 21:22:42 +07:00
kittapath
a781de2499 send noti leave to commander 2025-08-04 21:22:04 +07:00
14b15a9816 revert code task #1693
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-04 15:33:20 +07:00
kittapath
0c9ec3dd43 lock insignia
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-01 17:08:11 +07:00
Bright
f6594f9773 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-08-01 13:38:29 +07:00
Bright
009de80c3f FIX ระบบวินัย >> ข้อมูลพื้นฐาน (กรรมการ) ข้อมูลรายการเรื่องเรียนไม่แสดง #1707
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-08-01 11:40:01 +07:00
Bright
593e5a3f57 ส่งเหตุผลเป็น ENG #1714
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-08-01 10:26:07 +07:00
Bright
71dc9f05d3 add field DisciplineDirectors.RootDnaId 2025-07-31 18:50:21 +07:00
Bright
23d86f632e เพิ่ม API การเจ้าหน้าที่แก้ไขข้อมูลการขอลาออกได้หาก สถานะเป็น ใหม่ (NEW) #1714
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-31 14:52:04 +07:00
e3a57b0159 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-31 13:24:58 +07:00
7016df503a #1701 2025-07-31 13:24:08 +07:00
Bright
708ef29ebe Fix issue #1678
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-30 11:30:38 +07:00
Bright
1f41b96844 Fix ระบบวินัย #1680, #1682, #1683, #1684, #1685, #1680,#1686, #1687, #1688 2025-07-29 18:28:13 +07:00
ce8736b083 #1698
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-29 17:40:37 +07:00
0223ff5d9b #1693
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-29 11:54:35 +07:00
Bright
b40d4e2765 Migrate & Fix Report ขอลาออก #1661, #1665
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-25 18:08:48 +07:00
Bright
b548d8fea6 เพิ่มฟิลด์ตำแหน่งทางการบริหาร 2025-07-25 13:44:53 +07:00
Bright
ac037aff4b แยกบันทึกทีละฟิลด์
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-24 11:48:25 +07:00
Bright
d3be22cfbd Fix Bug กรองวันที่
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-22 10:27:05 +07:00
Bright
757035a4b0 Fix Bug กรองวันที่ #1630, #1631
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-21 14:03:09 +07:00
Bright
3384c520d7 Fix รายการให้ออกส่ง status เป็นว่างรายการไม่แสดงทั้งหมด #1654
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-21 10:33:42 +07:00
Bright
aef2d3381a Fix #1630, #1631
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-18 15:57:48 +07:00
Bright
ac6e4f5c1f api คำสั่งแต่งตั้ง เลื่อน ย้ายจากราชกิจจาฯ
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-17 22:46:51 +07:00
Bright
0b9d3b16ac Fix Bug ค้นหาขั้นสูงระบบวินัย
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-17 15:41:44 +07:00
Bright
1b861c1a65 ระบบวินัยเพิ่มค้นหาขั้นสูง #1628, #1629, #1630, #1631
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-16 17:18:51 +07:00
Bright
6b73a0aa47 Fix ข้อมูลที่อยู่ไม่อัปเดตในระบบทะเบียนประวัติ issue #1619
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-15 18:31:40 +07:00
Bright
6d90951000 Fix Bug LeaveReport #1606
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-14 15:35:36 +07:00
Suphonchai Phoonsawat
8b3eaf0664 fix unnecessory using
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-11 10:40:06 +07:00
Suphonchai Phoonsawat
53e547f168 fix issue #1263 2025-07-11 10:03:38 +07:00
Bright
e58bda8e9e Fix รายงานให้แสดงรายชื่อตรงสังกัดที่เลือก issue #1606
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-09 16:14:15 +07:00
Bright
c348dae155 คำสั่งที่สร้างทะเบียนประวัติส่ง key รูปภาพที่อยู่บน s3 เพิ่ม #911, #1183
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-07 14:34:44 +07:00
f2d01b8505 fix Null Value
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-07 12:01:34 +07:00
Suphonchai Phoonsawat
0e74ad730c fix Middleware
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-07-04 14:57:25 +07:00
Suphonchai Phoonsawat
7d431d7882 add status code
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-04 13:40:10 +07:00
Suphonchai Phoonsawat
8e890af48f เช็คซ้ำ post LeaveBeginning
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-07-04 10:57:02 +07:00
Bright
d6a3bdc8ba สร้างรายการรับโอน ถ้าเป็นขรก.เดิมใช้รูปภาพจากทะเบียนประวัติ #1168
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-03 16:16:32 +07:00
Bright
18be7bee37 Fix รับโอน รูปภาพไม่แสดง issue #1168
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-07-02 15:17:51 +07:00
Bright
94446fe6fd test #1168
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-07-02 13:40:45 +07:00
Bright
c657398e72 แก้ให้แสดงรายชื่อตามสิทธิ์ #1575, #1576, #1577
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-06-24 14:02:44 +07:00
Suphonchai Phoonsawat
015d2ea956 Merge remote-tracking branch 'origin/develop' into develop 2025-06-24 12:51:21 +07:00
Suphonchai Phoonsawat
8f9b40c303 ปรับการแกะ keycloakid มาจาก token เนื่องจาก middleware ทำงานก่อน auth middleware จึงทำให้ยังไม่มี context.User เลยเอาไปหา keycloakId ไมได้
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-06-24 12:49:24 +07:00
419866bb70 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-06-24 12:09:17 +07:00
6308ffbc8f #1382 2025-06-24 12:06:44 +07:00
Suphonchai Phoonsawat
89a90099a7 fix การใช้งาน middleware
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-06-24 10:47:54 +07:00
Suphonchai Phoonsawat
2e77371316 ปรับ Middleware โดยรวม Exception + LogWriter ไว้ด้วยกัน 2025-06-24 10:42:11 +07:00
Suphonchai Phoonsawat
f4b3eeac76 Remove .idea folder from version control 2025-06-24 10:41:20 +07:00
Suphonchai Phoonsawat
298b61fc67 Merge branch 'develop' into working 2025-06-23 20:44:16 +07:00
Suphonchai Phoonsawat
2a0e1f7623 remove 2025-06-23 20:42:56 +07:00
kittapath
1887c62e18 add save dna root emp retire out 2025-06-23 19:53:40 +07:00
kittapath
6d3d14445f Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-06-23 18:43:17 +07:00
kittapath
c6fee999eb แก้ไขสิทธิ์ 2025-06-23 18:43:09 +07:00
Suphonchai Phoonsawat
0baa85e857 Correct Middleware 2025-06-23 17:03:18 +07:00
Suphonchai Phoonsawat
f9d8fa285f Merge branch 'working' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
# Conflicts:
#	.idea/.idea.BMA.EHR.Solution/.idea/workspace.xml
2025-06-23 16:10:47 +07:00
Suphonchai Phoonsawat
b9931ce2e4 test 2025-06-23 16:10:31 +07:00
Suphonchai Phoonsawat
1038d2e894 change git ignore 2025-06-23 16:08:46 +07:00
Suphonchai Phoonsawat
1624b2f365 Add 2025-06-23 15:12:22 +07:00
Suphonchai Phoonsawat
ba6bfdaedf Add File 2025-06-23 15:11:44 +07:00
Suphonchai Phoonsawat
27acadbb07 Add Dna Id to table 2025-06-20 14:44:53 +07:00
kittapath
3e8e461ebe ออกคำสั่งถึงแก่กรรม 2025-06-20 12:45:18 +07:00
kittapath
8870139cbe permission 2025-06-20 10:46:57 +07:00
kittapath
058c762eb2 edit permission 2025-06-20 10:39:17 +07:00
kittapath
065fafc3d7 edit permission 2025-06-20 10:29:45 +07:00
kittapath
1e5676e8ab migrate db 2025-06-20 01:24:57 +07:00
kittapath
30ff1ae15c Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-06-20 00:35:32 +07:00
kittapath
1ef8544833 หา dna บรรจุ 2025-06-20 00:35:25 +07:00
Suphonchai Phoonsawat
ea25f5252b Merge branch 'working' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-06-19 13:07:42 +07:00
Suphonchai Phoonsawat
826aa8db19 fix employee insignia request cal 2025-06-19 13:06:22 +07:00
kittapath
b1ad88c37b ลบสิทธิ์ลาออก 2025-06-19 09:46:42 +07:00
Bright
9e84bddb65 update issue #1578
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-06-18 15:23:41 +07:00
Suphonchai Phoonsawat
ea55d21f51 add Dna Id Field to Process TimeStamp
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-06-18 13:43:46 +07:00
Bright
e790b50f58 fix bug report #1368, #1578 2025-06-17 18:07:41 +07:00
Suphonchai Phoonsawat
360580535a fix again
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-06-17 14:19:52 +07:00
Suphonchai Phoonsawat
9070378060 แก้ดึงข้อมูลเวลา มาใช้ process time stamp
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-06-17 13:22:39 +07:00
Suphonchai Phoonsawat
2d7459da25 fix Approve การลงเวลากรณีพิเศษ
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-06-17 11:02:42 +07:00
Suphonchai Phoonsawat
326a258e2b add migration placement and retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-06-16 14:40:38 +07:00
bc8b681900 update (positionExecutiveField) 2025-06-16 13:45:21 +07:00
706edbd0f0 update placement and retire 2025-06-16 12:10:50 +07:00
Bright
b528f0a81d ปรับเหตุผลคำสั่งลาออก,โอนออก issue #1572 2025-06-11 12:05:46 +07:00
kittapath
afb2cfa189 remove workflow retire 2025-06-11 10:58:47 +07:00
kittapath
61407c342b Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
# Conflicts:
#	BMA.EHR.Application/Repositories/RetirementEmployeeRepository.cs
#	BMA.EHR.Application/Repositories/RetirementRepository.cs
2025-06-11 09:17:26 +07:00
Suphonchai Phoonsawat
588e13c3f5 change word 2025-06-11 09:15:52 +07:00
4bf0593b0e fix resign detail 2025-06-10 16:42:37 +07:00
b0cfc2eee9 fix url noti retirement reject & field Id
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-06-10 12:25:21 +07:00
fdae099855 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-06-10 11:11:34 +07:00
9bde6a9895 #1425 2025-06-10 11:10:40 +07:00
Suphonchai Phoonsawat
b747e3ae68 change word 2025-06-05 15:36:44 +07:00
Suphonchai Phoonsawat
40babdf1a7 ตอนกดขอยกเลิกส่ง noti
- ตอนผู้ยื่นกดขอยกเลิกแจ้งมาที่ผู้มีอำนาจ
 - ผู้มีอำนาจอนุมัติหรือไม่อนุมัติ แจ้งผู้ยื่น และผู้บังคับบัญชาที่มีใน list
2025-06-05 15:15:49 +07:00
Suphonchai Phoonsawat
7e3ae58b33 นับ || x.LeaveStatus == "DELETING" เข้าไปในรายการ Approve ด้วย 2025-06-05 14:41:58 +07:00
moss
dff98272dd Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-06-05 12:16:58 +07:00
moss
237567e5ab edit path noti 2025-06-05 12:16:50 +07:00
Bright
a494020d37 fix bug 2025-06-05 11:24:18 +07:00
Bright
78a47bc735 fix issue #1568 (convert thaiNumber) 2025-06-05 09:52:12 +07:00
moss
13709c65ef Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-06-04 18:24:46 +07:00
moss
d539f6fa4a แก้ชื่อ noti 2025-06-04 18:24:30 +07:00
Bright
ffecbf7df2 fix issue #1554, #1558 2025-06-04 17:01:55 +07:00
moss
b260e4067f ออกคำสั่งลูกจ้าง 2025-06-04 16:19:06 +07:00
Suphonchai Phoonsawat
6ad83ecc53 fix migration 2025-06-04 10:02:32 +07:00
Bright
175232148b fix issue #1543 2025-05-30 14:04:33 +07:00
moss
be9545f37c Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-05-30 12:38:25 +07:00
moss
75d8434935 check type officer 2025-05-30 12:38:07 +07:00
Suphonchai Phoonsawat
22304e7186 Merge branch 'develop' into working 2025-05-30 11:55:55 +07:00
Suphonchai Phoonsawat
fb76f5737a fix cronjob 2025-05-30 11:55:23 +07:00
moss
c49375718d add mark insignia 2025-05-30 11:36:48 +07:00
moss
db84cdbf29 check type insignia 2025-05-30 10:58:15 +07:00
Suphonchai Phoonsawat
96246d5853 Merge branch 'develop' into working 2025-05-30 10:42:27 +07:00
e0ed1fc240 Merge branch 'develop' into adiDev 2025-05-29 17:47:56 +07:00
25f6ebcdd7 #1423 2025-05-29 17:46:42 +07:00
Suphonchai Phoonsawat
ad72bc7ff6 fix bug 2025-05-29 16:30:08 +07:00
moss
cf6f0feef5 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-05-29 15:00:16 +07:00
moss
97b5bd1176 status camcel 2025-05-29 14:59:57 +07:00
Suphonchai Phoonsawat
88270a230f fix #1357 ปรับ API 2025-05-29 13:57:44 +07:00
Suphonchai Phoonsawat
7b55e16e7d เส้นดาวน์โหลดรายชื่อของลูกจ้างแสดงไม่ถูกต้อง #1357 2025-05-29 13:10:27 +07:00
Suphonchai Phoonsawat
c3c9c85d30 fix #1357 2025-05-29 13:08:06 +07:00
Bright
d0e39e385b เปลี่ยน Method เส้นอัพเดท mark 2025-05-29 12:07:49 +07:00
moss
de72adc3ae search retriement cancel 2025-05-29 11:22:14 +07:00
moss
87715ff7cc check status retire resign 2025-05-29 10:34:44 +07:00
Suphonchai Phoonsawat
dc2603d107 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-28 16:00:43 +07:00
Suphonchai Phoonsawat
9483d537ce fix 2025-05-28 15:58:02 +07:00
moss
216d7c02fb update status cancel 2025-05-28 15:33:05 +07:00
moss
2547590ce8 add repo 2025-05-28 15:19:02 +07:00
Suphonchai Phoonsawat
fd25873348 เพิ่มการบันทึกไปทะเบียนประวัติ ตามประเภท officer หรือ employee โดยไปเรียก api ของระบบโครงสร้าง
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-28 11:28:14 +07:00
Suphonchai Phoonsawat
d9be2426c4 เพิ่ม api เรียกรายการ แยก officer,employee 2025-05-28 10:56:36 +07:00
Suphonchai Phoonsawat
22a3914072 เพิ่มคำนวนเครื่องราชย์แยกตาม type 2025-05-28 10:48:40 +07:00
moss
355f5b9591 add comment retirement resign 2025-05-27 20:19:40 +07:00
moss
513eb223be retirement resign cancel add api add commander 2025-05-27 20:16:53 +07:00
moss
afef4fde9f gen commander at retirement resign 2025-05-27 20:10:19 +07:00
moss
4b43104400 ยกเลิกลูกจ้าง
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-05-27 19:48:38 +07:00
moss
28f8971e7f filter retireresign 2025-05-27 17:34:10 +07:00
moss
2f37334444 edit insignia emp
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-27 11:18:06 +07:00
moss
b1380d4a2f เพิ่มลูกจ้างลงทะเบียนเครื่องราช 2025-05-27 10:46:44 +07:00
Bright
c832465e71 เพิ่มลูกจ้าง api อัพเดทสถานะ mark ระบบเครื่องราช (issue ##1344)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-23 17:54:36 +07:00
moss
a2efb8d9af update status approve
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-05-23 17:01:05 +07:00
moss
7bfa69e19e แก้สถานะ ลาออก
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-23 15:12:36 +07:00
moss
dc3c5a82a1 step ระบบลาออก
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-23 10:49:40 +07:00
Bright
5c789232f1 fix ฟิลด์วันที่รายงานขอโอน issue #1533, #1534, #1535, #1536, #1537
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-05-21 17:39:46 +07:00
Suphonchai Phoonsawat
164ed56671 apply migrarion 2025-05-19 10:45:46 +07:00
Suphonchai Phoonsawat
51b849f882 Merge branch 'working' into develop 2025-05-19 10:32:56 +07:00
Bright
851c024171 api อัพเดทสถานะ Mark ระบบเครื่องราช 2025-05-16 17:35:44 +07:00
Suphonchai Phoonsawat
3beba561fc fix #1547 **** รอรัน migration อีกครั้ง *****
fix #1520
2025-05-16 10:33:38 +07:00
6e1965ba79 wait migrate 2025-05-15 18:05:48 +07:00
5df7a9e20f Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop 2025-05-15 12:07:02 +07:00
3e58fd1339 fixing updated dear & commanderPosition 2025-05-15 12:06:31 +07:00
Suphonchai Phoonsawat
852e4ee03d Merge branch 'working' into develop 2025-05-15 12:06:03 +07:00
Suphonchai Phoonsawat
3a09367e88 เพิ่มเติม field mark ต่างๆของเครื่องราชย์ 2025-05-15 12:04:07 +07:00
Suphonchai Phoonsawat
afb7b60a19 แก้เครื่องราชย์ 2025-05-15 10:06:08 +07:00
moss
a32c12460a แก้ชื่อตพแหน่ง 2025-05-15 10:04:54 +07:00
Suphonchai Phoonsawat
9af97134f4 Merge branch 'develop' into working 2025-05-15 06:40:41 +07:00
moss
5a33e4690d add isDeputy
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-14 15:26:08 +07:00
moss
a81b8d50fb ที่อยู่ระหว่างลา
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-14 12:35:26 +07:00
Bright
c7dd897909 fix ระบบลา >> แบบรายงาน (ลาประกอบพิธีฮัจญ์) #1493
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-14 12:04:42 +07:00
moss
741eccd933 บันทึกเรียนระบบลา
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-14 11:36:38 +07:00
Bright
3f31f68c60 fix บันทึกการพิจารณาของระบบขอลาออกกรณีเส้นอนุมัติ วันที่สิ้นสุดการยับยั้งต้องว่าง #1518
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-13 14:29:49 +07:00
Suphonchai Phoonsawat
2f1cd53493 แก้ ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่ ให้ startTime เป็น 09:30 2025-05-13 12:46:25 +07:00
Suphonchai Phoonsawat
9e953cd5d6 fix คำนวนเครื่องราชย์ ลูกจ้าง 2025-05-13 12:27:19 +07:00
Suphonchai Phoonsawat
e653b0e40a Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-13 10:20:19 +07:00
Suphonchai Phoonsawat
847b89da23 fix issue : #1524 2025-05-13 10:16:05 +07:00
Bright
af9ae3e763 fix noti ถึงแก่กรรม #1523 2025-05-13 09:54:24 +07:00
Suphonchai Phoonsawat
f09cea096f fix code 2025-05-13 09:28:45 +07:00
Suphonchai Phoonsawat
4cc57322c0 fix ccode 2025-05-08 22:19:12 +07:00
Suphonchai Phoonsawat
496917c34c fix #1352 2025-05-08 21:06:26 +07:00
Suphonchai Phoonsawat
41bcc2a1ef ปรับการขอยกเลิกการลา ให้สถานะเป็น DELETING จนมีการอนุมัติ แล้วเปลี่ยนเป็น DELETE 2025-05-08 16:36:36 +07:00
Suphonchai Phoonsawat
0367e33768 fix leavereport วันลาพักผ่อน 2025-05-08 16:11:46 +07:00
Suphonchai Phoonsawat
f71cb56a40 fix #1519
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-08 15:30:34 +07:00
Suphonchai Phoonsawat
0451b9e3e1 fixc ลาพักผ่าน adminById
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-08 14:57:38 +07:00
Suphonchai Phoonsawat
c1597c4a5c แก้ format วันที่ภรรยาคลอดบุตร (แปลงเป็นวันที่จาก string)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-08 14:14:13 +07:00
Suphonchai Phoonsawat
e277279f78 Add ProfileType
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-08 13:19:56 +07:00
moss
4815b43864 แก้แสดงสังกัด
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-08 09:05:39 +07:00
moss
d43d151e75 sort retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 23:30:12 +07:00
Bright
d3b22ecf48 fix สังกัดเบิ้ล issue #1394 #1401
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-05-07 17:59:38 +07:00
moss
e452bd9255 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-07 17:14:07 +07:00
moss
64eb77674a เพิ่มวันที่ยับยั่ง 2025-05-07 17:13:57 +07:00
Suphonchai Phoonsawat
2d0475246a Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-05-07 16:45:16 +07:00
Suphonchai Phoonsawat
e351adb5fa add try catch 2025-05-07 16:42:05 +07:00
Bright
47e5df9ba9 [Fix SIT] บรรจุแต่งตั้ง ไม่เข้าทะเบียนประวัติ และไม่ลงโครงสร้าง #119
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 15:55:31 +07:00
Suphonchai Phoonsawat
eeb82dcbe1 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-07 15:36:31 +07:00
Suphonchai Phoonsawat
f3d74681f3 fix #1512 2025-05-07 15:35:34 +07:00
moss
f2a0b754b3 retire add approver
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 15:24:24 +07:00
moss
9f3388eb20 save retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 15:19:41 +07:00
moss
95513f0e10 set env page redirect
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 15:16:04 +07:00
Suphonchai Phoonsawat
37bd6cf6ee Merge remote-tracking branch 'origin/develop' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 14:32:05 +07:00
Suphonchai Phoonsawat
48baf99adf fix #1511 และเปลี่ยน Env เพิ่ม VITE_URL_MGT 2025-05-07 14:23:39 +07:00
moss
4da9dc6946 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 14:17:39 +07:00
moss
2b8713cbe0 retire add approve 2025-05-07 14:17:28 +07:00
Suphonchai Phoonsawat
0b407f3c68 change insigniaTypeId เป็น optional
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 14:05:08 +07:00
Suphonchai Phoonsawat
8ce58201e9 เพิ่มการแสดงรายการตามสิทธิ์
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-07 12:55:30 +07:00
Suphonchai Phoonsawat
3880ce6985 fix #1509
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 12:36:23 +07:00
Suphonchai Phoonsawat
e55001e234 fix permission
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 12:01:14 +07:00
Suphonchai Phoonsawat
8f8bcd9cc8 fix xml comment 2025-05-07 11:57:15 +07:00
Suphonchai Phoonsawat
01590c4894 issue #1291 2025-05-07 11:51:19 +07:00
Suphonchai Phoonsawat
e345331381 add field
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-07 06:33:33 +07:00
Suphonchai Phoonsawat
089e70c7c7 fix #901
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-06 19:40:22 +07:00
Suphonchai Phoonsawat
4d500fcdcd Merge branch 'develop' into working 2025-05-06 19:15:01 +07:00
Suphonchai Phoonsawat
fffa6bc374 fix #1414 2025-05-06 19:14:32 +07:00
Bright
21029ca9ce fix รายการลายังไม่แสดงตามสิทธิ์
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-06 19:04:17 +07:00
Bright
ed0bde9780 fix #1462, #1476
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-05-06 18:16:14 +07:00
06a6019e97 เพิ่มฟิวออกคำสั่งจาก placment (รับโอน) ส่งไป org
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-05-06 15:12:30 +07:00
23b6070785 #1384
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-06 12:05:33 +07:00
Suphonchai Phoonsawat
2240c383c7 add ข้อมูลเพิ่มจาก api leave-profile #1476
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-02 20:49:59 +07:00
Suphonchai Phoonsawat
505df8e8b1 Merge branch 'develop' into working 2025-05-02 20:19:41 +07:00
Suphonchai Phoonsawat
5ba93feb52 add field และ เพิ่ม call ProfileLeave API 2025-05-02 20:19:01 +07:00
Bright
ae3d5dab70 revert #1462
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-02 17:36:16 +07:00
Suphonchai Phoonsawat
4382e779d7 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-02 13:56:10 +07:00
Suphonchai Phoonsawat
42bdb66440 เพิ่ม Param leaveId และ เรียก api ยกเลิกการลาในทะเบียนประวัติ #1492 2025-05-02 13:55:40 +07:00
f96aa09cc7 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-02 13:49:42 +07:00
ff89c2c791 fix 2025-05-02 13:48:07 +07:00
Suphonchai Phoonsawat
249911b931 fix warning
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-02 12:13:14 +07:00
Suphonchai Phoonsawat
66d4a08f3c fix #1462 และ #1497
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-02 12:03:56 +07:00
Suphonchai Phoonsawat
9bf7ee2e9a เพิ่ม Field ตาม issue #1335
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-02 10:35:56 +07:00
Suphonchai Phoonsawat
b5c967c5fc add Field to /leave/report/reject/{id}
Some checks failed
release-dev / release-dev (push) Failing after 11s
แก้ไขบั้ก นับวันลาที่ approve ก่อนวันที่ลา
2025-05-01 19:59:05 +07:00
Suphonchai Phoonsawat
665e861303 fix #1471 and # 1487
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-05-01 12:02:04 +07:00
Suphonchai Phoonsawat
c1a0a8c2b5 remove code
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-05-01 10:07:52 +07:00
Suphonchai Phoonsawat
05e56ff6f7 fix #1471 again
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-05-01 10:05:17 +07:00
Suphonchai Phoonsawat
10571679f1 Add LeaveAll to LeaveReport
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-30 19:01:55 +07:00
Suphonchai Phoonsawat
a931dad4d9 fix #1473
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-30 14:54:57 +07:00
Suphonchai Phoonsawat
a5404cef72 fix #1471
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-30 14:25:28 +07:00
Suphonchai Phoonsawat
c25cb43720 fix leavetotal #1466
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-30 13:14:01 +07:00
Suphonchai Phoonsawat
34f0499986 fix #1466
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-30 11:57:07 +07:00
Suphonchai Phoonsawat
7d39720121 fix #1467
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-30 11:46:09 +07:00
Suphonchai Phoonsawat
91fc939b6d add field to api GET /leave/user/delete/{id}
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-29 21:21:26 +07:00
Suphonchai Phoonsawat
ca1a2c05c3 fix Leave API
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-29 19:08:51 +07:00
Suphonchai Phoonsawat
6f9116ead5 Update ค่าไปตาราง Beginning เมื่อมีการ approve การลา
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-29 15:43:06 +07:00
Suphonchai Phoonsawat
749b2b68a1 fix LeaveBeggining Add รายการใหม่เมื่อมีการตรวจสอบ auto ไม่ต้องใช้ cronjob เพราะว่ารายการจะเขอะเกินไป 2025-04-29 15:21:42 +07:00
Suphonchai Phoonsawat
746f435ca8 fix approve status
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-29 14:12:54 +07:00
Suphonchai Phoonsawat
16f6eb7b50 fix
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-29 10:54:20 +07:00
Suphonchai Phoonsawat
9d2dd44549 Add Keycloak UserId
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-29 09:50:44 +07:00
Suphonchai Phoonsawat
a710ebd297 fix using 2025-04-29 09:12:42 +07:00
Bright
124109bf57 fix issue #1401
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-28 18:41:34 +07:00
Suphonchai Phoonsawat
414dae40cc Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-28 12:07:38 +07:00
Suphonchai Phoonsawat
ae2112f23a fix issue 2025-04-28 12:02:29 +07:00
c0383da15d #1448 , #1449
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-28 10:11:42 +07:00
Suphonchai Phoonsawat
28544df284 fix #1382 2025-04-28 09:45:48 +07:00
Suphonchai Phoonsawat
d54db7b58f เพิ่ม REsponse LeaveRange,LeaveRangeEnd ลงใน /user/table
Some checks failed
release-dev / release-dev (push) Failing after 12s
เพิ่ม fullname ลงไป และ search จากฟีลนั้น
2025-04-25 14:48:26 +07:00
Suphonchai Phoonsawat
04b17729e0 ปรับการเอาวันที่ใช้ไป และยอดวันลาพักผ่อนยกมา มาใช้งาน
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-25 11:05:19 +07:00
Suphonchai Phoonsawat
a7b8c2786c fix : Add วันลาใช้ไป เพิ่มเติมไปใน func หาวันที่มีการ approve 2025-04-25 10:44:01 +07:00
Suphonchai Phoonsawat
db483ce18d improve ErrorExceptionMiddleWare Code 2025-04-25 10:23:47 +07:00
Suphonchai Phoonsawat
b90a0ad489 fix api
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-24 17:02:01 +07:00
Suphonchai Phoonsawat
4ca6b7d842 add nowarn
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-24 11:09:59 +07:00
Suphonchai Phoonsawat
16b0990454 fix docker file
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-24 11:04:33 +07:00
Suphonchai Phoonsawat
92847e6be2 แก้ไข
- format response
- ส่ง noti โดยมีการแนบลิงค์
2025-04-24 10:59:31 +07:00
Suphonchai Phoonsawat
19c30e69df CRUD Leave Beginning
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-23 11:25:12 +07:00
moss
b4c169be75 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-04-23 09:33:01 +07:00
moss
e39c6f62c8 บรรจุ 2025-04-23 09:32:52 +07:00
Suphonchai Phoonsawat
dd3c614679 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-22 15:36:29 +07:00
Suphonchai Phoonsawat
e635e4ff61 เพิี่มขั้นตอนการอนุมัติใบลา โดยดึงข้อมูลจากตาราง approver 2025-04-22 15:35:10 +07:00
Suphonchai Phoonsawat
ddc3d268be add api add commander and approver ด้วย และเพิ่มประเภทของผู้อนุมัติ 2025-04-22 14:28:51 +07:00
Suphonchai Phoonsawat
193cffa7c4 fix #1335 2025-04-22 13:46:35 +07:00
Suphonchai Phoonsawat
56501b5bcd fix #1337 2025-04-22 13:31:54 +07:00
Bright
0f705431d4 fix ระบบทะเบียนประวัติผู้พ้นจากราชการ ขรก. >>กรณีส่งกลับเข้ารับราชการ (ข้อมูลตำแหน่งหน่วยงานที่บรรจุแสดงผิด) #1401 2025-04-22 13:25:11 +07:00
Suphonchai Phoonsawat
2730ac9174 fix #1134 2025-04-22 13:16:37 +07:00
Suphonchai Phoonsawat
b61e36e532 fix #1136 2025-04-22 13:05:47 +07:00
Suphonchai Phoonsawat
7b6e5635ea Merge branch 'develop' into working 2025-04-22 11:06:18 +07:00
Bright
15385286da fix ระบบพ้นจากราชการ>>ประกาศเกษียณ (ดาวน์โหลดรายการประกาศเกษียณระบบแจ้ง Error) #1380
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-22 10:54:11 +07:00
Suphonchai Phoonsawat
6b453b8bdf บันทึกและแก้ไขการเพิ่ม LeaveRangeEnd และการเอาค่ามาแสดง 2025-04-22 10:51:58 +07:00
Suphonchai Phoonsawat
bec082a554 Merge branch 'develop' into working 2025-04-22 10:40:24 +07:00
Suphonchai Phoonsawat
3659d03d94 แก้ไข /leave/user/check
เพิ่ม range and rangeEnd เพื่อตรวจสอบการลา เพื่อให้สามารถลาครึ่งวัน รวมกับลาเต็มวันได้
2025-04-22 10:39:17 +07:00
moss
d0b8c4ee35 create retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-21 18:16:20 +07:00
Suphonchai Phoonsawat
cd54079a47 Merge branch 'develop' into working 2025-04-21 17:20:17 +07:00
Suphonchai Phoonsawat
d408d875db fix leave report เพิ่ม leavesubtype แก้ตัวเลขให้แสดงเลขไทย 2025-04-21 17:19:46 +07:00
moss
58f52cbb84 return dis
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-21 14:07:10 +07:00
Bright
1552225e9c fix ระบบทะเบียนประวัติผู้พ้นจากราชการ ลูกจ้างประจำฯ >>ระบบแสดง Null กรณีส่งมาระบบอื่น ๆ #1404 2025-04-21 13:24:47 +07:00
Bright
5c215b9213 fix ระบบทะเบียนประวัติผู้พ้นจากราชการ ขรก. >>ตัวอักษรย่อเลขที่ทำแหน่งไม่แสดง กรณีโดนลงโทษทางวินัย #1399 2025-04-21 11:40:59 +07:00
Bright
ed98f171ba ปรับ noti (add-workflow)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-18 16:30:01 +07:00
moss
e57274d446 edit param dis
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-18 13:50:56 +07:00
moss
bfc49ee9a6 ลบ comment 2025-04-18 11:41:13 +07:00
moss
0697cdd3ee ยกเลิกลาออก
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-04-18 10:14:12 +07:00
moss
4340454e41 ลบคำสั่งเลื่อน
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-17 23:16:48 +07:00
moss
c89ecf8cda search กรรมการ
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-17 23:09:37 +07:00
moss
864c348531 report discipline 2025-04-17 18:05:42 +07:00
moss
7db251aea9 edit param
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-17 16:20:19 +07:00
moss
ccb183dc95 วินัยเพิ่มหมายเหตุ
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-17 15:54:19 +07:00
Suphonchai Phoonsawat
28b573bfb8 บันทึกผู้อนุมัติการลา โโยแปลง json ที่มาจาก FormData 2025-04-17 10:58:09 +07:00
Suphonchai Phoonsawat
885478f672 add commander position and leave approvers 2025-04-17 09:31:05 +07:00
Suphonchai Phoonsawat
59be7ac619 - commander position 2025-04-09 16:19:54 +07:00
Suphonchai Phoonsawat
50f3d22090 Add Migration 2025-04-09 16:05:07 +07:00
Suphonchai Phoonsawat
6fd3fff0c8 Merge branch 'develop' into working 2025-04-09 15:24:18 +07:00
moss
c6663b35c3 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-08 18:01:39 +07:00
moss
a4d2e5dc15 salary-leave-discipline 2025-04-08 18:01:31 +07:00
Bright
db20be6e50 Noti พนักงานผู้รับอุทธรณ์ & filter รายงานการดำเนินการทางวินัย
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-08 17:44:59 +07:00
moss
221f700722 report leave
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-08 17:03:33 +07:00
moss
0bc0fb2c99 re command
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-05 18:05:04 +07:00
moss
887d015276 space posno
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-05 16:45:44 +07:00
moss
179d61cc16 report retire 2025-04-04 11:43:19 +07:00
moss
f68eae8120 reportreire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-04 10:55:16 +07:00
moss
d0a6f21e05 tag command
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-03 17:11:49 +07:00
moss
928df2d62c tag build command
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-04-03 17:04:46 +07:00
moss
81d22c9f05 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-03 16:49:51 +07:00
moss
337bff8853 ยกเลิกลา 2025-04-03 16:49:40 +07:00
Bright
07e8136188 fix ข้อมูลที่แสดงผลในรายงานหนังสือลาออก
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-03 16:39:46 +07:00
Bright
7716a6fd02 noti หนังสือเวียน
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-03 14:19:39 +07:00
moss
38edf0ea41 change status 2025-04-03 14:06:18 +07:00
Bright
1d3f8973e0 no message 2025-04-03 11:51:50 +07:00
moss
e947f08f8e แก้สถ่นะออกคำสั่ง
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-03 11:13:25 +07:00
Suphonchai Phoonsawat
24d9da8412 Merge branch 'develop' into working 2025-04-02 09:17:42 +07:00
Suphonchai Phoonsawat
e51ab03a5c fix 2025-04-02 09:17:13 +07:00
moss
e160e1e552 report retirement 2025-04-01 12:08:05 +07:00
moss
6dd057516f refid ส่งกลับ 2025-04-01 11:08:27 +07:00
moss
b1d198133f เลือกตำแหน่ง
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-04-01 10:12:53 +07:00
moss
acd931f6f0 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-04-01 03:02:04 +07:00
moss
039431b3ce test build 2025-04-01 03:01:50 +07:00
Bright
9f55dcb5a9 ส่งฟิลด์ไปออกคำสั่งกลับรับราชการเพิ่ม (ฟิลด์ประเภท ระดับ ตำแหน่ง) 2025-03-31 17:32:58 +07:00
moss
c0ff9d4eb2 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop 2025-03-31 16:46:27 +07:00
moss
4a13a7b06a \n discipline 2025-03-31 16:46:18 +07:00
Suphonchai Phoonsawat
9136cb8d8a add PositionLeaveName ในรายงาน
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-31 12:17:10 +07:00
Suphonchai Phoonsawat
9e9b3316e9 report 2025-03-31 11:58:47 +07:00
Suphonchai Phoonsawat
734b29c77c fix #1327
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-31 11:18:03 +07:00
Suphonchai Phoonsawat
82a2dc42e6 fix #1310 2025-03-31 10:59:06 +07:00
Suphonchai Phoonsawat
31625d0418 Merge branch 'develop' into working 2025-03-31 10:35:56 +07:00
moss
26be9d691f add posexe appointment
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-03-29 14:59:03 +07:00
moss
18d93995aa ส่งคัวกลับ
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-03-28 23:45:36 +07:00
moss
34b8562ffe add api use
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-28 21:50:17 +07:00
5f80de81a4 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-28 18:26:18 +07:00
1054227c65 fix #112 2025-03-28 18:24:53 +07:00
moss
c5a57a1f1f sort เกษียณ
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-28 16:51:39 +07:00
moss
c16f364b8a เลือกตำแหน่งบรรจุกลับ
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-28 16:31:33 +07:00
moss
c9ed721cc0 sort retirement
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-28 14:58:04 +07:00
moss
8d7ca40e00 sort report retire
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-03-28 11:32:53 +07:00
Suphonchai Phoonsawat
7b78dc6ce8 Merge branch 'develop' into working 2025-03-28 11:15:23 +07:00
Suphonchai Phoonsawat
4cda0b52c8 สลับตำแหน่งการแสดงชื่อหน่วยงาน 2025-03-28 11:13:23 +07:00
moss
ef9a42a97a sort report retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 18:44:06 +07:00
moss
8d1b37aef7 sort retirement
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 16:31:40 +07:00
moss
3542906e41 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 15:58:33 +07:00
moss
066f49cad7 report retirement 2025-03-27 15:58:22 +07:00
Suphonchai Phoonsawat
775e72ba70 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-03-27 15:21:56 +07:00
Suphonchai Phoonsawat
4e3faab969 fix #1309 2025-03-27 15:21:32 +07:00
Bright
94100e304e fix ส่งหนังสือเวียนไม่ต้องส่งผู้ถึงแก่กรรม
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 14:56:09 +07:00
Suphonchai Phoonsawat
9e466a2422 fix minio 2025-03-27 14:38:51 +07:00
Suphonchai Phoonsawat
15d8bb4365 Merge remote-tracking branch 'origin/develop' into develop 2025-03-27 12:25:26 +07:00
Suphonchai Phoonsawat
0fb3fd1d06 fix Convert FormData แล้วเขียนลง Logs 2025-03-27 12:24:58 +07:00
moss
60a46c9232 Merge branch 'develop' of github.com:Frappet/hrms-api-backend into develop
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-03-27 12:00:48 +07:00
moss
8460a96db0 change APPOINTED to APPOINT 2025-03-27 12:00:32 +07:00
Bright
1424b03aac ถึงแก่กรรม
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 11:37:41 +07:00
Bright
dd8e87b994 ถึงแก้กรรม 2025-03-27 11:02:58 +07:00
moss
9be78c8bdc on noti 2025-03-27 10:33:56 +07:00
moss
3ba0607a80 report retire sort
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-27 04:42:52 +07:00
Bright
44cd46effc เพิ่มกวาดรายชื่อตอนส่งหนังสือเวียนถึงแก่กรรม (issue #1281 & #1287)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-26 18:42:42 +07:00
3779128e6c Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-26 17:15:15 +07:00
bcb7c7781c #111 , #1271 2025-03-26 17:12:46 +07:00
Suphonchai Phoonsawat
e4dccb5c1f add log to placement and retirement
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-26 12:59:42 +07:00
Suphonchai Phoonsawat
f1460dd384 add log to discipline 2025-03-26 12:33:22 +07:00
Suphonchai Phoonsawat
559d682dfd add log to insignia 2025-03-26 12:24:34 +07:00
Suphonchai Phoonsawat
65fbf4582a add migration สำหรับ LeaveBeginning 2025-03-26 12:11:41 +07:00
Suphonchai Phoonsawat
92451af236 เพิ่มเติม function การเขียน log 2025-03-26 11:43:26 +07:00
Bright
54e634d006 fix bug ส่งหนังสือเวียน (issue #1280, #1282)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-25 18:05:25 +07:00
Bright
a7bf381d0a fix bug retirement
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-24 18:01:59 +07:00
Bright
fcf76349f6 กรณีเลือกหน่วยงาน เพิ่มฟิลด์ posExecutiveName 2025-03-24 16:33:46 +07:00
a4c629b9bd Merge branch 'develop' into adiDev 2025-03-24 15:37:27 +07:00
6cb0ddff6b #1271 (1) placement and retirement 2025-03-24 15:36:28 +07:00
Bright
484ff73667 migrate 2025-03-24 14:40:46 +07:00
Suphonchai Phoonsawat
c1a20aca35 Merge remote-tracking branch 'origin/develop' into develop
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-21 21:35:23 +07:00
Suphonchai Phoonsawat
0ec841f826 fix CheckTime ให้ใช้ Round ของ user และการฌช็คเวลาเป็น UTC+7 2025-03-21 21:34:39 +07:00
Bright
eaa54a13f7 migrate
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-21 18:08:41 +07:00
Suphonchai Phoonsawat
0af37b0ecc Merge remote-tracking branch 'origin/develop' into develop 2025-03-21 15:44:43 +07:00
Suphonchai Phoonsawat
b8fef58b28 เพิ่ม middleware ในการเขียน log โดยเขียนไป elasticsearch โดยไม่ใช้ Serilog เพื่อจัด format เอง 2025-03-21 15:44:11 +07:00
Bright
1b6cc4f014 migrate + add field PositionExecutiveOld 2025-03-21 14:31:45 +07:00
Suphonchai Phoonsawat
71a1c48392 refix issue #1265
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-21 13:01:17 +07:00
Suphonchai Phoonsawat
0cb17540b0 issue #1256
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-19 16:13:22 +07:00
Suphonchai Phoonsawat
a8a988a372 Merge branch 'develop' into working 2025-03-19 16:00:10 +07:00
Suphonchai Phoonsawat
de85a8f369 fix issue #1255 2025-03-19 15:58:11 +07:00
kittapath
12fab7cc1f report leave
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-18 14:22:53 +07:00
Suphonchai Phoonsawat
b812fab46a Merge branch 'develop' into working 2025-03-18 13:15:37 +07:00
Suphonchai Phoonsawat
86fa8f5d41 change config 2025-03-18 13:14:58 +07:00
Bright
11db0315e7 fix throw ซ้ำแล้วไม่ส่ง email
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-03-14 18:01:25 +07:00
kittapath
4bbb71d6e2 update db hrms 2025-03-14 08:44:04 +07:00
Bright
6c84542e94 เปลี่ยนเส้น api call รายชื่อ
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-12 13:17:09 +07:00
Bright
2a6bef472b fix issue #1234 2025-03-12 10:26:47 +07:00
123501378b fix
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-12 10:17:43 +07:00
dc8a3dc39c Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 10s
# Conflicts:
#	BMA.EHR.Leave/Controllers/LeaveReportController.cs
2025-03-11 17:39:58 +07:00
7a9053f5ce fix 2025-03-11 17:33:10 +07:00
Suphonchai Phoonsawat
6f7b9bf3e6 fix start time
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-10 09:37:34 +07:00
Suphonchai Phoonsawat
950b5c4604 fix #1239
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-09 09:38:13 +07:00
Suphonchai Phoonsawat
db8f425877 แก้ cron กลับ ตีหนึ่ง
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-08 13:04:58 +07:00
Suphonchai Phoonsawat
bf61ae65de ทดสอบรันตอนบ่ายโมง
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-03-08 12:07:53 +07:00
Suphonchai Phoonsawat
86e711d616 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-08 10:53:54 +07:00
Suphonchai Phoonsawat
772c9482aa add timezone in docker container and force before hangfire start 2025-03-08 10:53:24 +07:00
kittapath
8980c4a2ee on noti leave 2025-03-08 00:35:47 +07:00
kittapath
3b95c4d2d1 report leave sort
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-07 23:30:43 +07:00
kittapath
4487214e95 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-03-07 22:43:09 +07:00
kittapath
b96f49bd54 แก้รายงานลางงาน 2025-03-07 22:42:58 +07:00
Suphonchai Phoonsawat
7ba9a6df5a Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-07 15:05:43 +07:00
Suphonchai Phoonsawat
22f4fce080 change cron timezone 2025-03-07 15:04:55 +07:00
kittapath
e028dc5cf5 report ลงเวลา
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-07 14:49:27 +07:00
3882e11454 fix and add filter leaveRequest
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-03-06 10:24:56 +07:00
Bright
19ff8f2d65 fix issue #1194
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-25 11:03:50 +07:00
kittapath
35c6bc97a1 noti build 2025-02-24 10:08:16 +07:00
kittapath
01dc27099e แก้ ตำแหน่ง
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-21 23:48:11 +07:00
kittapath
3d0994b29b Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-21 19:11:31 +07:00
kittapath
e092604b97 ออกคำสั่งใหม่ 2025-02-21 19:11:20 +07:00
Suphonchai Phoonsawat
11c84e0013 fix #1189
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-02-21 16:03:05 +07:00
Suphonchai Phoonsawat
cea4e472e8 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-02-21 12:39:39 +07:00
Suphonchai Phoonsawat
9b0f1f0b3e fix #1188 2025-02-21 12:39:01 +07:00
Bright
12aceb5e00 add status filter
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-02-20 16:59:21 +07:00
9718ff149c update 2025-02-20 15:06:05 +07:00
2120cd8014 fix date2
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-20 13:32:24 +07:00
f74c8a1e38 fix date
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-02-20 11:50:10 +07:00
cdc0d9d1ee Merge branch 'adiDev' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-20 11:23:52 +07:00
ad0edf92a6 fix 2025-02-20 11:22:45 +07:00
kittapath
5953893e74 email not null 2025-02-20 00:10:02 +07:00
kittapath
0e159182b0 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-02-19 17:57:48 +07:00
kittapath
ae990c0c5f noti วินัย 2025-02-19 17:56:02 +07:00
aa31ac0f06 fix retirement
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-02-19 14:35:59 +07:00
8c530d9769 fix sum absent and late day
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-02-19 13:36:58 +07:00
9e513d3f1a #924
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-17 18:10:45 +07:00
kittapath
ea34087f11 insignia report 4
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-02-13 18:24:24 +07:00
kittapath
764a27fbd5 insignia4
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-02-13 17:20:58 +07:00
kittapath
077d20a779 report insignia6
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-13 16:44:37 +07:00
kittapath
da9ed437dc report insignia5 2025-02-13 15:42:15 +07:00
Suphonchai Phoonsawat
f953e24515 fix add person witth issue #1067
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-13 11:43:26 +07:00
Suphonchai Phoonsawat
f4055d01c3 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-12 18:33:54 +07:00
Suphonchai Phoonsawat
f6c6fe069d fix issue : #1067 2025-02-12 18:33:19 +07:00
719bf7c44f Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-11 20:22:47 +07:00
7843da3bde add endpoint report 2025-02-11 20:21:49 +07:00
Bright
e77757e324 fix issue #116, #1173, #1174
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-10 17:27:13 +07:00
Suphonchai Phoonsawat
b6aa239b57 fix ระบบเครื่องราชฯ>>จัดการคำขอ (อัปโหลดไฟล์) #1066
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-10 16:02:54 +07:00
Suphonchai Phoonsawat
5971933bab Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 14s
2025-02-10 15:10:19 +07:00
Suphonchai Phoonsawat
b40e6ad198 fix ระบบเครื่องราชฯ (insignia1)>>จัดการคำขอ (อัปโหลดไฟล์) #502 2025-02-10 15:09:33 +07:00
Bright
e1e9a89d6d update migrate 2025-02-10 11:13:05 +07:00
Bright
fd17afb145 migrate (add table ProfileComplaintInvestigate) 2025-02-10 10:20:49 +07:00
kittapath
fec4095617 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop 2025-02-07 16:53:12 +07:00
kittapath
970e368ce4 no message 2025-02-07 16:52:49 +07:00
Bright
45e4402b13 เบอร์โทรปรับให้เก็บแค่ตัวเลข
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-02-07 10:18:54 +07:00
Bright
98f493ec97 fix ออกคำสั่งบรรจุเสร็จสิ้น (ข้อมูลที่อยู่ไม่บันทึกลงระบบทะเบียนประวัติ) UAT #889
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-06 18:17:32 +07:00
kittapath
91196ec876 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-05 17:49:23 +07:00
kittapath
5ea175ca77 add dna 2025-02-05 17:48:58 +07:00
Bright
2490c549e1 fix รายงานระบบวินัยไม่สามารถดาวน์โหลดเอกสารได้
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-02-05 13:40:12 +07:00
Bright
dbe6916782 add field rootDnaId 2025-02-05 09:25:33 +07:00
Bright
08c144066b fix SIT รายงานระบบบรรจุ แต่งตั้ง ย้าย โอน>>รายงานจำนวนลูกจ้างประจำ กทม. ที่ได้รับการจ้าง แต่งตั้งและย้าย (ข้อมูลไม่ถูกบันทึกลงรายงาน) #1085
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-04 17:20:40 +07:00
Bright
74281c697c migrate (add table PlacementAppointmentEmployee) 2025-02-04 16:30:08 +07:00
kittapath
a4447b9014 คำสั่งรักษาการ
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-02-04 15:37:14 +07:00
Bright
4fc2ee5ca0 fix issue #1083 : SIT รายงานระบบบรรจุ ข้อมูลไม่ถูกบันทึกลงรายงาน 2025-02-04 13:26:25 +07:00
Bright
5ec9580e96 fix issue #1083 : SIT รายงานระบบบรรจุ ข้อมูลไม่ถูกบันทึกลงรายงาน
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-04 11:34:02 +07:00
4988427f9f add api report(2)
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-04 11:29:22 +07:00
f332823819 add api report 2025-02-04 11:14:27 +07:00
252fe0ff9a Merge branch 'develop' into adiDev 2025-02-03 18:16:18 +07:00
9ec411eebb add api report 2025-02-03 18:15:18 +07:00
kittapath
800a9a8f50 candidate report
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-03 17:30:53 +07:00
kittapath
ce5f2e3389 report de retire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-03 17:22:27 +07:00
kittapath
056a768ac9 report probation
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-03 17:18:50 +07:00
kittapath
6d44f6e9c3 retirement report
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-03 17:09:43 +07:00
kittapath
8a27795586 report placement
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-02-03 17:01:41 +07:00
780eebea4d updated
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-30 15:35:16 +07:00
Bright
59edf6a716 api get รายชื่อผู้เกษียณอายุราชการ
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-30 15:07:46 +07:00
f81806f59f fixing date & status report probation
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-30 14:55:04 +07:00
Suphonchai Phoonsawat
fe690f639d Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-30 12:04:23 +07:00
Suphonchai Phoonsawat
cb197caaf2 Merge remote-tracking branch 'origin/develop' into develop 2025-01-30 12:03:56 +07:00
Suphonchai Phoonsawat
e6a73f1d19 fix issue : SIT ระบบบันทึกการลา>> สิทธิ์การลา(โอนสิทธิ์การลา) #974 2025-01-30 12:03:14 +07:00
Suphonchai Phoonsawat
177cefcccc fix issue : ระบบการลา>>สังกัด ฝ่าย (เอา / ออก เปลี่ยนเป็นว่าง) #1131 2025-01-30 11:43:36 +07:00
a0cc5b62ff fixing field
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-30 11:33:00 +07:00
Suphonchai Phoonsawat
339de6132e TEST Retirement Hangfire
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-29 20:25:19 +07:00
Suphonchai Phoonsawat
049a289467 ปรับ api ให้รับ keycloak id จาก token
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-29 16:49:28 +07:00
Suphonchai Phoonsawat
7098a8620d Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-01-29 14:50:40 +07:00
Suphonchai Phoonsawat
cec878cb94 fix issue : SIT ระบบบันทึกเวลาปฏิบัติงาน>>ลงเวลาเข้า-ออกงาน (กรณีลงเวลาออกอีกวัน) #921
ระบบลงเวลาต้องมีการเช็คสถานะใน rabbitMQ ด้วยว่ามีการรอรันอยู่ไหม ลงเวลาเข้า/ออกงาน #894
2025-01-29 14:49:42 +07:00
Bright
e7ba802279 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-29 13:25:38 +07:00
Bright
01f16eaef4 cronjob retirement (test) 2025-01-29 12:15:30 +07:00
Bright
e42dd1926b no message 2025-01-28 16:26:43 +07:00
Bright
204a1abc4d add table RetirementRawProfile 2025-01-28 13:11:20 +07:00
Suphonchai Phoonsawat
9f0c03921d issue ระบบลาและลงเวลา>>รายการลงเวลาปฏิบัติงาน (สอบถาม) #1074 เพิ่ม
Some checks failed
release-dev / release-dev (push) Failing after 12s
Query String Profile Type
2025-01-27 16:33:00 +07:00
Suphonchai Phoonsawat
8b7bfb5ea0 fix issue : ระบบลาและลงเวลา>>รายการลงเวลาปฏิบัติงาน (สอบถาม) #1074
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-27 14:18:22 +07:00
Suphonchai Phoonsawat
7d88493a54 fix issue : ระบบลงเวลาต้องมีการเช็คสถานะใน rabbitMQ ด้วยว่ามีการรอรันอยู่ไหม ลงเวลาเข้า/ออกงาน #894
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-27 13:32:57 +07:00
Suphonchai Phoonsawat
7d4642a2f3 fix issue : SIT ระบบบันทึกการลา>>รายการลา (กรณีขอยกเลิกการลา) #935 2025-01-27 11:42:09 +07:00
Suphonchai Phoonsawat
b2141b0be7 Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-01-27 11:07:16 +07:00
Suphonchai Phoonsawat
b07b75c699 fix issue : SIT ระบบบันทึกการลา>>สิทธิ์การลา (โอนสิทธิ์การลา) #974 2025-01-27 11:04:33 +07:00
kittapath
6616fc72a0 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-27 10:49:44 +07:00
kittapath
87e8c17309 ให้ออกลูกจ้าง
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-27 10:14:54 +07:00
kittapath
8a3baab88f เพิ่มเครื่องราชฯ เพิ่มหน้ากรองลูกจ้างประจำก่อนประมวลผล
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-25 01:20:08 +07:00
kittapath
d0e5089a06 no message
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-24 22:33:14 +07:00
kittapath
535fa21b87 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-24 17:16:16 +07:00
kittapath
0efa5badc1 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-01-24 17:14:57 +07:00
kittapath
3aa94c7b34 add command placement 2025-01-24 17:14:39 +07:00
Bright
5c27f0d28d fix report issue #893 2025-01-24 16:03:49 +07:00
Bright
6d4f2f965a fix probation report 2025-01-24 15:24:35 +07:00
Suphonchai Phoonsawat
2852615d62 ปรับการคำนวนยอดวันลาสะสม ของปีก่อนหน้า 2025-01-24 10:27:22 +07:00
Suphonchai Phoonsawat
6afb95fe1b fix issue : SIT ระบบบันทึกเวลาปฏิบัติงาน>>ลงเวลากรณีพิเศษ (ไม่มีแจ้งเตือนไปยังผู้บังคับบัญชา) #969 2025-01-24 10:18:41 +07:00
Suphonchai Phoonsawat
752b1a5479 fix issue : SIT ระบบบันทึกการลา>>รายการลา (ลาพักผ่อน ยังไม่ถึง 10 วัน ระบบแจ้งลาเกินกำหนด) #973
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-23 15:32:31 +07:00
Suphonchai Phoonsawat
cfb00597ba Merge branch 'develop' into working 2025-01-23 15:14:37 +07:00
Suphonchai Phoonsawat
b1f9378424 fix issue : SIT ระบบบันทึกการลา>>รายการลา (ข้อมูลผู้สังกัดและเรียนไม่แสดง) #971 2025-01-23 15:14:09 +07:00
Suphonchai Phoonsawat
9774291573 fix
- SIT ระบบบันทึกเวลาปฏิบัติงาน>>ลงเวลาเข้า-ออกงาน (กรณีลงเวลาออกอีกวัน) #921
- ระบบลา (ขรก.) >> ลาพักผ่อน (การแจ้งเตือนการเลือกวันที่ซ้ำ) #837
2025-01-23 14:58:04 +07:00
kittapath
ff4019978f แก้ format org
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-23 11:48:12 +07:00
kittapath
78bbfb7107 no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-22 17:06:55 +07:00
kittapath
a8dc4b82db no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-22 15:12:29 +07:00
kittapath
92e6d1ebfc edit display org
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-22 15:10:34 +07:00
Suphonchai Phoonsawat
0c32520802 add messge leave in between 2025-01-22 09:29:52 +07:00
Suphonchai Phoonsawat
f70fbff8f0 Merge branch 'develop' into working 2025-01-21 19:41:19 +07:00
Suphonchai Phoonsawat
b861ddcdc7 change file 2025-01-21 19:40:32 +07:00
Bright
50b3dde54e ปรับแบบรายงานการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ (18) #1
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-21 18:10:31 +07:00
5380dad68e fixing report result by no
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-21 13:31:54 +07:00
Bright
92b1c01efc fix issue #950 2025-01-21 12:51:25 +07:00
43fb8a3b61 Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-21 12:47:09 +07:00
681f9ec0e4 fix 2025-01-21 12:45:53 +07:00
kittapath
ac1f371bbb add salary special
Some checks failed
release-dev / release-dev (push) Failing after 12s
2025-01-21 11:30:51 +07:00
kittapath
f8932def1d DisciplineComplaint_Appeal add profileType
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-20 22:38:18 +07:00
kittapath
9d4f1368d3 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-20 22:18:56 +07:00
kittapath
68f379bd59 ประเภท ขรก ร้องทุกข์ 2025-01-20 22:16:25 +07:00
Bright
35f590e1f3 report placement.probation
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-20 17:54:15 +07:00
kittapath
afb1f83bdf add posTypeName
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-20 16:25:02 +07:00
kittapath
74b2a817d3 add posTypeShortName 2025-01-20 16:24:12 +07:00
kittapath
19e913f68f profileType แจ้งการถึงแก่กรรม
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-20 16:20:01 +07:00
Bright
d692ea4359 report discipline
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-17 15:06:28 +07:00
kittapath
1bec091856 eq.Reason.Trim().ToUpper()
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-17 14:34:07 +07:00
kittapath
ae513bbbd5 test retire
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-17 14:20:44 +07:00
kittapath
d516e265e0 no message
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-17 11:21:39 +07:00
kittapath
37d1ff3f40 add RetirementDeceased
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-17 11:11:06 +07:00
kittapath
2095cd7fb4 add phnoe
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-16 17:55:07 +07:00
kittapath
2ece06d82c Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-16 17:24:45 +07:00
kittapath
102b5e21dc report 02 add edu 2025-01-16 17:24:30 +07:00
Bright
082f4b2f59 report placement, retire 2025-01-16 17:06:23 +07:00
kittapath
1b04e2dfc3 migrate 2025-01-15 16:14:54 +07:00
Bright
ed0af9661c เพิ่มฟิลด์สถานภาพ 2025-01-14 18:12:07 +07:00
kittapath
97b050779a no message
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-14 12:57:43 +07:00
kittapath
a6b256a39c add ReasonResign
Some checks failed
release-dev / release-dev (push) Failing after 13s
2025-01-13 16:52:51 +07:00
kittapath
549bbfcf52 report 13
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-13 15:12:44 +07:00
322d4218bc Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-13 10:06:47 +07:00
68346f8096 checkpoint report #852 (1) 2025-01-13 10:05:56 +07:00
3ee1da6a12 fixing number to thai
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-11 15:42:22 +07:00
d9dd45338e fixing field
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-11 13:42:03 +07:00
91afbdf2e3 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
Some checks failed
release-dev / release-dev (push) Failing after 10s
* 'develop' of github.com:Frappet/BMA-EHR-BackEnd:
  no message
  edit report probation
2025-01-11 12:46:50 +07:00
d1b3160847 fixing report probation 2025-01-11 12:46:39 +07:00
kittapath
825fbf6a2d no message
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-11 12:25:12 +07:00
kittapath
dba085d55a edit report probation
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-11 10:57:59 +07:00
164dc819ab Merge branch 'develop' into adiDev 2025-01-10 19:27:49 +07:00
b636233bfd checkpoint #852 (1,2) 2025-01-10 19:26:19 +07:00
223e876152 add law & skill
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-10 18:31:27 +07:00
kittapath
294fc79425 no message
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-10 16:51:04 +07:00
kittapath
304a742dac Merge branch 'main' into develop
Some checks failed
release-dev / release-dev (push) Failing after 11s
2025-01-10 16:02:44 +07:00
kittapath
c7aa109479 Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop 2025-01-10 15:58:58 +07:00
4dc69285ea updated report probation 2025-01-10 15:23:38 +07:00
kittapath
5604d7076e no message 2025-01-09 11:50:36 +07:00
kittapath
74f05fccfe update report
Some checks failed
release-dev / release-dev (push) Failing after 10s
2025-01-08 19:20:29 +07:00
kittapath
febc07623b build report v2
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-07 22:01:41 +07:00
kittapath
e170061cff no message 2025-01-07 21:59:48 +07:00
kittapath
66d44bdb93 no message
Some checks failed
release-dev / release-dev (push) Has been cancelled
2025-01-07 21:59:06 +07:00
kittapath
fd6ba2253c Merge branch 'develop' 2025-01-07 21:35:35 +07:00
kittapath
5b02c27c3f Merge branch 'develop' 2025-01-05 22:00:25 +07:00
kittapath
5d1f3755f7 Merge branch 'develop' 2024-12-27 00:41:26 +07:00
kittapath
9f985b0bfc Merge branch 'develop' 2024-12-25 01:45:55 +07:00
kittapath
0afd9a2a8d Merge branch 'develop' 2024-12-18 12:04:35 +07:00
Suchin Sapphasitthatha
6b2348f070 add Insignia CI 2024-12-16 09:17:05 +00:00
Suchin Sapphasitthatha
1afe331397 Reverse CI for CheckIn & Leave 2024-12-16 16:15:47 +07:00
Suchin Sapphasitthatha
035395f5a5 disable CI 2024-12-16 09:14:06 +00:00
Suchin Sapphasitthatha
a1815ed7e7 exp: test sdk 8 2024-12-15 19:29:56 +07:00
Suchin Sapphasitthatha
af420225d8 exp: test dockerfile 2024-12-15 18:48:31 +07:00
Suchin Sapphasitthatha
00c2370b19 exp: test dockerfile 2024-12-15 18:25:56 +07:00
Suchin Sapphasitthatha
ae3d705187 exp: test dockerfile again 2024-12-15 18:10:49 +07:00
Suchin Sapphasitthatha
3e4299fb4c Test Change Docker file for Leave 2024-12-15 17:56:38 +07:00
Suchin Sapphasitthatha
76ddcfc614 modify CI to include build leave api 2024-12-15 09:29:56 +00:00
Suchin Sapphasitthatha
10196f44a8 modify dockerfile for CheckInConsumer 2024-12-15 10:39:09 +07:00
482 changed files with 804163 additions and 9478 deletions

View file

@ -22,4 +22,12 @@
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
README.md
.git
**/bin/
**/obj/
.vscode/
.dockerignore
.gitignore
README.md
*.md

View file

@ -0,0 +1,83 @@
name: Build & Deploy Checkin Service
on:
push:
tags:
- "checkin-dev[0-9]+.[0-9]+.[0-9]+"
- "checkin-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-checkin
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/checkin-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.CheckInConsumer/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_CHECKIN "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

View file

@ -0,0 +1,83 @@
name: Build & Deploy Discipline Service
on:
push:
tags:
- "discipline-dev[0-9]+.[0-9]+.[0-9]+"
- "discipline-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-discipline
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/discipline-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.Discipline.Service/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_DISCIPLINE "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

View file

@ -0,0 +1,83 @@
name: Build & Deploy Insignia Service
on:
push:
tags:
- "insignia-dev[0-9]+.[0-9]+.[0-9]+"
- "insignia-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-insignia
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/insignia-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.Insignia/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_INSIGNIA "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

View file

@ -0,0 +1,83 @@
name: Build & Deploy Leave Service
on:
push:
tags:
- "leave-dev[0-9]+.[0-9]+.[0-9]+"
- "leave-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-leave
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/leave-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.Leave/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_LEAVE "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

View file

@ -0,0 +1,83 @@
name: Build & Deploy Placement Service
on:
push:
tags:
- "placement-dev[0-9]+.[0-9]+.[0-9]+"
- "placement-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-placement
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/placement-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.Placement.Service/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_PLACEMENT "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

View file

@ -0,0 +1,83 @@
name: Build & Deploy Retirement Service
on:
push:
tags:
- "retirement-dev[0-9]+.[0-9]+.[0-9]+"
- "retirement-dev[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: latest
SERVICE_NAME: hrms-api-retirement
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Tag Version
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed 's/retirement-dev//g')
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV
fi
- name: Login in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: .
file: ./BMA.EHR.Retirement.Service/Dockerfile
tags: ${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}:${{ env.IMAGE_VERSION }}
push: true
- name: Remote Deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ vars.SSH_DEPLOY_HOST }}
port: ${{ vars.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
password: ${{ secrets.SSH_DEPLOY_PASSWORD }}
script: |
cd ~/repo
./replace-env.sh API_RETIREMENT "${{ env.IMAGE_VERSION }}"
./deploy.sh ${{ env.SERVICE_NAME }}
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}/${{ env.SERVICE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ gitea.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}

22
.github/workflows/discord-notify.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Discord PR Notify
on:
pull_request:
types: [opened]
jobs:
discord:
runs-on: ubuntu-latest
steps:
- name: Send Discord
run: |
curl -X POST "${{ secrets.DISCORD_WEBHOOK_PULLREQUEST }}" \
-H "Content-Type: application/json" \
-d '{
"embeds": [{
"title": "🔔 **Service:** ${{ github.repository }}",
"description": "👤 **Author:** ${{ github.event.pull_request.user.login }}\n🌿 **Branch:** ${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\n📦 **Pull Request:** [#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})",
"color": 5814783,
"timestamp": "${{ github.event.pull_request.created_at }}"
}]
}'

View file

@ -0,0 +1,101 @@
name: DockerHub Release - CheckIn Consumer
run-name: DockerHub Release - CheckIn Consumer by ${{ github.actor }}
on:
push:
tags:
- "checkin-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-checkin
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.CheckInConsumer/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR CheckIn Consumer
org.opencontainers.image.description=HRMS CheckIn Consumer Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Command Service
run-name: DockerHub Release - Command Service by ${{ github.actor }}
on:
push:
tags:
- "command-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-command
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Command.Service/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Command Service
org.opencontainers.image.description=HRMS Command API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Discipline Service
run-name: DockerHub Release - Discipline Service by ${{ github.actor }}
on:
push:
tags:
- "discipline-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-discipline
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Discipline.Service/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Discipline Service
org.opencontainers.image.description=HRMS Discipline API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Insignia Service
run-name: DockerHub Release - Insignia Service by ${{ github.actor }}
on:
push:
tags:
- "insignia-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-insignia
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Insignia/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Insignia Service
org.opencontainers.image.description=HRMS Insignia API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,119 @@
name: DockerHub Release - Leave Service
run-name: DockerHub Release - Leave Service by ${{ github.actor }}
on:
push:
tags:
- "leave-[0-9]+.[0-9]+.[0-9]+"
# branches:
# - main
# - develop
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-leave
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
elif [[ $GITHUB_REF == 'refs/heads/'* ]]; then
BRANCH_NAME=${GITHUB_REF#refs/heads/}
IMAGE_VER="${BRANCH_NAME}-latest"
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=ref,event=branch
type=raw,value=${{ steps.gen_ver.outputs.image_ver }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Leave/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo "Image pushed with digest ${{ steps.build.outputs.digest }}"
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Placement Service
run-name: DockerHub Release - Placement Service by ${{ github.actor }}
on:
push:
tags:
- "placement-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-placement
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Placement.Service/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Placement Service
org.opencontainers.image.description=HRMS Placement API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Report Service
run-name: DockerHub Release - Report Service by ${{ github.actor }}
on:
push:
tags:
- "reportv2-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-reportv2
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Report.Service/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Report Service
org.opencontainers.image.description=HRMS Report API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -0,0 +1,101 @@
name: DockerHub Release - Retirement Service
run-name: DockerHub Release - Retirement Service by ${{ github.actor }}
on:
push:
tags:
- "retirement-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
IMAGE_VER:
description: "Image version (e.g., latest, v1.0.0)"
required: false
default: "latest"
env:
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: hrms-api-retirement
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
release-to-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Generate version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo "image_ver=${IMAGE_VER}" >> $GITHUB_OUTPUT
echo "Generated version: ${IMAGE_VER}"
- name: Display version
run: |
echo "Git Ref: $GITHUB_REF"
echo "Image Version: ${{ steps.gen_ver.outputs.image_ver }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{env.DOCKERHUB_REGISTRY}}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: BMA.EHR.Retirement.Service/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.gen_ver.outputs.image_ver }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=BMA EHR Retirement Service
org.opencontainers.image.description=HRMS Retirement API Service
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify Discord on success
if: success()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="✅ DockerHub release succeeded\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"
- name: Notify Discord on failure
if: failure()
env:
IMAGE_VER: ${{ steps.gen_ver.outputs.image_ver }}
run: |
TAG_INFO="Tag: ${IMAGE_VER:-unknown}"
REF_INFO="Ref: ${GITHUB_REF}"
ACTOR_INFO="Actor: ${GITHUB_ACTOR}"
MSG="❌ DockerHub release failed\n${TAG_INFO}\n${REF_INFO}\n${ACTOR_INFO}"
curl -s -H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"${MSG}\"}" \
"$DISCORD_WEBHOOK"

View file

@ -1,107 +1,107 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "retirement-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "retirement-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-retirement-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-retirement
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-retirement-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-retirement
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_retirement.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Retirement.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
# act workflow_dispatch -W .github/workflows/release_retirement.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Retirement.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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 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

@ -1,9 +1,9 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "consumer-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "consumer-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com

View file

@ -1,89 +1,107 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
# push:
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
# tags-ignore:
# - '2.*'
# Allow run workflow manually from Action tab
workflow_dispatch:
# push:
# tags:
# - "command-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-command-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-command
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-command-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-command
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_command.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# skip Set up QEMU because it fail on act and container
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Test Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Command.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
# act workflow_dispatch -W .github/workflows/release_command.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Command.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0
if: success()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Success✅✅✅
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- uses: snow-actions/line-notify@v1.1.0
if: failure()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Failure❌❌❌
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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 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

@ -1,107 +1,107 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "discipline-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "discipline-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-discipline-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-discipline
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-discipline-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-discipline
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_discipline.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Discipline.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
# act workflow_dispatch -W .github/workflows/release_discipline.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Discipline.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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 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

@ -1,9 +1,9 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "insignia-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "insignia-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com

View file

@ -1,9 +1,9 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "leave-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "leave-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
@ -57,7 +57,7 @@ jobs:
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Remote Deployment
uses: appleboy/ssh-action@v0.1.8
uses: appleboy/ssh-action@v1
with:
host: ${{env.DEPLOY_HOST}}
username: frappet

View file

@ -1,107 +1,107 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
push:
tags:
- "placement-[0-9]+.[0-9]+.[0-9]+"
# push:
# tags:
# - "placement-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-placement-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-placement
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-placement-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-placement
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_placement.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Placement.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
# act workflow_dispatch -W .github/workflows/release_placement.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Placement.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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 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

@ -1,89 +1,107 @@
name: release-dev
run-name: release-dev ${{ github.actor }}
on:
# push:
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
# tags-ignore:
# - '2.*'
# Allow run workflow manually from Action tab
workflow_dispatch:
# push:
# tags:
# - "reportv2-[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-report-v2-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-report-v2
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-report-v2-service
DEPLOY_HOST: frappet.com
DEPLOY_PORT: 10102
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-report-v2
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_report.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# skip Set up QEMU because it fail on act and container
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Test Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Report.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
# act workflow_dispatch -W .github/workflows/release_report.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set output tags
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Gen Version
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER=${{ steps.vars.outputs.tag }}
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='test-vBeta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Check Version
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login in to registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and load local docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
file: BMA.EHR.Report.Service/Dockerfile
push: true
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0
if: success()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Success✅✅✅
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- uses: snow-actions/line-notify@v1.1.0
if: failure()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Failure❌❌❌
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- name: Reload docker compose
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{env.DEPLOY_HOST}}
username: frappet
password: ${{ secrets.SSH_PASSWORD }}
port: ${{env.DEPLOY_PORT}}
script: |
cd "${{env.COMPOSE_PATH}}"
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 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 }}

21
.gitignore vendored
View file

@ -16,6 +16,19 @@
# Mono auto generated files
mono_crash.*
# JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
.idea/
*.iml
*.ipr
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@ -360,4 +373,10 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
# VS Code C# Dev Kit cache
*.lscache
# Claude Code
.claude/

View file

@ -1 +0,0 @@
BMA.EHR.Solution

Before

Width:  |  Height:  |  Size: 16 B

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,552 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile kind="Docker">BMA.EHR.CheckInConsumer/BMA.EHR.CheckInConsumer.csproj</projectFile>
<projectFile profileName="BMA.EHR.CheckInConsumer">BMA.EHR.CheckInConsumer/BMA.EHR.CheckInConsumer.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Insignia/BMA.EHR.Insignia.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Insignia/BMA.EHR.Insignia.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Insignia/BMA.EHR.Insignia.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Leave/BMA.EHR.Leave.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Leave/BMA.EHR.Leave.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Leave/BMA.EHR.Leave.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj</projectFile>
<projectFile profileName="dotnet">BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj</projectFile>
<projectFile profileName="report-designer">BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj</projectFile>
<projectFile kind="Docker">BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj</projectFile>
<projectFile profileName="http">BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj</projectFile>
<projectFile profileName="https">BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="85fddeb6-44fd-40a4-864f-89daec07db75" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BMA.EHR.Insignia/appsettings.json" beforeDir="false" afterPath="$PROJECT_DIR$/BMA.EHR.Insignia/appsettings.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BMA.EHR.Leave/Controllers/LeaveController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/BMA.EHR.Leave/Controllers/LeaveController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BMA.EHR.Leave/appsettings.json" beforeDir="false" afterPath="$PROJECT_DIR$/BMA.EHR.Leave/appsettings.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DpaMonitoringSettings">
<option name="autoShow" value="false" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"customColor": "",
"associatedIndex": 2
}]]></component>
<component name="ProjectId" id="2lB1pnEIkATarPnZkJ5vo5hUlwn" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
".NET Launch Settings Profile.BMA.EHR.Leave: https.executor": "Debug",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "working",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "preferences.lookFeel",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"rider.external.source.directories": [
"/Users/suphonchai/Library/Application Support/JetBrains/Rider2024.1/resharper-host/DecompilerCache",
"/Users/suphonchai/Library/Application Support/JetBrains/Rider2024.1/resharper-host/SourcesCache",
"/Users/suphonchai/Library/Application Support/Symbols/src"
]
}
}]]></component>
<component name="RunManager" selected=".NET Launch Settings Profile.BMA.EHR.Leave: https">
<configuration name="BMA.EHR.CheckInConsumer" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.CheckInConsumer/BMA.EHR.CheckInConsumer.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net8.0" />
<option name="LAUNCH_PROFILE_NAME" value="BMA.EHR.CheckInConsumer" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Command.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Command.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Command.Service/BMA.EHR.Command.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Discipline.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Discipline.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Discipline.Service/BMA.EHR.Discipline.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Insignia: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Insignia: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Insignia/BMA.EHR.Insignia.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Leave: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Leave/BMA.EHR.Leave.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Leave: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Leave/BMA.EHR.Leave.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.MetaData.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.MetaData.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.MetaData.Service/BMA.EHR.MetaData.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.OrganizationEmployee.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.OrganizationEmployee.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.OrganizationEmployee.Service/BMA.EHR.OrganizationEmployee.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Placement.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Placement.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Placement.Service/BMA.EHR.Placement.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Report.Service: dotnet" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net6.0" />
<option name="LAUNCH_PROFILE_NAME" value="dotnet" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Report.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net6.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Report.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net6.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Report.Service: report-designer" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net6.0" />
<option name="LAUNCH_PROFILE_NAME" value="report-designer" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Retirement.Service: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.Retirement.Service: https" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/BMA.EHR.Retirement.Service/BMA.EHR.Retirement.Service.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net7.0" />
<option name="LAUNCH_PROFILE_NAME" value="https" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="BMA.EHR.CheckInConsumer/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.checkinconsumer" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="sourceFilePath" value="BMA.EHR.CheckInConsumer/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Command.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.command.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Command.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Insignia/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.insignia" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Insignia/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Leave/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.leave" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Leave/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.MetaData.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.metadata.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.MetaData.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.OrganizationEmployee.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.organizationemployee.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.OrganizationEmployee.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Placement.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.placement.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Placement.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Report.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.report.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Report.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration name="BMA.EHR.Retirement.Service/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="containerName" value="bma.ehr.retirement.service" />
<option name="contextFolderPath" value="$PROJECT_DIR$" />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="BMA.EHR.Retirement.Service/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
<configuration default="true" type="docker-deploy" factoryName="dockerfile" temporary="true">
<deployment type="dockerfile" />
<method v="2" />
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="85fddeb6-44fd-40a4-864f-89daec07db75" name="Changes" comment="" />
<created>1724638841465</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1724638841465</updated>
<workItem from="1724638842250" duration="4068000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/BMA.EHR.Leave/Controllers/LeaveController.cs</url>
<line>1152</line>
<properties documentPath="$PROJECT_DIR$/BMA.EHR.Leave/Controllers/LeaveController.cs" containingFunctionPresentation="Method 'GetTimeRecordAsync'">
<startOffsets>
<option value="52378" />
</startOffsets>
<endOffsets>
<option value="52431" />
</endOffsets>
</properties>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View file

@ -1,6 +1,6 @@
version: 37
jobs:
- name: CI for Checkin [UAT]
- name: CI for UAT
steps:
- !CheckoutStep
name: checkout code
@ -33,32 +33,44 @@ jobs:
dotnet test -l trx --collect:"XPlat Code Coverage"
#/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml
useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
condition: NEVER
- !PublishTRXReportStep
name: publish unit test report
reportName: Unit Test
filePatterns: '**/*.trx'
condition: ALWAYS
condition: NEVER
- !PublishCoberturaReportStep
name: publish code coverage report
reportName: Code Coverage
filePatterns: '**/coverage.cobertura.xml'
condition: ALWAYS
condition: NEVER
- !PublishRoslynatorReportStep
name: publish code problem report
reportName: Code Problems
filePatterns: roslynator-analysis.xml
failThreshold: HIGH
condition: ALWAYS
condition: NEVER
- !SetBuildVersionStep
name: set build version
buildVersion: '@tag@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep
name: build docker image
name: build docker image - Leave
dockerfile: ./BMA.EHR.Leave/Dockerfile
output: !RegistryOutput
tags: hrms-git.chin.in.th/bma-hrms/hrms-api-leave:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-leave:latest
condition: NEVER
- !BuildImageStep
name: build docker image - Checkin
dockerfile: ./BMA.EHR.CheckInConsumer/Dockerfile
output: !RegistryOutput
tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest
condition: NEVER
- !BuildImageStep
name: build docker image - Insignia
dockerfile: ./BMA.EHR.Insignia/Dockerfile
output: !RegistryOutput
tags: hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:latest
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !TagCreateTrigger
@ -68,53 +80,3 @@ jobs:
maxRetries: 3
retryDelay: 30
timeout: 14400
- name: CI for PROD
steps:
- !CheckoutStep
name: checkout code
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !GenerateChecksumStep
name: generate package checksum
files: package-lock.json yarn.lock
targetFile: checksum
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetupCacheStep
name: set up npm cache
key: node_modules_@file:checksum@
loadKeys:
- node_modules
paths:
- node_modules
uploadStrategy: UPLOAD_IF_NOT_HIT
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetBuildVersionStep
name: set build version
buildVersion: '@tag@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: build & test
runInContainer: true
image: node
interpreter: !DefaultInterpreter
commands: |
npm install
npm run build
useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !BuildImageStep
name: build docker image
dockerfile: ./docker/Dockerfile
output: !RegistryOutput
tags: hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:latest
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !TagCreateTrigger
tags: prod-*
branches: main
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 14400

93
.vscode/launch.json vendored
View file

@ -1,35 +1,60 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/BMA.EHR.Leave.Service/bin/Debug/net7.0/BMA.EHR.Leave.Service.dll",
"args": [],
"cwd": "${workspaceFolder}/BMA.EHR.Leave.Service",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/BMA.EHR.Leave/bin/Debug/net7.0/BMA.EHR.Leave.dll",
"args": [],
"cwd": "${workspaceFolder}/BMA.EHR.Leave",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web) - Insignia",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/BMA.EHR.Insignia/bin/Debug/net7.0/BMA.EHR.Insignia.dll",
"args": [],
"cwd": "${workspaceFolder}/BMA.EHR.Insignia",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

View file

@ -23,11 +23,12 @@ namespace BMA.EHR.Application
services.AddTransient<CommandStatusRepository>();
services.AddTransient<InsigniaPeriodsRepository>();
services.AddTransient<RetirementRepository>();
services.AddTransient<RetirementEmployeeRepository>();
services.AddTransient<UserProfileRepository>();
services.AddTransient<OrganizationCommonRepository>();
services.AddTransient<InboxRepository>();
services.AddTransient<NotificationRepository>();
services.AddTransient<RetirementRepository>();
//services.AddTransient<RetirementRepository>();
services.AddTransient<RetireReportRepository>();
services.AddTransient<InsigniaReportRepository>();
services.AddTransient<CommandReportRepository>();
@ -52,12 +53,16 @@ namespace BMA.EHR.Application
services.AddTransient<UserDutyTimeRepository>();
services.AddTransient<AdditionalCheckRequestRepository>();
services.AddTransient<UserCalendarRepository>();
services.AddTransient<CheckInJobStatusRepository>();
services.AddTransient<LeaveTypeRepository>();
services.AddTransient<LeaveRequestRepository>();
services.AddTransient<LeaveBeginningRepository>();
services.AddTransient<MinIOLeaveService>();
services.AddTransient<LeaveProcessJobStatusRepository>();
return services;
}

View file

@ -4,6 +4,9 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);$(WarningsNotAsErrors)</NoWarn>
</PropertyGroup>
<ItemGroup>

View file

@ -51,7 +51,7 @@ namespace BMA.EHR.Application.Messaging
}
catch
{
throw;
//throw;
}
}

View file

@ -99,11 +99,11 @@ namespace BMA.EHR.Application.Repositories.Commands
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
PositionType = p.posTypeName == null ? "" : p.posTypeName,
PositionNumber = 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() : "",
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() : "",
Salary = p.Amount == null ? "0" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
@ -152,11 +152,11 @@ namespace BMA.EHR.Application.Repositories.Commands
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
PositionType = p.posTypeName == null ? "" : p.posTypeName,
PositionNumber = 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() : "",
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() : "",
Salary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
ExamNumber = p.ExamNumber == null ? "" : p.ExamNumber.Value.ToString().ToThaiNumber(),
@ -206,11 +206,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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,
@ -218,11 +218,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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(),
RemarkHorizontal = p.RemarkHorizontal,
@ -269,22 +269,22 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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() : "",
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()
})
@ -329,22 +329,22 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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() : "",
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()
})
@ -407,11 +407,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
@ -477,11 +477,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
@ -750,11 +750,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
@ -1173,11 +1173,11 @@ namespace BMA.EHR.Application.Repositories.Commands
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName.ToThaiNumber(),
// 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() : "",
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
@ -1307,11 +1307,11 @@ namespace BMA.EHR.Application.Repositories.Commands
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() : "",
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})

View file

@ -248,7 +248,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.Draft! == true)
.Where(x => x.Placement!.PlacementType!.Name == "สอบแข่งขัน")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINT")
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -307,7 +307,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.Draft! == true)
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINT")
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -919,7 +919,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -934,7 +934,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -986,7 +986,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1001,7 +1001,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -1423,7 +1423,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1440,7 +1440,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -1534,7 +1534,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1550,7 +1550,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -1603,7 +1603,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1832,7 +1832,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1849,7 +1849,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -1905,7 +1905,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1922,7 +1922,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -1978,7 +1978,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -1995,7 +1995,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2051,7 +2051,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2068,7 +2068,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2124,7 +2124,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2141,7 +2141,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2197,7 +2197,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2214,7 +2214,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2270,7 +2270,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2287,7 +2287,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2340,7 +2340,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2355,7 +2355,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -2409,7 +2409,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2462,7 +2462,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2515,7 +2515,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2568,7 +2568,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2621,7 +2621,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2673,7 +2673,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2725,7 +2725,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -2994,7 +2994,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -3046,7 +3046,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var edu in placementProfile.PlacementEducations)
{
var _res = await client.PostAsJsonAsync(apiUrlEdu, new
@ -3083,7 +3083,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var cer in placementProfile.PlacementCertificates)
{
var _res = await client.PostAsJsonAsync(apiUrlCer, new
@ -3104,7 +3104,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
profileId = profileId,
@ -3113,11 +3113,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = placementProfile.PositionSalaryAmount,
mouthSalaryAmount = placementProfile.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.positionName == null ? string.Empty : placementProfile.positionName,
positionLine = string.Empty,
positionPathSide = string.Empty,
@ -3135,7 +3135,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -3287,7 +3287,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -3297,11 +3297,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.positionName,
positionLine = "",
positionPathSide = "",
@ -3319,7 +3319,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -3468,7 +3468,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -3478,11 +3478,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.positionName,
positionLine = "",
positionPathSide = "",
@ -3500,7 +3500,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -3649,7 +3649,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -3659,11 +3659,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.positionName,
positionLine = "",
positionPathSide = "",
@ -3681,7 +3681,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -3832,7 +3832,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -3842,11 +3842,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.position,
positionLine = "",
positionPathSide = "",
@ -3864,7 +3864,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -4017,7 +4017,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -4027,11 +4027,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.position,
positionLine = "",
positionPathSide = "",
@ -4049,7 +4049,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -4199,7 +4199,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -4209,11 +4209,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.position,
positionLine = "",
positionPathSide = "",
@ -4231,7 +4231,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -4382,7 +4382,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -4409,7 +4409,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave);
string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrlLeave, new
@ -4560,7 +4560,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -4587,7 +4587,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave);
string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrlLeave, new
@ -4928,7 +4928,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -5085,7 +5085,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -5262,7 +5262,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -5440,7 +5440,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -5450,11 +5450,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = placementProfile.posMasterNo == null ? "" :
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
placementProfile.node == 4 ? $"{placementProfile.child4ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 3 ? $"{placementProfile.child3ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 2 ? $"{placementProfile.child2ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 1 ? $"{placementProfile.child1ShortName} {placementProfile.posMasterNo}" :
placementProfile.node == 0 ? $"{placementProfile.rootShortName} {placementProfile.posMasterNo}" : "",
position = placementProfile.position,
positionLine = "",
positionPathSide = "",
@ -5472,7 +5472,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -5626,7 +5626,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -5805,7 +5805,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -5986,7 +5986,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -6001,7 +6001,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -6182,7 +6182,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -6197,7 +6197,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -6371,7 +6371,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -6452,7 +6452,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend });
var result = await res.Content.ReadAsStringAsync();
@ -6549,7 +6549,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
@ -6630,7 +6630,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend });
var result = await res.Content.ReadAsStringAsync();
@ -6719,7 +6719,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -6877,7 +6877,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -6887,11 +6887,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = data.posMasterNo == null ? "" :
data.node == 4 ? $"{data.child4ShortName}{data.posMasterNo}" :
data.node == 3 ? $"{data.child3ShortName}{data.posMasterNo}" :
data.node == 2 ? $"{data.child2ShortName}{data.posMasterNo}" :
data.node == 1 ? $"{data.child1ShortName}{data.posMasterNo}" :
data.node == 0 ? $"{data.rootShortName}{data.posMasterNo}" : "",
data.node == 4 ? $"{data.child4ShortName} {data.posMasterNo}" :
data.node == 3 ? $"{data.child3ShortName} {data.posMasterNo}" :
data.node == 2 ? $"{data.child2ShortName} {data.posMasterNo}" :
data.node == 1 ? $"{data.child1ShortName} {data.posMasterNo}" :
data.node == 0 ? $"{data.rootShortName} {data.posMasterNo}" : "",
position = data.position,
positionType = data.posTypeName,
positionLevel = data.posLevelName,
@ -6906,7 +6906,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -7062,7 +7062,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Put, apiUrl);
var _res = await client.PutAsJsonAsync(apiUrl, new
{
@ -7215,7 +7215,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -7225,11 +7225,11 @@ namespace BMA.EHR.Application.Repositories.Commands
positionSalaryAmount = recv.PositionSalaryAmount,
mouthSalaryAmount = recv.MouthSalaryAmount,
posNo = data.posMasterNo == null ? "" :
data.node == 4 ? $"{data.child4ShortName}{data.posMasterNo}" :
data.node == 3 ? $"{data.child3ShortName}{data.posMasterNo}" :
data.node == 2 ? $"{data.child2ShortName}{data.posMasterNo}" :
data.node == 1 ? $"{data.child1ShortName}{data.posMasterNo}" :
data.node == 0 ? $"{data.rootShortName}{data.posMasterNo}" : "",
data.node == 4 ? $"{data.child4ShortName} {data.posMasterNo}" :
data.node == 3 ? $"{data.child3ShortName} {data.posMasterNo}" :
data.node == 2 ? $"{data.child2ShortName} {data.posMasterNo}" :
data.node == 1 ? $"{data.child1ShortName} {data.posMasterNo}" :
data.node == 0 ? $"{data.rootShortName} {data.posMasterNo}" : "",
position = data.position,
positionType = data.posTypeName,
positionLevel = data.posLevelName,
@ -7244,7 +7244,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
@ -7385,7 +7385,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -7411,7 +7411,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -7544,7 +7544,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -7570,7 +7570,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -7704,7 +7704,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -7730,7 +7730,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -7864,7 +7864,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -7890,7 +7890,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -8024,7 +8024,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8050,7 +8050,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -8184,7 +8184,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8210,7 +8210,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -8344,7 +8344,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8370,7 +8370,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -8504,7 +8504,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8530,7 +8530,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new
{
@ -8663,7 +8663,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8806,7 +8806,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -8949,7 +8949,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -9091,7 +9091,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -9234,7 +9234,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync();
@ -9612,7 +9612,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrl, new
@ -9628,7 +9628,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
@ -10913,7 +10913,7 @@ namespace BMA.EHR.Application.Repositories.Commands
{
try
{
var orgIdSend = new List<Guid>() { Guid.Parse("08dc31bb-0707-4ce0-82fd-7e76903e9fca"), Guid.Parse("08dc30ee-2be8-40d0-81bf-b3f2f52dc0ad") };
var orgIdSend = new List<Guid>() { Guid.Parse("") };
var profiles = await _dbContext.Set<Profile>()
.Include(x => x.Prefix)
.Include(x => x.Gender)
@ -11388,7 +11388,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var insignia in Insignias)
{
var _res = await client.PostAsJsonAsync(apiUrlInsig, new

View file

@ -1,9 +1,14 @@
using BMA.EHR.Application.Common.Interfaces;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories.MessageQueue;
using BMA.EHR.Domain.Models.Discipline;
using BMA.EHR.Domain.Models.Retirement;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Microsoft.Extensions.Configuration;
using BMA.EHR.Application.Requests;
namespace BMA.EHR.Application.Repositories
{
@ -13,33 +18,60 @@ namespace BMA.EHR.Application.Repositories
private readonly IDisciplineDbContext _dbDisContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly NotificationRepository _repositoryNoti;
private readonly IConfiguration _configuration;
public DisciplineRepository(IApplicationDBContext dbContext,
IDisciplineDbContext dbDisContext,
NotificationRepository repositoryNoti,
IConfiguration configuration,
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_dbDisContext = dbDisContext;
_httpContextAccessor = httpContextAccessor;
_repositoryNoti = repositoryNoti;
_configuration = configuration;
}
//เรื่องร้องเรียน
public async Task NotifyDisciplineComplaint()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineComplaint>()
.Include(x => x.DisciplineComplaint_Profiles)
.Where(x => x.DateNotification != null)
.Where(x => x.DateNotification.Value.Date == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director";
var refId = new List<Guid>();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
refId = cronjobNoti.DisciplineComplaint_Profiles.Select(x => x.PersonId),
});
var _result = await _res.Content.ReadAsStringAsync();
var org = JsonConvert.DeserializeObject<DirectorRequest>(_result);
if (_res.IsSuccessStatusCode)
{
refId = org.result.Select(x => Guid.Parse(x.id)).ToList();
}
}
await _repositoryNoti.PushNotificationsAsync(
refId.ToArray(),
$"แจ้งเตือนบันทึกข้อมูลร้องเรียนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลร้องเรียนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
$"แจ้งเตือนบันทึกข้อมูลร้องเรียนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
"",
"",
true,
true
);
}
await _dbContext.SaveChangesAsync();
}
@ -47,16 +79,39 @@ namespace BMA.EHR.Application.Repositories
public async Task NotifyDisciplineInvestigate()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineInvestigate>()
.Include(x => x.DisciplineInvestigate_ProfileComplaints)
.Where(x => x.InvestigationDateEnd != null && x.InvestigationDateEnd.Value.Date.AddDays(-7) == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director";
var refId = new List<Guid>();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
refId = cronjobNoti.DisciplineInvestigate_ProfileComplaints.Select(x => x.PersonId),
});
var _result = await _res.Content.ReadAsStringAsync();
var org = JsonConvert.DeserializeObject<DirectorRequest>(_result);
if (_res.IsSuccessStatusCode)
{
refId = org.result.Select(x => Guid.Parse(x.id)).ToList();
}
}
await _repositoryNoti.PushNotificationsAsync(
refId.ToArray(),
$"แจ้งเตือนบันทึกข้อมูลสืบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลสืบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
$"แจ้งเตือนบันทึกข้อมูลสืบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
"",
"",
true,
true
);
}
await _dbContext.SaveChangesAsync();
}
@ -65,16 +120,39 @@ namespace BMA.EHR.Application.Repositories
public async Task NotifyDisciplineDisciplinary()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineDisciplinary>()
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
.Where(x => x.DisciplinaryDateEnd != null && x.DisciplinaryDateEnd.Value.Date.AddDays(-7) == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director";
var refId = new List<Guid>();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
refId = cronjobNoti.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(x => x.PersonId),
});
var _result = await _res.Content.ReadAsStringAsync();
var org = JsonConvert.DeserializeObject<DirectorRequest>(_result);
if (_res.IsSuccessStatusCode)
{
refId = org.result.Select(x => Guid.Parse(x.id)).ToList();
}
}
await _repositoryNoti.PushNotificationsAsync(
refId.ToArray(),
$"แจ้งเตือนบันทึกข้อมูลสอบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลสอบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
$"แจ้งเตือนบันทึกข้อมูลสอบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
"",
"",
true,
true
);
}
await _dbContext.SaveChangesAsync();
}

View file

@ -1,15 +1,16 @@
using Amazon.S3.Model.Internal.MarshallTransformations;
using Amazon.Runtime.Internal.Endpoints.StandardLibrary;
using Amazon.S3.Model.Internal.MarshallTransformations;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Domain.Models.Base;
using BMA.EHR.Domain.Models.HR;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Text;
using Microsoft.Extensions.Configuration;
namespace BMA.EHR.Application.Repositories
{
@ -52,15 +53,18 @@ namespace BMA.EHR.Application.Repositories
#region " For Call External API "
protected async Task<string> GetExternalAPIAsync(string apiPath, string accessToken, string apiKey)
protected async Task<string> GetExternalAPIAsync(string apiPath, string accessToken, string apiKey, CancellationToken cancellationToken = default)
{
try
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey);
var _res = await client.GetAsync(apiPath);
client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.GetAsync(apiPath,cancellationToken: combinedCts.Token);
if (_res.IsSuccessStatusCode)
{
var _result = await _res.Content.ReadAsStringAsync();
@ -76,19 +80,25 @@ namespace BMA.EHR.Application.Repositories
}
}
protected async Task<string> PostExternalAPIAsync(string apiPath, string accessToken, object? body, string apiKey)
protected async Task<string> SendExternalAPIAsync(HttpMethod method, string apiPath, string accessToken, object? body, string apiKey, CancellationToken cancellationToken = default)
{
try
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
// สร้าง request message
var request = new HttpRequestMessage(method, apiPath);
var json = JsonConvert.SerializeObject(body);
var stringContent = new StringContent(json, UnicodeEncoding.UTF8, "application/json");
stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent);
client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.SendAsync(request, combinedCts.Token);
if (_res.IsSuccessStatusCode)
{
var _result = await _res.Content.ReadAsStringAsync();
@ -104,10 +114,45 @@ namespace BMA.EHR.Application.Repositories
}
}
protected async Task<bool> PostExternalAPIBooleanAsync(string apiPath, string accessToken, object? body, string apiKey)
public async Task<string> PostExternalAPIAsync(string apiPath, string accessToken, object? body, string apiKey, CancellationToken cancellationToken = default)
{
try
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
var json = JsonConvert.SerializeObject(body);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
//stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent, combinedCts.Token);
if (_res.IsSuccessStatusCode)
{
var _result = await _res.Content.ReadAsStringAsync();
return _result;
}
return string.Empty;
}
}
catch
{
throw;
}
}
protected async Task<bool> PostExternalAPIBooleanAsync(string apiPath, string accessToken, object? body, string apiKey, CancellationToken cancellationToken = default)
{
try
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
var json = JsonConvert.SerializeObject(body);
var stringContent = new StringContent(json, UnicodeEncoding.UTF8, "application/json");
stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
@ -115,8 +160,8 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent);
client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent, combinedCts.Token);
return _res.IsSuccessStatusCode;
}
}

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,11 @@
using BMA.EHR.Domain.Models.Base;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System.IO.Pipes;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Text;
namespace BMA.EHR.Application.Repositories.Leaves
{
@ -43,6 +46,38 @@ namespace BMA.EHR.Application.Repositories.Leaves
#region " Methods "
public async Task<string> PostExternalAPIAsync(string apiPath, string accessToken, object? body, string apiKey, CancellationToken cancellationToken = default)
{
try
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
var json = JsonConvert.SerializeObject(body);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
//stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent, combinedCts.Token);
if (_res.IsSuccessStatusCode)
{
var _result = await _res.Content.ReadAsStringAsync();
return _result;
}
return string.Empty;
}
}
catch
{
throw;
}
}
public virtual async Task<IReadOnlyList<T>> GetAllAsync()
{
return await _dbSet.ToListAsync();
@ -68,6 +103,24 @@ namespace BMA.EHR.Application.Repositories.Leaves
return entity;
}
public virtual async Task<IReadOnlyList<T>> AddRangeAsync(List<T> entities)
{
foreach (var entity in entities)
{
if (entity is EntityBase)
{
(entity as EntityBase).CreatedUserId = UserId ?? "";
(entity as EntityBase).CreatedFullName = FullName ?? "System Administrator";
(entity as EntityBase).CreatedAt = DateTime.Now;
}
}
await _dbSet.AddRangeAsync(entities);
await _dbContext.SaveChangesAsync();
return entities;
}
public virtual async Task<T> UpdateAsync(T entity)
{
if (entity is EntityBase)

View file

@ -0,0 +1,587 @@
using Amazon.S3.Model;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Messaging;
using BMA.EHR.Application.Responses.Profiles;
using BMA.EHR.Domain.Extensions;
using BMA.EHR.Domain.Models.Leave.Commons;
using BMA.EHR.Domain.Models.Leave.Requests;
using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System.Collections.Concurrent;
namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
{
public class LeaveBeginningRepository : GenericLeaveRepository<Guid, LeaveBeginning>
{
#region " Fields "
private readonly ILeaveDbContext _dbContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly OrganizationCommonRepository _organizationCommonRepository;
private readonly UserProfileRepository _userProfileRepository;
private readonly IConfiguration _configuration;
private readonly EmailSenderService _emailSenderService;
/// <summary>
/// Keyed locks to serialize get-or-create for LeaveBeginning rows by (ProfileId, LeaveYear, LeaveTypeId).
/// Prevents duplicate inserts when concurrent requests (e.g. UI calling /user/check twice) hit the same key.
/// </summary>
private static readonly ConcurrentDictionary<string, SemaphoreSlim> _getOrAddLocks = new();
#endregion
#region " Constructor and Destuctor "
public LeaveBeginningRepository(ILeaveDbContext dbContext,
IHttpContextAccessor httpContextAccessor,
OrganizationCommonRepository organizationCommonRepository,
UserProfileRepository userProfileRepository,
IConfiguration configuration,
EmailSenderService emailSenderService) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_httpContextAccessor = httpContextAccessor;
_organizationCommonRepository = organizationCommonRepository;
_userProfileRepository = userProfileRepository;
_configuration = configuration;
_emailSenderService = emailSenderService;
}
#endregion
#region " Properties "
protected Guid UserOrganizationId
{
get
{
if (UserId != null || UserId != "")
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!), AccessToken);
else
return Guid.Empty;
}
}
#endregion
public async Task<List<LeaveBeginning>> GetAllByYearAsync(int year)
{
return await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.Where(x => x.LeaveYear == year)
.ToListAsync();
}
public async Task<LeaveBeginning?> GetByYearAndTypeIdAsync(int year, Guid typeId)
{
var data = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year && x.LeaveTypeId == typeId);
return data;
}
public async Task UpdateLeaveUsageAsync(int year, Guid typeId, Guid userId, double day)
{
// var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
var pf = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken);
if (pf == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
var data = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
if (data == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
data.LeaveDaysUsed += day;
await _dbContext.SaveChangesAsync();
}
public async Task UpdateLeaveCountAsync(int year, Guid typeId, Guid userId, int count)
{
// var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
var pf = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken);
if (pf == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
var data = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
if (data == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
data.LeaveCount += count;
await _dbContext.SaveChangesAsync();
}
public async Task ProcessEarlyLeaveRequest(int year)
{
// Get Early Leave Request (กรองตามปีงบประมาณ: 1 ต.ค. (year-1) 30 ก.ย. (year))
var fiscalStart = new DateTime(year - 1, 10, 1);
var fiscalEnd = new DateTime(year, 9, 30);
var leaveReq = await _dbContext.Set<LeaveRequest>()
.Include(x => x.Type)
.Where(x => x.LeaveStatus == "APPROVE")
.Where(x => x.LeaveStartDate.Date <= fiscalEnd && x.LeaveEndDate.Date >= fiscalStart)
.ToListAsync();
foreach (var leave in leaveReq)
{
await GetByYearAndTypeIdForUserWithUpdateAsync(year, leave.Type.Id, leave.KeycloakUserId);
}
}
public async Task ProcessEarlyLeaveRequestSchedule()
{
int year = DateTime.Now.Year;
await ProcessEarlyLeaveRequest(year);
}
public async Task<LeaveBeginning?> GetByYearAndTypeIdForUserAsync(int year, Guid typeId, Guid userId)
{
// var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
var pf = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken);
if (pf == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
LeaveBeginning Factory()
{
var limit = 0.0;
var prev = _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefault(x => x.LeaveYear == year - 1 && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
// คำนวณปีงบประมาณจาก startDate (ปีงบประมาณเริ่ม 1 ต.ค. และสิ้นสุด 30 ก.ย.)
var isCurrentYear = DateTime.Now.Year == year;
var prevRemain = 0.0;
if (prev != null)
{
prevRemain = isCurrentYear ? prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0) : 0.0;
}
if (govAge >= 180)
{
if (govAge >= 3650)
{
limit = 10 + prevRemain;
if (limit > 30) limit = 30;
}
else
{
limit = 10 + prevRemain;
if (limit > 20) limit = 20;
}
}
else
{
limit = 0.0;
}
return new LeaveBeginning
{
LeaveYear = year,
LeaveTypeId = typeId,
ProfileId = pf.Id,
Prefix = pf.Prefix,
FirstName = pf.FirstName,
LastName = pf.LastName,
LeaveDaysUsed = 0,
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
RootDnaId = pf.RootDnaId,
Child1DnaId = pf.Child1DnaId,
Child2DnaId = pf.Child2DnaId,
Child3DnaId = pf.Child3DnaId,
Child4DnaId = pf.Child4DnaId
};
}
return await GetOrAddForUserAsync(year, typeId, pf.Id, Factory);
}
public async Task<LeaveBeginning?> GetByYearAndTypeIdForUserWithUpdateAsync(int year, Guid typeId, Guid userId)
{
// var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
var pf = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken);
if (pf == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
var limit = 0.0;
var prev = _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefault(x => x.LeaveYear == year - 1 && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
var prevRemain = 0.0;
if (prev != null)
{
prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0);
}
if (govAge >= 180)
{
if (govAge >= 3650)
{
limit = 10 + prevRemain;
if (limit > 30) limit = 30;
}
else
{
limit = 10 + prevRemain;
if (limit > 20) limit = 20;
}
}
else
{
limit = 0.0;
}
var data = await _dbContext.Set<LeaveBeginning>()
.Where(x => x.LeaveYear == year && x.LeaveTypeId == typeId && x.ProfileId == pf.Id)
.FirstOrDefaultAsync();
if (data != null)
{
data.LeaveDays = leaveType?.Code == "LV-005" ? limit : 0;
await _dbContext.SaveChangesAsync();
}
// return new LeaveBeginning
// {
// LeaveYear = year,
// LeaveTypeId = typeId,
// ProfileId = pf.Id,
// Prefix = pf.Prefix,
// FirstName = pf.FirstName,
// LastName = pf.LastName,
// LeaveDaysUsed = 0,
// LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
// RootDnaId = pf.RootDnaId,
// Child1DnaId = pf.Child1DnaId,
// Child2DnaId = pf.Child2DnaId,
// Child3DnaId = pf.Child3DnaId,
// Child4DnaId = pf.Child4DnaId
// };
return data;
}
public async Task<LeaveBeginning?> GetByYearAndTypeIdForUser(int year, Guid typeId, GetProfileByKeycloakIdDto? pf)
{
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
LeaveBeginning Factory()
{
var limit = 0.0;
var prev = _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefault(x => x.LeaveYear == year - 1 && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
// คำนวณปีงบประมาณจาก startDate (ปีงบประมาณเริ่ม 1 ต.ค. และสิ้นสุด 30 ก.ย.)
var isCurrentYear = DateTime.Now.Year == year;
var prevRemain = 0.0;
if (prev != null)
{
prevRemain = isCurrentYear ? prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0) : 0.0;
}
if (govAge >= 180)
{
if (govAge >= 3650)
{
limit = 10 + prevRemain;
if (limit > 30) limit = 30;
}
else
{
limit = 10 + prevRemain;
if (limit > 20) limit = 20;
}
}
else
{
limit = 0.0;
}
return new LeaveBeginning
{
LeaveYear = year,
LeaveTypeId = typeId,
ProfileId = pf.Id,
Prefix = pf.Prefix,
FirstName = pf.FirstName,
LastName = pf.LastName,
LeaveDaysUsed = 0,
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
RootDnaId = pf.RootDnaId,
Child1DnaId = pf.Child1DnaId,
Child2DnaId = pf.Child2DnaId,
Child3DnaId = pf.Child3DnaId,
Child4DnaId = pf.Child4DnaId
};
}
return await GetOrAddForUserAsync(year, typeId, pf.Id, Factory);
}
public async Task<LeaveBeginning?> GetByYearAndTypeIdForUser2Async(int year, Guid typeId, Guid userId)
{
// var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
var pf = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken);
if (pf == null)
{
return null;
}
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
LeaveBeginning Factory()
{
var limit = 0.0;
var prev = _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefault(x => x.LeaveYear == year - 1 && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
// คำนวณปีงบประมาณจาก startDate (ปีงบประมาณเริ่ม 1 ต.ค. และสิ้นสุด 30 ก.ย.)
var isCurrentYear = DateTime.Now.Year == year;
var prevRemain = 0.0;
if (prev != null)
{
prevRemain = isCurrentYear ? prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0) : 0.0;
}
if (govAge >= 180)
{
if (govAge >= 3650)
{
limit = 10 + prevRemain;
if (limit > 30) limit = 30;
}
else
{
limit = 10 + prevRemain;
if (limit > 20) limit = 20;
}
}
else
{
limit = 0.0;
}
return new LeaveBeginning
{
LeaveYear = year,
LeaveTypeId = typeId,
ProfileId = pf.Id,
Prefix = pf.Prefix,
FirstName = pf.FirstName,
LastName = pf.LastName,
LeaveDaysUsed = 0,
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
RootDnaId = pf.RootDnaId,
Child1DnaId = pf.Child1DnaId,
Child2DnaId = pf.Child2DnaId,
Child3DnaId = pf.Child3DnaId,
Child4DnaId = pf.Child4DnaId
};
}
return await GetOrAddForUserAsync(year, typeId, pf.Id, Factory);
}
/// <summary>
/// Get-or-create a LeaveBeginning row for (ProfileId, LeaveYear, LeaveTypeId) with concurrency protection.
/// Uses a keyed SemaphoreSlim to serialize within-process requests, and re-queries after acquiring the lock.
/// If a cross-process insert wins (unique index violation), the duplicate key exception is caught and the row
/// created by the winner is returned.
/// </summary>
private async Task<LeaveBeginning?> GetOrAddForUserAsync(int year, Guid typeId, Guid profileId, Func<LeaveBeginning> factory)
{
var key = $"{profileId}_{year}_{typeId}";
var semaphore = _getOrAddLocks.GetOrAdd(key, _ => new SemaphoreSlim(1, 1));
await semaphore.WaitAsync();
try
{
// Re-query inside the lock — another thread may have created it while we waited.
var existing = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year && x.LeaveTypeId == typeId && x.ProfileId == profileId);
if (existing != null)
{
return existing;
}
var entity = factory();
_dbContext.Set<LeaveBeginning>().Add(entity);
try
{
await _dbContext.SaveChangesAsync();
return entity;
}
catch (DbUpdateException)
{
// Cross-process/cross-server race hit the unique index (IX_LeaveBeginnings_ProfileId_LeaveYear_LeaveTypeId).
// Detach the failed insert and return the row created by the winner.
_dbContext.Detach(entity);
var winner = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year && x.LeaveTypeId == typeId && x.ProfileId == profileId);
return winner;
}
}
finally
{
semaphore.Release();
}
}
public async Task<List<LeaveBeginning>> GetAllByYearAndTypeAsync(int year, Guid typeId, List<ProfileData> userIdList)
{
var updateList = new List<LeaveBeginning>();
var result = new List<LeaveBeginning>();
var beginningList = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.Where(x => x.LeaveYear == year && x.LeaveTypeId == typeId)
.ToListAsync();
foreach (var pf in userIdList)
{
//var pf = await _userProfileRepository.GetProfileByKeycloakIdAsync(id, AccessToken);
//if (pf == null)
//{
// continue; // Goto Next Id
//}
var profile = await _userProfileRepository.GetProfileByProfileIdAsync(pf.Id, AccessToken);
if (profile == null)
{
return null;
}
var govAge = (pf?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
var leaveType = await _dbContext.Set<LeaveType>().FirstOrDefaultAsync(x => x.Id == typeId);
var data = beginningList.FirstOrDefault(x => x.ProfileId == pf.Id);
if (data == null)
{
var limit = 0.0;
var prev = await _dbContext.Set<LeaveBeginning>()
.Include(x => x.LeaveType)
.FirstOrDefaultAsync(x => x.LeaveYear == year - 1 && x.LeaveTypeId == typeId && x.ProfileId == pf.Id);
var prevRemain = 0.0;
if (prev != null)
{
prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0);
}
if (govAge >= 180)
{
if (govAge >= 3650)
{
limit = 10 + prevRemain;
if (limit > 30) limit = 30;
}
else
{
limit = 10 + prevRemain;
if (limit > 20) limit = 20;
}
}
else
{
limit = 0.0;
}
data = new LeaveBeginning
{
LeaveYear = year,
LeaveTypeId = typeId,
ProfileId = pf.Id,
Prefix = pf.Prefix,
FirstName = pf.FirstName,
LastName = pf.LastName,
LeaveDaysUsed = 0,
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
RootDnaId = profile.RootDnaId,
Child1DnaId = profile.Child1DnaId,
Child2DnaId = profile.Child2DnaId,
Child3DnaId = profile.Child3DnaId,
Child4DnaId = profile.Child4DnaId
};
updateList.Add(data);
}
result.Add(data);
}
if (!updateList.Any())
{
await _dbContext.Set<LeaveBeginning>().AddRangeAsync(updateList);
await _dbContext.SaveChangesAsync();
}
return result;
}
}
public class ProfileData
{
public Guid Id { get; set; } = Guid.Empty;
public string Prefix { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public DateTime? DateStart { get; set; } = null;
public DateTime? DateAppoint { get; set; } = null;
}
}

View file

@ -9,6 +9,8 @@ using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Serilog;
using System.Diagnostics;
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
{
@ -72,48 +74,38 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
await base.AddAsync(entity);
var userId = UserId != null ? Guid.Parse(UserId) : Guid.Empty;
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken ?? "");
var profile_id = profile == null ? Guid.Empty : profile.Id;
// var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken ?? "");
var profile = await _userProfileRepository.GetProfileByKeycloakIdNew2Async(userId, AccessToken ?? "");
var rootOc = _userProfileRepository.GetRootOcId(profile_id, AccessToken);
var approver = string.Empty;
var list = new List<OrganizationApproverResponse>();
if (rootOc != null)
// fix issue : SIT ระบบบันทึกเวลาปฏิบัติงาน>>ลงเวลากรณีพิเศษ (ไม่มีแจ้งเตือนไปยังผู้บังคับบัญชา) #969
// send noti + inbox + mail
// send inbox and notification
var subject_str = $"มีการขออนุมัติลงเวลากรณีพิเศษ";
var body_str = $"โปรดพิจารณาคำร้องขอลงเวลาในกรณีพิเศษจาก {profile.Prefix}{profile.FirstName} {profile.LastName} ในวันที่ {entity.CheckDate.Date.ToThaiShortDate2()}";
var subject = subject_str;
var body = body_str;
_emailSenderService.SendMail(subject, body, "dev@frappet.com");
var inbox = new Inbox
{
list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
}
if (list.Count > 0)
Subject = subject_str,
Body = body_str,
ReceiverUserId = profile.CommanderId == Guid.Empty || profile.CommanderId == null ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : profile.CommanderId.Value,
Payload = "",
};
_appContext.Set<Inbox>().Add(inbox);
var noti = new Notification
{
var appr = list.FirstOrDefault();
// send inbox and notification
var subject_str = $"มีการขออนุมัติลงเวลากรณีพิเศษ";
var body_str = $"โปรดพิจารณาคำร้องขอลงเวลาในกรณีพิเศษจาก {profile.Prefix}{profile.FirstName} {profile.LastName} ในวันที่ {entity.CheckDate.Date.ToThaiShortDate2()}";
var subject = subject_str;
var body = body_str;
_emailSenderService.SendMail(subject, body, "dev@frappet.com");
var inbox = new Inbox
{
Subject = subject_str,
Body = body_str,
ReceiverUserId = appr.Id == Guid.Empty ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : appr.Id,
Payload = "",
};
_appContext.Set<Inbox>().Add(inbox);
var noti = new Notification
{
Body = body_str,
ReceiverUserId = appr.Id == Guid.Empty ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : appr.Id,
Type = "",
Payload = "",
};
_appContext.Set<Notification>().Add(noti);
await _appContext.SaveChangesAsync();
}
Body = body_str,
ReceiverUserId = profile.CommanderId == Guid.Empty || profile.CommanderId == null ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : profile.CommanderId.Value,
Type = "",
Payload = "",
};
_appContext.Set<Notification>().Add(noti);
await _appContext.SaveChangesAsync();
return entity;
}
@ -153,6 +145,147 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
}
}
public async Task<List<AdditionalCheckRequest>> GetAdditionalCheckRequestsByAdminRole(int year, int month, string role, string nodeId, int? node, string? keyword)
{
try
{
var data = await _dbContext.Set<AdditionalCheckRequest>().AsQueryable()
.Where(x => (x.CheckDate.Year == year && x.CheckDate.Month == month))
.OrderByDescending(x => x.CreatedAt.Date)
.ToListAsync();
if (!string.IsNullOrEmpty(keyword))
{
data = data.Where(x =>
(
(x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword)
|| x.Description.Contains(keyword)
).ToList();
}
if (role == "OWNER")
{
node = null;
}
if (role == "OWNER" || role == "CHILD")
{
data = data
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true))))))
.ToList();
}
else if (role == "BROTHER")
{
data = data
.Where(x => node == 4 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))
.ToList();
}
else if (role == "ROOT")
{
data = data
.Where(x => x.RootDnaId == Guid.Parse(nodeId!)).ToList();
}
// else if (role == "PARENT")
// {
// data = data
// .Where(x => x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId != null && x.Child1DnaId != Guid.Empty).ToList();
// }
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) &&
(x.Child1DnaId == Guid.Empty || x.Child1DnaId == null) :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) &&
(x.Child2DnaId == Guid.Empty || x.Child2DnaId == null) :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) &&
(x.Child3DnaId == Guid.Empty || x.Child3DnaId == null) :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) &&
(x.Child4DnaId == Guid.Empty || x.Child4DnaId == null) :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}
return data;
}
catch
{
throw;
}
}
public async Task<List<AdditionalCheckRequest>> GetAdditionalCheckRequestsByAdminRole2(DateTime startDate, DateTime endDate, string role, string nodeId, int? node, string? keyword, string? status)
{
try
{
var data = await _dbContext.Set<AdditionalCheckRequest>().AsQueryable()
.Where(x => (x.CheckDate.Date >= startDate.Date && x.CheckDate.Date <= endDate.Date))
.OrderByDescending(x => x.CreatedAt.Date)
.ToListAsync();
if(!string.IsNullOrEmpty(status))
data = data.Where(x => x.Status == status).ToList();
if (!string.IsNullOrEmpty(keyword))
{
data = data.Where(x =>
(
(x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword)
|| x.Description.Contains(keyword)
).ToList();
}
if (role == "OWNER")
{
node = null;
}
if (role == "OWNER" || role == "CHILD")
{
data = data
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true))))))
.ToList();
}
else if (role == "BROTHER")
{
data = data
.Where(x => node == 4 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))
.ToList();
}
else if (role == "ROOT")
{
data = data
.Where(x => x.RootDnaId == Guid.Parse(nodeId!)).ToList();
}
// else if (role == "PARENT")
// {
// data = data
// .Where(x => x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId != null && x.Child1DnaId != Guid.Empty).ToList();
// }
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) &&
(x.Child1DnaId == Guid.Empty || x.Child1DnaId == null) :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) &&
(x.Child2DnaId == Guid.Empty || x.Child2DnaId == null) :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) &&
(x.Child3DnaId == Guid.Empty || x.Child3DnaId == null) :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) &&
(x.Child4DnaId == Guid.Empty || x.Child4DnaId == null) :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}
return data;
}
catch
{
throw;
}
}
#endregion
}
}

View file

@ -0,0 +1,191 @@
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
{
public class CheckInJobStatusRepository : GenericLeaveRepository<Guid, CheckInJobStatus>
{
#region " Fields "
private readonly ILeaveDbContext _dbContext;
#endregion
#region " Constructor and Destructor "
public CheckInJobStatusRepository(ILeaveDbContext dbContext,
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
}
#endregion
#region " Methods "
/// <summary>
/// ดึงข้อมูล Job Status จาก TaskId
/// </summary>
public async Task<CheckInJobStatus?> GetByTaskIdAsync(Guid taskId)
{
var data = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.TaskId == taskId)
.FirstOrDefaultAsync();
return data;
}
/// <summary>
/// ดึงข้อมูล Job Status จาก UserId และสถานะ
/// </summary>
public async Task<List<CheckInJobStatus>> GetByUserIdAndStatusAsync(Guid userId, string status)
{
var data = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.KeycloakUserId == userId && x.Status == status)
.OrderByDescending(x => x.CreatedDate)
.ToListAsync();
return data;
}
/// <summary>
/// ดึงข้อมูล Job Status ที่ยัง pending หรือ processing
/// </summary>
public async Task<List<CheckInJobStatus>> GetPendingOrProcessingJobsAsync(Guid userId)
{
var data = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.KeycloakUserId == userId &&
(x.Status == "PENDING" || x.Status == "PROCESSING"))
//.OrderByDescending(x => x.CreatedDate)
.ToListAsync();
return data;
}
/// <summary>
/// อัปเดตสถานะเป็น Processing
/// </summary>
public async Task<CheckInJobStatus> UpdateToProcessingAsync(Guid taskId)
{
var job = await GetByTaskIdAsync(taskId);
if (job != null)
{
job.Status = "PROCESSING";
job.ProcessingDate = DateTime.Now;
await UpdateAsync(job);
}
return job!;
}
/// <summary>
/// อัปเดตสถานะเป็น Completed
/// </summary>
public async Task<CheckInJobStatus> UpdateToCompletedAsync(Guid taskId, string? additionalData = null)
{
var job = await GetByTaskIdAsync(taskId);
if (job != null)
{
job.Status = "COMPLETED";
job.CompletedDate = DateTime.Now;
if (!string.IsNullOrEmpty(additionalData))
{
job.AdditionalData = additionalData;
}
await UpdateAsync(job);
}
return job!;
}
/// <summary>
/// อัปเดตสถานะเป็น Failed
/// </summary>
public async Task<CheckInJobStatus> UpdateToFailedAsync(Guid taskId, string errorMessage)
{
var job = await GetByTaskIdAsync(taskId);
if (job != null)
{
job.Status = "FAILED";
job.CompletedDate = DateTime.Now;
job.ErrorMessage = errorMessage;
await UpdateAsync(job);
}
return job!;
}
/// <summary>
/// ดึงข้อมูลงานที่ค้างอยู่ในสถานะ PENDING หรือ PROCESSING เกินเวลาที่กำหนด (นาที)
/// </summary>
public async Task<List<CheckInJobStatus>> GetStalePendingOrProcessingJobsAsync(int timeoutMinutes = 30)
{
//var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
var staleJobs = await _dbContext.Set<CheckInJobStatus>()
.Where(x => (x.Status == "PENDING" || x.Status == "PROCESSING")
&& x.CreatedDate <= cutoffDate)
.OrderBy(x => x.CreatedDate)
.ToListAsync();
return staleJobs;
}
/// <summary>
/// ดึงข้อมูลงานที่ค้างอยู่ในสถานะ PENDING หรือ PROCESSING เกินเวลาที่กำหนด (นาที) ของ user คนใดคนหนึ่ง
/// </summary>
public async Task<List<CheckInJobStatus>> GetStalePendingOrProcessingJobsByUserAsync(Guid userId, int timeoutMinutes = 30)
{
var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
//var cutoffDate = new DateTime(2026, 5, 28, 23, 59, 59);
var staleJobs = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.KeycloakUserId == userId
&& (x.Status == "PENDING" || x.Status == "PROCESSING")
&& x.CreatedDate < cutoffDate)
.OrderBy(x => x.CreatedDate)
.ToListAsync();
return staleJobs;
}
/// <summary>
/// Mark งานที่ค้างเกินเวลาที่กำหนดเป็น FAILED
/// </summary>
public async Task<int> MarkStaleJobsAsFailedAsync(int timeoutMinutes = 30)
{
var staleJobs = await GetStalePendingOrProcessingJobsAsync(timeoutMinutes);
foreach (var job in staleJobs)
{
job.Status = "FAILED";
job.CompletedDate = DateTime.Now;
job.ErrorMessage = $"งานค้างในสถานะ {job.Status} เกิน {timeoutMinutes} นาที ระบบทำเครื่องหมายเป็น FAILED อัตโนมัติ";
}
if (staleJobs.Any())
{
_dbContext.Set<CheckInJobStatus>().UpdateRange(staleJobs);
await _dbContext.SaveChangesAsync();
}
return staleJobs.Count;
}
/// <summary>
/// ล้างข้อมูล Job Status ที่เก่าเกิน X วัน
/// </summary>
public async Task<int> CleanupOldJobsAsync(int daysOld = 30)
{
var cutoffDate = DateTime.Now.AddDays(-daysOld);
var oldJobs = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.CreatedDate < cutoffDate)
.ToListAsync();
_dbContext.Set<CheckInJobStatus>().RemoveRange(oldJobs);
await _dbContext.SaveChangesAsync();
return oldJobs.Count;
}
#endregion
}
}

View file

@ -61,9 +61,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return await _dbContext.Set<DutyTime>().Where(x => x.IsActive).ToListAsync();
}
public async Task<DutyTime?> GetDefaultAsync()
public async Task<DutyTime?> GetDefaultAsync(CancellationToken cancellationToken = default)
{
return await _dbContext.Set<DutyTime>().Where(x => x.IsDefault).FirstOrDefaultAsync();
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
return await _dbContext.Set<DutyTime>().Where(x => x.IsDefault).FirstOrDefaultAsync(combinedCts.Token);
}
#endregion

View file

@ -0,0 +1,795 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text.Json;
using System.IO;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories.Leaves.LeaveRequests;
using BMA.EHR.Application.Repositories.MetaData;
using BMA.EHR.Application.Responses.Profiles;
using BMA.EHR.Domain.Extensions;
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
{
public class LeaveProcessJobStatusRepository: GenericLeaveRepository<Guid, LeaveProcessJobStatus>
{
#region " Fields "
private readonly ILeaveDbContext _dbContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly UserProfileRepository _userProfileRepository;
private readonly HolidayRepository _holidayRepository;
private readonly DutyTimeRepository _dutyTimeRepository;
private readonly UserDutyTimeRepository _userDutyTimeRepository;
private readonly ProcessUserTimeStampRepository _processUserTimeStampRepository;
private readonly LeaveRequestRepository _leaveRequestRepository;
private readonly IConfiguration _configuration;
private readonly IWebHostEnvironment _env;
#endregion
#region " Constructor and Destructor "
public LeaveProcessJobStatusRepository(ILeaveDbContext dbContext,
IHttpContextAccessor httpContextAccessor,
UserProfileRepository userProfileRepository,
HolidayRepository holidayRepository,
DutyTimeRepository dutyTimeRepository,
UserDutyTimeRepository userDutyTimeRepository,
ProcessUserTimeStampRepository processUserTimeStampRepository,
LeaveRequestRepository leaveRequestRepository,
IConfiguration configuration,
IWebHostEnvironment env) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_httpContextAccessor = httpContextAccessor;
_userProfileRepository = userProfileRepository;
_holidayRepository = holidayRepository;
_configuration = configuration;
_leaveRequestRepository = leaveRequestRepository;
_dutyTimeRepository = dutyTimeRepository;
_userDutyTimeRepository = userDutyTimeRepository;
_processUserTimeStampRepository = processUserTimeStampRepository;
_env = env;
}
#endregion
#region " Methods "
/// <summary>
/// ดึงข้อมูล Job Status จาก TaskId
/// </summary>
public async Task<LeaveProcessJobStatus?> GetByTaskIdAsync(Guid id)
{
var data = await _dbContext.Set<LeaveProcessJobStatus>()
.Where(x => x.Id == id)
.FirstOrDefaultAsync();
return data;
}
/// <summary>
/// ดึงข้อมูล Job Status จาก UserId และสถานะ
/// </summary>
public async Task<List<LeaveProcessJobStatus>> GetByUserIdAndStatusAsync(Guid userId, string status)
{
var data = await _dbContext.Set<LeaveProcessJobStatus>()
.Where(x => x.CreatedUserId == userId.ToString("D") && x.Status == status)
.OrderByDescending(x => x.CreatedDate)
.ToListAsync();
return data;
}
/// <summary>
/// ดึงข้อมูล Job Status จาก UserId
/// </summary>
public async Task<List<LeaveProcessJobStatus>> GetByUserIdAsync(Guid userId)
{
var data = await _dbContext.Set<LeaveProcessJobStatus>()
.Where(x => x.CreatedUserId == userId.ToString("D"))
.OrderByDescending(x => x.CreatedDate)
.ToListAsync();
return data;
}
/// <summary>
/// ดึงข้อมูล Job Status ที่ยัง pending หรือ processing
/// </summary>
public async Task<List<LeaveProcessJobStatus>> GetPendingOrProcessingJobsAsync(Guid userId)
{
var data = await _dbContext.Set<LeaveProcessJobStatus>()
.Where(x => x.CreatedUserId == userId.ToString("D") &&
(x.Status == "PENDING" || x.Status == "PROCESSING"))
//.OrderByDescending(x => x.CreatedDate)
.ToListAsync();
return data;
}
public async Task<List<LeaveProcessJobStatus>> GetPendingJobsAsync()
{
var data = await _dbContext.Set<LeaveProcessJobStatus>()
.Where(x => x.Status == "PENDING")
.ToListAsync();
return data;
}
/// <summary>
/// อัปเดตสถานะเป็น Processing
/// </summary>
public async Task<LeaveProcessJobStatus> UpdateToProcessingAsync(Guid id)
{
var job = await GetByTaskIdAsync(id);
if (job != null)
{
job.Status = "PROCESSING";
job.ProcessingDate = DateTime.Now;
await UpdateAsync(job);
}
return job!;
}
/// <summary>
/// อัปเดตสถานะเป็น Completed
/// </summary>
public async Task<LeaveProcessJobStatus> UpdateToCompletedAsync(Guid id, string? additionalData = null)
{
var job = await GetByTaskIdAsync(id);
if (job != null)
{
job.Status = "COMPLETED";
job.CompletedDate = DateTime.Now;
await UpdateAsync(job);
}
return job!;
}
/// <summary>
/// อัปเดตสถานะเป็น Failed
/// </summary>
public async Task<LeaveProcessJobStatus> UpdateToFailedAsync(Guid id, string errorMessage)
{
var job = await GetByTaskIdAsync(id);
if (job != null)
{
job.Status = "FAILED";
job.CompletedDate = DateTime.Now;
job.ErrorMessage = errorMessage;
await UpdateAsync(job);
}
return job!;
}
public async Task ProcessTaskAsync(Guid rootDnaId, DateTime? startDate, DateTime? endDate)
{
var profiles = new List<GetProfileByKeycloakIdRootDto>();
var dateStart = startDate?.Date ?? DateTime.Now.Date;
var dateEnd = endDate?.Date ?? DateTime.Now.Date;
var holidays = await _holidayRepository.GetHolidayAsync(dateStart, dateEnd);
var weekend = _holidayRepository.GetWeekEnd(dateStart, dateEnd);
var excludeDates = holidays.Union(weekend).ToList();
var dateList = new List<LoopDate>();
for (DateTime i = dateStart; i <= dateEnd; i = i.AddDays(1))
{
if (holidays.Contains(i))
{
var d = await _holidayRepository.GetHolidayAsync(i);
dateList.Add(new LoopDate
{
date = i,
isHoliday = true,
isWeekEnd = false,
dateRemark = d
});
}
else if (weekend.Contains(i))
{
dateList.Add(new LoopDate
{
date = i,
isHoliday = true,
isWeekEnd = false,
dateRemark = "วันหยุด"
});
}
else
{
dateList.Add(new LoopDate
{
date = i,
isHoliday = false,
isWeekEnd = false,
dateRemark = ""
});
}
}
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
if (defaultRound == null)
{
throw new Exception("ไม่พบรอบการลงเวลา Default");
}
var employees = new List<DateResultReport>();
foreach (var dd in dateList.Where(x => !x.isHoliday && !x.isWeekEnd))
{
profiles = await _userProfileRepository.GetAllOfficerByRootDnaId(rootDnaId.ToString(),dd.date);
foreach (var p in profiles)
{
var count = 1;
var keycloakUserId = p.Keycloak ?? Guid.Empty;
var timeStamps = await _processUserTimeStampRepository.GetTimestampByDateAsync(keycloakUserId, dd.date);
var fullName = $"{p.Prefix}{p.FirstName} {p.LastName}";
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id, dd.date);
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
var duty = userRound ?? defaultRound;
// check วันลาของแต่ละคน
var leaveReq = await _leaveRequestRepository.GetLeavePeriodAsync(keycloakUserId, dd.date);
var remarkStr = string.Empty;
var status = string.Empty;
var stampType = string.Empty;
var stampAmount = 0.0;
if (leaveReq != null)
{
switch (leaveReq.Type.Code.ToUpper())
{
case "LV-001":
case "LV-002":
case "LV-005":
remarkStr += leaveReq.Type.Name;
var leaveRange = leaveReq.LeaveRange == null ? "" : leaveReq.LeaveRange.ToUpper();
if(leaveReq.LeaveStartDate.Date == leaveReq.LeaveEndDate.Date)
{
if (leaveRange == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRange == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
// var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
// if (leaveRangeEnd == "MORNING")
// remarkStr += "ครึ่งวันเช้า";
// else if (leaveRangeEnd == "AFTERNOON")
// remarkStr += "ครึ่งวันบ่าย";
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
if (leaveRange != leaveRangeEnd)
{
if (leaveRangeEnd == "MORNING")
remarkStr += " - ครึ่งวันเช้า";
else if (leaveRangeEnd == "AFTERNOON")
remarkStr += " - ครึ่งวันบ่าย";
}
}
else
{
if(dd.date == leaveReq.LeaveStartDate.Date)
{
if (leaveRange == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRange == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
}
else if(dd.date == leaveReq.LeaveEndDate.Date)
{
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
if (leaveRangeEnd == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRangeEnd == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
else
remarkStr += "เต็มวัน";
}
else
{
remarkStr += "เต็มวัน";
}
}
break;
default:
remarkStr += leaveReq.Type.Name;
break;
}
status = "LEAVE";
if(leaveReq.LeaveStartDate.Date == dd.date)
{
stampType = leaveReq.LeaveRange ?? "";
stampAmount = leaveReq.LeaveRange != "ALL" ? 0.5 : 1;
}
else if(leaveReq.LeaveEndDate.Date == dd.date)
{
stampAmount = leaveReq.LeaveRangeEnd != "ALL" ? 0.5 : 1;
stampType = leaveReq.LeaveRangeEnd ?? "";
}
else
stampAmount = leaveReq.LeaveRange != "ALL" || leaveReq.LeaveRangeEnd != "ALL" ? 0.5 : 1;
if(stampType == "ALL") stampType = "FULL_DAY";
}
else
{
if (timeStamps == null)
{
if (dd.date <= DateTime.Now.Date)
{
remarkStr = "ขาดราชการ";
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
if (dd.isHoliday == true)
{
remarkStr = $"วันหยุด ({dd.dateRemark})";
status = "HOLIDAY";
}
else if (dd.isWeekEnd)
{
remarkStr = dd.dateRemark;
status = "WEEKEND";
}
}
else remarkStr = "";
}
else
{
// check status ของการลงเวลา
if (timeStamps.CheckOut != null)
{
if (timeStamps.CheckOutStatus == "ABSENT")
{
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{timeStamps.CheckOutLocationName})".Trim() : "");
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
}
else if (timeStamps.CheckInStatus == "ABSENT")
{
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
}
else if (timeStamps.CheckInStatus == "LATE")
{
remarkStr = "สาย" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
status = "LATE";
stampType = "FULL_DAY";
stampAmount = 1;
//lateTotal += 1;
}
else
remarkStr = !timeStamps.IsLocationCheckIn ? $" นอกสถานที่:{timeStamps.CheckInLocationName}".Trim() : "";
}
else
{
if (timeStamps.CheckInStatus == "ABSENT")
{
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
}
else if (timeStamps.CheckInStatus == "LATE")
{
status = "LATE";
stampType = "FULL_DAY";
stampAmount = 1;
remarkStr = "สาย" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
//lateTotal += 1;
}
else
remarkStr = !timeStamps.IsLocationCheckIn ? $" นอกสถานที่:{timeStamps.CheckInLocationName}".Trim() : "";
}
}
}
var emp = new DateResultReport
{
profileId = p.Id.ToString(),
stampDate = dd.date,
stampType = stampType,
stampAmount = stampAmount,
remark = remarkStr,
status = status
};
employees.Add(emp);
count++;
}
// Write employees to JSON file
// var fileName = $"employees_{DateTime.Now:yyyyMMdd_HHmmss}.txt";
// var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Exports", fileName);
// // Ensure directory exists
// var directory = Path.GetDirectoryName(filePath);
// if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
// {
// Directory.CreateDirectory(directory);
// }
// var jsonOptions = new JsonSerializerOptions
// {
// WriteIndented = true,
// Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
// };
// var jsonContent = JsonSerializer.Serialize(employees, jsonOptions);
// await File.WriteAllTextAsync(filePath, jsonContent);
}
//call api
var apiPath = $"{_configuration["API"]}/org/unauthorize/profile/absent-late/batch";
var apiKey = _configuration["API_KEY"];
var body = new
{
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
};
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
if(apiResult == "")
{
throw new Exception($"เรียก API {apiPath} ไม่สำเร็จ");
}
}
public async Task ProcessEmpTaskAsync(Guid rootDnaId, DateTime? startDate, DateTime? endDate)
{
var profiles = new List<GetProfileByKeycloakIdRootDto>();
var dateStart = startDate?.Date ?? DateTime.Now.Date;
var dateEnd = endDate?.Date ?? DateTime.Now.Date;
var holidays = await _holidayRepository.GetHolidayAsync(dateStart, dateEnd);
var weekend = _holidayRepository.GetWeekEnd(dateStart, dateEnd);
var excludeDates = holidays.Union(weekend).ToList();
var dateList = new List<LoopDate>();
for (DateTime i = dateStart; i <= dateEnd; i = i.AddDays(1))
{
if (holidays.Contains(i))
{
var d = await _holidayRepository.GetHolidayAsync(i);
dateList.Add(new LoopDate
{
date = i,
isHoliday = true,
isWeekEnd = false,
dateRemark = d
});
}
else if (weekend.Contains(i))
{
dateList.Add(new LoopDate
{
date = i,
isHoliday = true,
isWeekEnd = false,
dateRemark = "วันหยุด"
});
}
else
{
dateList.Add(new LoopDate
{
date = i,
isHoliday = false,
isWeekEnd = false,
dateRemark = ""
});
}
}
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
if (defaultRound == null)
{
throw new Exception("ไม่พบรอบการลงเวลา Default");
}
var employees = new List<DateResultReport>();
foreach (var dd in dateList.Where(x => !x.isHoliday && !x.isWeekEnd))
{
profiles = await _userProfileRepository.GetAllEmployeeByRootDnaId(rootDnaId.ToString(),dd.date);
foreach (var p in profiles)
{
var count = 1;
var keycloakUserId = p.Keycloak ?? Guid.Empty;
var timeStamps = await _processUserTimeStampRepository.GetTimestampByDateAsync(keycloakUserId, dd.date);
var fullName = $"{p.Prefix}{p.FirstName} {p.LastName}";
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id, dd.date);
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
var duty = userRound ?? defaultRound;
// check วันลาของแต่ละคน
var leaveReq = await _leaveRequestRepository.GetLeavePeriodAsync(keycloakUserId, dd.date);
var remarkStr = string.Empty;
var status = string.Empty;
var stampType = string.Empty;
var stampAmount = 0.0;
if (leaveReq != null)
{
switch (leaveReq.Type.Code.ToUpper())
{
case "LV-001":
case "LV-002":
case "LV-005":
remarkStr += leaveReq.Type.Name;
var leaveRange = leaveReq.LeaveRange == null ? "" : leaveReq.LeaveRange.ToUpper();
if(leaveReq.LeaveStartDate.Date == leaveReq.LeaveEndDate.Date)
{
if (leaveRange == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRange == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
// var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
// if (leaveRangeEnd == "MORNING")
// remarkStr += "ครึ่งวันเช้า";
// else if (leaveRangeEnd == "AFTERNOON")
// remarkStr += "ครึ่งวันบ่าย";
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
if (leaveRange != leaveRangeEnd)
{
if (leaveRangeEnd == "MORNING")
remarkStr += " - ครึ่งวันเช้า";
else if (leaveRangeEnd == "AFTERNOON")
remarkStr += " - ครึ่งวันบ่าย";
}
}
else
{
if(dd.date == leaveReq.LeaveStartDate.Date)
{
if (leaveRange == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRange == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
}
else if(dd.date == leaveReq.LeaveEndDate.Date)
{
var leaveRangeEnd = leaveReq.LeaveRangeEnd == null ? "" : leaveReq.LeaveRangeEnd.ToUpper();
if (leaveRangeEnd == "MORNING")
remarkStr += "ครึ่งวันเช้า";
else if (leaveRangeEnd == "AFTERNOON")
remarkStr += "ครึ่งวันบ่าย";
}
else
{
remarkStr += "เต็มวัน";
}
}
break;
default:
remarkStr += leaveReq.Type.Name;
break;
}
status = "LEAVE";
if(leaveReq.LeaveStartDate.Date == dd.date)
{
stampType = leaveReq.LeaveRange ?? "";
stampAmount = leaveReq.LeaveRange != "ALL" ? 0.5 : 1;
}
else if(leaveReq.LeaveEndDate.Date == dd.date)
{
stampAmount = leaveReq.LeaveRangeEnd != "ALL" ? 0.5 : 1;
stampType = leaveReq.LeaveRangeEnd ?? "";
}
else
stampAmount = leaveReq.LeaveRange != "ALL" || leaveReq.LeaveRangeEnd != "ALL" ? 0.5 : 1;
if(stampType == "ALL") stampType = "FULL_DAY";
//stampAmount = leaveReq.LeaveRange != "ALL" || leaveReq.LeaveRangeEnd != "ALL" ? 0.5 : 1;
}
else
{
if (timeStamps == null)
{
if (dd.date <= DateTime.Now.Date)
{
remarkStr = "ขาดราชการ";
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
if (dd.isHoliday == true)
{
remarkStr = $"วันหยุด ({dd.dateRemark})";
status = "HOLIDAY";
}
else if (dd.isWeekEnd)
{
remarkStr = dd.dateRemark;
status = "WEEKEND";
}
}
else remarkStr = "";
}
else
{
// check status ของการลงเวลา
if (timeStamps.CheckOut != null)
{
if (timeStamps.CheckOutStatus == "ABSENT")
{
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{timeStamps.CheckOutLocationName})".Trim() : "");
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
}
else if (timeStamps.CheckInStatus == "ABSENT")
{
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
}
else if (timeStamps.CheckInStatus == "LATE")
{
remarkStr = "สาย" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
status = "LATE";
stampType = "FULL_DAY";
stampAmount = 1;
//lateTotal += 1;
}
else
remarkStr = !timeStamps.IsLocationCheckIn ? $" นอกสถานที่:{timeStamps.CheckInLocationName}".Trim() : "";
}
else
{
if (timeStamps.CheckInStatus == "ABSENT")
{
status = "ABSENT";
stampType = "FULL_DAY";
stampAmount = 1;
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
}
else if (timeStamps.CheckInStatus == "LATE")
{
status = "LATE";
stampType = "FULL_DAY";
stampAmount = 1;
remarkStr = "สาย" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
//lateTotal += 1;
}
else
remarkStr = !timeStamps.IsLocationCheckIn ? $" นอกสถานที่:{timeStamps.CheckInLocationName}".Trim() : "";
}
}
}
var emp = new DateResultReport
{
profileId = p.Id.ToString(),
stampDate = dd.date,
stampType = stampType,
stampAmount = stampAmount,
remark = remarkStr,
status = status
};
employees.Add(emp);
count++;
}
// Write employees to JSON file
// var fileName = $"employees_{DateTime.Now:yyyyMMdd_HHmmss}.txt";
// var filePath = Path.Combine(_env.ContentRootPath, "Exports", fileName);
// // Ensure directory exists
// var directory = Path.GetDirectoryName(filePath);
// if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
// {
// Directory.CreateDirectory(directory);
// }
// var jsonOptions = new JsonSerializerOptions
// {
// WriteIndented = true,
// Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
// };
// var jsonContent = JsonSerializer.Serialize(employees, jsonOptions);
// Console.WriteLine($"Writing file to: {filePath}");
// await File.WriteAllTextAsync(filePath, jsonContent);
// Console.WriteLine($"File written successfully: {fileName}");
}
// call api
var apiPath = $"{_configuration["API"]}/org/unauthorize/profile-employee/absent-late/batch";
var apiKey = _configuration["API_KEY"];
var body = new
{
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
};
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
if(apiResult == "")
{
throw new Exception($"เรียก API {apiPath} ไม่สำเร็จ");
}
}
public async Task ProcessPendingJobsAsync()
{
var pendingJobs = await GetPendingJobsAsync();
Console.WriteLine($"พบงานที่ค้างอยู่ในสถานะ PENDING จำนวน {pendingJobs.Count} งาน");
foreach (var job in pendingJobs)
{
try
{
// อัปเดตสถานะเป็น Processing
await UpdateToProcessingAsync(job.Id);
// ทำงานที่ต้องการที่นี่ (เช่น เรียก API, ประมวลผลข้อมูล ฯลฯ)
await ProcessTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
await ProcessEmpTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
// อัปเดตสถานะเป็น Completed
await UpdateToCompletedAsync(job.Id);
}
catch (Exception ex)
{
// หากเกิดข้อผิดพลาด อัปเดตสถานะเป็น Failed พร้อมข้อความแสดงข้อผิดพลาด
await UpdateToFailedAsync(job.Id, ex.Message);
}
}
}
#endregion
}
class LoopDate
{
public DateTime date { get; set; }
public bool isHoliday { get; set; }
public bool isWeekEnd { get; set; }
public string dateRemark { get; set; }
}
class DateResultReport
{
public string? profileId { get; set; }
public DateTime stampDate { get; set; }
public string stampType { get; set; }
public double stampAmount { get; set; }
public string remark { get; set; }
public string status { get; set; }
}
}

View file

@ -139,26 +139,64 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return data;
}
public async Task<List<ProcessUserTimeStamp>> GetTimestampByDateLateAsync(string type, string role, string nodeId, int node)
public async Task<List<ProcessUserTimeStamp>> GetTimestampByDateLateAsync(string type, string role, string nodeId, int? node, string nodeIdByReq, int? nodeByReq, DateTime StartDate, DateTime EndDate)
{
var _nodeId = Guid.Parse(nodeId);
var data = new List<ProcessUserTimeStamp>();
if (role == "OWNER" || role == "CHILD")
data = await _dbContext.Set<ProcessUserTimeStamp>().AsQueryable()
.Where(x => x.CheckInStatus == "LATE")
.Where(u => u.CheckIn.Date >= StartDate && u.CheckIn.Date <= EndDate)
.Where(x => x.ProfileType == type.Trim().ToUpper()).ToListAsync();
// กรองตามสิทธิ์ admin ก่อน
if (role == "CHILD")
{
data = await _dbContext.Set<ProcessUserTimeStamp>().AsQueryable()
.Where(x => x.CheckInStatus == "LATE")
.Where(x => x.ProfileType == type.Trim().ToUpper())
.Where(x => node == 4 ? x.Child4Id == _nodeId : (node == 3 ? x.Child3Id == _nodeId : (node == 2 ? x.Child2Id == _nodeId : (node == 1 ? x.Child1Id == _nodeId : (node == 0 ? x.RootId == _nodeId : true)))))
.ToListAsync();
data = data.Where(x =>
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId) :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId) :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId) :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId) :
node == 0 ? x.RootDnaId == Guid.Parse(nodeId) :
node == null ? true : true
).ToList();
}
else
else if (role == "BROTHER")
{
data = await _dbContext.Set<ProcessUserTimeStamp>().AsQueryable()
.Where(x => x.CheckInStatus == "LATE")
.Where(x => x.ProfileType == type.Trim().ToUpper())
.Where(x => node == 4 ? x.Child4Id == _nodeId : (node == 3 ? x.Child3Id == _nodeId : (node == 2 ? x.Child2Id == _nodeId : (node == 1 ? x.Child1Id == _nodeId : (node == 0 ? x.RootId == _nodeId : true)))))
.Where(x => node == 0 ? x.Child1Id == null : (node == 1 ? x.Child2Id == null : (node == 2 ? x.Child3Id == null : (node == 3 ? x.Child4Id == null : true))))
.ToListAsync();
data = data.Where(x =>
node == 4 ? x.Child3DnaId == Guid.Parse(nodeId) :
node == 3 ? x.Child2DnaId == Guid.Parse(nodeId) :
node == 2 ? x.Child1DnaId == Guid.Parse(nodeId) :
node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId) :
node == null ? true : true
).ToList();
}
else if (role == "ROOT")
{
data = data.Where(x => x.RootDnaId == Guid.Parse(nodeId)).ToList();
}
// else if (role == "PARENT")
// {
// data = data.Where(x => x.RootDnaId == Guid.Parse(nodeId) && x.Child1DnaId != null).ToList();
// }
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}
// กรองตามที่ fe ส่งมา
if (role == "ROOT" || role == "OWNER" || role == "CHILD" || role == "BROTHER" || role == "PARENT")
{
data = data.Where(x =>
nodeByReq == 4 ? x.Child4DnaId == Guid.Parse(nodeIdByReq) :
nodeByReq == 3 ? x.Child3DnaId == Guid.Parse(nodeIdByReq) :
nodeByReq == 2 ? x.Child2DnaId == Guid.Parse(nodeIdByReq) :
nodeByReq == 1 ? x.Child1DnaId == Guid.Parse(nodeIdByReq) :
nodeByReq == 0 ? x.RootDnaId == Guid.Parse(nodeIdByReq) : true
).ToList();
}
return data;
}
@ -175,9 +213,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryAsync(Guid keycloakId, int year, int page = 1, int pageSize = 10, string keyword = "")
{
var fiscalDateStart = new DateTime(year - 1, 10, 1);
var fiscalDateEnd = new DateTime(year, 9, 30);
var data = await _dbContext.Set<ProcessUserTimeStamp>()
.Where(u => u.KeycloakUserId == keycloakId)
.Where(u => u.CheckIn.Year == year)
.Where(u => u.CheckIn.Date >= fiscalDateStart && u.CheckIn.Date <= fiscalDateEnd)
.OrderByDescending(u => u.CheckIn.Date)
.Skip((page - 1) * pageSize)
.Take(pageSize)
@ -186,6 +227,19 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return data;
}
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryAsync2(Guid keycloakId, int year)
{
var fiscalDateStart = new DateTime(year - 1, 10, 1);
var fiscalDateEnd = new DateTime(year, 9, 30);
var data = await _dbContext.Set<ProcessUserTimeStamp>()
.Where(u => u.KeycloakUserId == keycloakId)
.Where(u => u.CheckIn.Date >= fiscalDateStart && u.CheckIn.Date <= fiscalDateEnd)
.OrderByDescending(u => u.CheckIn.Date)
.ToListAsync();
return data;
}
public async Task<int> GetTimeStampHistoryForAdminCountAsync(DateTime startDate, DateTime endDate)
{
var data = await _dbContext.Set<ProcessUserTimeStamp>()
@ -218,6 +272,55 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return data;
}
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryForAdminRoleAsync(DateTime startDate, DateTime endDate, string role, string nodeId, int? node)
{
var data = await _dbContext.Set<ProcessUserTimeStamp>()
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
.OrderBy(u => u.CheckIn)
.ToListAsync();
if (role == "OWNER")
{
node = null;
}
if (role == "OWNER" || role == "CHILD")
{
data = data
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true))))))
.ToList();
}
else if (role == "BROTHER")
{
data = data
.Where(x => node == 4 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))
.ToList();
}
else if (role == "ROOT")
{
data = data
.Where(x => x.RootDnaId == Guid.Parse(nodeId!))
.ToList();
}
// else if (role == "PARENT")
// {
// data = data
// .Where(x => x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId != null)
// .ToList();
// }
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}
return data;
}
public async Task<ProcessUserTimeStamp?> GetTimeStampById(Guid id)
{
var data = await _dbContext.Set<ProcessUserTimeStamp>()

View file

@ -62,7 +62,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
{
var data = _dbContext.Set<UserDutyTime>()
.Where(u => !u.IsProcess)
.Where(u => u.EffectiveDate.Value.Date <= DateTime.Now.Date)
.Where(u => u.EffectiveDate.Value.Date <= DateTime.Now.AddHours(7).Date)
.ToList();
foreach (var d in data)
@ -101,13 +101,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return data;
}
public async Task<UserDutyTime?> GetLastEffectRound(Guid profileId)
public async Task<UserDutyTime?> GetLastEffectRound(Guid profileId, DateTime? effectiveDate = null, CancellationToken cancellationToken = default)
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
effectiveDate ??= DateTime.Now;
var data = await _dbContext.Set<UserDutyTime>()
.Where(x => x.ProfileId == profileId)
.Where(x => x.IsProcess)
.Where(x => x.EffectiveDate.Value.Date <= effectiveDate.Value.Date)
.OrderByDescending(x => x.EffectiveDate)
.FirstOrDefaultAsync();
.FirstOrDefaultAsync(combinedCts.Token);
return data;
}

View file

@ -74,12 +74,16 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
return data;
}
public async Task<UserTimeStamp?> GetLastRecord(Guid keycloakId)
public async Task<UserTimeStamp?> GetLastRecord(Guid keycloakId, CancellationToken cancellationToken = default)
{
// กำหนด timeout เป็น 30 นาที
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMinutes(30));
using var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
var data = await _dbContext.Set<UserTimeStamp>()
.Where(u => u.KeycloakUserId == keycloakId)
.OrderByDescending(u => u.CheckIn)
.FirstOrDefaultAsync();
.FirstOrDefaultAsync(combinedCts.Token);
return data;
}
@ -90,7 +94,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
.Where(u => u.KeycloakUserId == keycloakId)
.Where(u => u.CheckIn.Year == year)
.OrderBy(u => u.CheckIn)
.ToListAsync();
return data;
@ -101,12 +105,61 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
var data = await _dbContext.Set<UserTimeStamp>()
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
.OrderBy(u => u.CheckIn)
.ToListAsync();
return data;
}
public async Task<List<UserTimeStamp>> GetTimeStampHistoryForAdminRoleAsync(DateTime startDate, DateTime endDate, string role, string nodeId, int? node)
{
var data = await _dbContext.Set<UserTimeStamp>()
.Where(u => u.CheckIn.Date >= startDate.Date && u.CheckIn.Date <= endDate.Date)
.OrderBy(u => u.CheckIn)
.ToListAsync();
if (role == "OWNER")
{
node = null;
}
if (role == "OWNER" || role == "CHILD")
{
data = data
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true))))))
.ToList();
}
else if (role == "BROTHER")
{
data = data
.Where(x => node == 4 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 1 || node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))
.ToList();
}
else if (role == "ROOT")
{
data = data
.Where(x => x.RootDnaId == Guid.Parse(nodeId!))
.ToList();
}
// else if (role == "PARENT")
// {
// data = data
// .Where(x => x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId != null)
// .ToList();
// }
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}
return data;
}
public async Task<UserTimeStamp?> GetTimeStampById(Guid id)
{
var data = await _dbContext.Set<UserTimeStamp>()

View file

@ -51,12 +51,13 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
// // throw new Exception(GlobalMessages.DataNotFound);
// }
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
//var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
var apiUrl = $"{_configuration["API"]}/org/dotnet/get-profileId";
var profileId = "";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();

View file

@ -55,12 +55,13 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
// // throw new Exception(GlobalMessages.DataNotFound);
// }
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
//var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
var apiUrl = $"{_configuration["API"]}/org/dotnet/get-profileId";
var profileId = "";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -131,12 +132,13 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
// {
// return 0;
// }
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
//var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
var apiUrl = $"{_configuration["API"]}/org/dotnet/get-profileId";
var profileId = "";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -185,6 +187,44 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
}
}
private async Task<string> GetMyProfileIdAsync()
{
var apiUrl = $"{_configuration["API"]}/org/dotnet/get-profileId";
var response = await GetExternalAPIAsync(apiUrl, AccessToken!, _configuration["API_KEY"]!);
if (string.IsNullOrWhiteSpace(response))
return string.Empty;
var org = JsonConvert.DeserializeObject<OrgRequest>(response);
if (org == null || org.result == null)
return string.Empty;
return org.result.profileId ?? string.Empty;
}
public async Task<int> DeleteAllMyNotificationsAsync()
{
try
{
var profileId = await GetMyProfileIdAsync();
if (string.IsNullOrEmpty(profileId))
return 0;
var notifications = await _dbContext.Set<Notification>()
.Where(x => x.ReceiverUserId == Guid.Parse(profileId))
.Where(x => x.DeleteDate == null)
.ToListAsync();
_dbContext.Set<Notification>().RemoveRange(notifications);
await _dbContext.SaveChangesAsync();
return notifications.Count;
}
catch
{
throw;
}
}
public async Task PushNotificationAsync(Guid ReceiverUserId, string Subject, string Body, string Payload = "", string NotiLink = "", bool IsSendInbox = false, bool IsSendMail = false)
{
try
@ -227,7 +267,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -235,7 +275,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
@ -287,7 +327,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -295,7 +335,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
@ -361,7 +401,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -369,7 +409,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
@ -434,7 +474,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -442,7 +482,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
@ -504,7 +544,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -512,7 +552,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}
@ -566,7 +606,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
@ -574,7 +614,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
if (_res.IsSuccessStatusCode)
{
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
if (org != null && org.result != null)
if (org != null && org.result != null && org.result != "")
_emailSenderService.SendMail(Subject, Body, org.result);
}
}

View file

@ -26,6 +26,16 @@ namespace BMA.EHR.Application.Repositories.MetaData
#region " Methods "
public async Task<string> GetHolidayAsync(DateTime date, string category = "NORMAL")
{
var data = await _dbContext.Set<Holiday>().AsQueryable()
.Where(x => x.Category == category)
.Where(x => x.HolidayDate.Date == date.Date)
.Select(x => x.Name)
.FirstOrDefaultAsync();
return data ?? string.Empty;
}
public async Task<List<DateTime>> GetHolidayAsync(DateTime startDate, DateTime endDate, string category = "NORMAL")
{
var data = await _dbContext.Set<Holiday>().AsQueryable()
@ -39,12 +49,16 @@ namespace BMA.EHR.Application.Repositories.MetaData
public async Task<int> GetHolidayCountAsync(DateTime startDate, DateTime endDate, string category = "NORMAL")
{
var data = await _dbContext.Set<Holiday>().AsQueryable()
var query = _dbContext.Set<Holiday>().AsQueryable()
.Where(x => x.Category == category)
.Where(x => x.HolidayDate.Date >= startDate && x.HolidayDate.Date <= endDate)
.CountAsync();
.Where(x => x.HolidayDate.Date >= startDate && x.HolidayDate.Date <= endDate);
return data;
if (category == "NORMAL")
query = query.Where(x => x.HolidayDate.DayOfWeek != DayOfWeek.Saturday && x.HolidayDate.DayOfWeek != DayOfWeek.Sunday);
else
query = query.Where(x => x.HolidayDate.DayOfWeek != DayOfWeek.Sunday);
return await query.CountAsync();
}
public List<DateTime> GetWeekEnd(DateTime startDate, DateTime endDate, string category = "NORMAL")

View file

@ -1,4 +1,4 @@
using Amazon.S3;
using Amazon.S3;
using Amazon.S3.Model;
using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Hosting;
@ -37,7 +37,9 @@ namespace BMA.EHR.Application.Repositories
var config = new AmazonS3Config
{
ServiceURL = _configuration["MinIO:Endpoint"],
ForcePathStyle = true
ForcePathStyle = true,
SignatureVersion = "V4", // รองรับ MinIO
AuthenticationRegion = "th-middle-rack-1" // บาง MinIO ใช้ region "us-east-1" โดย default
};
_s3Client = new AmazonS3Client(_configuration["MinIO:AccessKey"], _configuration["MinIO:SecretKey"], config);

View file

@ -1,4 +1,4 @@
using Amazon.S3;
using Amazon.S3;
using Amazon.S3.Model;
using BMA.EHR.Domain.Models.Documents;
using BMA.EHR.Domain.Shared;
@ -40,7 +40,9 @@ namespace BMA.EHR.Application.Repositories
var config = new AmazonS3Config
{
ServiceURL = _configuration["MinIO:Endpoint"],
ForcePathStyle = true
ForcePathStyle = true,
SignatureVersion = "V4", // รองรับ MinIO
AuthenticationRegion = "th-middle-rack-1" // บาง MinIO ใช้ region "us-east-1" โดย default
};
_s3Client = new AmazonS3Client(_configuration["MinIO:AccessKey"], _configuration["MinIO:SecretKey"], config);

View file

@ -43,7 +43,9 @@ namespace BMA.EHR.Application.Repositories
var config = new AmazonS3Config
{
ServiceURL = _configuration["MinIO:Endpoint"],
ForcePathStyle = true
ForcePathStyle = true,
SignatureVersion = "V4", // รองรับ MinIO
AuthenticationRegion = "th-middle-rack-1" // บาง MinIO ใช้ region "us-east-1" โดย default
};
_s3Client = new AmazonS3Client(_configuration["MinIO:AccessKey"], _configuration["MinIO:SecretKey"], config);

View file

@ -1,4 +1,4 @@
using Amazon.S3;
using Amazon.S3;
using Amazon.S3.Model;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Domain.Models.Documents;
@ -39,7 +39,9 @@ namespace BMA.EHR.Application.Repositories
var config = new AmazonS3Config
{
ServiceURL = _configuration["MinIO:Endpoint"],
ForcePathStyle = true
ForcePathStyle = true,
SignatureVersion = "V4", // รองรับ MinIO
AuthenticationRegion = "th-middle-rack-1" // บาง MinIO ใช้ region "us-east-1" โดย default
};
_s3Client = new AmazonS3Client(_configuration["MinIO:AccessKey"], _configuration["MinIO:SecretKey"], config);
@ -153,6 +155,40 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<FormFile> GetImageToFormFileAsync(string refId)
{
try
{
using var memoryStream = new MemoryStream();
var request = new GetObjectRequest
{
BucketName = _bucketName,
Key = refId
};
using var response = await _s3Client.GetObjectAsync(request);
using var responseStream = response.ResponseStream;
await responseStream.CopyToAsync(memoryStream);
var finalBytes = memoryStream.ToArray();
var finalStream = new MemoryStream(finalBytes);
var fileName = Path.GetFileName(refId);
var contentType = response.Headers.ContentType ?? "image/jpeg";
return new FormFile(finalStream, 0, finalStream.Length, "file", fileName)
{
Headers = new HeaderDictionary(),
ContentType = contentType
};
}
catch
{
throw;
}
}
public async Task DeleteFileAsync(Guid fileId)
{
try

View file

@ -10,6 +10,7 @@ using System.Net.Http.Headers;
using Microsoft.Extensions.Configuration;
using System.Security.Claims;
using System.Net.Http.Json;
using BMA.EHR.Application.Responses.Leaves;
namespace BMA.EHR.Application.Repositories
{
@ -58,9 +59,14 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = await client.GetAsync(apiPath);
if (!req.IsSuccessStatusCode)
{
throw new Exception("Error calling permission API");
}
var res = await req.Content.ReadAsStringAsync();
return res;
}
@ -71,6 +77,39 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<GetPermissionWithActingResultDto?> GetPermissionWithActingAPIAsync(string action, string system)
{
try
{
var apiPath = $"{_configuration["API"]}/org/permission/dotnet-acting/{action}/{system}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = await client.GetAsync(apiPath);
if (!req.IsSuccessStatusCode)
{
throw new Exception("Error calling permission API");
}
var apiResult = await req.Content.ReadAsStringAsync();
//return res;
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetPermissionWithActingResultDto>(apiResult);
return raw;
}
return null;
}
}
catch
{
throw;
}
}
public async Task<dynamic> GetPermissionOrgAPIAsync(string action, string system, string profileId)
{
try
@ -80,7 +119,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = await client.GetAsync(apiPath);
var res = await req.Content.ReadAsStringAsync();
return res;

View file

@ -2,24 +2,40 @@
using BMA.EHR.Domain.Models.Placement;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System.Net.Http.Headers;
using Newtonsoft.Json;
namespace BMA.EHR.Application.Repositories
{
/// <summary>
/// Response model จาก Org API (check-isLeave)
/// </summary>
public class OrgProfileResult
{
public string citizenId { get; set; } = "";
public string? profileId { get; set; }
public bool isLeave { get; set; }
public bool isActive { get; set; }
}
public class PlacementRepository : GenericRepository<Guid, Placement>
{
#region " Fields "
private readonly IApplicationDBContext _dbContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IConfiguration _configuration;
#endregion
#region " Constructor and Destructor "
public PlacementRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
public PlacementRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor, IConfiguration configuration) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_httpContextAccessor = httpContextAccessor;
_configuration = configuration;
}
#endregion
@ -76,6 +92,148 @@ namespace BMA.EHR.Application.Repositories
return data;
}
/// <summary>
/// Job อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง
/// และอัพเดทบุคคลภายนอกที่เข้ามาอยู่ในระบบแล้ว
/// ทำงานทุกวันเวลา 05:00 น.
/// </summary>
public async Task UpdateStatusPlacementProfiles()
{
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === STARTED ===");
// 1. Query ทั้ง 2 กรณี: ทุกคนที่ยังไม่ DONE
var allCitizenIds = await _dbContext.Set<PlacementProfile>()
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
&& p.PlacementStatus != "DONE"
// && p.CitizenId == "2536721883131"
)
.Select(p => new { p.CitizenId, p.IsOfficer })
.ToListAsync();
if (!allCitizenIds.Any())
{
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] No profiles to process");
return;
}
var officerCount = allCitizenIds.Count(x => x.IsOfficer == true);
var notOfficerCount = allCitizenIds.Count(x => x.IsOfficer == false);
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบข้าราชการ {officerCount} คน, บุคคลภายนอก {notOfficerCount} คน");
// 2. ส่ง citizenIds ทั้งหมดไป Org API ครั้งเดียว
var citizenIds = allCitizenIds.Select(x => x.CitizenId).Distinct().ToList();
var apiUrl = $"{_configuration["API"]}/org/dotnet/check-isLeave";
List<OrgProfileResult> orgResults = new();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var payload = new { citizenIds };
var jsonPayload = JsonConvert.SerializeObject(payload);
var content = new StringContent(jsonPayload, System.Text.Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync(apiUrl, content);
var result = await response.Content.ReadAsStringAsync();
var responseObj = JsonConvert.DeserializeAnonymousType(result, new
{
status = 0,
message = "",
result = new List<OrgProfileResult>()
});
orgResults = responseObj?.result ?? new();
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Org API ตอบกลับ {orgResults.Count} รายการ");
}
catch (Exception ex)
{
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Call API failed: {ex.Message}");
return;
}
}
if (!orgResults.Any())
{
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] ไม่มีรายการต้องอัปเดต");
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
return;
}
// 3. แยกข้อมูลตามเงื่อนไข
var leaveCitizenIds = orgResults.Where(x => x.isLeave).Select(x => x.citizenId).ToList();
var inSystemProfiles = orgResults.Where(x => x.isActive && !x.isLeave && !string.IsNullOrEmpty(x.profileId)).ToList();
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] ลาออก {leaveCitizenIds.Count} รายการ, อยู่ที่ทะเบียนประวัติ {inSystemProfiles.Count} รายการ");
// 4. Split Batch Update (500 รายการ/batch)
var batchSize = 500;
var totalUpdated = 0;
// 4.1 Update คนลาออก → IsOfficer = false
if (leaveCitizenIds.Any())
{
var totalBatches = (int)Math.Ceiling((double)leaveCitizenIds.Count / batchSize);
for (int i = 0; i < totalBatches; i++)
{
var batch = leaveCitizenIds.Skip(i * batchSize).Take(batchSize).ToList();
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
&& batch.Contains(p.CitizenId)
&& p.IsOfficer == true)
.ToListAsync();
foreach (var profile in profilesToUpdate)
{
profile.profileId = null;
profile.IsOfficer = false;
}
await _dbContext.SaveChangesAsync();
totalUpdated += profilesToUpdate.Count;
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] [ลาออก] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
}
}
// 4.2 Update คนที่อยู่ในทะเบียนประวัติ → profileId + IsOfficer = true
if (inSystemProfiles.Any())
{
var totalBatches = (int)Math.Ceiling((double)inSystemProfiles.Count / batchSize);
for (int i = 0; i < totalBatches; i++)
{
var batch = inSystemProfiles.Skip(i * batchSize).Take(batchSize).ToList();
var batchCitizenIds = batch.Select(x => x.citizenId).ToList();
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
&& batchCitizenIds.Contains(p.CitizenId)
&& p.IsOfficer == false)
.ToListAsync();
foreach (var profile in profilesToUpdate)
{
var orgProfile = batch.FirstOrDefault(x => x.citizenId == profile.CitizenId);
if (orgProfile != null)
{
profile.profileId = orgProfile.profileId;
profile.IsOfficer = true;
}
}
await _dbContext.SaveChangesAsync();
totalUpdated += profilesToUpdate.Count;
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] [เข้าระบบ] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
}
}
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] อัปเดตรวมทั้งหมด {totalUpdated} รายการ");
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
}
#endregion
}
}

View file

@ -5,6 +5,7 @@ using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using System.Text;
using System.Text.RegularExpressions;
using static BMA.EHR.Domain.Extensions.DateTimeExtension;
namespace BMA.EHR.Application.Repositories.Reports
@ -82,76 +83,128 @@ namespace BMA.EHR.Application.Repositories.Reports
sb.Append(monthDiff == 0 ? "" : $"{monthDiff} เดือน ");
sb.Append(dayDiff == 0 ? "" : $"{dayDiff} วัน ");
}
var data = await _dbExamContext.Set<Candidate>().AsQueryable()
.Where(x => x.Id == id)
.Select(p => new
{
p.Id,
AvatarId = p.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.ProfileImg.Id,
ExamIdenNumber = p.ExamIdenNumber == null ? "-" : p.ExamIdenNumber.ToThaiNumber(),
PositionName = p.PositionExam == null ? "-" : p.PositionExam.PositionName.ToThaiNumber(),
PositionLevelName = p.PositionExam == null ? "-" : p.PositionExam.PositionLevelName.ToThaiNumber(),
PeriodExamName = p.PeriodExam == null ? "-" : p.PeriodExam.Name.ToThaiNumber(),
PeriodExamRound = p.PeriodExam == null ? "-" : p.PeriodExam.Round.ToString().ToThaiNumber(),
PeriodExamYear = p.PeriodExam == null ? "-" : (p.PeriodExam.Year + 543).ToString().ToThaiNumber(),
var candidate = await _dbExamContext.Set<Candidate>()
.Where(x => x.Id == id)
.Include(p => p.PeriodExam)
.Include(p => p.Educations)
.Include(p => p.PositionExam)
.Include(p => p.ProfileImg)
.FirstOrDefaultAsync();
FullName = $"{p.PrefixName}{p.FirstName} {p.LastName}",
Religion = p.ReligionName == null ? "-" : p.ReligionName,
Nationality = p.Nationality == null ? "-" : p.Nationality,
DateOfBirth = p.DateOfBirth == null ? "-" : p.DateOfBirth.Value.ToThaiFullDate2().ToThaiNumber(),
Age = p.DateOfBirth == null ? "-" : p.DateOfBirth.Value.CalculateAgeStrV2(0, 0).ToThaiNumber(),
CitizenId = p.CitizenId == null ? "-" : p.CitizenId.ToThaiNumber(),
EducationLevelExamName = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationLevelExamName.ToThaiNumber(),
EducationName = p.Educations.FirstOrDefault() == null ? null : (p.Educations.FirstOrDefault().EducationLevelExamName == "ปริญญาตรี" || p.Educations.FirstOrDefault().EducationLevelExamName == "ปริญญาโท" || p.Educations.FirstOrDefault().EducationLevelExamName == "ปริญญาเอก" ? p.Educations.FirstOrDefault().EducationName : null),
EducationMajor = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationMajor.ToThaiNumber(),
EducationLocation = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationLocation,
EducationEndDate = p.Educations.FirstOrDefault() == null || p.Educations.FirstOrDefault().EducationEndDate == null ? "-" : p.Educations.FirstOrDefault().EducationEndDate.Value.ToThaiFullDate2().ToThaiNumber(),
EducationScores = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationScores.ToThaiNumber(),
EducationType = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationType,
EducationLevelHighName = p.Educations.FirstOrDefault() == null ? "-" : p.Educations.FirstOrDefault().EducationLevelHighName,
OccupationPositionType = p.OccupationPositionType == "other" ? "ผู้ปฏิบัติงานอื่นในกรุงเทพมหานคร" : (p.OccupationPositionType == "temp" ? "ลูกจ้างชั่วคราว" : (p.OccupationPositionType == "prem" ? "ลูกจ้างประจำ" : "-")),
OccupationPosition = p.OccupationPosition == null ? "-" : p.OccupationPosition,
OccupationSalary = p.OccupationSalary == null ? "-" : p.OccupationSalary.Value.ToString("N0").ToThaiNumber(),
OccupationGroup = p.OccupationGroup == null ? "-" : p.OccupationGroup,
OccupationPile = p.OccupationPile == null ? "-" : p.OccupationPile,
OccupationOrg = p.OccupationOrg == null ? "-" : p.OccupationOrg,
OccupationTelephone = p.OccupationTelephone == null ? "-" : p.OccupationTelephone.ToThaiNumber(),
CareersTotal = sb.ToString().ToThaiNumber(),
// Careers = p.Careers.Select(y => new
// {
// Position = y.Position,
// Type = y.Type,
// DurationStart = y.DurationStart.ToThaiShortDate2(),
// DurationEnd = y.DurationEnd.ToThaiShortDate2(),
// RangeDate = y.RangeDate,
// }).ToList(),
RegistAddress = p.RegistAddress == null ? "-" : p.RegistAddress.ToThaiNumber(),
RegistProvinceName = p.RegistProvinceName == null ? "-" : p.RegistProvinceName,
RegistDistrictName = p.RegistDistrictName == null ? "-" : p.RegistDistrictName,
RegistSubDistrictName = p.RegistSubDistrictName == null ? "-" : p.RegistSubDistrictName,
RegistZipCode = p.RegistZipCode == null ? "-" : p.RegistZipCode.ToThaiNumber(),
CurrentAddress = p.CurrentAddress == null ? (p.RegistAddress == null ? "-" : p.RegistAddress.ToThaiNumber()) : p.CurrentAddress.ToThaiNumber(),
CurrentProvinceName = p.CurrentProvinceName == null ? (p.RegistProvinceName == null ? "-" : p.RegistProvinceName) : p.CurrentProvinceName,
CurrentDistrictName = p.CurrentDistrictName == null ? (p.RegistDistrictName == null ? "-" : p.RegistDistrictName) : p.CurrentDistrictName,
CurrentSubDistrictName = p.CurrentSubDistrictName == null ? (p.RegistSubDistrictName == null ? "-" : p.RegistSubDistrictName) : p.CurrentSubDistrictName,
CurrentZipCode = p.CurrentZipCode == null ? (p.RegistZipCode == null ? "-" : p.RegistZipCode.ToThaiNumber()) : p.CurrentZipCode.ToThaiNumber(),
Telephone = p.Telephone == null ? "-" : p.Telephone.ToThaiNumber(),
Email = p.Email == null ? "-" : p.Email,
ContactFullName = $"{p.ContactPrefixName}{p.ContactFirstname} {p.ContactLastname}",
ContactRelations = p.ContactRelations == null ? "-" : p.ContactRelations,
ContactTel = p.ContactTel == null ? "-" : p.ContactTel.ToThaiNumber(),
RegisterDate = p.RegisterDate == null ? "-" : p.RegisterDate.Value.ToThaiFullDate().ToThaiNumber(),
})
.FirstOrDefaultAsync();
if (data == null)
if (candidate == null)
throw new Exception(GlobalMessages.CandidateNotFound);
return data;
List<string> editorConfirmLists;
var textOnly = string.IsNullOrEmpty(candidate.PeriodExam?.EditorConfirm)
? null
: Regex.Replace(
candidate.PeriodExam.EditorConfirm,
"<[^>]+>",
string.Empty
)
.Replace("&nbsp;", " ")
.Trim();
if (!string.IsNullOrEmpty(textOnly))
{
// ลบข้อความทั้งหมดก่อน "1." เพื่อให้เริ่มต้นที่ข้อแรกเสมอ
var cleanedText = Regex.Replace(textOnly, @"^.*?1\.", "1.").Trim();
// ถ้าข้อ 3 จบด้วย "มาตรา 1374." แล้วเลข 4. ติดกับประโยค ให้แทรกขึ้นบรรทัดใหม่เป็นข้อ 4.
if (!cleanedText.Contains("\n4.") && Regex.IsMatch(cleanedText, @"1374\.\s*"))
{
cleanedText = Regex.Replace(cleanedText, @"1374\.\s*", "137\n4. ");
}
// แยกข้อความเป็นแต่ละข้อ โดย split เมื่อเจอ pattern "ตัวเลข. "
// ใช้ lookahead (?=...) เพื่อไม่กินตัวเลขทิ้ง และให้ตัวเลขยังอยู่ในผลลัพธ์
editorConfirmLists = Regex.Split(cleanedText, @"(?=\d+\. )")
.Where(s => !string.IsNullOrWhiteSpace(s))
.Select(s => s.Replace("\n", "").Replace("\r", "").Trim())
.ToList();
}
else
{
editorConfirmLists = new List<string> { "-" };
}
return new
{
candidate.Id,
AvatarId = candidate.ProfileImg?.Id ?? Guid.Empty,
ExamIdenNumber = candidate.ExamIdenNumber ?? "-",
PositionName = candidate.PositionExam?.PositionName ?? "-",
PositionLevelName = candidate.PositionExam?.PositionLevelName ?? "-",
PeriodExamName = candidate.PeriodExam?.Name ?? "-",
PeriodExamRound = candidate.PeriodExam?.Round.ToString() ?? "-",
PeriodExamYear = candidate.PeriodExam != null ? (candidate.PeriodExam.Year + 543).ToString() : "-",
FullName = $"{candidate.PrefixName}{candidate.FirstName} {candidate.LastName}",
Religion = candidate.ReligionName ?? "-",
Nationality = candidate.Nationality ?? "-",
DateOfBirth = candidate.DateOfBirth?.ToThaiFullDate2() ?? "-",
Age = candidate.DateOfBirth?.CalculateAgeStrV2(0, 0) ?? "-",
CitizenId = candidate.CitizenId ?? "-",
EducationLevelExamName = candidate.Educations.FirstOrDefault()?.EducationLevelExamName ?? "-",
EducationName = (candidate.Educations.FirstOrDefault()?.EducationLevelExamName is "ปริญญาตรี" or "ปริญญาโท" or "ปริญญาเอก")
? candidate.Educations.FirstOrDefault()?.EducationName
: null,
EducationMajor = candidate.Educations.FirstOrDefault()?.EducationMajor ?? "-",
EducationLocation = candidate.Educations.FirstOrDefault()?.EducationLocation ?? "-",
EducationEndDate = candidate.Educations.FirstOrDefault()?.EducationEndDate?.ToThaiFullDate2() ?? "-",
EducationScores = candidate.Educations.FirstOrDefault()?.EducationScores ?? "-",
EducationType = candidate.Educations.FirstOrDefault()?.EducationType ?? "-",
EducationLevelHighName = candidate.Educations.FirstOrDefault()?.EducationLevelHighName ?? "-",
OccupationPositionType = candidate.OccupationPositionType == "other" ? "ผู้ปฏิบัติงานอื่นในกรุงเทพมหานคร" :
candidate.OccupationPositionType == "temp" ? "ลูกจ้างชั่วคราว" :
candidate.OccupationPositionType == "prem" ? "ลูกจ้างประจำ" : "-",
OccupationPosition = candidate.OccupationPosition ?? "-",
OccupationSalary = candidate.OccupationSalary.HasValue
? (candidate.OccupationSalary.Value % 1 == 0
? candidate.OccupationSalary.Value.ToString("N0")
: candidate.OccupationSalary.Value.ToString("N2"))
: "-",
OccupationGroup = candidate.OccupationGroup ?? "-",
OccupationPile = candidate.OccupationPile ?? "-",
OccupationOrg = candidate.OccupationOrg ?? "-",
OccupationTelephone = candidate.OccupationTelephone ?? "-",
CareersTotal = sb.ToString(),
RegistAddress = candidate.RegistAddress ?? "-",
RegistProvinceName = candidate.RegistProvinceName ?? "-",
RegistDistrictName = candidate.RegistDistrictName ?? "-",
RegistSubDistrictName = candidate.RegistSubDistrictName ?? "-",
RegistZipCode = candidate.RegistZipCode ?? "-",
CurrentAddress = candidate.CurrentAddress ?? candidate.RegistAddress ?? "-",
CurrentProvinceName = candidate.CurrentProvinceName ?? candidate.RegistProvinceName ?? "-",
CurrentDistrictName = candidate.CurrentDistrictName ?? candidate.RegistDistrictName ?? "-",
CurrentSubDistrictName = candidate.CurrentSubDistrictName ?? candidate.RegistSubDistrictName ?? "-",
CurrentZipCode = candidate.CurrentZipCode ?? candidate.RegistZipCode ?? "-",
Telephone = candidate.Telephone ?? "-",
Email = candidate.Email ?? "-",
ContactFullName = $"{candidate.ContactPrefixName}{candidate.ContactFirstname} {candidate.ContactLastname}",
ContactRelations = candidate.ContactRelations ?? "-",
ContactTel = candidate.ContactTel ?? "-",
RegisterDate = candidate.RegisterDate?.ToThaiFullDate() ?? "-",
IsBachelors = candidate.PositionExam != null && !string.IsNullOrEmpty(candidate.PositionExam.PositionLevelName) && candidate.PositionExam.PositionLevelName.Trim() == "ปฏิบัติการ"
? new List<object>
{
new { label = "ชื่อปริญญา", value = candidate.Educations.FirstOrDefault()?.EducationName ?? "-" },
new { label = "สาขาวิชา/วิชาเอก", value = candidate.Educations.FirstOrDefault()?.EducationMajor ?? "-" }
}
: new List<object>
{
new { label = "สาขาวิชา/วิชาเอก", value = candidate.Educations.FirstOrDefault()?.EducationMajor ?? "-" }
},
EditorConfirms = editorConfirmLists
};
}
public async Task<dynamic> GetExamCareerCandidateAsync(Guid id)
{
@ -176,10 +229,10 @@ namespace BMA.EHR.Application.Repositories.Reports
{
Position = item.Position,
Type = item.Type,
DurationStart = item.DurationStart.ToThaiNumber(),
DurationEnd = item.DurationEnd.ToThaiNumber(),
RangeDate = item.RangeDate.ToThaiNumber(),
Index = retVal.ToString().ToThaiNumber(),
DurationStart = item.DurationStart,
DurationEnd = item.DurationEnd,
RangeDate = item.RangeDate,
Index = retVal.ToString(),
};
data.Add(_data);
retVal++;

View file

@ -3,6 +3,7 @@ using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories.MessageQueue;
using BMA.EHR.Application.Responses;
using BMA.EHR.Domain.Extensions;
using BMA.EHR.Domain.Models.Commands.Core;
using BMA.EHR.Domain.Models.HR;
using BMA.EHR.Domain.Models.Insignias;
using BMA.EHR.Domain.Models.MetaData;
@ -12,9 +13,14 @@ using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Globalization;
using System.Net;
using System.Net.Http.Headers;
namespace BMA.EHR.Application.Repositories.Reports
{
@ -27,6 +33,7 @@ namespace BMA.EHR.Application.Repositories.Reports
private readonly OrganizationCommonRepository _organizationCommonRepository;
private readonly NotificationRepository _repositoryNoti;
private readonly InsigniaPeriodsRepository _repositoryInsignia;
private readonly IConfiguration _configuration;
private readonly string CRLF = "\r\n";
private readonly UserProfileRepository _userProfileRepository;
@ -41,6 +48,7 @@ namespace BMA.EHR.Application.Repositories.Reports
InsigniaPeriodsRepository repositoryInsignia,
NotificationRepository repositoryNoti,
IWebHostEnvironment hostEnvironment,
IConfiguration configuration,
UserProfileRepository userProfileRepository,
IHttpContextAccessor httpContextAccessor)
{
@ -51,6 +59,7 @@ namespace BMA.EHR.Application.Repositories.Reports
_repositoryInsignia = repositoryInsignia;
_userProfileRepository = userProfileRepository;
_httpContextAccessor = httpContextAccessor;
_configuration = configuration;
}
#endregion
@ -126,6 +135,26 @@ namespace BMA.EHR.Application.Repositories.Reports
return thaiYear;
}
public async Task<dynamic> GetNameInsigniaNote(Guid id)
{
var note = await _dbContext.Set<InsigniaNote>()
.FirstOrDefaultAsync(x => x.Id == id);
if (note == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
string name = note.Name.ToString().ToThaiNumber();
return name;
}
public async Task<dynamic> GetYearInsigniaNote(Guid id)
{
var note = await _dbContext.Set<InsigniaNote>()
.FirstOrDefaultAsync(x => x.Id == id);
if (note == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
string thaiYear = note.Year.ToThaiYear().ToString().ToThaiNumber();
return thaiYear;
}
public async Task<dynamic> Get2YearInsigniaPeriod(Guid id)
{
var period = await _dbContext.Set<InsigniaPeriod>()
@ -743,36 +772,89 @@ namespace BMA.EHR.Application.Repositories.Reports
}
//44-บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ
public async Task<dynamic> GetSummaryCoinReport(Guid id)
public async Task<dynamic> GetSummaryCoinReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaPeriod>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insignia = await _dbContext.Set<InsigniaRequestProfile>()
//.Include(x => x.Profile)
.Where(x => x.Request.Period.Id == period.Id)
.Where(x => x.IsApprove == true)
.Where(x => x.Status == "PENDING")
.Where(x => x.RequestInsignia.InsigniaType != null)
.Where(x => x.RequestInsignia.InsigniaType.Name == "เหรียญบำเหน็จในราชการ")
.Select(x => new
{
//Gendor = x.Profile.Gender == null ? null : x.Profile.Gender.Name,
Gendor = x.Gender, //_userProfileRepository.GetOfficerProfileById(x.ProfileId, AccessToken).Gender ?? "",
RequestInsigniaName = x.RequestInsignia.Name,
InsigniaInitial = $"{x.RequestInsignia.Name}({x.RequestInsignia.ShortName})",
OcId = x.Request.OrganizationId
})
.ToListAsync();
/* var data_insignia = await _dbContext.Set<InsigniaRequestProfile>()
//.Include(x => x.Profile)
.Where(x => x.Request.Period.Id == period.Id)
.Where(x => x.IsApprove == true)
.Where(x => x.Status == "PENDING")
.Where(x => x.RequestInsignia.InsigniaType != null)
.Where(x => x.RequestInsignia.InsigniaType.Name == "เหรียญบำเหน็จในราชการ")
.Select(x => new
{
//Gendor = x.Profile.Gender == null ? null : x.Profile.Gender.Name,
Gendor = x.Gender, //_userProfileRepository.GetOfficerProfileById(x.ProfileId, AccessToken).Gender ?? "",
RequestInsigniaName = x.RequestInsignia.Name,
InsigniaInitial = $"{x.RequestInsignia.Name}({x.RequestInsignia.ShortName})",
OcId = x.Request.OrganizationId
})
.ToListAsync();*/
var data_insigniaQuery = _dbContext.Set<InsigniaRequestProfile>()
.Where(x => x.Request.Period.Id == period.Id)
.Where(x => x.IsApprove == true)
.Where(x => x.Status == "PENDING")
.Where(x => x.RequestInsignia.InsigniaType != null)
.Where(x => x.RequestInsignia.InsigniaType.Name == "เหรียญบำเหน็จในราชการ");
var insignia = (from r in data_insignia
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery
.Select(x => new
{
Gendor = x.Gender, // Gender as is, directly from x.Gender
RequestInsigniaName = x.RequestInsignia.Name, // Name of the Insignia
InsigniaInitial = $"{x.RequestInsignia.Name}({x.RequestInsignia.ShortName})", // Insignia's full name and short name
OcId = x.Request.OrganizationId // Organization ID
})
.ToListAsync();
var org = _userProfileRepository.GetOc(nodeId, node, AccessToken);
var organizationName = $"{(!string.IsNullOrEmpty(org.Child4) ? org.Child4 + "/" : "")}{(!string.IsNullOrEmpty(org.Child3) ? org.Child3 + "/" : "")}{(!string.IsNullOrEmpty(org.Child2) ? org.Child2 + "/" : "")}{(!string.IsNullOrEmpty(org.Child1) ? org.Child1 + "/" : "")}{org.Root ?? ""}";
var insignia = (from r in data
group r by new { OcId = r.OcId, InsigniaInitial = r.InsigniaInitial } into g
select new
{
RowNo = 1,
DepartmentName = _userProfileRepository.GetOc(g.Key.OcId, 0, AccessToken).Root, //_organizationCommonRepository.GetOrganizationNameFullPath(g.Key.OcId, false, false),
DepartmentName = organizationName,
//_userProfileRepository.GetOc(g.Key.OcId, 0, AccessToken).Root,
//_organizationCommonRepository.GetOrganizationNameFullPath(g.Key.OcId, false, false),
InsigniaInitial = g.Key.InsigniaInitial,
G1Male = g.Sum(x => x.Gendor == "ชาย" && x.RequestInsigniaName == "เหรียญจักรพรรดิมาลา" ? 1 : 0).ToString().ToThaiNumber(),
G1Female = g.Sum(x => x.Gendor == "หญิง" && x.RequestInsigniaName == "เหรียญจักรพรรดิมาลา" ? 1 : 0).ToString().ToThaiNumber(),
@ -811,7 +893,7 @@ namespace BMA.EHR.Application.Repositories.Reports
select new
{
RowNo = 1,
DepartmentName = _userProfileRepository.GetOc(g.Key.OcId, 0, AccessToken).Root, //_organizationCommonRepository.GetOrganizationNameFullPath(g.Key.OcId, false, false),
DepartmentName = _userProfileRepository.GetOc(g.Key.OcId, 0, AccessToken)?.Root ?? "-", //_organizationCommonRepository.GetOrganizationNameFullPath(g.Key.OcId, false, false),
G1Male = g.Sum(x => x.Gendor == "ชาย" && x.RequestInsigniaName == "เหรียญจักรพรรดิมาลา" ? 1 : 0),
G1Female = g.Sum(x => x.Gendor == "หญิง" && x.RequestInsigniaName == "เหรียญจักรพรรดิมาลา" ? 1 : 0),
G2Male = g.Sum(x => x.Gendor == "ชาย" ? 1 : 0),
@ -832,7 +914,7 @@ namespace BMA.EHR.Application.Repositories.Reports
}
//45-บัญชีแสดงรายชื่อผู้ขอพระราชทานเหรียญจักรพรรดิมาลา
public async Task<dynamic> GetCoinReport(Guid id)
public async Task<dynamic> GetCoinReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaPeriod>()
.FirstOrDefaultAsync(x => x.Id == id);
@ -863,38 +945,102 @@ namespace BMA.EHR.Application.Repositories.Reports
})
.Distinct()
.ToList();
var data = (from r in await _dbContext.Set<InsigniaRequestProfile>()
//.Include(x => x.Profile)
//.ThenInclude(x => x.Gender)
//.Include(x => x.Profile)
//.ThenInclude(x => x.Prefix)
.Include(x => x.Request)
.ThenInclude(x => x.Period)
.Include(x => x.Request)
//.ThenInclude(x => x.Organization)
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.ToListAsync()
where r.Request.Period == period
&& r.IsApprove == true
&& r.Status == "PENDING"
&& r.RequestInsignia.InsigniaType != null
&& r.RequestInsignia.InsigniaType.Name != "เหรียญบำเหน็จในราชการ"
select new
{
InsigniaInitial = r.RequestInsignia.ShortName,
InsigniaName = r.RequestInsignia.Name,
ProfileId = r.ProfileId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
// $"{r.Profile.Prefix?.Name}{r.Profile.FirstName} {r.Profile.LastName}",
Gender = r.Gender,
Male = gender.Sum(x => x.Male),
Female = gender.Sum(x => x.Female),
InsigniaId = r.RequestInsignia.Id,
OCName = _userProfileRepository.GetOc(r.Request.OrganizationId, 0, AccessToken).Root, //_organizationCommonRepository.GetOrganizationNameFullPath(g.Key.OcId, false, false),
})
.Distinct()
.ToList();
var dataQuery = _dbContext.Set<InsigniaRequestProfile>()
.Include(x => x.Request)
.ThenInclude(x => x.Period)
.Include(x => x.Request)
/*.ThenInclude(x => x.Organization)*/
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.Where(r => r.Request.Period == period
&& r.IsApprove == true
&& r.Status == "PENDING"
&& r.RequestInsignia.InsigniaType != null
&& r.RequestInsignia.InsigniaType.Name != "เหรียญบำเหน็จในราชการ");
if (type == "officer")
{
dataQuery = dataQuery.Where(r => r.ProfileType == "officer");
}
else if (type == "employee")
{
dataQuery = dataQuery.Where(r => r.ProfileType == "employee");
}
switch (node)
{
case 0:
dataQuery = dataQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
dataQuery = dataQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
dataQuery = dataQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
dataQuery = dataQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
dataQuery = dataQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
// Grouping by ProfileId and InsigniaId, and calculating the sum for Male and Female
var data = await dataQuery
.GroupBy(r => new
{
r.RequestInsignia.ShortName,
r.RequestInsignia.Name,
r.ProfileId,
r.Prefix,
r.FirstName,
r.LastName,
r.Gender,
r.Root,
r.RootId,
r.Child1,
r.Child1Id,
r.Child2,
r.Child2Id,
r.Child3,
r.Child3Id,
r.Child4,
r.Child4Id,
r.RequestInsignia.Id,
r.Request.OrganizationId
})
.Select(group => new
{
InsigniaInitial = group.Key.ShortName,
InsigniaName = group.Key.Name,
ProfileId = group.Key.ProfileId,
FullName = $"{group.Key.Prefix}{group.Key.FirstName} {group.Key.LastName}",
Gender = group.Key.Gender,
Root = group.Key.Root ?? "",
RootId = group.Key.RootId,
Child1 = group.Key.Child1 ?? "",
Child1Id = group.Key.Child1Id,
Child2 = group.Key.Child2 ?? "",
Child2Id = group.Key.Child2Id,
Child3 = group.Key.Child3 ?? "",
Child3Id = group.Key.Child3Id,
Child4 = group.Key.Child4 ?? "",
Child4Id = group.Key.Child4Id,
Male = group.Count(r => r.Gender == "Male"), // Count male entries
Female = group.Count(r => r.Gender == "Female"), // Count female entries
InsigniaId = group.Key.Id,
OCName = _userProfileRepository.GetOc(group.Key.OrganizationId, 0, AccessToken).Root
})
.Distinct()
.ToListAsync();
// loop to add temp row with 50 rows per page
var insigniaList = data.Select(x => new { InsigniaId = x.InsigniaId, InsigniaInitial = x.InsigniaInitial, InsigniaName = x.InsigniaName })
@ -913,6 +1059,16 @@ namespace BMA.EHR.Application.Repositories.Reports
ProfileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
FullName = "",
Gender = "",
Root = "",
RootId = (Guid?)Guid.Parse("00000000-0000-0000-0000-000000000000"),
Child1 = "",
Child1Id = (Guid?)Guid.Parse("00000000-0000-0000-0000-000000000000"),
Child2 = "",
Child2Id = (Guid?)Guid.Parse("00000000-0000-0000-0000-000000000000"),
Child3 = "",
Child3Id = (Guid?)Guid.Parse("00000000-0000-0000-0000-000000000000"),
Child4 = "",
Child4Id = (Guid?)Guid.Parse("00000000-0000-0000-0000-000000000000"),
Male = 0,
Female = 0,
InsigniaId = ins.InsigniaId,
@ -959,6 +1115,330 @@ namespace BMA.EHR.Application.Repositories.Reports
return s_data;
}
public async Task<dynamic> GeInsigniaRequestProfiles(Guid id)
{
var profile = await _dbContext.Set<InsigniaRequestProfile>()
.Where(x => x.Id == id)
.Select(x => new
{
Fullname = $"{x.Prefix}{x.FirstName} {x.LastName}",
Position = x.Position ?? "",
Oc = (x.Child4 == null ? "" : x.Child4 + " ") +
(x.Child3 == null ? "" : x.Child3 + " ") +
(x.Child2 == null ? "" : x.Child2 + " ") +
(x.Child1 == null ? "" : x.Child1 + " ") +
(x.Root == null ? "" : x.Root),
BirthDate = x.BirthDate == null ? "" : x.BirthDate.Value.ToThaiShortDate().ToString().ToThaiNumber(),
DateAppoint = x.DateAppoint == null ? "" : x.DateAppoint.Value.ToThaiShortDate().ToString().ToThaiNumber(),
ProfileId = x.ProfileId
})
.FirstOrDefaultAsync();
if (profile == null)
throw new Exception(GlobalMessages.DataNotFound);
var profileSalarys = await _userProfileRepository.GetProfileSalaryById(profile.ProfileId, AccessToken);
var salarys = profileSalarys.Select(x => new
{
DateAffect = x.DateAffect == null ? "" : x.DateAffect.ToThaiShortDate().ToString().ToThaiNumber(),
Position = x.Position ?? "",
Root = x.Root,
Child1 = x.Child1,
Child2 = x.Child2,
Child3 = x.Child3,
Child4 = x.Child4,
Oc = (x.Child4 == null ? "" : x.Child4 + " ") +
(x.Child3 == null ? "" : x.Child3 + " ") +
(x.Child2 == null ? "" : x.Child2 + " ") +
(x.Child1 == null ? "" : x.Child1 + " ") +
(x.Root == null ? "" : x.Root),
Age = x.Age == null ? "" : x.Age.ToString().ToThaiNumber(),
Amount = x.Amount == null ? "" : x.Amount.ToString("N0", new CultureInfo("th-TH")).ToThaiNumber(),
Remark = x.Remark == null ? "" : x.Remark.ToThaiNumber(),
}).ToList();
var result = new
{
profile.Fullname,
profile.Position,
profile.Oc,
profile.BirthDate,
profile.DateAppoint,
Salarys = salarys
};
return result;
}
//47-บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี
public async Task<dynamic> GetEvaluationResultReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaPeriod>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insigniaQuery = _dbContext.Set<InsigniaRequestProfile>()
.Where(x => x.Request.Period.Id == period.Id)
.Where(x => x.IsApprove == true)
.Where(x => x.Status == "PENDING")
.Where(x => x.RequestInsignia.InsigniaType != null);
/*.Where(x => x.RequestInsignia.InsigniaType.Name == "เหรียญบำเหน็จในราชการ");*/
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery
.Select(x => new
{
ProfileId = x.ProfileId,
FullName = $"{x.Prefix}{x.FirstName} {x.LastName}",
RequestInsigniaName = x.RequestInsignia.Name, // Name of the Insignia
Reason = x.Reason,
})
.ToListAsync();
var seq = 1;
var resultList = new List<object>();
foreach (var d in data)
{
var _baseAPI = _configuration["API"];
var _apiUrl = $"{_baseAPI}/org/unauthorize/calculateEvaluation/{type}";
using (var _client = new HttpClient())
{
_client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
var orgResponse = JObject.Parse(_result);
var resultItems = orgResponse["result"];
// ค้นหาข้อมูลที่ตรงกันกับ ProfileId
var matchedData = resultItems
.Where(item => item["profileId"].ToString() == d.ProfileId.ToString())
.FirstOrDefault();
if (matchedData != null)
{
resultList.Add(new
{
rowNo = seq++.ToString().ToThaiNumber(),
d.ProfileId,
d.FullName,
d.RequestInsigniaName,
yearAPR1 = matchedData["yearAPR1"]?.ToString() ?? "-",
periodAPR1 = matchedData["periodAPR1"]?.ToString() ?? "-",
resultAPR1 = matchedData["resultAPR1"]?.ToString() ?? "-",
yearOCT1 = matchedData["yearOCT1"]?.ToString() ?? "-",
periodOCT1 = matchedData["periodOCT1"]?.ToString() ?? "-",
resultOCT1 = matchedData["resultOCT1"]?.ToString() ?? "-",
yearAPR2 = matchedData["yearAPR2"]?.ToString() ?? "-",
periodAPR2 = matchedData["periodAPR2"]?.ToString() ?? "-",
resultAPR2 = matchedData["resultAPR2"]?.ToString() ?? "-",
yearOCT2 = matchedData["yearOCT2"]?.ToString() ?? "-",
periodOCT2 = matchedData["periodOCT2"]?.ToString() ?? "-",
resultOCT2 = matchedData["resultOCT2"]?.ToString() ?? "-",
yearAPR3 = matchedData["yearAPR3"]?.ToString() ?? "-",
periodAPR3 = matchedData["periodAPR3"]?.ToString() ?? "-",
resultAPR3 = matchedData["resultAPR3"]?.ToString() ?? "-",
yearOCT3 = matchedData["yearOCT3"]?.ToString() ?? "-",
periodOCT3 = matchedData["periodOCT3"]?.ToString() ?? "-",
resultOCT3 = matchedData["resultOCT3"]?.ToString() ?? "-",
yearAPR4 = matchedData["yearAPR4"]?.ToString() ?? "-",
periodAPR4 = matchedData["periodAPR4"]?.ToString() ?? "-",
resultAPR4 = matchedData["resultAPR4"]?.ToString() ?? "-",
yearOCT4 = matchedData["yearOCT4"]?.ToString() ?? "-",
periodOCT4 = matchedData["periodOCT4"]?.ToString() ?? "-",
resultOCT4 = matchedData["resultOCT4"]?.ToString() ?? "-",
yearAPR5 = matchedData["yearAPR5"]?.ToString() ?? "-",
periodAPR5 = matchedData["periodAPR5"]?.ToString() ?? "-",
resultAPR5 = matchedData["resultAPR5"]?.ToString() ?? "-",
yearOCT5 = matchedData["yearOCT5"]?.ToString() ?? "-",
periodOCT5 = matchedData["periodOCT5"]?.ToString() ?? "-",
resultOCT5 = matchedData["resultOCT5"]?.ToString() ?? "-",
remark = d.Reason ?? "-"
});
}
else
{
resultList.Add(new
{
rowNo = seq++.ToString().ToThaiNumber(),
d.ProfileId,
d.FullName,
d.RequestInsigniaName,
yearAPR1 = "-",
periodAPR1 = "-",
resultAPR1 = "-",
yearOCT1 = "-",
periodOCT1 = "-",
resultOCT1 = "-",
yearAPR2 = "-",
periodAPR2 = "-",
resultAPR2 = "-",
yearOCT2 = "-",
periodOCT2 = "-",
resultOCT2 = "-",
yearAPR3 = "-",
periodAPR3 = "-",
resultAPR3 = "-",
yearOCT3 = "-",
periodOCT3 = "-",
resultOCT3 = "-",
yearAPR4 = "-",
periodAPR4 = "-",
resultAPR4 = "-",
yearOCT4 = "-",
periodOCT4 = "-",
resultOCT4 = "-",
yearAPR5 = "-",
periodAPR5 = "-",
resultAPR5 = "-",
yearOCT5 = "-",
periodOCT5 = "-",
resultOCT5 = "-",
remark = "-"
});
}
}
}
}
return resultList;
}
//47-บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี NEW
public async Task<dynamic> GetEvaluationResult5YearReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaPeriod>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insigniaQuery = _dbContext.Set<InsigniaRequestProfile>()
.Where(x => x.Request.Period.Id == period.Id)
.Where(x => x.IsApprove == true)
.Where(x => x.Status == "PENDING")
.Where(x => x.RequestInsignia.InsigniaType != null);
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery
.Select(x => new
{
ProfileId = x.ProfileId,
FullName = $"{x.Prefix}{x.FirstName} {x.LastName}",
RequestInsigniaName = x.RequestInsignia.Name, // Name of the Insignia
Reason = x.Reason,
Agency = x.Root,
ResultAPR1 = x.APR1,
ResultOCT1 = x.OCT1,
ResultAPR2 = x.APR2,
ResultOCT2 = x.OCT2,
ResultAPR3 = x.APR3,
ResultOCT3 = x.OCT3,
ResultAPR4 = x.APR4,
ResultOCT4 = x.OCT4,
ResultAPR5 = x.APR5,
ResultOCT5 = x.OCT5
})
.ToListAsync();
var seq = 1;
var resultList = new List<object>();
foreach (var d in data)
{
resultList.Add(new
{
rowNo = seq++.ToString().ToThaiNumber(),
d.ProfileId,
d.FullName,
d.RequestInsigniaName,
Agency = d.Agency,
ResultAPR1 = d.ResultAPR1 ?? "-",
ResultOCT1 = d.ResultOCT1 ?? "-",
ResultAPR2 = d.ResultAPR2 ?? "-",
ResultOCT2 = d.ResultOCT2 ?? "-",
ResultAPR3 = d.ResultAPR3 ?? "-",
ResultOCT3 = d.ResultOCT3 ?? "-",
ResultAPR4 = d.ResultAPR4 ?? "-",
ResultOCT4 = d.ResultOCT4 ?? "-",
ResultAPR5 = d.ResultAPR5 ?? "-",
ResultOCT5 = d.ResultOCT5 ?? "-",
Remark = d.Reason ?? "-"
});
}
return resultList;
}
//noti ยื่นเสนอคน
public async Task NotifyInsignia()
{
@ -1095,7 +1575,53 @@ namespace BMA.EHR.Application.Repositories.Reports
}
}
public void CalculateInsigniaRequestBkkByType(string type = "officer")
{
CalInsigniaRequestBkkByType(type).GetAwaiter().GetResult();
}
//คำนวนผู้ได้รับเครื่องราชฯ
public async Task CalInsigniaRequestBkkByType(string type = "officer")
{
var insigniaPeriods = await _dbContext.Set<InsigniaPeriod>()
.Include(x => x.InsigniaRequests)
.AsQueryable()
.ToListAsync();
insigniaPeriods = insigniaPeriods
.Where(x => x.StartDate <= DateTime.Now.Date && x.InsigniaRequests.Where(x => x.ProfileType!.ToLower().Trim() == type.Trim().ToLower()).Count() == 0).ToList();
foreach (var insigniaPeriod in insigniaPeriods)
{
var organizations = await _userProfileRepository.GetActiveRootLatestAsync(AccessToken);
if (organizations == null)
continue;
insigniaPeriod.RevisionId = Guid.Parse(organizations[0].OrgRevisionId);
foreach (var organization in organizations)
{
if (organization == null)
continue;
var result = await _repositoryInsignia.GetInsigniaRequestByTypeAsync(insigniaPeriod.Id, organization.Id, type);
if (result != null)
{
Guid period = result.PeriodId;
string requestStatus = result.RequestStatus;
var candidate = await _repositoryInsignia.GetInsigniaCandidateBKKByTypeAsync(insigniaPeriod.Id, organization.Id, type);
// ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
if (requestStatus == null)
{
// บันทึกรายชื่อ
if (candidate != null)
await _repositoryInsignia.InsertCandidate(period, organization.Id, organization.OrgRootName, candidate, type);
}
}
}
}
}
public async Task CalInsignaiRequestBkk()
{
var insigniaPeriods = await _dbContext.Set<InsigniaPeriod>()
@ -1136,6 +1662,226 @@ namespace BMA.EHR.Application.Repositories.Reports
}
}
}
public async Task<dynamic> GetKhr5TotalReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaNote>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insigniaQuery = _dbContext.Set<InsigniaNoteProfile>()
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.Where(x => x.InsigniaNote.Id == period.Id)
// .Where(x => x.IsApprove == true)
.Where(x => x.Status == "DONE")
.Where(x => x.RequestInsignia.InsigniaType != null);
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery.Select(x => new
{
Gendor = x.Gender ?? "",
InsigniaTypeName = x.RequestInsignia.InsigniaType.Name,
RequestInsigniaName = x.RequestInsignia.Name,
InsigniaInitial = $"{x.RequestInsignia.Name}({x.RequestInsignia.ShortName})", // Insignia's full name and short name
OcId = x.Root
}).ToListAsync();
var insignia = (from r in data
group r by new { OcId = r.OcId, r.InsigniaTypeName, r.RequestInsigniaName } into g
select new
{
RowNo = 1,
DepartmentName = g.Key.OcId,
InsigniaTypeName = g.Key.InsigniaTypeName,
RequestInsigniaName = g.Key.RequestInsigniaName,
Male = g.Sum(x => x.Gendor == "ชาย" ? 1 : 0),
Female = g.Sum(x => x.Gendor == "หญิง" ? 1 : 0),
Remark = "",
}).ToList();
return insignia;
}
public async Task<dynamic> GetKhr6TotalReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaNote>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insigniaQuery = _dbContext.Set<InsigniaNoteProfile>()
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.Where(x => x.InsigniaNote.Id == period.Id)
// .Where(x => x.IsApprove == true)
.Where(x => x.Status == "DONE")
.Where(x => x.RequestInsignia.InsigniaType != null);
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery.Select(x => new
{
Gendor = x.Gender ?? "",
InsigniaTypeName = x.RequestInsignia.InsigniaType.Name,
RequestInsigniaName = x.RequestInsignia.Name,
IsApprove = x.IsApprove,
InsigniaInitial = $"{x.RequestInsignia.Name}({x.RequestInsignia.ShortName})", // Insignia's full name and short name
DatePayment = x.DatePayment,
OcId = x.Root
}).ToListAsync();
var insignia = (from r in data
group r by new { OcId = r.OcId, r.InsigniaTypeName, r.RequestInsigniaName } into g
select new
{
RowNo = 1,
DepartmentName = g.Key.OcId,
InsigniaTypeName = g.Key.InsigniaTypeName,
RequestInsigniaName = g.Key.RequestInsigniaName,
/* Pending = g.Sum(x => x.IsApprove == false ? 1 : 0),
Done = g.Sum(x => x.IsApprove == true ? 1 : 0),*/
Pending = g.Sum(x => x.DatePayment == null ? 1 : 0),
Done = g.Sum(x => x.DatePayment != null ? 1 : 0),
Remark = "",
}).ToList();
return insignia;
}
public async Task<dynamic> GetKhr4TotalReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
{
var period = await _dbContext.Set<InsigniaNote>()
.FirstOrDefaultAsync(x => x.Id == id);
if (period == null)
throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
var data_insigniaQuery = _dbContext.Set<InsigniaNoteProfile>()
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.Where(x => x.InsigniaNote.Id == period.Id)
.Where(x => x.Status == "DONE")
.Where(x => x.RequestInsignia.InsigniaType != null);
if (type == "officer")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer");
}
else if (type == "employee")
{
data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee");
}
switch (node)
{
case 0:
data_insigniaQuery = data_insigniaQuery.Where(r => r.RootDnaId == nodeId);
break;
case 1:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child1DnaId == nodeId);
break;
case 2:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child2DnaId == nodeId);
break;
case 3:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child3DnaId == nodeId);
break;
case 4:
data_insigniaQuery = data_insigniaQuery.Where(r => r.Child4DnaId == nodeId);
break;
default:
break;
}
var data = await data_insigniaQuery.Select(x => new
{
CitizenId = x.CitizenId,
Prefix = x.Prefix,
FullName = $"{x.FirstName} {x.LastName}",
PosTypeName = x.PosTypeName,
PosLevelName = x.PosLevelName,
Position = x.Position,
Root = x.Root,
OrganizationOrganizationReceive = x.OrganizationOrganizationReceive,
OrganizationOrganizationSend = x.OrganizationOrganizationSend,
IsApprove = x.IsApprove == true ? "ได้รับ" : "ไม่ได้รับ",
RequestInsignia = x.RequestInsignia.Name,
Number = x.Number,
DatePayment = x.DatePayment,
}).ToListAsync();
return data;
}
#endregion
}
}

View file

@ -46,12 +46,12 @@ namespace BMA.EHR.Application.Repositories.Reports
#region 13
public async Task<object> GetProbationAssignAsync(Guid assign_id, string token)
{
var api_url = $"{_configuration["APIPROBATION"]}/assign?assign_id={assign_id}";
var api_url = $"{_configuration["APIPROBATION"]}/assign?assign_id={assign_id}&isReport=true";
ProbationAssignResponse probation_assign;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -82,6 +82,15 @@ namespace BMA.EHR.Application.Repositories.Reports
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace("&nbsp;", " ").ToString().ToThaiNumber(),
}).ToList();
var competencyGroups = probation_assign.result.competency_groups.Select(x => new
{
name = string.IsNullOrEmpty(x.name) ? string.Empty : x.name.ToThaiNumber(),
level = string.IsNullOrEmpty(x.level) ? string.Empty : x.level.ToThaiNumber(),
description = string.IsNullOrEmpty(x.description)
? string.Empty
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace("&nbsp;", " ").ToString().ToThaiNumber(),
}).ToList();
var outputs = probation_assign.result.outputs.Select(x => new
{
id = string.IsNullOrEmpty(x.id.ToString()) ? string.Empty : x.id.ToString().ToThaiNumber(),
@ -89,11 +98,26 @@ namespace BMA.EHR.Application.Repositories.Reports
output_desc = string.IsNullOrEmpty(x.output_desc) ? string.Empty : x.output_desc.ToThaiNumber(),
}).ToList();
var skills = probation_assign.result.skills.Select(x => new
{
name = string.IsNullOrEmpty(x.title) ? string.Empty : x.title.ToThaiNumber(),
level = string.IsNullOrEmpty(x.level) ? string.Empty : x.level.ToThaiNumber(),
description = string.IsNullOrEmpty(x.description)
? string.Empty
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace("&nbsp;", " ").ToString().ToThaiNumber(),
}).ToList();
var laws = probation_assign.result.laws.Where(x => x.selected == true).Select((x, Index) => new
{
title = string.IsNullOrEmpty(x.description) ? string.Empty : $"{(Index + 1).ToString().ToThaiNumber()}. {x.description.ToThaiNumber()}",
}).ToList();
return new
{
Name = string.IsNullOrEmpty(probation_assign.result.profile.name) ? "-" : probation_assign.result.profile.name,
Position = string.IsNullOrEmpty(probation_assign.result.profile.Position) ? "-" : probation_assign.result.profile.Position,
PositionLevel = string.IsNullOrEmpty(probation_assign.result.profile.positionLevelName) ? "-" : probation_assign.result.profile.positionLevelName,
PositionAndLevel = string.IsNullOrEmpty(probation_assign.result.profile.PositionAndLevel) ? "-" : probation_assign.result.profile.PositionAndLevel,
Department = string.IsNullOrEmpty(probation_assign.result.profile.Department) ? "-" : probation_assign.result.profile.Department,
OrganizationOrganization = string.IsNullOrEmpty(probation_assign.result.profile.OrganizationOrganization) ? "-" : probation_assign.result.profile.OrganizationOrganization,
Oc = string.IsNullOrEmpty(probation_assign.result.profile.Oc) ? "-" : probation_assign.result.profile.Oc,
@ -111,7 +135,10 @@ namespace BMA.EHR.Application.Repositories.Reports
Jobs = jobs,
Knowledges = knowledges,
Competencys = competencys,
CompetencyGroups = competencyGroups,
Outputs = outputs,
Skills = skills,
Laws = laws,
OtherDesc = string.IsNullOrEmpty(probation_assign.result.assign.other_desc) ? "-" : probation_assign.result.assign.other_desc,
Other4Desc = string.IsNullOrEmpty(probation_assign.result.assign.other4_desc) ? "-" : probation_assign.result.assign.other4_desc,
Other5No1Desc = string.IsNullOrEmpty(probation_assign.result.assign.other5_no1_desc) ? "-" : probation_assign.result.assign.other5_no1_desc,
@ -134,7 +161,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -147,26 +174,8 @@ namespace BMA.EHR.Application.Repositories.Reports
var training_seminar = evaluate_record.result.evaluate.training_seminar == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
var other_training = evaluate_record.result.evaluate.other_training == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
var expects = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0
? new
{
col1 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col1 == "/" ? "✓" : string.Empty,
col2 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col2 == "/" ? "✓" : string.Empty,
col3 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col3 == "/" ? "✓" : string.Empty,
col4 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col4 == "/" ? "✓" : string.Empty,
col5 = evaluate_record.result.evaluate.achievements[0].evaluate_expect_level.col5 == "/" ? "✓" : string.Empty,
}
: null;
var outputs = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0
? new
{
col1 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col1 == "/" ? "✓" : string.Empty,
col2 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col2 == "/" ? "✓" : string.Empty,
col3 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col3 == "/" ? "✓" : string.Empty,
col4 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col4 == "/" ? "✓" : string.Empty,
col5 = evaluate_record.result.evaluate.achievements[0].evaluate_output_level.col5 == "/" ? "✓" : string.Empty,
}
: null;
var expects = evaluate_record?.result?.evaluate?.achievements?.evaluate_expect_level ?? null;
var outputs = evaluate_record?.result?.evaluate?.achievements?.evaluate_output_level ?? null;
var knows = evaluate_record.result.evaluate != null
? new
{
@ -365,6 +374,7 @@ namespace BMA.EHR.Application.Repositories.Reports
DirectorDated = string.IsNullOrEmpty(evaluate_record.result.evaluate.sign_dated.ToString()) ? "-" : evaluate_record.result.evaluate.sign_dated.ToThaiFullDate().ToString().ToThaiNumber(),
Name = string.IsNullOrEmpty(evaluate_record.result.experimentee.name) ? string.Empty : evaluate_record.result.experimentee.name,
Position = string.IsNullOrEmpty(evaluate_record.result.experimentee.Position) ? string.Empty : evaluate_record.result.experimentee.Position,
PositionLevel = string.IsNullOrEmpty(evaluate_record.result.experimentee.PositionLevelName) ? "-" : evaluate_record.result.experimentee.PositionLevelName,
Department = string.IsNullOrEmpty(evaluate_record.result.experimentee.Department) ? string.Empty : evaluate_record.result.experimentee.Department,
Organization = string.IsNullOrEmpty(evaluate_record.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_record.result.experimentee.OrganizationOrganization,
Oc = string.IsNullOrEmpty(evaluate_record.result.experimentee.Oc) ? string.Empty : evaluate_record.result.experimentee.Oc,
@ -375,13 +385,7 @@ namespace BMA.EHR.Application.Repositories.Reports
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_record.result.evaluate.date_finish.ToString()) ? string.Empty : evaluate_record.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
Role = evaluate_record.result.evaluate.role == "mentor" ? "ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ" : "ผู้บังคับบัญชา",
Expects = expects,
ExpectDesc = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0
? evaluate_record.result.evaluate.achievements[0].evaluate_expect_desc
: string.Empty,
Outputs = outputs,
OutputDesc = evaluate_record.result.evaluate != null && evaluate_record.result.evaluate.achievements.Count > 0
? evaluate_record.result.evaluate.achievements[0].evaluate_output_desc
: string.Empty,
AchievementOtherDesc = evaluate_record.result.evaluate.achievement_other_desc,
AchievementStrengthDesc = evaluate_record.result.evaluate.achievement_strength_desc,
AchievementImproveDesc = evaluate_record.result.evaluate.achievement_improve_desc,
@ -429,7 +433,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -592,6 +596,7 @@ namespace BMA.EHR.Application.Repositories.Reports
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name,
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
@ -637,7 +642,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -822,6 +827,7 @@ namespace BMA.EHR.Application.Repositories.Reports
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name,
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
@ -881,14 +887,14 @@ namespace BMA.EHR.Application.Repositories.Reports
#endregion
#region 18 ( )
public async Task<object> GetEvaluateResultAssignAsync(Guid id, string token)
public async Task<object> GetEvaluateResultAssignAsync(Guid id, int no, string token)
{
var api_url = $"{_configuration["APIPROBATION"]}/evaluate-result?assign_id={id}";
var api_url = $"{_configuration["APIPROBATION"]}/evaluate-result?assign_id={id}&evaluate_no={no}";
EvaluateResultAssignResponse evaluate_assign;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
@ -903,18 +909,18 @@ namespace BMA.EHR.Application.Repositories.Reports
var developComplete2 = evaluate_assign.result.evaluate.develop_complete == 0
? "🗹"
: "☐";
var passResult1 = evaluate_assign.result.evaluate.pass_result == 1
? "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็น ควรให้รับราชการต่อไป"
: "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็น ควรให้รับราชการต่อไป";
var passResult1 = evaluate_assign.result.evaluate.pass_result == 1 || evaluate_assign.result.evaluate.pass_result == 4
? no == 1 ? "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป"
: no == 1 ? "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป";
var passResult2 = evaluate_assign.result.evaluate.pass_result == 2
? "🗹 ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกราชการต่อไป"
: "☐ ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกราชการต่อไป";
? no == 1 ? "🗹 ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "🗹 ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ"
: no == 1 ? "☐ ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "☐ ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ";
var passResult3 = evaluate_assign.result.evaluate.pass_result == 3
? $"🗹 เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน"
: "☐ เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก.....เดือน";
var passResult = evaluate_assign.result.evaluate.pass_result == 1
? "เห็นควรให้รับราชการต่อไป"
var passResult = evaluate_assign.result.evaluate.pass_result == 1 || evaluate_assign.result.evaluate.pass_result == 4
? no == 1 ? "เห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "เห็นควรให้รับราชการต่อไป"
: evaluate_assign.result.evaluate.pass_result == 2
? "เห็นควรให้ออกจากราชการ"
: $"เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน";
@ -931,8 +937,9 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
@ -940,12 +947,12 @@ namespace BMA.EHR.Application.Repositories.Reports
ExpandMonth = expandMonth,
ChairmanName = string.IsNullOrEmpty(evaluate_assign.result.chairman.name) ? string.Empty : evaluate_assign.result.chairman.name,
ChairmanPosition = string.IsNullOrEmpty(evaluate_assign.result.chairman.Position) ? string.Empty : evaluate_assign.result.chairman.Position,
ChairmanDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.chairman_dated.ToThaiFullDate().ToString().ToThaiNumber(),
ChairmanDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate?.chairman_dated?.ToThaiFullDate().ToString().ToThaiNumber(),
CommanderName = string.IsNullOrEmpty(evaluate_assign.result.commander.name) ? string.Empty : evaluate_assign.result.commander.name,
CommanderPosition = string.IsNullOrEmpty(evaluate_assign.result.commander.Position) ? string.Empty : evaluate_assign.result.commander.Position,
CommanderDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director1_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.director1_dated.ToThaiFullDate().ToString().ToThaiNumber(),
CommanderPosition = string.IsNullOrEmpty(evaluate_assign.result.commander.position) ? string.Empty : evaluate_assign.result.commander.position,
CommanderDate = string.IsNullOrEmpty(evaluate_assign.result.commander.dated.ToString()) ? "-" : evaluate_assign.result.commander.dated?.ToThaiFullDate().ToString().ToThaiNumber(),
Name = evaluate_assign.result.experimentee.name,
RoundNo = evaluate_assign.result.assign.round_no.ToString().ToThaiNumber(),
RoundNo = no.ToString().ToThaiNumber(),
DateStart = evaluate_assign.result.assign.date_start != string.Empty ? dateStart_ : "-",
DateFinish = evaluate_assign.result.assign.date_finish != string.Empty ? dateFinish_ : "-",
Develop1 = developComplete1,

View file

@ -1,4 +1,5 @@
using System.Reflection.Metadata;
using System.Net.Http.Headers;
using System.Reflection.Metadata;
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Responses;
using BMA.EHR.Domain.Extensions;
@ -9,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
namespace BMA.EHR.Application.Repositories.Reports
@ -21,20 +23,23 @@ namespace BMA.EHR.Application.Repositories.Reports
private readonly IWebHostEnvironment _hostingEnvironment;
private readonly MinIOService _documentService;
private readonly OrganizationCommonRepository _organizationCommonRepository;
private readonly IConfiguration _configuration;
#endregion
#region " Constructor and Destructor "
public RetireReportRepository(IApplicationDBContext dbContext,
MinIOService documentService,
OrganizationCommonRepository organizationCommonRepository,
IWebHostEnvironment hostEnvironment)
MinIOService documentService,
OrganizationCommonRepository organizationCommonRepository,
IWebHostEnvironment hostEnvironment,
IConfiguration configuration)
{
_dbContext = dbContext;
_hostingEnvironment = hostEnvironment;
_organizationCommonRepository = organizationCommonRepository;
_documentService = documentService;
_configuration = configuration;
}
#endregion
@ -64,12 +69,43 @@ namespace BMA.EHR.Application.Repositories.Reports
//}
#region
public async Task<dynamic> GetProfileRetirementdAsync(Guid retireId)
public async Task<dynamic> GetProfileRetirementdAsync(Guid retireId, string token)
{
var retire = await _dbContext.Set<RetirementPeriod>()
.Include(x => x.RetirementProfiles)
.FirstOrDefaultAsync(x => x.Id == retireId);
// var retires = new List<dynamic>();
var apiUrl = $"{_configuration["API"]}/org/root/search/sort";
dynamic rootOrder = new List<string>();
dynamic child1Order = new List<string>();
dynamic child2Order = new List<string>();
dynamic child3Order = new List<string>();
dynamic child4Order = new List<string>();
dynamic posTypeNameOrder = new List<string>();
dynamic posLevelNameOrder = new List<string>();
dynamic hospital = new List<string>();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();
var org = JsonConvert.DeserializeObject<dynamic>(_result);
if (org != null && org.result != null)
{
rootOrder = org.result.root;
child1Order = org.result.child1;
child2Order = org.result.child2;
child3Order = org.result.child3;
child4Order = org.result.child4;
posTypeNameOrder = org.result.posTypeNameOrder;
posLevelNameOrder = org.result.posLevelNameOrder;
hospital = org.result.hospital;
}
}
if (retire == null)
{
var retireHistorys = await _dbContext.Set<RetirementPeriodHistory>().AsQueryable()
@ -121,20 +157,42 @@ namespace BMA.EHR.Application.Repositories.Reports
profiles = profiles.OrderBy(x => x.order).ToList();
}
var mapProfiles = new List<ProfileRetireJsonRequest>();
// string previousRoot = null;
// string previousPosTypeName = null;
// string previousPosLevelName = null;
if (profiles.Count > 0)
{
mapProfiles = profiles.Select((profile, index) => new ProfileRetireJsonRequest
mapProfiles = profiles
// .OrderBy(x => rootOrder.ToObject<List<string>>().IndexOf(x.root))
// .ThenBy(x => posTypeNameOrder.ToObject<List<string>>().IndexOf(x.posTypeName ?? ""))
// .ThenBy(x => posLevelNameOrder.ToObject<List<string>>().IndexOf(x.posLevelName ?? ""))
.Select((profile, index) =>
{
order = (index + 1).ToString().ToThaiNumber(),
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
root = profile.root,
position = profile.position != "" && profile.position != null ? profile.position : "-",
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
// bool isDuplicateRoot = profile.root == previousRoot;
// previousRoot = profile.root;
// bool isDuplicatePosType = profile.posTypeName == previousPosTypeName;
// previousPosTypeName = profile.posTypeName;
// bool isDuplicatePosLevel = profile.posLevelName == previousPosLevelName;
// previousPosLevelName = profile.posLevelName;
return new ProfileRetireJsonRequest
{
order = retireHistorys.TypeReport == null ? (index + 1).ToString().ToThaiNumber() : $"{(index + 1).ToString().ToThaiNumber()}. ลำดับที่ {(profile.order).ToString().ToThaiNumber()}",
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
root = "",
child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
(profile.child4 == null ? "" : profile.child4 + "\n") +
(profile.child3 == null ? "" : profile.child3 + "\n") +
(profile.child2 == null ? "" : profile.child2 + "\n") +
(profile.child1 == null ? "" : profile.child1 + "\n") +
(profile.reason == null ? "" : profile.reason),
position = profile.position != "" && profile.position != null ? profile.position : "-",
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
};
}).ToList();
}
string SignDate = retireHistorys.SignDate != null ? DateTime.Parse(retireHistorys.SignDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "-";
return new { SignDate, retireHistorys.Detail, retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profiles = mapProfiles };
return new { SignDate, Detail = retireHistorys.Detail.ToThaiNumber(), retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profiles = mapProfiles };
}
}
else
@ -208,20 +266,67 @@ namespace BMA.EHR.Application.Repositories.Reports
// retires.Add(data);
// }
var mapProfiles = new List<ProfileRetireJsonRequest>();
string previousRoot = null;
string previousChild1 = null;
string previousPosTypeName = null;
string previousPosLevelName = null;
if (profile_retire.Count > 0)
{
mapProfiles = profile_retire.Select((profile, index) => new ProfileRetireJsonRequest
if (retire.TypeReport == null)
{
order = (index + 1).ToString().ToThaiNumber(),
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
root = profile.root,
position = profile.position != "" && profile.position != null ? profile.position : "-",
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
profile_retire = profile_retire
.OrderBy(x => string.IsNullOrEmpty(x.root) ? int.MaxValue : rootOrder.ToObject<List<string>>().IndexOf(x.root))
.ThenBy(x => child1Order.ToObject<List<string>>().IndexOf(x.child1 ?? ""))
.ThenBy(x => child2Order.ToObject<List<string>>().IndexOf(x.child2 ?? ""))
.ThenBy(x => child3Order.ToObject<List<string>>().IndexOf(x.child3 ?? ""))
.ThenBy(x => child4Order.ToObject<List<string>>().IndexOf(x.child4 ?? ""))
.ThenBy(x => posTypeNameOrder.ToObject<List<string>>().IndexOf(x.posTypeName ?? ""))
.ThenBy(x => posLevelNameOrder.ToObject<List<string>>().IndexOf(x.posLevelName ?? ""))
.ThenBy(x => x.posNo).ToList();
}
mapProfiles = profile_retire.Select((profile, index) =>
{
bool isDuplicateRoot = profile.root == previousRoot;
previousRoot = profile.root;
if (isDuplicateRoot == false)
{
previousChild1 = null;
previousPosTypeName = null;
previousPosLevelName = null;
}
bool isDuplicateHospital = profile.child1 == previousChild1;
previousChild1 = profile.child1;
if (isDuplicateHospital == false)
{
previousPosTypeName = null;
previousPosLevelName = null;
}
bool isDuplicatePosType = profile.posTypeName == previousPosTypeName;
previousPosTypeName = profile.posTypeName;
bool isDuplicatePosLevel = profile.posLevelName == previousPosLevelName;
previousPosLevelName = profile.posLevelName;
return new ProfileRetireJsonRequest
{
order = retire.TypeReport == null ? (index + 1).ToString().ToThaiNumber() : $"{(index + 1).ToString().ToThaiNumber()}. ลำดับที่ {(profile.order).ToString().ToThaiNumber()}",
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
root = (isDuplicateRoot ? "" : profile.root + "\n") +
(isDuplicateHospital || !hospital.ToObject<List<string>>().Contains(profile.child1) ? "" : profile.child1 + "\n") +
(isDuplicatePosType ? "" : $"ตำแหน่งประเภท{profile.posTypeName}" + "\n") +
(isDuplicatePosLevel ? "" : $"ระดับ{profile.posLevelName}").ToThaiNumber(),
child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
(profile.child4 == null ? "" : profile.child4 + "\n") +
(profile.child3 == null ? "" : profile.child3 + "\n") +
(profile.child2 == null ? "" : profile.child2 + "\n") +
(profile.child1 == null || hospital.ToObject<List<string>>().Contains(profile.child1) ? "" : profile.child1 + "\n") +
(profile.reason == null ? "" : profile.reason),
position = profile.position != "" && profile.position != null ? profile.position : "-",
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
};
}).ToList();
}
string SignDate = retire.SignDate != null ? DateTime.Parse(retire.SignDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "-";
return new { SignDate, retire.Detail, retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profiles = mapProfiles };
return new { SignDate, Detail = retire.Detail.ToThaiNumber(), retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profiles = mapProfiles };
}
}
#endregion
@ -251,24 +356,6 @@ namespace BMA.EHR.Application.Repositories.Reports
p.posMasterNo,
p.posLevelName,
p.posTypeName,
// ProfileId = p.Profile.Id,
// Prefix = p.Profile.Prefix == null ? null : p.Profile.Prefix.Name,
// PrefixId = p.Profile.Prefix == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Prefix.Id,
// p.Profile.FirstName,
// p.Profile.LastName,
// Position = p.Profile.Position == null ? null : p.Profile.Position.Name,
// PositionId = p.Profile.Position == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Position.Id,
// PositionType = p.Profile.PositionType == null ? null : p.Profile.PositionType.Name,
// PositionTypeId = p.Profile.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionType.Id,
// p.Profile.PositionLine,
// p.Profile.PositionLineId,
// PositionLevel = p.Profile.PositionLevel == null ? null : p.Profile.PositionLevel.Name,
// PositionLevelId = p.Profile.PositionLevel == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionLevel.Id,
// p.Profile.PositionExecutive,
// p.Profile.PositionExecutiveId,
// Organization = p.Profile.Oc,
// OrganizationId = p.Profile.OcId,
p.position,
p.Number,
p.Date,
@ -397,6 +484,8 @@ namespace BMA.EHR.Application.Repositories.Reports
p.SendDate,
p.ActiveDate,
p.Reason,
p.ReasonResign,
p.Remark,
p.Status,
salary = p.AmountOld,
p.ApproveReason,
@ -416,11 +505,168 @@ namespace BMA.EHR.Application.Repositories.Reports
p.CommanderRejectReason,
p.CommanderRejectDate,
p.RemarkHorizontal,
Type = "OFFICER"
})
.FirstOrDefaultAsync();
if (data == null)
data = await _dbContext.Set<RetirementResignEmployee>().AsQueryable()
.Where(x => x.Id == id)
.Select(p => new
{
p.Id,
p.prefix,
p.firstName,
p.lastName,
p.profileId,
p.Location,
p.SendDate,
p.ActiveDate,
p.Reason,
p.ReasonResign,
p.Remark,
p.Status,
salary = p.AmountOld,
p.ApproveReason,
p.RejectReason,
p.IsActive,
p.CreatedAt,
p.PositionTypeOld,
p.PositionLevelOld,
p.PositionNumberOld,
p.OrganizationPositionOld,
p.OligarchReject,
p.OligarchApproveReason,
p.OligarchRejectReason,
p.OligarchRejectDate,
p.CommanderReject,
p.CommanderApproveReason,
p.CommanderRejectReason,
p.CommanderRejectDate,
p.RemarkHorizontal,
Type = "EMPLOYEE",
})
.FirstOrDefaultAsync();
if (data == null)
return null;
var approverPositionExecutiveName = "...............";
var approverStatus = "☐ อนุญาต";
var approverRejectStatus = "☐ ยับยั้งการลาออกไว้จนถึงวันที่...................";
var approver = "...................";
var approverPosition = "...................";
var diffDate = "☐ ไม่น้อยกว่า ๓๐ วัน ☐ น้อยกว่า ๓๐ วัน";
if (data.SendDate.HasValue && data.ActiveDate.HasValue)
{
var time = data.ActiveDate.Value - data.SendDate.Value;
var day = time.TotalDays;
if (day < 30)
{
diffDate = "☐ ไม่น้อยกว่า ๓๐ วัน ☑ น้อยกว่า ๓๐ วัน";
}
else
{
diffDate = "☑ ไม่น้อยกว่า ๓๐ วัน ☐ น้อยกว่า ๓๐ วัน";
}
}
var commanderDateUpdate = "วันที่...................";
var commanderStatus = "☐ อนุญาต ตั้งแต่วันที่...................";
var commanderCommentApprove = "...................";
var commanderRejectStatus = "☐ ยับยั้งการลาออกไว้จนถึงวันที่...................";
var commanderCommentReject = "...................";
var commander = "...................";
var commanderPosition = "...................";
if (data.Type == "OFFICER")
{
var Approver = _dbContext.Set<RetirementResignApprover>()
.Where(x => x.RetirementResign.Id == data.Id && x.ApproveType == "APPROVER")
.ToList();
var Commander = _dbContext.Set<RetirementResignApprover>()
.Where(x => x.RetirementResign.Id == data.Id && x.ApproveType == "COMMANDER")
.OrderByDescending(x => x.Seq)
.ToList();
if (Approver.Count > 0)
{
approverPositionExecutiveName = Approver[0].PositionExecutiveName;
approverStatus = Approver[0].ApproveStatus == "APPROVE" ? "☑ อนุญาต" : approverStatus;
approverRejectStatus = Approver[0].ApproveStatus == "REJECT"
? $"☑ ยับยั้งการลาออกไว้จนถึง{(Approver[0].RejectDate != null ? DateTime.Parse(Approver[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: approverRejectStatus;
approver = $"{Approver[0].Prefix}{Approver[0].FirstName} {Approver[0].LastName}";
approverPosition = Approver[0].PositionName;
}
if (Commander.Count > 0)
{
commanderDateUpdate = Commander.Count > 1
? Commander[1].LastUpdatedAt != null
? DateTime.Parse(Commander[1].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber()
: commanderDateUpdate
: Commander[0].LastUpdatedAt != null
? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber()
: commanderDateUpdate;
commanderStatus = Commander[0].ApproveStatus == "APPROVE"
? $"☑ อนุญาต ตั้งแต่{(Commander[0].LastUpdatedAt != null ? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: commanderStatus;
commanderCommentApprove = Commander[0].ApproveStatus == "APPROVE"
? !string.IsNullOrWhiteSpace(Commander[0].Comment) ? Commander[0].Comment : commanderCommentApprove
: commanderCommentApprove;
commanderRejectStatus = Commander[0].ApproveStatus == "REJECT"
? $"☑ ยับยั้งการลาออกไว้จนถึง{(Commander[0].RejectDate != null ? DateTime.Parse(Commander[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: approverRejectStatus;
commanderCommentReject = Commander[0].ApproveStatus == "REJECT"
? !string.IsNullOrWhiteSpace(Commander[0].Comment) ? Commander[0].Comment : commanderCommentReject
: commanderCommentReject;
commander = $"{Commander[0].Prefix}{Commander[0].FirstName} {Commander[0].LastName}";
commanderPosition = Commander[0].PositionName;
}
}
else
{
var EmpApproves = _dbContext.Set<RetirementResignEmployeeApprover>()
.Where(x => x.RetirementResignEmployee.Id == data.Id && x.ApproveType == "APPROVER")
.ToList();
var EmpCommander = _dbContext.Set<RetirementResignEmployeeApprover>()
.Where(x => x.RetirementResignEmployee.Id == data.Id && x.ApproveType == "COMMANDER")
.OrderByDescending(x => x.Seq)
.ToList();
if (EmpApproves.Count > 0)
{
approverPositionExecutiveName = EmpApproves[0].PositionExecutiveName;
approverStatus = EmpApproves[0].ApproveStatus == "APPROVE" ? "☑ อนุญาต" : approverStatus;
approverRejectStatus = EmpApproves[0].ApproveStatus == "REJECT"
? $"☑ ยับยั้งการลาออกไว้จนถึง{(EmpApproves[0].RejectDate != null ? DateTime.Parse(EmpApproves[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: approverRejectStatus;
approver = $"{EmpApproves[0].Prefix}{EmpApproves[0].FirstName} {EmpApproves[0].LastName}";
approverPosition = EmpApproves[0].PositionName;
}
if (EmpCommander.Count > 0)
{
commanderDateUpdate = EmpCommander.Count > 1
? EmpCommander[1].LastUpdatedAt != null
? DateTime.Parse(EmpCommander[1].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber()
: commanderDateUpdate
: EmpCommander[0].LastUpdatedAt != null
? DateTime.Parse(EmpCommander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber()
: commanderDateUpdate;
commanderStatus = EmpCommander[0].ApproveStatus == "APPROVE"
? $"☑ อนุญาต ตั้งแต่{(EmpCommander[0].LastUpdatedAt != null ? DateTime.Parse(EmpCommander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: commanderStatus;
commanderCommentApprove = EmpCommander[0].ApproveStatus == "APPROVE"
? !string.IsNullOrWhiteSpace(EmpCommander[0].Comment) ? EmpCommander[0].Comment : commanderCommentApprove
: commanderCommentApprove;
commanderRejectStatus = EmpCommander[0].ApproveStatus == "REJECT"
? $"☑ ยับยั้งการลาออกไว้จนถึง{(EmpCommander[0].RejectDate != null ? DateTime.Parse(EmpCommander[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: approverRejectStatus;
commanderCommentReject = EmpCommander[0].ApproveStatus == "REJECT"
? !string.IsNullOrWhiteSpace(EmpCommander[0].Comment) ? EmpCommander[0].Comment : commanderCommentReject
: commanderCommentReject;
commander = $"{EmpCommander[0].Prefix}{EmpCommander[0].FirstName} {EmpCommander[0].LastName}";
commanderPosition = EmpCommander[0].PositionName;
}
}
var _data = new
{
data.Id,
@ -428,11 +674,14 @@ namespace BMA.EHR.Application.Repositories.Reports
data.prefix,
data.firstName,
data.lastName,
data.Location,
Location = string.IsNullOrEmpty(data.Location) ? string.Empty : data.Location.ToThaiNumber(),
FullName = $"{data.prefix}{data.firstName} {data.lastName}",
SendDate = string.IsNullOrEmpty(data.SendDate.ToString()) ? string.Empty : DateTime.Parse(data.SendDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
ActiveDate = string.IsNullOrEmpty(data.ActiveDate.ToString()) ? string.Empty : DateTime.Parse(data.ActiveDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
data.Reason,
data.ReasonResign,
data.Remark,
ReasonRemark = data.Reason == "OTHER" ? string.IsNullOrEmpty(data.Remark) ? data.ReasonResign : $"{data.ReasonResign}({data.Remark})" : data.ReasonResign,
data.Status,
data.salary,
data.PositionTypeOld,
@ -452,6 +701,19 @@ namespace BMA.EHR.Application.Repositories.Reports
data.CommanderRejectReason,
CommanderRejectDate = string.IsNullOrEmpty(data.CommanderRejectDate.ToString()) ? string.Empty : DateTime.Parse(data.CommanderRejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
data.RemarkHorizontal,
dear = approverPositionExecutiveName,
approverStatus,
approverRejectStatus,
approver,
approverPosition,
diffDate,
commanderDateUpdate,
commanderStatus,
commanderCommentApprove,
commanderRejectStatus,
commanderCommentReject,
commander,
commanderPosition
};
return _data;

View file

@ -37,7 +37,8 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
//CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Name = $"{data.prefix}{data.firstName} {data.lastName}",
};
}
@ -52,7 +53,7 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
Name = $"{data.prefix}{data.firstName} {data.lastName}",
};
@ -67,7 +68,7 @@ namespace BMA.EHR.Application.Repositories.Reports
.FirstOrDefaultAsync();
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Subject = $"ข้าราชการขอโอน",
Name = $"{data.prefix}{data.firstName} {data.lastName}",
Location = $"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร ๑๗๓ ถนนดินสอ กทม. ๑๐๒๐๐",
@ -84,7 +85,7 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
Subject2 = $"ตรวจสอบหนี้สิน และภาระผูกพันกับกรุงเทพมหานครของข้าราชการ",
Subject3 = $"ตรวจสอบหนี้สินและภาระผูกพันของข้าราชการ",
@ -105,7 +106,7 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
Subject2 = $"ตรวจสอบพฤติการณ์ทางวินัย และภาระหนี้สิน (เงินกู้สวัสดิการข้าราชการ) ของข้าราชการ",
Subject3 = $"ตรวจสอบภาระผูกพันกับกรุงเทพมหานครเกี่ยวกับการลาศึกษา อบรม ของข้าราชการ",
@ -126,7 +127,7 @@ namespace BMA.EHR.Application.Repositories.Reports
return new
{
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate2().ToString().ToThaiNumber(),
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
Subject2 = $"ตรวจสอบพฤติการณ์ทางวินัย และภาระหนี้สิน (เงินกู้สวัสดิการข้าราชการ) ของข้าราชการ",
Subject3 = $"ตรวจสอบภาระผูกพันกับกรุงเทพมหานครเกี่ยวกับการลาศึกษา อบรม ของข้าราชการ",

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,16 @@
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories.MessageQueue;
using BMA.EHR.Domain.Models.Notifications;
using BMA.EHR.Domain.Models.Retirement;
using BMA.EHR.Domain.Shared;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Security.Claims;
using System.Text;
namespace BMA.EHR.Application.Repositories
{
@ -11,15 +19,28 @@ namespace BMA.EHR.Application.Repositories
private readonly IApplicationDBContext _dbContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly NotificationRepository _repositoryNoti;
private readonly IConfiguration _configuration;
private readonly string URL = string.Empty;
public RetirementRepository(IApplicationDBContext dbContext,
NotificationRepository repositoryNoti,
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
IHttpContextAccessor httpContextAccessor,
UserProfileRepository userProfileRepository,
IConfiguration configuration) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_httpContextAccessor = httpContextAccessor;
_repositoryNoti = repositoryNoti;
_configuration = configuration;
URL = _configuration["VITE_URL_MGT"];
}
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
#endregion
//ปลดออก
public async Task NotifyDischarge()
{
@ -34,11 +55,6 @@ namespace BMA.EHR.Application.Repositories
cronjobNoti.Profile.IsLeave = true;
cronjobNoti.Profile.LeaveReason = "DISCHARGE";
cronjobNoti.Profile.LeaveDate = DateTime.Now;
// await _repositoryNoti.PushNotificationAsync(
// Guid.Parse("08db721d-ada0-4e64-89d3-7584a893d8b8"),
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}",
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}"
// );
}
await _dbContext.SaveChangesAsync();
}
@ -57,11 +73,6 @@ namespace BMA.EHR.Application.Repositories
cronjobNoti.Profile.IsLeave = true;
cronjobNoti.Profile.LeaveReason = "DISMISS";
cronjobNoti.Profile.LeaveDate = DateTime.Now;
// await _repositoryNoti.PushNotificationAsync(
// Guid.Parse("08db721d-ada0-4e64-89d3-7584a893d8b8"),
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}",
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}"
// );
}
await _dbContext.SaveChangesAsync();
}
@ -75,18 +86,839 @@ namespace BMA.EHR.Application.Repositories
.Where(x => x.Date != null && x.Date.Value.Date == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
//cronjobNoti.Profile.IsLeave = true;
//cronjobNoti.Profile.LeaveReason = "LAYOFF";
//cronjobNoti.Profile.LeaveDate = DateTime.Now;
// await _repositoryNoti.PushNotificationAsync(
// Guid.Parse("08db721d-ada0-4e64-89d3-7584a893d8b8"),
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}",
// $"แจ้งเตือนการปลดออกของ {cronjobNoti.Profile.Prefix?.Name}{cronjobNoti.Profile.FirstName} {cronjobNoti.Profile.LastName}"
// );
}
await _dbContext.SaveChangesAsync();
}
public void TestMethod()
{
return;
}
public async Task<RetirementResign?> GetByIdAsync(Guid id)
{
try
{
var data = await _dbContext.Set<RetirementResign>().AsQueryable()
.Include(x => x.Approvers)
.FirstOrDefaultAsync(x => x.Id == id);
return data;
}
catch
{
throw;
}
}
public async Task OfficerApproveRetirementResign(Guid id)
{
var rawData = await GetByIdAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
rawData.Status = "PENDING";
if (rawData.ApproveStep == "st1")
{
rawData.ApproveStep = "st2";
}
else if (rawData.ApproveStep == "st3")
{
rawData.ApproveStep = "st4";
// TODO: Send notification to 1st Approver
var _firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(_noti1);
}
// TODO: Send notification to 1st Commander
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
public async Task CommanderApproveRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st2")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "COMMANDER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "APPROVE";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
rawData.Status = "PENDING";
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "PENDING";
rawData.ApproveStep = "st3";
if (rawData.Group == "1.1")
{
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task CommanderRejectRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st2")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "COMMANDER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "REJECT";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti);
rawData.Status = "PENDING";
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "PENDING";
// rawData.LeaveComment = reason;
// if (rawData.Group != "1.1")
// {
rawData.ApproveStep = "st3";
// }
if (rawData.Group == "1.1")
{
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task ApproveRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st3")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "APPROVER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "APPROVE";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "APPROVE";
// rawData.LeaveDirectorComment = reason;
if (rawData.Group != "1.1")
{
rawData.ApproveStep = "st5";
}
else
{
rawData.ApproveStep = "st4";
}
if (rawData.profileId != null)
{
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณได้รับการอนุมัติ",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task RejectRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st3")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "APPROVER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "REJECT";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "REJECT";
if (rawData.Group != "1.1")
{
rawData.ApproveStep = "st5";
}
else
{
rawData.ApproveStep = "st4";
}
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
await _dbContext.SaveChangesAsync();
}
}
public async Task<RetirementResignCancel?> GetByIdCancelAsync(Guid id)
{
try
{
var data = await _dbContext.Set<RetirementResignCancel>().AsQueryable()
.Include(x => x.Approvers)
.FirstOrDefaultAsync(x => x.Id == id);
return data;
}
catch
{
throw;
}
}
public async Task OfficerApproveRetirementResignCancel(Guid id)
{
var rawData = await GetByIdCancelAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
rawData.Status = "PENDING";
if (rawData.ApproveStep == "st1")
{
rawData.ApproveStep = "st2";
}
else if (rawData.ApproveStep == "st3")
{
rawData.ApproveStep = "st4";
// TODO: Send notification to 1st Approver
var _firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(_noti1);
}
// TODO: Send notification to 1st Commander
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
public async Task CommanderApproveRetirementResignCancel(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdCancelAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st2")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "COMMANDER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "APPROVE";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
rawData.Status = "PENDING";
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(noti);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "PENDING";
rawData.ApproveStep = "st3";
if (rawData.Group == "1.1")
{
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task CommanderRejectRetirementResignCancel(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdCancelAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st2")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "COMMANDER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "REJECT";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(noti);
rawData.Status = "PENDING";
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "PENDING";
// rawData.LeaveComment = reason;
// if (rawData.Group != "1.1")
// {
rawData.ApproveStep = "st3";
// }
if (rawData.Group == "1.1")
{
// TODO: Send notification to 1st Approver
var firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail-reject/{rawData.Id}",
};
_dbContext.Set<Notification>().Add(noti1);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task ApproveRetirementResignCancel(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdCancelAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st3")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "APPROVER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "APPROVE";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "APPROVE";
// rawData.LeaveDirectorComment = reason;
if (rawData.Group != "1.1")
{
rawData.ApproveStep = "st5";
}
else
{
rawData.ApproveStep = "st4";
}
if (rawData.profileId != null)
{
// Send Noti
var noti = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณได้รับการอนุมัติ",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
}
await _dbContext.SaveChangesAsync();
}
}
public async Task RejectRetirementResignCancel(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
var rawData = await GetByIdCancelAsync(id);
if (rawData == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
// if (rawData.ApproveStep != "st3")
// {
// throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
// }
// check commander approve
var approvers = rawData.Approvers.Where(x => x.ApproveType!.ToUpper() == "APPROVER").OrderBy(x => x.Seq).ToList();
var approver = approvers.FirstOrDefault(x => x.KeycloakId == userId);
if (approver == null)
{
throw new Exception("คุณไม่มีสิทธิ์อนุมัติการลาออกในขั้นตอนนี้");
}
// check prev approver มี action แล้วหรือไม่?
var prevApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq - 1);
if (prevApprover != null)
{
if (prevApprover.ApproveStatus == "PENDING")
{
throw new Exception("ไม่สามารถทำการอนุมัติได้ เนื่องจากยังอยู่ระหว่างการพิจารณาโดยผู้บังคับบัญชารายก่อนหน้า");
}
}
var maxSeq = approvers.Max(x => x.Seq);
approver.ApproveStatus = "REJECT";
approver.Comment = reason;
approver.RejectDate = date;
if (approver.Seq != maxSeq)
{
var nextApprover = approvers.FirstOrDefault(x => x.Seq == approver.Seq + 1);
// Send Noti
var noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti1);
await _dbContext.SaveChangesAsync();
}
else
{
rawData.Status = "REJECT";
if (rawData.Group != "1.1")
{
rawData.ApproveStep = "st5";
}
else
{
rawData.ApproveStep = "st4";
}
// Send Noti
var noti = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
await _dbContext.SaveChangesAsync();
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Application.Requests
{
public class DirectorRequest
{
public DirectorRequestData[] result { get; set; }
}
public class DirectorRequestData
{
public string id { get; set; }
}
}

View file

@ -9,4 +9,18 @@ namespace BMA.EHR.Application.Requests
public Guid? BorrowOrganizationId { get; set; }
public Guid InsigniaNoteProfileId { get; set; }
}
public class InsigniaReclaimRequest
{
public DateTime ReclaimDate { get; set; }
public Guid InsigniaNoteProfileId { get; set; }
public string? ReclaimNote { get; set; }
}
public class UpdateInsigniaReclaimRequest
{
public DateTime ReclaimDate { get; set; }
public string? ReclaimNote { get; set; }
}
}

View file

@ -16,6 +16,7 @@ namespace BMA.EHR.Application.Requests
public int Amount { get; set; }
public int Round { get; set; }
public string[] EmpPosId { get; set; }
public FormFile? File { get; set; }
}
}

View file

@ -23,6 +23,7 @@
public bool? MarkDiscipline { get; set; }
public bool? MarkLeave { get; set; }
public bool? MarkRate { get; set; }
public bool? MarkInsignia { get; set; }
public List<InsigniaRequestDoc>? Docs { get; set; }
public List<MatchingCondition> MatchingConditions { get; set; } = new List<MatchingCondition>();

View file

@ -52,9 +52,30 @@ namespace BMA.EHR.Application.Requests
public double? Amount { get; set; }
public double? PositionSalaryAmount { get; set; }
public Guid? RootId { get; set; }
public Guid? RootDnaId { get; set; }
public string? Root { get; set; }
public Guid? Child1Id { get; set; }
public Guid? Child1DnaId { get; set; }
public string? Child1 { get; set; }
public Guid? Child2Id { get; set; }
public Guid? Child2DnaId { get; set; }
public string? Child2 { get; set; }
public Guid? Child3Id { get; set; }
public Guid? Child3DnaId { get; set; }
public string? Child3 { get; set; }
public Guid? Child4Id { get; set; }
public Guid? Child4DnaId { get; set; }
public string? Child4 { get; set; }
public List<MatchingCondition> MatchingConditions { get; set; } = new List<MatchingCondition>();
public bool? MarkDiscipline { get; set; } = false;
public bool? MarkLeave { get; set; } = false;
public bool? MarkRate { get; set; } = false;
public bool? MarkInsignia { get; set; } = false;
}
public class MatchingCondition

View file

@ -10,5 +10,9 @@
public string name { get; set; }
public string url { get; set; }
public bool? isReport { get; set; }
public bool? isTemplate { get; set; }
}
}

View file

@ -26,6 +26,8 @@ namespace BMA.EHR.Application.Responses
public string Position { get; set; } = string.Empty;
public string Department { get; set; } = string.Empty;
public string Oc { get; set; } = string.Empty;
public string PositionLevelName { get; set; } = string.Empty;
}
public class Commander

View file

@ -26,6 +26,7 @@ namespace BMA.EHR.Application.Responses
public string PositionLineId { get; set; } = string.Empty;
public string OrganizationOrganization { get; set; } = string.Empty;
public string Position { get; set; } = string.Empty;
public string PositionLevelName { get; set; } = string.Empty;
public string Department { get; set; } = string.Empty;
public string Oc { get; set; } = string.Empty;
}

View file

@ -26,6 +26,7 @@ namespace BMA.EHR.Application.Responses
public string Department { get; set; }
public string OrganizationOrganization { get; set; }
public string Oc { get; set; }
public string PositionLevelName { get; set; }
}
public class Director
@ -89,19 +90,20 @@ namespace BMA.EHR.Application.Responses
public string role { get; set; }
public DateTime createdAt { get; set; }
public DateTime updatedAt { get; set; }
public List<Achievement> achievements { get; set; }
public Achievement achievements { get; set; }
}
public class Achievement
{
public string evaluate_expect_desc { get; set; }
public EvaluateExpectLevel evaluate_expect_level { get; set; }
public string evaluate_output_desc { get; set; }
public EvaluateOutputLevel evaluate_output_level { get; set; }
// public string evaluate_expect_desc { get; set; }
public List<EvaluateExpectLevel> evaluate_expect_level { get; set; }
// public string evaluate_output_desc { get; set; }
public List<EvaluateOutputLevel> evaluate_output_level { get; set; }
}
public class EvaluateExpectLevel
{
public string? title { get; set; }
public string col1 { get; set; }
public string col2 { get; set; }
public string col3 { get; set; }
@ -111,6 +113,7 @@ namespace BMA.EHR.Application.Responses
public class EvaluateOutputLevel
{
public string? title { get; set; }
public string col1 { get; set; }
public string col2 { get; set; }
public string col3 { get; set; }

View file

@ -19,15 +19,19 @@ namespace BMA.EHR.Application.Responses
public class Commander
{
public string personal_id { get; set; }
// public string personal_id { get; set; }
public string name { get; set; }
public string PositionId { get; set; }
public string PositionLevelId { get; set; }
public string PositionLineId { get; set; }
public string Position { get; set; }
public string Department { get; set; }
public string OrganizationOrganization { get; set; }
public string Oc { get; set; }
// public string PositionId { get; set; }
// public string PositionLevelId { get; set; }
// public string PositionLineId { get; set; }
public string position { get; set; }
// public string Department { get; set; }
// public string OrganizationOrganization { get; set; }
// public string Oc { get; set; }
public DateTime? dated { get; set; }
public string posLevel { get; set; }
public string posType { get; set; }
}
public class Chairman
@ -64,6 +68,7 @@ namespace BMA.EHR.Application.Responses
public string PositionLevelId { get; set; }
public string PositionLineId { get; set; }
public string Position { get; set; }
public string PositionLevelName { get; set; }
public string Department { get; set; }
public string OrganizationOrganization { get; set; }
public string Oc { get; set; }
@ -99,9 +104,9 @@ namespace BMA.EHR.Application.Responses
public int pass_result { get; set; }
public int expand_month { get; set; }
public string reson { get; set; }
public DateTime chairman_dated { get; set; }
public DateTime director1_dated { get; set; }
public DateTime director2_dated { get; set; }
public DateTime? chairman_dated { get; set; }
public DateTime? director1_dated { get; set; }
public DateTime? director2_dated { get; set; }
public string createdAt { get; set; }
public string updatedAt { get; set; }
}

View file

@ -0,0 +1,33 @@
namespace BMA.EHR.Application.Responses.Insignias
{
public class PostProfileEmpInsigniaDto
{
public Guid profileEmployeeId { get; set; }
public int year { get; set; } = 0;
public string no { get; set; } = string.Empty;
public string volume { get; set; } = string.Empty;
public string section { get; set; } = string.Empty;
public string page { get; set; } = string.Empty;
public DateTime receiveDate { get; set; } = DateTime.MinValue;
public Guid insigniaId { get; set; }
public DateTime dateAnnounce { get; set; } = DateTime.MinValue;
public string issue { get; set; } = string.Empty;
public string volumeNo { get; set; } = string.Empty;
public DateTime? refCommandDate { get; set; }
public string refCommandNo { get; set; } = string.Empty;
public string note { get; set; } = string.Empty;
}
}

View file

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BMA.EHR.Domain.Shared;
using Newtonsoft.Json;
namespace BMA.EHR.Application.Responses.Leaves
{
public class GetPermissionWithActingDto
{
public string privilege {get; set;} = string.Empty;
public bool isAct {get; set;} = false;
public List<ActingPermission> posMasterActs {get; set;} = new();
}
public class ActingPermission
{
public string posNo {get; set;} = string.Empty;
//public string? privilege {get; set;} = "PARENT";
[JsonConverter(typeof(PrivilegeConverter))]
public string privilege {get; set;} = "CHILD";
public Guid? rootDnaId {get; set;}
public Guid? child1DnaId {get; set;}
public Guid? child2DnaId {get; set;}
public Guid? child3DnaId {get; set;}
public Guid? child4DnaId {get; set;}
}
public class GetPermissionWithActingResultDto
{
public int status {get; set;} = 0;
public string message {get; set;} = string.Empty;
public GetPermissionWithActingDto result {get; set;} = new();
}
}

View file

@ -0,0 +1,56 @@
namespace BMA.EHR.Application.Responses.Leaves
{
public class GetProfileLeaveByKeycloakDto
{
public string ProfileType { get; set; }
public string Prefix { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CitizenId { get; set; }
public DateTime BirthDate { get; set; }
public DateTime RetireDate { get; set; }
public string GovAge { get; set; } = string.Empty;
public string Age { get; set; } = string.Empty;
public DateTime DateAppoint { get; set; }
public DateTime DateCurrent { get; set; }
public int? Amount { get; set; } = 0;
public string? TelephoneNumber { get; set; } = string.Empty;
public string Position { get; set; } = string.Empty;
public string PosLevel { get; set; } = string.Empty;
public string PosType { get; set; } = string.Empty;
public string? PositionLeaveName { get; set; }
public string? PosExecutiveName { get; set; }
public string CurrentAddress { get; set; } = string.Empty;
public string Oc { get; set; } = string.Empty;
public bool isCommission { get; set; } = false;
public string Root { get; set; } = string.Empty;
public string? Child1 { get; set; }
public string? Child2 { get; set; }
public string? Child3 { get; set; }
public string? Child4 { get; set; }
public List<ProfileLeavePosition> Positions { get; set; } = new();
public List<ProfileLeaveEducation> Educations { get; set; } = new();
}
public class ProfileLeavePosition
{
public string? PositionName { get; set; } = string.Empty;
public DateTime DateStart { get; set; }
public DateTime DateEnd { get; set; }
public string? PositionType { get; set; } = string.Empty;
public string? PositionLevel { get; set; } = string.Empty;
public string? OrgRoot { get; set; } = string.Empty;
public string? OrgChild1 { get; set; } = string.Empty;
public string? OrgChild2 { get; set; } = string.Empty;
public string? OrgChild3 { get; set; } = string.Empty;
public string? OrgChild4 { get; set; } = string.Empty;
}
public class ProfileLeaveEducation
{
public string EducationLevel { get; set; } = string.Empty;
public string Institute { get; set; } = string.Empty;
public string? Country { get; set; } = string.Empty;
public DateTime? FinishDate { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace BMA.EHR.Application.Responses.Leaves
{
public class GetProfileLeaveByKeycloakResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public GetProfileLeaveByKeycloakDto? Result { get; set; }
}
}

View file

@ -8,6 +8,8 @@
public string LeaveTypeCode { get; set; } = string.Empty;
public double SumLeaveDay { get; set; }
public double SumLeaveDay { get; set; } = 0.0;
public int CountLeaveDay { get; set; } = 0;
}
}

View file

@ -37,5 +37,11 @@ namespace BMA.EHR.Application.Responses.Organizations
public string? Child4 { get; set; }
public string? Child4ShortName { get; set; }
public Guid? RootDnaId { get; set; }
public Guid? Child1DnaId { get; set; }
public Guid? Child2DnaId { get; set; }
public Guid? Child3DnaId { get; set; }
public Guid? Child4DnaId { get; set; }
}
}

View file

@ -14,7 +14,10 @@
public List<Job> jobs { get; set; }
public List<Knowledge> knowledges { get; set; }
public List<Competency> competencys { get; set; }
public List<Competency> competency_groups { get; set; }
public List<Output> outputs { get; set; }
public List<Law> laws { get; set; }
public List<Skill> skills { get; set; }
}
public class Profile
@ -28,6 +31,8 @@
public string Position { get; set; } = string.Empty;
public string Department { get; set; } = string.Empty;
public string Oc { get; set; } = string.Empty;
public string positionLevelName { get; set; } = string.Empty;
public string PositionAndLevel { get; set; } = string.Empty;
}
public class Assign
@ -72,6 +77,21 @@
public string description { get; set; } = string.Empty;
}
public class Skill
{
public int id { get; set; }
public string level { get; set; } = string.Empty;
public string title { get; set; } = string.Empty;
public string description { get; set; } = string.Empty;
}
public class Law
{
public int id { get; set; }
public string description { get; set; } = string.Empty;
public bool selected { get; set; }
}
public class Competency
{
public string id { get; set; } = string.Empty;

View file

@ -8,6 +8,7 @@
public string? posNo { get; set; }
public string? root { get; set; }
public string? reason { get; set; }
public string? child { get; set; }
}
}

View file

@ -8,4 +8,12 @@
public List<GetProfileByKeycloakIdRootDto> Result { get; set; } = new();
}
public class GetListProfileByKeycloakIdRootResultAddTotalDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public GetProfileByKeycloakIdRootAddTotalDto Result { get; set; } = new();
}
}

View file

@ -0,0 +1,23 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetMarkStatusDto
{
public Guid Id { get; set; }
public bool? MarkDiscipline { get; set; } = false;
public bool? MarkLeave { get; set; } = false;
public bool? MarkRate { get; set; } = false;
public bool? MarkInsignia { get; set; } = false;
public string? APR1 { get; set; }
public string? APR2 { get; set; }
public string? APR3 { get; set; }
public string? APR4 { get; set; }
public string? APR5 { get; set; }
public string? OCT1 { get; set; }
public string? OCT2 { get; set; }
public string? OCT3 { get; set; }
public string? OCT4 { get; set; }
public string? OCT5 { get; set; }
}
}

View file

@ -0,0 +1,12 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetMarkStatusResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public List<GetMarkStatusDto> Result { get; set; } = new();
}
}

View file

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetOcStaff
{
public Guid ProfileId { get; set; }
public Guid Keycloak { get; set; }
public string FullName { get; set; } = null!;
public Guid? RootId { get; set; }
public Guid? OrgChild1Id { get; set; }
public Guid? OrgChild2Id { get; set; }
public Guid? OrgChild3Id { get; set; }
public Guid? OrgChild4Id { get; set; }
public Guid? RootDnaId { get; set; }
public Guid? Child1DnaId { get; set; }
public Guid? Child2DnaId { get; set; }
public Guid? Child3DnaId { get; set; }
public Guid? Child4DnaId { get; set; }
}
public class GetOcStaffResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public List<GetOcStaff> Result { get; set; } = new();
}
}

View file

@ -0,0 +1,11 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetOrgProfileByProfileIdDto
{
public string? Root { get; set; }
public string? Child1 { get; set; }
public string? Child2 { get; set; }
public string? Child3 { get; set; }
public string? Child4 { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetOrgProfileByProfileIdResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public GetOrgProfileByProfileIdDto? Result { get; set; }
}
}

View file

@ -44,6 +44,8 @@ namespace BMA.EHR.Application.Responses.Profiles
public string? ProfileType { get; set; }
public bool? IsLeave { get; set; }
public bool? IsProbation { get; set; }
public string? Root { get; set; }
public string? Child1 { get; set; }
public string? Child2 { get; set; }
@ -54,10 +56,37 @@ namespace BMA.EHR.Application.Responses.Profiles
public Guid? Child2Id { get; set; }
public Guid? Child3Id { get; set; }
public Guid? Child4Id { get; set; }
public Guid? RootDnaId { get; set; }
public Guid? Child1DnaId { get; set; }
public Guid? Child2DnaId { get; set; }
public Guid? Child3DnaId { get; set; }
public Guid? Child4DnaId { get; set; }
public double? Amount { get; set; }
public double? PositionSalaryAmount { get; set; }
public string? Commander { get; set; }
public Guid? CommanderId { get; set; }
public Guid? CommanderKeycloak { get; set; }
public string? TelephoneNumber { get; set; }
public string? CurrentAddress { get; set; }
public string? CurrentSubDistrict { get; set; }
public string? CurrentDistrict { get; set; }
public string? CurrentProvince { get; set; }
public string? CurrentZipCode { get; set; }
public string? PositionLeaveName { get; set; }
public string? PosExecutiveName { get; set; }
public string? CommanderPositionName { get; set; } = string.Empty;
}
public class PosLevel

View file

@ -9,10 +9,34 @@ namespace BMA.EHR.Application.Responses.Profiles
public string? Prefix { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? CitizenId { get; set; }
public Guid? Keycloak { get; set; }
public string? PosNo { get; set; }
public string? Position { get; set; }
public string? PositionLevel { get; set; }
public string? PositionType { get; set; }
public string? Oc { get; set; }
public string? OrgRootId { get; set; }
public string? OrgChild1Id { get; set; }
public string? OrgChild2Id { get; set; }
public string? OrgChild3Id { get; set; }
public string? OrgChild4Id { get; set; }
public DateTime? DateStart { get; set; }
public DateTime? DateAppoint { get; set; }
public string? RootDnaId { get; set; }
public string? Child1DnaId { get; set; }
public string? Child2DnaId { get; set; }
public string? Child3DnaId { get; set; }
public string? Child4DnaId { get; set; }
}
public class GetProfileByKeycloakIdRootAddTotalDto
{
public List<GetProfileByKeycloakIdRootDto> Data { get; set; } = new();
public int Total { get; set; }
}
}

View file

@ -49,6 +49,29 @@ namespace BMA.EHR.Application.Responses.Profiles
public double? Amount { get; set; }
public double? PositionSalaryAmount { get; set; }
public Guid? RootId { get; set; }
public Guid? RootDnaId { get; set; }
public string? Root { get; set; }
public Guid? Child1Id { get; set; }
public Guid? Child1DnaId { get; set; }
public string? Child1 { get; set; }
public Guid? Child2Id { get; set; }
public Guid? Child2DnaId { get; set; }
public string? Child2 { get; set; }
public Guid? Child3Id { get; set; }
public Guid? Child3DnaId { get; set; }
public string? Child3 { get; set; }
public Guid? Child4Id { get; set; }
public Guid? Child4DnaId { get; set; }
public string? Child4 { get; set; }
public string? ProfileType { get; set; }
public bool? MarkDiscipline { get; set; } = false;
public bool? MarkLeave { get; set; } = false;
public bool? MarkRate { get; set; } = false;
public bool? MarkInsignia { get; set; } = false;
}
}

View file

@ -0,0 +1,16 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetProfileSalaryDto
{
public DateTime DateAffect { get; set; }
public string Position { get; set; } = string.Empty;
public string Root { get; set; } = string.Empty;
public string Child1 { get; set; } = string.Empty;
public string Child2 { get; set; } = string.Empty;
public string Child3 { get; set; } = string.Empty;
public string Child4 { get; set; } = string.Empty;
public int Age { get; set; } = 0;
public int Amount { get; set; } = 0;
public string Remark { get; set; } = string.Empty;
}
}

View file

@ -0,0 +1,11 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetProfileSalaryResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public List<GetProfileSalaryDto> Result { get; set; } = new();
}
}

View file

@ -0,0 +1,57 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetUserOCAllDto
{
public Guid ProfileId { get; set; }
public string? Prefix { get; set; }
public string? Rank { get; set; }
public string? Avatar { get; set; }
public string? AvatarName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? CitizenId { get; set; }
public DateTime? BirthDate { get; set; }
public string? Position { get; set; }
public int? PosMaster { get; set; }
public int? PosMasterNo { get; set; }
public string? PosLevelName { get; set; }
public string? PosLevelRank { get; set; }
public Guid? PosLevelId { get; set; }
public string? PosTypeName { get; set; }
public string? PosTypeRank { get; set; }
public Guid? PosTypeId { get; set; }
public string? PosExecutiveName { get; set; }
public int? PosExecutivePriority { get; set; }
public Guid? PosExecutiveId { get; set; }
public string RootId { get; set; }
public string? RootDnaId { get; set; }
public string? Root { get; set; }
public string? RootShortName { get; set; }
public string? Child1Id { get; set; }
public string? Child1DnaId { get; set; }
public string? Child1 { get; set; }
public string? Child1ShortName { get; set; }
public string? Child2Id { get; set; }
public string? Child2DnaId { get; set; }
public string? Child2 { get; set; }
public string? Child2ShortName { get; set; }
public string? Child3Id { get; set; }
public string? Child3DnaId { get; set; }
public string? Child3 { get; set; }
public string? Child3ShortName { get; set; }
public string? Child4Id { get; set; }
public string? Child4DnaId { get; set; }
public string? Child4 { get; set; }
public string? Child4ShortName { get; set; }
public int? Node { get; set; }
public string? NodeId { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace BMA.EHR.Application.Responses.Profiles
{
public class GetUserOCAllResultDto
{
public string Message { get; set; } = string.Empty;
public int Status { get; set; } = -1;
public GetUserOCAllDto? Result { get; set; }
}
}

View file

@ -4,26 +4,27 @@
{
public Guid ProfileId { get; set; }
public string Prefix { get; set; } = string.Empty;
public string? Prefix { get; set; } = string.Empty;
public string Rank { get; set; } = string.Empty;
public string? Rank { get; set; } = string.Empty;
public string Avatar { get; set; } = string.Empty;
public string? Avatar { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string? FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string? LastName { get; set; } = string.Empty;
public string CitizenId { get; set; } = string.Empty;
public string? CitizenId { get; set; } = string.Empty;
public DateTime BirthDate { get; set; } = DateTime.MinValue;
public DateTime? BirthDate { get; set; } = DateTime.MinValue;
public string Position { get; set; } = string.Empty;
public string? Position { get; set; } = string.Empty;
public Guid RootId { get; set; }
public Guid? RootDnaId { get; set; }
public string Root { get; set; } = string.Empty;
public string? Root { get; set; } = string.Empty;
public string RootShortName { get; set; } = string.Empty;
public string? RootShortName { get; set; } = string.Empty;
}
}

Some files were not shown because too many files have changed in this diff Show more