[Bug อัตรากำลังลูกจ้าง] เพิ่มตำแหน่ง #117

This commit is contained in:
Bright 2025-04-29 17:15:35 +07:00
parent d9799e642f
commit f790fa72cb

View file

@ -572,7 +572,7 @@ export class EmployeePositionController extends Controller {
const chk_SName0 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgRoot: { orgRootShortName: SName },
orgRoot: { orgRootShortName: SName, id: requestBody.orgRootId ?? "" },
orgChild1Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
},
@ -588,7 +588,7 @@ export class EmployeePositionController extends Controller {
const chk_SName1 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild1: { orgChild1ShortName: SName },
orgChild1: { orgChild1ShortName: SName, id: requestBody.orgChild1Id ?? "" },
orgChild2Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
},
@ -604,7 +604,7 @@ export class EmployeePositionController extends Controller {
const chk_SName2 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild2: { orgChild2ShortName: SName },
orgChild2: { orgChild2ShortName: SName, id: requestBody.orgChild2Id ?? "" },
orgChild3Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
},
@ -620,7 +620,7 @@ export class EmployeePositionController extends Controller {
const chk_SName3 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild3: { orgChild3ShortName: SName },
orgChild3: { orgChild3ShortName: SName, id: requestBody.orgChild3Id ?? "" },
orgChild4Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
},
@ -636,7 +636,7 @@ export class EmployeePositionController extends Controller {
const chk_SName4 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild4: { orgChild4ShortName: SName },
orgChild4: { orgChild4ShortName: SName, id: requestBody.orgChild4Id ?? "" },
posMasterNo: requestBody.posMasterNo,
},
relations: ["orgChild4"],
@ -780,7 +780,7 @@ export class EmployeePositionController extends Controller {
const chk_SName0 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgRoot: { orgRootShortName: SName },
orgRoot: { orgRootShortName: SName, id: requestBody.orgRootId ?? "" },
orgChild1Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
id: Not(posMaster.id),
@ -797,7 +797,7 @@ export class EmployeePositionController extends Controller {
const chk_SName1 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild1: { orgChild1ShortName: SName },
orgChild1: { orgChild1ShortName: SName, id: requestBody.orgChild1Id ?? "" },
orgChild2Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
id: Not(posMaster.id),
@ -814,7 +814,7 @@ export class EmployeePositionController extends Controller {
const chk_SName2 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild2: { orgChild2ShortName: SName },
orgChild2: { orgChild2ShortName: SName, id: requestBody.orgChild2Id ?? "" },
orgChild3Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
id: Not(posMaster.id),
@ -831,7 +831,7 @@ export class EmployeePositionController extends Controller {
const chk_SName3 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild3: { orgChild3ShortName: SName },
orgChild3: { orgChild3ShortName: SName, id: requestBody.orgChild3Id ?? "" },
orgChild4Id: IsNull(),
posMasterNo: requestBody.posMasterNo,
id: Not(posMaster.id),
@ -848,7 +848,7 @@ export class EmployeePositionController extends Controller {
const chk_SName4 = await this.employeePosMasterRepository.findOne({
where: {
orgRevisionId: posMaster.orgRevisionId,
orgChild4: { orgChild4ShortName: SName },
orgChild4: { orgChild4ShortName: SName, id: requestBody.orgChild4Id ?? "" },
posMasterNo: requestBody.posMasterNo,
id: Not(posMaster.id),
},