Merge branch 'develop'

* develop:
  อัพเดตฟิลด์ prefixMain #2033
  อัพเดท view_pos_master
  fix duplicate salary list
  fix
This commit is contained in:
Warunee Tamkoo 2025-11-25 18:03:09 +07:00
commit 657de4c0bb
3 changed files with 20 additions and 12 deletions

View file

@ -6041,6 +6041,7 @@ export class CommandController extends Controller {
profile.isProbation = item.bodyProfile.isProbation; profile.isProbation = item.bodyProfile.isProbation;
//เพิ่มใหม่จากรับโอน //เพิ่มใหม่จากรับโอน
profile.prefix = item.bodyProfile.prefix ?? null; profile.prefix = item.bodyProfile.prefix ?? null;
profile.prefixMain = item.bodyProfile.prefix ?? null;
profile.firstName = item.bodyProfile.firstName ?? null; profile.firstName = item.bodyProfile.firstName ?? null;
profile.lastName = item.bodyProfile.lastName ?? null; profile.lastName = item.bodyProfile.lastName ?? null;
profile.birthDate = item.bodyProfile.birthDate ?? null; profile.birthDate = item.bodyProfile.birthDate ?? null;
@ -6093,6 +6094,7 @@ export class CommandController extends Controller {
profile.amountSpecial = item.bodyProfile.amountSpecial ?? null; profile.amountSpecial = item.bodyProfile.amountSpecial ?? null;
profile.isProbation = item.bodyProfile.isProbation; profile.isProbation = item.bodyProfile.isProbation;
profile.prefix = item.bodyProfile.prefix ?? null; profile.prefix = item.bodyProfile.prefix ?? null;
profile.prefixMain = item.bodyProfile.prefix ?? null;
profile.firstName = item.bodyProfile.firstName ?? null; profile.firstName = item.bodyProfile.firstName ?? null;
profile.lastName = item.bodyProfile.lastName ?? null; profile.lastName = item.bodyProfile.lastName ?? null;
profile.birthDate = item.bodyProfile.birthDate ?? null; profile.birthDate = item.bodyProfile.birthDate ?? null;
@ -6152,6 +6154,7 @@ export class CommandController extends Controller {
item.bodyProfile.prefix && item.bodyProfile.prefix != "" item.bodyProfile.prefix && item.bodyProfile.prefix != ""
? item.bodyProfile.prefix ? item.bodyProfile.prefix
: profile.prefix; : profile.prefix;
profile.prefixMain = item.bodyProfile.prefix ?? null;
profile.firstName = profile.firstName =
item.bodyProfile.firstName && item.bodyProfile.firstName != "" item.bodyProfile.firstName && item.bodyProfile.firstName != ""
? item.bodyProfile.firstName ? item.bodyProfile.firstName

View file

@ -340,6 +340,7 @@ export class OrganizationUnauthorizeController extends Controller {
const [findPosMaster, total] = await AppDataSource.getRepository(viewPosMaster) const [findPosMaster, total] = await AppDataSource.getRepository(viewPosMaster)
.createQueryBuilder("viewPosMaster") .createQueryBuilder("viewPosMaster")
.where({orgRevisionId: findRevision?.id}) .where({orgRevisionId: findRevision?.id})
.andWhere({positionIsSelected: true})
// .andWhere("viewPosMaster.rootId IN (:...rootIds)", { rootIds }) // .andWhere("viewPosMaster.rootId IN (:...rootIds)", { rootIds })
.andWhere( .andWhere(
new Brackets((qb) => { new Brackets((qb) => {
@ -517,8 +518,8 @@ export class OrganizationUnauthorizeController extends Controller {
new Date( new Date(
`${new Date(item.disCriplineDate).getFullYear()}-${String(new Date(item.disCriplineDate).getMonth() + 1).padStart(2, "0")}-${String(new Date(item.disCriplineDate).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`, `${new Date(item.disCriplineDate).getFullYear()}-${String(new Date(item.disCriplineDate).getMonth() + 1).padStart(2, "0")}-${String(new Date(item.disCriplineDate).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`,
) <= datePeriodEnd ) <= datePeriodEnd
? true ? false
: false, : true,
isSuspension: item.dateRetire == null ? false : true, isSuspension: item.dateRetire == null ? false : true,
isAbsent: item.profileDisciplineId ? true : false, isAbsent: item.profileDisciplineId ? true : false,
isLeave: item.profileLeaveId ? true : false, isLeave: item.profileLeaveId ? true : false,
@ -971,8 +972,8 @@ export class OrganizationUnauthorizeController extends Controller {
new Date( new Date(
`${new Date(item.disCriplineDate).getFullYear()}-${String(new Date(item.disCriplineDate).getMonth() + 1).padStart(2, "0")}-${String(new Date(item.disCriplineDate).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`, `${new Date(item.disCriplineDate).getFullYear()}-${String(new Date(item.disCriplineDate).getMonth() + 1).padStart(2, "0")}-${String(new Date(item.disCriplineDate).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`,
) <= datePeriodEnd ) <= datePeriodEnd
? true ? false
: false, : true,
isSuspension: item.dateRetire == null ? false : true, isSuspension: item.dateRetire == null ? false : true,
isAbsent: item.profileDisciplineId ? true : false, isAbsent: item.profileDisciplineId ? true : false,
isLeave: item.profileLeaveId ? true : false, isLeave: item.profileLeaveId ? true : false,

View file

@ -78,14 +78,18 @@ import { ViewColumn, ViewEntity } from "typeorm";
LEFT JOIN LEFT JOIN
posExecutive ON position.posExecutiveId = posExecutive.id posExecutive ON position.posExecutiveId = posExecutive.id
LEFT JOIN ( LEFT JOIN (
SELECT * SELECT *
FROM profileDiscipline pd1 FROM (
WHERE pd1.date = ( SELECT
SELECT MAX(pd2.date) pd.*,
FROM profileDiscipline pd2 ROW_NUMBER() OVER (
WHERE pd2.profileId = pd1.profileId PARTITION BY profileId
) ORDER BY date DESC, id DESC
) AS profileDiscipline ON profileDiscipline.profileId = profile.id ) AS rn
FROM profileDiscipline pd
) t
WHERE rn = 1
) AS profileDiscipline ON profileDiscipline.profileId = profile.id
LEFT JOIN ( LEFT JOIN (
SELECT pl1.* SELECT pl1.*
FROM profileLeave pl1 FROM profileLeave pl1