This commit is contained in:
commit
bf97558614
38 changed files with 22170 additions and 381 deletions
86
.github/workflows/release_Retirement.yaml
vendored
86
.github/workflows/release_Retirement.yaml
vendored
|
|
@ -1,13 +1,10 @@
|
|||
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:
|
||||
- "retirement-[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
IMAGE_NAME: ehr/bma-ehr-retirement-service
|
||||
|
|
@ -23,20 +20,22 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
- 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='${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
|
||||
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 }}
|
||||
|
|
@ -69,21 +68,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
- name: Notify Discord Success
|
||||
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
|
||||
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()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
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 }}
|
||||
|
|
|
|||
86
.github/workflows/release_discipline.yaml
vendored
86
.github/workflows/release_discipline.yaml
vendored
|
|
@ -1,13 +1,10 @@
|
|||
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:
|
||||
- "discipline-[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
IMAGE_NAME: ehr/bma-ehr-discipline-service
|
||||
|
|
@ -23,20 +20,22 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
- 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='${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
|
||||
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 }}
|
||||
|
|
@ -69,21 +68,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
- name: Notify Discord Success
|
||||
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
|
||||
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()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
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 }}
|
||||
|
|
|
|||
53
.github/workflows/release_insignia.yaml
vendored
53
.github/workflows/release_insignia.yaml
vendored
|
|
@ -20,8 +20,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
# Gen Version try to get version from tag or inut
|
||||
- name: Set output tags
|
||||
id: vars
|
||||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
||||
|
|
@ -70,21 +68,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
- name: Notify Discord Success
|
||||
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
|
||||
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()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
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 }}
|
||||
|
|
|
|||
53
.github/workflows/release_leave.yaml
vendored
53
.github/workflows/release_leave.yaml
vendored
|
|
@ -20,8 +20,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
# Gen Version try to get version from tag or inut
|
||||
- name: Set output tags
|
||||
id: vars
|
||||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
||||
|
|
@ -70,21 +68,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
- name: Notify Discord Success
|
||||
if: success()
|
||||
with:
|
||||
access_token: ${{ secrets.TOKEN_LINE }}
|
||||
message: |
|
||||
-Success✅✅✅
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
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()
|
||||
with:
|
||||
access_token: ${{ secrets.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
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 }}
|
||||
|
|
|
|||
86
.github/workflows/release_placement.yaml
vendored
86
.github/workflows/release_placement.yaml
vendored
|
|
@ -1,13 +1,10 @@
|
|||
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:
|
||||
- "placement-[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
IMAGE_NAME: ehr/bma-ehr-placement-service
|
||||
|
|
@ -23,20 +20,22 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
- 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='${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
|
||||
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 }}
|
||||
|
|
@ -69,21 +68,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
- name: Notify Discord Success
|
||||
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
|
||||
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()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
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 }}
|
||||
|
|
|
|||
|
|
@ -108,13 +108,13 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
if (entity.LeaveDocument != null)
|
||||
{
|
||||
foreach(var d in entity.LeaveDocument)
|
||||
foreach (var d in entity.LeaveDocument)
|
||||
{
|
||||
_dbContext.Attatch(d);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entity.Type != null)
|
||||
_dbContext.Attatch(entity.Type);
|
||||
|
|
@ -334,7 +334,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return await rawData.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<LeaveRequest> ApproveCancelLeaveRequestAsync(LeaveRequest data,string Reason)
|
||||
public async Task<LeaveRequest> ApproveCancelLeaveRequestAsync(LeaveRequest data, string Reason)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -365,7 +365,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -534,8 +534,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
await UpdateAsync(rawData);
|
||||
|
||||
var leaveType = await _appDbContext.Set<TypeLeave>()
|
||||
.FirstOrDefaultAsync(x => x.Name == rawData.Type.Name);
|
||||
//var leaveType = await _appDbContext.Set<TypeLeave>()
|
||||
// .FirstOrDefaultAsync(x => x.Name == rawData.Type.Name);
|
||||
|
||||
|
||||
// insert to profile leave
|
||||
|
|
@ -553,24 +553,53 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
// };
|
||||
// _appDbContext.Set<ProfileLeave>().Add(profileLeave);
|
||||
var _baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{_baseAPI}/org/profile/leave";
|
||||
using (var client = new HttpClient())
|
||||
var apiUrlSalary = string.Empty;
|
||||
if (profile.ProfileType == "OFFICER")
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
apiUrlSalary = $"{_baseAPI}/org/profile/leave";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
profileId = profile.Id,
|
||||
leaveTypeId = leaveType?.Id ?? null,
|
||||
dateLeaveStart = rawData.LeaveStartDate,
|
||||
dateLeaveEnd = rawData.LeaveEndDate,
|
||||
leaveDays = 0,//หน้า fe ไม่ได้ใช้
|
||||
leaveCount = 0,//หน้า fe ไม่ได้ใช้
|
||||
totalLeave = rawData.LeaveTotal,
|
||||
status = "approve",
|
||||
reason = rawData.LeaveDetail,
|
||||
});
|
||||
// var _result = await _res.Content.ReadAsStringAsync();
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = profile.Id,
|
||||
leaveTypeId = rawData?.Type?.Id ?? null,
|
||||
dateLeaveStart = rawData.LeaveStartDate,
|
||||
dateLeaveEnd = rawData.LeaveEndDate,
|
||||
totalLeave = 0,//หน้า fe ไม่ได้ใช้
|
||||
leaveCount = 0,//หน้า fe ไม่ได้ใช้
|
||||
leaveDays = rawData.LeaveTotal,
|
||||
status = "approve",
|
||||
reason = rawData.LeaveDetail,
|
||||
});
|
||||
// var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
}
|
||||
else if (profile.ProfileType == "EMPLOYEE")
|
||||
{
|
||||
apiUrlSalary = $"{_baseAPI}/org/profile-employee/leave";
|
||||
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(apiUrlSalary, new
|
||||
{
|
||||
profileEmployeeId = profile.Id,
|
||||
leaveTypeId = rawData?.Type?.Id ?? null,
|
||||
dateLeaveStart = rawData.LeaveStartDate,
|
||||
dateLeaveEnd = rawData.LeaveEndDate,
|
||||
totalLeave = 0,
|
||||
leaveCount = 0,
|
||||
leaveDays = rawData.LeaveTotal,
|
||||
status = "approve",
|
||||
reason = rawData.LeaveDetail,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("ไม่สามารถทำรายการได้");
|
||||
}
|
||||
await _appDbContext.SaveChangesAsync();
|
||||
|
||||
|
|
@ -628,9 +657,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumSendLeaveAsync(int year)
|
||||
{
|
||||
var startFiscalDate = new DateTime(year - 1, 10, 1);
|
||||
var endFiscalDate = new DateTime(year, 9, 30);
|
||||
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
//.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStartDate.Date >= startFiscalDate && x.LeaveStartDate.Date <= endFiscalDate)
|
||||
.Where(x => x.LeaveStatus == "NEW") // fix issue : #729
|
||||
.ToListAsync();
|
||||
|
||||
var res = (from d in data
|
||||
|
|
@ -649,9 +683,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumApproveLeaveAsync(int year)
|
||||
{
|
||||
// fix issue : #729
|
||||
var startFiscalDate = new DateTime(year - 1, 10, 1);
|
||||
var endFiscalDate = new DateTime(year, 9, 30);
|
||||
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
//.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStartDate.Date >= startFiscalDate && x.LeaveStartDate.Date <= endFiscalDate) // fix issue : #729
|
||||
.Where(x => x.LeaveStatus == "APPROVE")
|
||||
.ToListAsync();
|
||||
|
||||
|
|
@ -671,9 +710,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumRejectLeaveAsync(int year)
|
||||
{
|
||||
// fix issue : #729
|
||||
var startFiscalDate = new DateTime(year - 1, 10, 1);
|
||||
var endFiscalDate = new DateTime(year, 9, 30);
|
||||
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
//.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStartDate.Date >= startFiscalDate && x.LeaveStartDate.Date <= endFiscalDate) // fix issue : #729
|
||||
.Where(x => x.LeaveStatus == "REJECT")
|
||||
.ToListAsync();
|
||||
|
||||
|
|
@ -693,9 +737,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public async Task<List<GetSumApproveLeaveByTypeDto>> GetSumDeleteLeaveAsync(int year)
|
||||
{
|
||||
// fix issue : #729
|
||||
var startFiscalDate = new DateTime(year - 1, 10, 1);
|
||||
var endFiscalDate = new DateTime(year, 9, 30);
|
||||
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Year == year)
|
||||
//.Where(x => x.LeaveStartDate.Year == year)
|
||||
.Where(x => x.LeaveStartDate.Date >= startFiscalDate && x.LeaveStartDate.Date <= endFiscalDate) // fix issue : #729
|
||||
.Where(x => x.LeaveStatus == "DELETE")
|
||||
.ToListAsync();
|
||||
|
||||
|
|
@ -777,6 +826,64 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<GetSumApproveLeaveByRootDto>> GetSumApproveLeaveByRootAndRange(DateTime startDate, DateTime endDate, string type)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.ProfileType == type.Trim().ToUpper())
|
||||
.Where(x => x.LeaveStartDate.Date >= startDate.Date && x.LeaveStartDate.Date <= endDate.Date)
|
||||
.Where(x => x.LeaveStatus == "APPROVE").ToListAsync();
|
||||
|
||||
var res = (from d in data
|
||||
group d by new { d.Root, d.Child1, d.Child2, d.Child3, d.Child4, LeaveTypeId = d.Type.Id, LeaveTypeCode = d.Type.Code } into grp
|
||||
select new GetSumApproveLeaveByRootDto
|
||||
{
|
||||
Root = grp.Key.Root,
|
||||
LeaveTypeId = grp.Key.LeaveTypeId,
|
||||
LeaveTypeCode = grp.Key.LeaveTypeCode,
|
||||
SumLeaveDay = grp.Sum(x => x.LeaveTotal),
|
||||
|
||||
sickDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
maternityDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
wifeDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
personalDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
restDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
ordainDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
absentDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
studyDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
agencyDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
coupleDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
therapyDayCountMale = grp.Where(x => x.Gender == "ชาย").Sum(x => x.LeaveTotal),
|
||||
|
||||
sickDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
maternityDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
wifeDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
personalDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
restDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
ordainDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
absentDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
studyDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
agencyDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
coupleDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
therapyDayCountFemale = grp.Where(x => x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
|
||||
sickDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
maternityDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
wifeDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
personalDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
restDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
ordainDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
absentDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
studyDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
agencyDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
coupleDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
therapyDayCountNo = grp.Where(x => x.Gender == "ชาย" && x.Gender == "หญิง").Sum(x => x.LeaveTotal),
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<GetCountApproveLeaveByTypeDto>> GetCountApproveLeaveByTypeAndRange(DateTime startDate, DateTime endDate)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
|
|
|
|||
|
|
@ -139,6 +139,15 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
return data;
|
||||
}
|
||||
|
||||
public async Task<List<ProcessUserTimeStamp>> GetTimestampByDateLateAsync(string type)
|
||||
{
|
||||
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||
.Where(x => x.CheckInStatus == "LATE")
|
||||
.Where(x => x.ProfileType == type.Trim().ToUpper())
|
||||
.ToListAsync();
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<ProcessUserTimeStamp?> GetLastRecord(Guid keycloakId)
|
||||
{
|
||||
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||
|
|
|
|||
|
|
@ -243,6 +243,68 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllOfficer(string? accessToken, int? node, string? nodeId, bool isAll)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak-all-officer";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
var body = new
|
||||
{
|
||||
node = node,
|
||||
nodeId = nodeId,
|
||||
isAll = isAll,
|
||||
};
|
||||
|
||||
var profiles = new List<SearchProfileDto>();
|
||||
|
||||
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetListProfileByKeycloakIdRootResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetProfileByKeycloakIdRootDto>> GetProfileWithKeycloakAllEmployee(string? accessToken, int? node, string? nodeId, bool isAll)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak-all-employee";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
var body = new
|
||||
{
|
||||
node = node,
|
||||
nodeId = nodeId,
|
||||
isAll = isAll,
|
||||
};
|
||||
|
||||
var profiles = new List<SearchProfileDto>();
|
||||
|
||||
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetListProfileByKeycloakIdRootResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<SearchProfileDto>> SearchProfile(string? citizenId, string? firstName, string? lastName, string accessToken)
|
||||
{
|
||||
try
|
||||
|
|
@ -568,7 +630,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetActiveRootDto>> GetActiveRootAsync(string? accessToken,Guid? revisionId)
|
||||
public async Task<List<GetActiveRootDto>> GetActiveRootAsync(string? accessToken, Guid? revisionId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
namespace BMA.EHR.Application.Responses.Leaves
|
||||
{
|
||||
public class GetSumApproveLeaveByRootDto
|
||||
{
|
||||
public string Root { get; set; } = string.Empty;
|
||||
|
||||
public Guid LeaveTypeId { get; set; }
|
||||
|
||||
public string LeaveTypeCode { get; set; } = string.Empty;
|
||||
|
||||
public double SumLeaveDay { get; set; }
|
||||
|
||||
public double sickDayCountMale { get; set; }
|
||||
public double maternityDayCountMale { get; set; }
|
||||
public double wifeDayCountMale { get; set; }
|
||||
public double personalDayCountMale { get; set; }
|
||||
public double restDayCountMale { get; set; }
|
||||
public double ordainDayCountMale { get; set; }
|
||||
public double absentDayCountMale { get; set; }
|
||||
public double studyDayCountMale { get; set; }
|
||||
public double agencyDayCountMale { get; set; }
|
||||
public double coupleDayCountMale { get; set; }
|
||||
public double therapyDayCountMale { get; set; }
|
||||
public double sickDayCountFemale { get; set; }
|
||||
public double maternityDayCountFemale { get; set; }
|
||||
public double wifeDayCountFemale { get; set; }
|
||||
public double personalDayCountFemale { get; set; }
|
||||
public double restDayCountFemale { get; set; }
|
||||
public double ordainDayCountFemale { get; set; }
|
||||
public double absentDayCountFemale { get; set; }
|
||||
public double studyDayCountFemale { get; set; }
|
||||
public double agencyDayCountFemale { get; set; }
|
||||
public double coupleDayCountFemale { get; set; }
|
||||
public double therapyDayCountFemale { get; set; }
|
||||
public double sickDayCountNo { get; set; }
|
||||
public double maternityDayCountNo { get; set; }
|
||||
public double wifeDayCountNo { get; set; }
|
||||
public double personalDayCountNo { get; set; }
|
||||
public double restDayCountNo { get; set; }
|
||||
public double ordainDayCountNo { get; set; }
|
||||
public double absentDayCountNo { get; set; }
|
||||
public double studyDayCountNo { get; set; }
|
||||
public double agencyDayCountNo { get; set; }
|
||||
public double coupleDayCountNo { get; set; }
|
||||
public double therapyDayCountNo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Application.Responses.Profiles
|
||||
{
|
||||
public class GetListProfileByKeycloakIdRootResultDto
|
||||
{
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public int Status { get; set; } = -1;
|
||||
|
||||
public List<GetProfileByKeycloakIdRootDto> Result { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using BMA.EHR.Domain.Models.HR;
|
||||
|
||||
namespace BMA.EHR.Application.Responses.Profiles
|
||||
{
|
||||
public class GetProfileByKeycloakIdRootDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string? Prefix { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public Guid? Keycloak { get; set; }
|
||||
public string? PosNo { get; set; }
|
||||
public string? Position { get; set; }
|
||||
public string? PositionLevel { get; set; }
|
||||
public string? Oc { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,8 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|||
WORKDIR /src
|
||||
|
||||
# คัดลอกไฟล์ .csproj และ restore dependencies
|
||||
COPY *.csproj ./
|
||||
# COPY *.csproj ./
|
||||
COPY . ./
|
||||
RUN dotnet restore
|
||||
|
||||
# คัดลอกไฟล์ทั้งหมดและ build
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ WriteToConsole("Consumer Start!");
|
|||
var host = configuration["Rabbit:Host"] ?? "";
|
||||
var user = configuration["Rabbit:User"] ?? "";
|
||||
var pass = configuration["Rabbit:Password"] ?? "";
|
||||
var queue = configuration["Rabbit:Queue"] ?? "basic-queue";
|
||||
|
||||
// create connection
|
||||
var factory = new ConnectionFactory()
|
||||
|
|
@ -29,7 +30,8 @@ var factory = new ConnectionFactory()
|
|||
using var connection = factory.CreateConnection();
|
||||
using var channel = connection.CreateModel();
|
||||
|
||||
channel.QueueDeclare(queue: "bma-checkin-queue", durable: true, exclusive: false, autoDelete: false, arguments: null);
|
||||
//channel.QueueDeclare(queue: "bma-checkin-queue", durable: true, exclusive: false, autoDelete: false, arguments: null);
|
||||
channel.QueueDeclare(queue: queue, durable: true, exclusive: false, autoDelete: false, arguments: null);
|
||||
|
||||
var consumer = new EventingBasicConsumer(channel);
|
||||
|
||||
|
|
@ -59,7 +61,8 @@ consumer.Received += async (model, ea) =>
|
|||
//WriteToConsole($"ตอบกลับจาก REST API: {JsonConvert.SerializeObject(item)}");
|
||||
};
|
||||
|
||||
channel.BasicConsume(queue: "bma-checkin-queue", autoAck: true, consumer: consumer);
|
||||
//channel.BasicConsume(queue: "bma-checkin-queue", autoAck: true, consumer: consumer);
|
||||
channel.BasicConsume(queue: queue, autoAck: true, consumer: consumer);
|
||||
|
||||
//Console.WriteLine("\nPress 'Enter' to exit the process...");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
"Rabbit": {
|
||||
"Host": "192.168.1.40",
|
||||
"User": "admin",
|
||||
"Password": "Test123456"
|
||||
"Password": "Test123456",
|
||||
"Queue": "bma-checkin-queue"
|
||||
},
|
||||
"API": "https://localhost:7283/api/v1"
|
||||
}
|
||||
|
|
@ -82,5 +82,13 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
public double? PositionSalaryAmount { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
public Guid? Child1Id { get; set; }
|
||||
public string? Child1 { get; set; }
|
||||
public Guid? Child2Id { get; set; }
|
||||
public string? Child2 { get; set; }
|
||||
public Guid? Child3Id { get; set; }
|
||||
public string? Child3 { get; set; }
|
||||
public Guid? Child4Id { get; set; }
|
||||
public string? Child4 { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,5 +74,13 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
public string? LastInsigniaName { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
public Guid? Child1Id { get; set; }
|
||||
public string? Child1 { get; set; }
|
||||
public Guid? Child2Id { get; set; }
|
||||
public string? Child2 { get; set; }
|
||||
public Guid? Child3Id { get; set; }
|
||||
public string? Child3 { get; set; }
|
||||
public Guid? Child4Id { get; set; }
|
||||
public string? Child4 { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,9 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
|||
|
||||
public string? CitizenId { get; set; }
|
||||
|
||||
public string? Root { get; set; }
|
||||
public string? Gender { get; set; }
|
||||
|
||||
public string? Root { get; set; }
|
||||
|
||||
public string? Child1 { get; set; }
|
||||
|
||||
|
|
@ -173,6 +175,16 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
|||
|
||||
public string? Child4 { get; set; }
|
||||
|
||||
public Guid? RootId { get; set; }
|
||||
|
||||
public Guid? Child1Id { get; set; }
|
||||
|
||||
public Guid? Child2Id { get; set; }
|
||||
|
||||
public Guid? Child3Id { get; set; }
|
||||
|
||||
public Guid? Child4Id { get; set; }
|
||||
|
||||
public Guid? ProfileId { get; set; }
|
||||
public string? ProfileType { get; set; }
|
||||
public double? Amount { get; set; }
|
||||
|
|
|
|||
|
|
@ -77,5 +77,32 @@ namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
|||
public string? FirstName { get; set; }
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public string? CitizenId { get; set; }
|
||||
|
||||
public string? Gender { get; set; }
|
||||
|
||||
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; }
|
||||
|
||||
public Guid? RootId { get; set; }
|
||||
|
||||
public Guid? Child1Id { get; set; }
|
||||
|
||||
public Guid? Child2Id { get; set; }
|
||||
|
||||
public Guid? Child3Id { get; set; }
|
||||
|
||||
public Guid? Child4Id { get; set; }
|
||||
|
||||
public Guid? ProfileId { get; set; }
|
||||
public string? ProfileType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,5 +65,32 @@ namespace BMA.EHR.Domain.Models.Leave.TimeAttendants
|
|||
public string? FirstName { get; set; }
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public string? CitizenId { get; set; }
|
||||
|
||||
public string? Gender { get; set; }
|
||||
|
||||
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; }
|
||||
|
||||
public Guid? RootId { get; set; }
|
||||
|
||||
public Guid? Child1Id { get; set; }
|
||||
|
||||
public Guid? Child2Id { get; set; }
|
||||
|
||||
public Guid? Child3Id { get; set; }
|
||||
|
||||
public Guid? Child4Id { get; set; }
|
||||
|
||||
public Guid? ProfileId { get; set; }
|
||||
public string? ProfileType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
19220
BMA.EHR.Infrastructure/Migrations/20241210153801_update table insigniaprofile add child.Designer.cs
generated
Normal file
19220
BMA.EHR.Infrastructure/Migrations/20241210153801_update table insigniaprofile add child.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,195 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableinsigniaprofileaddchild : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child1",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child1Id",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child2",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child2Id",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child3",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child3Id",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child4",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child4Id",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child1",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child1Id",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child2",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child2Id",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child3",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child3Id",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child4",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child4Id",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1Id",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2Id",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3Id",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4Id",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1Id",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2Id",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3Id",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4Id",
|
||||
table: "InsigniaNoteProfiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6018,6 +6018,30 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.Property<DateTime?>("BirthDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Child1")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child1Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child2")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child2Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child3")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child3Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child4")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child4Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
|
|
@ -6403,6 +6427,30 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.Property<DateTime?>("BirthDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Child1")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child1Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child2")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child2Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child3")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child3Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child4")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child4Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
|
|
|
|||
1284
BMA.EHR.Infrastructure/Migrations/LeaveDb/20241212072757_update table leaveRequest add rootId.Designer.cs
generated
Normal file
1284
BMA.EHR.Infrastructure/Migrations/LeaveDb/20241212072757_update table leaveRequest add rootId.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,393 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableleaveRequestaddrootId : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child1",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child1Id",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child2",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child2Id",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child3",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child3Id",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child4",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child4Id",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CitizenId",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Gender",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ProfileId",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ProfileType",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Root",
|
||||
table: "UserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RootId",
|
||||
table: "UserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child1",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child1Id",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child2",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child2Id",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child3",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child3Id",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Child4",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child4Id",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CitizenId",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Gender",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ProfileId",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ProfileType",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Root",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RootId",
|
||||
table: "ProcessUserTimeStamps",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child1Id",
|
||||
table: "LeaveRequests",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child2Id",
|
||||
table: "LeaveRequests",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child3Id",
|
||||
table: "LeaveRequests",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "Child4Id",
|
||||
table: "LeaveRequests",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Gender",
|
||||
table: "LeaveRequests",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RootId",
|
||||
table: "LeaveRequests",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1Id",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2Id",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3Id",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4Id",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CitizenId",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Gender",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfileId",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfileType",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Root",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootId",
|
||||
table: "UserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1Id",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2Id",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3Id",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4Id",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CitizenId",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Gender",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfileId",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfileType",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Root",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootId",
|
||||
table: "ProcessUserTimeStamps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child1Id",
|
||||
table: "LeaveRequests");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child2Id",
|
||||
table: "LeaveRequests");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child3Id",
|
||||
table: "LeaveRequests");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Child4Id",
|
||||
table: "LeaveRequests");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Gender",
|
||||
table: "LeaveRequests");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootId",
|
||||
table: "LeaveRequests");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -226,15 +226,27 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("Child1")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child1Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child2")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child2Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child3")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child3Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child4")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child4Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
|
|
@ -298,6 +310,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("FirstName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("HajjDayStatus")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
|
|
@ -464,6 +479,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("Root")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("RootId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("StudyDayCountry")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
|
@ -768,6 +786,33 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะ Check-Out");
|
||||
|
||||
b.Property<string>("Child1")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child1Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child2")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child2Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child3")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child3Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child4")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child4Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
|
|
@ -798,6 +843,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("FirstName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("IsLocationCheckIn")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||
|
|
@ -839,6 +887,18 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("Prefix")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("ProfileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("ProfileType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Root")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("RootId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProcessUserTimeStamps");
|
||||
|
|
@ -1048,6 +1108,33 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out");
|
||||
|
||||
b.Property<string>("Child1")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child1Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child2")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child2Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child3")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child3Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Child4")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("Child4Id")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
|
|
@ -1070,6 +1157,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("FirstName")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<bool>("IsLocationCheckIn")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In");
|
||||
|
|
@ -1111,6 +1201,18 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("Prefix")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("ProfileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("ProfileType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Root")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("RootId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("UserTimeStamps");
|
||||
|
|
|
|||
|
|
@ -933,6 +933,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
LastInsigniaName = lastInsignia,
|
||||
Root = profile.Root,
|
||||
RootId = profile.RootId,
|
||||
Child1 = profile.Child1,
|
||||
Child1Id = profile.Child1Id,
|
||||
Child2 = profile.Child2,
|
||||
Child2Id = profile.Child2Id,
|
||||
Child3 = profile.Child3,
|
||||
Child3Id = profile.Child3Id,
|
||||
Child4 = profile.Child4,
|
||||
Child4Id = profile.Child4Id,
|
||||
});
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1080,6 +1088,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
PositionSalaryAmount = profileOld.PositionSalaryAmount,
|
||||
Root = profileOld.Root,
|
||||
RootId = profileOld.RootId,
|
||||
Child1 = profileOld.Child1,
|
||||
Child1Id = profileOld.Child1Id,
|
||||
Child2 = profileOld.Child2,
|
||||
Child2Id = profileOld.Child2Id,
|
||||
Child3 = profileOld.Child3,
|
||||
Child3Id = profileOld.Child3Id,
|
||||
Child4 = profileOld.Child4,
|
||||
Child4Id = profileOld.Child4Id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1838,6 +1854,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
PositionSalaryAmount = pf.PositionSalaryAmount,
|
||||
RootId = pf.RootId,
|
||||
Root = pf.Root,
|
||||
Child1 = pf.Child1,
|
||||
Child1Id = pf.Child1Id,
|
||||
Child2 = pf.Child2,
|
||||
Child2Id = pf.Child2Id,
|
||||
Child3 = pf.Child3,
|
||||
Child3Id = pf.Child3Id,
|
||||
Child4 = pf.Child4,
|
||||
Child4Id = pf.Child4Id,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
|
|
@ -2014,6 +2038,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
PositionSalaryAmount = _profile.PositionSalaryAmount,
|
||||
Root = _profile.Root,
|
||||
RootId = _profile.RootId,
|
||||
Child1 = _profile.Child1,
|
||||
Child1Id = _profile.Child1Id,
|
||||
Child2 = _profile.Child2,
|
||||
Child2Id = _profile.Child2Id,
|
||||
Child3 = _profile.Child3,
|
||||
Child3Id = _profile.Child3Id,
|
||||
Child4 = _profile.Child4,
|
||||
Child4Id = _profile.Child4Id,
|
||||
};
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -477,7 +477,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var currentDate = DateTime.Now;
|
||||
var checkFileBytes = new byte[0];
|
||||
|
||||
if (data.Img != null && data.Img.Length == 0)
|
||||
// fix issue : ระบบลงเวลาปฏิบัติงาน>>รูปภาพไม่แสดงในฝั่งของ Admin #804
|
||||
if (data.Img != null && data.Img.Length > 0)
|
||||
{
|
||||
var formFile = data.Img;
|
||||
using (var memoryStream = new MemoryStream())
|
||||
|
|
@ -609,7 +610,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
if (data.CheckInFileName == "no-file") throw new Exception(GlobalMessages.NoFileToUpload);
|
||||
var currentDate = data.CurrentDate ?? DateTime.Now;
|
||||
|
||||
var fileName = $"{_bucketName}/{userId}/{currentDate.ToString("dd-MM-yyyy")}/{data.CheckInFileName}";
|
||||
var check_status = data.CheckInId == null ? "check-in-picture" : "check-out-picture";
|
||||
|
||||
var fileName = $"{_bucketName}/{userId}/{currentDate.ToString("dd-MM-yyyy")}/{check_status}/{data.CheckInFileName}";
|
||||
using (var ms = new MemoryStream(data.CheckInFileBytes ?? new byte[0]))
|
||||
{
|
||||
await _minIOService.UploadFileAsync(fileName, ms);
|
||||
|
|
@ -634,14 +637,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
// validate duplicate check in
|
||||
var currentCheckIn = await _userTimeStampRepository.GetTimestampByDateAsync(userId, currentDate);
|
||||
|
||||
|
||||
|
||||
if (currentCheckIn != null)
|
||||
{
|
||||
return Error(new Exception("ไม่สามารถลงเวลาได้ เนื่องจากมีการลงเวลาในวันนี้แล้ว!"), StatusCodes.Status400BadRequest);
|
||||
}
|
||||
|
||||
|
||||
var checkin = new UserTimeStamp
|
||||
{
|
||||
KeycloakUserId = userId,
|
||||
|
|
@ -656,6 +656,23 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Prefix = profile.Prefix,
|
||||
FirstName = profile.FirstName,
|
||||
LastName = profile.LastName,
|
||||
CitizenId = profile.CitizenId,
|
||||
|
||||
Root = profile.Root,
|
||||
Child1 = profile.Child1,
|
||||
Child2 = profile.Child2,
|
||||
Child3 = profile.Child3,
|
||||
Child4 = profile.Child4,
|
||||
|
||||
RootId = profile.RootId,
|
||||
Child1Id = profile.Child1Id,
|
||||
Child2Id = profile.Child2Id,
|
||||
Child3Id = profile.Child3Id,
|
||||
Child4Id = profile.Child4Id,
|
||||
Gender = profile.Gender,
|
||||
|
||||
ProfileId = profile.Id,
|
||||
ProfileType = profile.ProfileType,
|
||||
};
|
||||
|
||||
var checkInStatus = DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) >
|
||||
|
|
@ -683,6 +700,23 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Prefix = profile.Prefix,
|
||||
FirstName = profile.FirstName,
|
||||
LastName = profile.LastName,
|
||||
CitizenId = profile.CitizenId,
|
||||
|
||||
Root = profile.Root,
|
||||
Child1 = profile.Child1,
|
||||
Child2 = profile.Child2,
|
||||
Child3 = profile.Child3,
|
||||
Child4 = profile.Child4,
|
||||
|
||||
RootId = profile.RootId,
|
||||
Child1Id = profile.Child1Id,
|
||||
Child2Id = profile.Child2Id,
|
||||
Child3Id = profile.Child3Id,
|
||||
Child4Id = profile.Child4Id,
|
||||
Gender = profile.Gender,
|
||||
|
||||
ProfileId = profile.Id,
|
||||
ProfileType = profile.ProfileType,
|
||||
};
|
||||
|
||||
await _userTimeStampRepository.AddAsync(checkin);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ using Newtonsoft.Json;
|
|||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System.Globalization;
|
||||
using System.Security.Claims;
|
||||
using BMA.EHR.Application.Responses.Profiles;
|
||||
|
||||
namespace BMA.EHR.Leave.Service.Controllers
|
||||
{
|
||||
|
|
@ -731,20 +732,19 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// LV2_035 - รายงานบัญชีแสดงวันลา ขรก
|
||||
/// LV2_035 - รายงานสำหรับการลางานของข้าราชการ-กรุงเทพมหานครสามัญ และลูกจ้างประจำกรุงเทพมหานคร
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("leaveday/officer")]
|
||||
[HttpPost("leaveday/{type}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetOfficerLeaveDayReport([FromBody] GetLeaveReportDto req)
|
||||
public async Task<ActionResult<ResponseObject>> GetLeaveDayReport([FromBody] GetLeaveDetailByNodeReportDto req, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -754,11 +754,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
|
||||
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
|
||||
if (profile.Count > 0)
|
||||
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
||||
if (type.Trim().ToUpper() == "OFFICER")
|
||||
{
|
||||
profile = profile.Where(p => p.IsLeave == false).ToList();
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||
}
|
||||
else
|
||||
{
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||
}
|
||||
// get leave day
|
||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
||||
|
|
@ -767,8 +770,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var count = 1;
|
||||
var employees = new List<dynamic>();
|
||||
|
||||
|
||||
|
||||
foreach (var p in profile)
|
||||
{
|
||||
var keycloakUserId = p.Keycloak ?? Guid.Empty;
|
||||
|
|
@ -810,7 +811,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
req.StartDate,
|
||||
req.EndDate);
|
||||
|
||||
|
||||
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||
if (defaultRound == null)
|
||||
{
|
||||
|
|
@ -887,21 +887,36 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
count++;
|
||||
}
|
||||
|
||||
var text = "";
|
||||
if (req.Type.Trim().ToUpper() == "FULL")
|
||||
{
|
||||
text = "หนึ่งปี";
|
||||
}
|
||||
else if (req.Type.Trim().ToUpper() == "HAFT")
|
||||
{
|
||||
text = "ครึ่งปี";
|
||||
}
|
||||
else if (req.Type.Trim().ToUpper() == "MONTH")
|
||||
{
|
||||
text = "หนึ่งเดือน";
|
||||
}
|
||||
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
||||
var result = new
|
||||
{
|
||||
template = "LeaveHalfYear-ขรก",
|
||||
template = "LeaveHalfYear-Officer",
|
||||
reportName = "LeaveHalfYear-Officer",
|
||||
data = new
|
||||
{
|
||||
leaveDateStart = req.StartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateEnd = req.EndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
organizationName = profile.First().Oc ?? "",
|
||||
leaveTitleType = req.Type == "FULL" ? "หนึ่งปี" : "ครึ่งปี",
|
||||
employees = employees
|
||||
dateTimeStamp = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
||||
organizationName = profile?.FirstOrDefault()?.Oc ?? "",
|
||||
employees = employees,
|
||||
headerText = type.Trim().ToUpper() == "OFFICER" ? "ข้าราชการสามัญ" : "ลูกจ้างประจำ",
|
||||
text = text
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -911,18 +926,18 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_036 - รายงานบัญชีแสดงวันลา ลูกจ้าง
|
||||
/// LV2_037 - รายงานการเข้างานจำแนกรายวัน รายสัปดาห์ รายเดือน แยกรายหน่วยงาน/ส่วนราชการ
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("leaveday/employee")]
|
||||
[HttpPost("time-records/{type}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetEmployeeLeaveDayReport([FromBody] GetLeaveReportDto req)
|
||||
public async Task<ActionResult<ResponseObject>> GetTimeRecordsOfficerReport([FromBody] GetLeaveDetailByNodeReportDto req, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -932,161 +947,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var profile = await _userProfileRepository.SearchProfileEmployee(null, null, null, AccessToken ?? "");
|
||||
var count = 1;
|
||||
var employees = new List<dynamic>();
|
||||
|
||||
// get leave day
|
||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
||||
var leaveCounts = await _leaveRequestRepository.GetCountApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
||||
var leaveTypes = await _leaveTypeRepository.GetAllAsync();
|
||||
|
||||
|
||||
|
||||
foreach (var p in profile)
|
||||
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
||||
if (type.Trim().ToUpper() == "OFFICER")
|
||||
{
|
||||
var keycloakUserId = p.Keycloak ?? Guid.Empty;
|
||||
|
||||
var sickDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-001");
|
||||
var sickDayCount = sickDay != null ? sickDay.SumLeaveDay : 0;
|
||||
var sickCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-001");
|
||||
var sickCount = sickCountData != null ? sickCountData.CountLeave : 0;
|
||||
|
||||
var personalDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-002");
|
||||
var personalDayCount = personalDay != null ? personalDay.SumLeaveDay : 0;
|
||||
var personalCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-002");
|
||||
var personalCount = personalCountData != null ? personalCountData.CountLeave : 0;
|
||||
|
||||
var maternityDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-003");
|
||||
var maternityDayCount = maternityDay != null ? maternityDay.SumLeaveDay : 0;
|
||||
var maternityCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-003");
|
||||
var maternityCount = maternityCountData != null ? maternityCountData.CountLeave : 0;
|
||||
|
||||
var wifeDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-004");
|
||||
var wifeDayCount = wifeDay != null ? wifeDay.SumLeaveDay : 0;
|
||||
var wifeCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-004");
|
||||
var wifeCount = wifeCountData != null ? wifeCountData.CountLeave : 0;
|
||||
|
||||
var restDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-005");
|
||||
var restDayCount = restDay != null ? restDay.SumLeaveDay : 0;
|
||||
var restCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-005");
|
||||
var restCount = restCountData != null ? restCountData.CountLeave : 0;
|
||||
|
||||
var ordainDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-006");
|
||||
var ordainDayCount = ordainDay != null ? ordainDay.SumLeaveDay : 0;
|
||||
var ordainCountData = leaveCounts.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-006");
|
||||
var ordainCount = ordainCountData != null ? ordainCountData.CountLeave : 0;
|
||||
|
||||
var timeStamps = await _processUserTimeStampRepository.GetTimeStampHistoryByRangeForUserAsync(p.Keycloak ?? Guid.Empty,
|
||||
req.StartDate,
|
||||
req.EndDate);
|
||||
|
||||
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||
if (defaultRound == null)
|
||||
{
|
||||
return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
|
||||
}
|
||||
|
||||
//var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id);
|
||||
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
|
||||
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
|
||||
|
||||
var duty = userRound ?? defaultRound;
|
||||
|
||||
var processTimeStamps = timeStamps
|
||||
.Select(d => new
|
||||
{
|
||||
d.Id,
|
||||
CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||
"LATE" :
|
||||
"NORMAL",
|
||||
CheckOutStatus = d.CheckOut == null ? "" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||
"LATE" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||
"ABSENT" :
|
||||
"NORMAL",
|
||||
});
|
||||
|
||||
var absentCount = processTimeStamps.Count(x => x.CheckOutStatus == "ABSENT");
|
||||
var lateCount = processTimeStamps.Count(x => x.CheckInStatus == "LATE");
|
||||
|
||||
|
||||
|
||||
var emp = new
|
||||
{
|
||||
no = count,
|
||||
fullName = $"{p.Prefix}{p.FirstName} {p.LastName}",// _userProfileRepository.GetUserFullName(p.Keycloak ?? Guid.Empty, AccessToken),
|
||||
posNo = p.PosNo ?? "",
|
||||
reason = "",
|
||||
|
||||
sickDay = sickDayCount,
|
||||
sickDayCount = sickCount,
|
||||
personalDay = personalDayCount,
|
||||
personalDayCount = personalCount,
|
||||
leaveDay = sickDayCount + personalDayCount,
|
||||
leaveTotal = sickCount + personalCount, //*รวมจำนวนครั้งลาป่วยและลากิจ(13)
|
||||
maternityDay = maternityDayCount,
|
||||
wifeDay = wifeDayCount,
|
||||
ordainDay = ordainDayCount,
|
||||
absentTotal = absentCount,
|
||||
lateTotal = lateCount,
|
||||
leaveTotalText = $"{sickDayCount + personalDayCount}/{sickCount + personalCount}"
|
||||
};
|
||||
|
||||
employees.Add(emp);
|
||||
count++;
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficer(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||
}
|
||||
|
||||
var result = new
|
||||
else
|
||||
{
|
||||
template = "LeaveHalfYear-ลูกจ้าง",
|
||||
reportName = "LeaveHalfYear-Employee",
|
||||
data = new
|
||||
{
|
||||
leaveDateStart = req.StartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateEnd = req.EndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
organizationName = profile.First().Oc ?? "",
|
||||
leaveTitleType = req.Type == "FULL" ? "หนึ่งปี" : "ครึ่งปี",
|
||||
employees = employees
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// LV2_037 - รายงานการลงเวลาประจำวัน
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("time-records/officer")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetTimeRecordsOfficerReport([FromBody] GetLeaveDetailReportDto req)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
|
||||
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
|
||||
if (profile.Count > 0)
|
||||
{
|
||||
profile = profile.Where(p => p.IsLeave == false).ToList();
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllEmployee(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD");
|
||||
}
|
||||
var date = req.StartDate.Date;
|
||||
|
||||
|
|
@ -1216,7 +1084,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
timeStamps.CheckOut != null ?
|
||||
$"{timeStamps.CheckOut.Value.ToString("HH:mm")} น." :
|
||||
"",
|
||||
|
||||
//remark = timeStamps == null ? "ขาดราชการ" : "",
|
||||
remark = remarkStr,
|
||||
|
||||
|
|
@ -1237,8 +1104,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
else if (timeStamps.CheckInLocationName == "ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่")
|
||||
seminarTotal += 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1267,26 +1132,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
}
|
||||
|
||||
var dateStamp = "";
|
||||
var reportName = "";
|
||||
switch (req.Type.ToUpper())
|
||||
{
|
||||
case "MONTH":
|
||||
{
|
||||
var dd = req.StartDate.Date;
|
||||
reportName = "TimeStamp-Month";
|
||||
dateStamp = $"เดือน {dd.ToString("MMMM", _culture.DateTimeFormat)} พ.ศ. {dd.Year.ToThaiYear()}".ToThaiNumber();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
dateStamp = req.StartDate.Date.ToThaiFullDate().ToThaiNumber();
|
||||
reportName = "TimeStamp-Day";
|
||||
break;
|
||||
}
|
||||
|
||||
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
||||
var item = new
|
||||
{
|
||||
DateTimeStamp = dateStamp,
|
||||
dateTimeStamp = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
||||
officerTotal = profile.Count,
|
||||
workTotal = workTotal,
|
||||
restTotal = restTotal,
|
||||
|
|
@ -1298,12 +1147,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
employees = employees
|
||||
};
|
||||
|
||||
|
||||
|
||||
var result = new
|
||||
{
|
||||
template = reportName,
|
||||
reportName = reportName,
|
||||
template = "TimeStamp-Day",
|
||||
reportName = "TimeStamp-Day",
|
||||
data = item
|
||||
};
|
||||
|
||||
|
|
@ -1315,6 +1162,139 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_035 - รายงานการเข้างานสาย จำแนกเป็นรายบุคคลและหรือรายหน่วยงาน/ส่วนราชการ
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("late/{type}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetLateReport([FromBody] GetLeaveDetailByNodeReportDto req, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_LEAVE_REPORT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
|
||||
var employees = new List<dynamic>();
|
||||
var count = 1;
|
||||
|
||||
var userTimeStamps = await _processUserTimeStampRepository.GetTimestampByDateLateAsync(type.Trim().ToUpper());
|
||||
foreach (var p in userTimeStamps)
|
||||
{
|
||||
var fullName = $"{p.Prefix}{p.FirstName} {p.LastName}";
|
||||
|
||||
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id);
|
||||
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
|
||||
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
|
||||
|
||||
var duty = userRound;
|
||||
if (duty == null)
|
||||
{
|
||||
duty = await _dutyTimeRepository.GetDefaultAsync();
|
||||
if (duty == null)
|
||||
{
|
||||
return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
|
||||
}
|
||||
}
|
||||
|
||||
var emp = new
|
||||
{
|
||||
no = count,
|
||||
fullName = fullName,
|
||||
dutyTimeName = $"{duty.StartTimeMorning} - {duty.EndTimeAfternoon} น.",
|
||||
checkInLocation = p.CheckInPOI,
|
||||
checkInTime = $"{p.CheckIn.ToString("HH:mm")} น.",
|
||||
checkOutLocation = p.CheckOutPOI ?? "",
|
||||
checkOutTime = p.CheckOut != null ?
|
||||
$"{p.CheckOut.Value.ToString("HH:mm")} น." :
|
||||
"",
|
||||
remark = "",
|
||||
checkInDate = p.CheckIn.Date.ToThaiFullDate2().ToThaiNumber(),
|
||||
checkedOutDate = p.CheckOut != null ?
|
||||
p.CheckOut.Value.ToThaiFullDate2().ToThaiNumber() :
|
||||
"",
|
||||
};
|
||||
employees.Add(emp);
|
||||
count++;
|
||||
}
|
||||
|
||||
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
||||
var item = new
|
||||
{
|
||||
dateTimeStamp = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
||||
// officerTotal = profile.Count,
|
||||
employees = employees
|
||||
};
|
||||
|
||||
var result = new
|
||||
{
|
||||
template = "TimeStamp-Day",
|
||||
reportName = "TimeStamp-Day",
|
||||
data = item
|
||||
};
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_035 - รายงานการลางาน จำแนกตามเพศ ประเภทการลา หน่วยงาน/ส่วนราชการ
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("leave2/{type}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetLeave2Report([FromBody] GetLeaveDetailByNodeReportDto req, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_LEAVE_REPORT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
Console.WriteLine(jsonData["result"]);
|
||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByRootAndRange(req.StartDate, req.EndDate, type);
|
||||
var enddate = req.EndDate.Date == req.StartDate.Date ? "" : $" - {req.EndDate.Date.ToThaiShortDate().ToThaiNumber()}";
|
||||
var result = new
|
||||
{
|
||||
template = "LeaveHalfYear-Officer",
|
||||
reportName = "LeaveHalfYear-Officer",
|
||||
data = new
|
||||
{
|
||||
dateTimeStamp = $"ณ วันที่ {req.StartDate.Date.ToThaiShortDate().ToThaiNumber()}{enddate}",
|
||||
employees = leaveDays
|
||||
}
|
||||
};
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -196,6 +196,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Child3 = profile.Child3,
|
||||
Child4 = profile.Child4,
|
||||
|
||||
RootId = profile.RootId,
|
||||
Child1Id = profile.Child1Id,
|
||||
Child2Id = profile.Child2Id,
|
||||
Child3Id = profile.Child3Id,
|
||||
Child4Id = profile.Child4Id,
|
||||
Gender = profile.Gender,
|
||||
|
||||
ProfileId = profile.Id,
|
||||
ProfileType = profile.ProfileType,
|
||||
Amount = profile.Amount,
|
||||
|
|
@ -764,6 +771,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
|
||||
var govAge = (profile?.DateStart?.Date ?? DateTime.Now.Date).DiffDay(DateTime.Now.Date);
|
||||
var thisYear = DateTime.Now.Year;
|
||||
|
||||
if (profile == null)
|
||||
{
|
||||
|
|
@ -813,10 +821,18 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
switch (leaveType.Code.ToUpper().Trim())
|
||||
{
|
||||
case "LV-001":
|
||||
isLeave = true;
|
||||
// fix issue : ระบบลา (ขรก.) >> ลาป่วย (กรณียื่นขอลาเกิน 120 วัน/ปี) #828
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= 120;
|
||||
//isLeave = true;
|
||||
break;
|
||||
case "LV-002":
|
||||
isLeave = true;
|
||||
// fix issue : ระบบลา (ขรก.) >> ลากิจส่วนตัว (กรณียื่นขอลาเกิน 45 วัน/ปี) #829
|
||||
// fix issue : ระบบลา (ขรก.) >> ลากิจส่วนตัว (กรณีผู้เข้ารับราชการไม่เกิน 1 ปี ยื่นขอลาเกิน 15 วัน/ปี) #831
|
||||
if (govAge <= 365)
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= 15;
|
||||
else
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= 45;
|
||||
//isLeave = true;
|
||||
break;
|
||||
case "LV-007":
|
||||
isLeave = true;
|
||||
|
|
@ -828,10 +844,32 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= 15;
|
||||
break;
|
||||
case "LV-005":
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= 10;
|
||||
// fix issue : ระบบลา (ขรก.) >> ลาพักผ่อน (กรณีรับราชการไม่ถึง 6 เดือน) #838
|
||||
var leavePrevYear = (await _leaveRequestRepository.GetSumApproveLeaveAsync(thisYear)).Where(x => x.LeaveTypeCode == "LV-005").FirstOrDefault();
|
||||
var leavePrevYearRemain = 10 - (leavePrevYear == null ? 0 : leavePrevYear.SumLeaveDay); // หายอดวันลาที่เหลือของปีก่อน
|
||||
|
||||
if (govAge >= 180)
|
||||
if (govAge >= 3650) // ถ้าอายุราชการเกิน 10 ปี ได้บวกเพิ่มอีก 10 วัน
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= (20 + leavePrevYearRemain);
|
||||
else
|
||||
isLeave = (totalDay - (sumWorkDay + sumWeekend) + sumApproveLeave) <= (10 + leavePrevYearRemain);
|
||||
else
|
||||
isLeave = false;
|
||||
break;
|
||||
case "LV-006":
|
||||
isLeave = totalDay <= 120;
|
||||
// fix issue : ระบบลา(ขรก.) >> ลาอุปสมบทหรือการลาประกอบพิธีฮัจย์ฯ(กรณีรับราชการน้อยกว่า 1 ปี) #840
|
||||
if (govAge < 365)
|
||||
isLeave = false;
|
||||
else
|
||||
{
|
||||
// fix issue : ระบบลา (ขรก.) >> ลาอุปสมบทหรือการลาประกอบพิธีฮัจย์ฯ (ยื่นขอลาได้มากกว่า 1 ครั้ง) #841
|
||||
var prevLeave = _context.Set<LeaveRequest>().Where(x => x.LeaveTypeCode == "LV-006").Where(x => x.LeaveStatus == "APPROVE").Count();
|
||||
|
||||
if (prevLeave > 0)
|
||||
isLeave = false;
|
||||
else
|
||||
isLeave = totalDay <= 120;
|
||||
}
|
||||
break;
|
||||
case "LV-008":
|
||||
case "LV-009":
|
||||
|
|
@ -897,7 +935,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
isLeave = req.EndLeaveDate.Date <= maxEnd;
|
||||
break;
|
||||
case "LV-011":
|
||||
isLeave = totalDay <= 360;
|
||||
//isLeave = totalDay <= 360;
|
||||
isLeave = totalDay <= 365; // fix issue : 847 เปลี่ยนเป็นเช็คว่าเกิน 365 วันหรีอไม่
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
11
BMA.EHR.Leave/DTOs/Reports/GetLeaveDetailByNodeReportDto.cs
Normal file
11
BMA.EHR.Leave/DTOs/Reports/GetLeaveDetailByNodeReportDto.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Leave.Service.DTOs.Reports
|
||||
{
|
||||
public class GetLeaveDetailByNodeReportDto
|
||||
{
|
||||
public DateTime StartDate { get; set; } = DateTime.MinValue;
|
||||
public DateTime EndDate { get; set; } = DateTime.MinValue;
|
||||
public string? Type { get; set; } = string.Empty;
|
||||
public int? node { get; set; }
|
||||
public string? nodeId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "https://localhost:7283;http://localhost:5028"
|
||||
"applicationUrl": "https://localhost:7283;http://localhost:5254"
|
||||
},
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5028"
|
||||
"applicationUrl": "http://localhost:5254"
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
|
|
|
|||
|
|
@ -896,6 +896,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -1105,6 +1106,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -1305,6 +1307,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -1507,6 +1510,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -1725,6 +1729,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
|
|||
|
|
@ -1719,7 +1719,9 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
currentProvinceId = (String?)null,
|
||||
currentDistrictId = (String?)null,
|
||||
currentSubDistrictId = (String?)null,
|
||||
currentZipCode = p.CurrentZipCode == null ? string.Empty : p.CurrentZipCode
|
||||
currentZipCode = p.CurrentZipCode == null ? string.Empty : p.CurrentZipCode,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
},
|
||||
bodyEducations = p.PlacementEducations.Select(e => new
|
||||
{
|
||||
|
|
@ -1759,6 +1761,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
date = r.commandAffectDate,
|
||||
commandId = r.commandId,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
|
|
@ -2019,7 +2022,9 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
currentProvinceId = (String?)null,
|
||||
currentDistrictId = (String?)null,
|
||||
currentSubDistrictId = (String?)null,
|
||||
currentZipCode = p.CurrentZipCode == null ? string.Empty : p.CurrentZipCode
|
||||
currentZipCode = p.CurrentZipCode == null ? string.Empty : p.CurrentZipCode,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
},
|
||||
bodyEducations = p.PlacementEducations.Select(e => new
|
||||
{
|
||||
|
|
@ -2058,6 +2063,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = string.Empty,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -2297,6 +2303,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -2522,6 +2529,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -2736,6 +2744,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
|
|||
|
|
@ -1061,12 +1061,15 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
currentDistrictId = (String?)null,
|
||||
currentSubDistrictId = (String?)null,
|
||||
currentZipCode = (String?)null,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
},
|
||||
bodySalarys = new
|
||||
{
|
||||
profileId = string.Empty,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
|
|||
|
|
@ -885,6 +885,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public int commandYear { get; set; }
|
||||
public string? templateDoc { get; set; }
|
||||
public double? amount { get; set; }
|
||||
public double? amountSpecial { get; set; }
|
||||
public double? positionSalaryAmount { get; set; }
|
||||
public double? mouthSalaryAmount { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -774,6 +774,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
@ -978,6 +979,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
amountSpecial = r.amountSpecial,
|
||||
commandId = r.commandId,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace BMA.EHR.Retirement.Service.Requests
|
|||
public int commandYear { get; set; }
|
||||
public string? templateDoc { get; set; }
|
||||
public double? amount { get; set; }
|
||||
public double? amountSpecial { get; set; }
|
||||
public double? positionSalaryAmount { get; set; }
|
||||
public double? mouthSalaryAmount { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue