Fix TimeStamp Report
This commit is contained in:
parent
67f6be635c
commit
b3c752d2e6
3 changed files with 24 additions and 18 deletions
33
.github/workflows/release_checkin_consumer.yaml
vendored
33
.github/workflows/release_checkin_consumer.yaml
vendored
|
|
@ -1,12 +1,9 @@
|
||||||
name: release-dev
|
name: release-dev
|
||||||
run-name: release-dev ${{ github.actor }}
|
run-name: release-dev ${{ github.actor }}
|
||||||
on:
|
on:
|
||||||
# push:
|
push:
|
||||||
# tags:
|
tags:
|
||||||
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
- "consumer-[0-9]+.[0-9]+.[0-9]+"
|
||||||
# tags-ignore:
|
|
||||||
# - '2.*'
|
|
||||||
# Allow run workflow manually from Action tab
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
env:
|
env:
|
||||||
REGISTRY: docker.frappet.com
|
REGISTRY: docker.frappet.com
|
||||||
|
|
@ -24,11 +21,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
# skip Set up QEMU because it fail on act and container
|
# 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
|
||||||
- name: Gen Version
|
- name: Gen Version
|
||||||
id: gen_ver
|
id: gen_ver
|
||||||
run: |
|
run: |
|
||||||
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
||||||
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
IMAGE_VER=${{ steps.vars.outputs.tag }}
|
||||||
else
|
else
|
||||||
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
||||||
fi
|
fi
|
||||||
|
|
@ -36,10 +37,11 @@ jobs:
|
||||||
IMAGE_VER='test-vBeta'
|
IMAGE_VER='test-vBeta'
|
||||||
fi
|
fi
|
||||||
echo '::set-output name=image_ver::'$IMAGE_VER
|
echo '::set-output name=image_ver::'$IMAGE_VER
|
||||||
- name: Test Version
|
- name: Check Version
|
||||||
run: |
|
run: |
|
||||||
echo $GITHUB_REF
|
echo $GITHUB_REF
|
||||||
echo ${{ steps.gen_ver.outputs.image_ver }}
|
echo ${{ steps.gen_ver.outputs.image_ver }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login in to registry
|
- name: Login in to registry
|
||||||
|
|
@ -48,7 +50,7 @@ jobs:
|
||||||
registry: ${{env.REGISTRY}}
|
registry: ${{env.REGISTRY}}
|
||||||
username: ${{secrets.DOCKER_USER}}
|
username: ${{secrets.DOCKER_USER}}
|
||||||
password: ${{secrets.DOCKER_PASS}}
|
password: ${{secrets.DOCKER_PASS}}
|
||||||
- name: Build and load local docker image
|
- name: Build and push docker image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
@ -56,14 +58,13 @@ jobs:
|
||||||
file: BMA.EHR.CheckInConsumer/Dockerfile
|
file: BMA.EHR.CheckInConsumer/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
||||||
|
- name: Remote Deployment
|
||||||
- name: Reload docker compose
|
|
||||||
uses: appleboy/ssh-action@v0.1.8
|
uses: appleboy/ssh-action@v0.1.8
|
||||||
with:
|
with:
|
||||||
host: ${{env.DEPLOY_HOST}}
|
host: ${{env.DEPLOY_HOST}}
|
||||||
username: frappet
|
username: frappet
|
||||||
password: ${{ secrets.SSH_PASSWORD }}
|
password: ${{ secrets.SSH_PASSWORD }}
|
||||||
port: ${{env.DEPLOY_PORT}}
|
port: 10102
|
||||||
script: |
|
script: |
|
||||||
cd "${{env.COMPOSE_PATH}}"
|
cd "${{env.COMPOSE_PATH}}"
|
||||||
docker compose pull
|
docker compose pull
|
||||||
|
|
@ -72,18 +73,18 @@ jobs:
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Success✅✅✅
|
-Success✅✅✅
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
By: ${{secrets.DOCKER_USER}}
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- uses: snow-actions/line-notify@v1.1.0
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
access_token: ${{ env.TOKEN_LINE }}
|
access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
message: |
|
||||||
-Failure❌❌❌
|
-Failure❌❌❌
|
||||||
Image: ${{env.IMAGE_NAME}}
|
Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
By: ${{secrets.DOCKER_USER}}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
public string? Gender { get; set; }
|
public string? Gender { get; set; }
|
||||||
|
|
||||||
public string? ProfileType { get; set; }
|
public string? ProfileType { get; set; }
|
||||||
|
public bool? IsLeave { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1062,6 +1062,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
|
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
|
||||||
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
|
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
|
||||||
|
if(profile.Count > 0)
|
||||||
|
{
|
||||||
|
profile = profile.Where(p => p.IsLeave == false).ToList();
|
||||||
|
}
|
||||||
var date = req.StartDate.Date;
|
var date = req.StartDate.Date;
|
||||||
|
|
||||||
var holidays = await _holidayRepository.GetHolidayAsync(req.StartDate.Date, req.EndDate.Date);
|
var holidays = await _holidayRepository.GetHolidayAsync(req.StartDate.Date, req.EndDate.Date);
|
||||||
|
|
@ -1206,9 +1210,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
workTotal += 1;
|
workTotal += 1;
|
||||||
if (!timeStamps.IsLocationCheckIn)
|
if (!timeStamps.IsLocationCheckIn)
|
||||||
{
|
{
|
||||||
if(timeStamps.CheckInLocationName!.Contains("ปฏิบัติงานที่บ้าน"))
|
if(timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
|
||||||
wfhTotal += 1;
|
wfhTotal += 1;
|
||||||
else if (timeStamps.CheckInLocationName!.Contains("ประชุม"))
|
else if (timeStamps.CheckInLocationName == "ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่")
|
||||||
seminarTotal += 1;
|
seminarTotal += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue