This commit is contained in:
AdisakKanthawilang 2024-03-01 15:37:30 +07:00
parent 16d718baa4
commit 4c2f7120ce

View file

@ -1156,7 +1156,6 @@ export class PositionController extends Controller {
) {
body.type = 0;
shortName = posMaster.orgRoot.orgRootShortName;
// labelName = posMaster.orgRoot.orgRootName+" "+posMaster.orgRoot.orgRootCode + "00"+" "+posMaster.orgRoot.orgRootShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1165,7 +1164,6 @@ export class PositionController extends Controller {
) {
body.type = 1;
shortName = posMaster.orgChild1.orgChild1ShortName;
// labelName = posMaster.orgChild1.orgChild1Name+" "+posMaster.orgChild1.orgChild1Code + "00"+" "+posMaster.orgChild1.orgChild1ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1174,7 +1172,6 @@ export class PositionController extends Controller {
) {
body.type = 2;
shortName = posMaster.orgChild2.orgChild2ShortName;
// labelName = posMaster.orgChild2.orgChild2Name+" "+posMaster.orgChild2.orgChild2Code + "00"+" "+posMaster.orgChild2.orgChild2ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1183,7 +1180,6 @@ export class PositionController extends Controller {
) {
body.type = 3;
shortName = posMaster.orgChild3.orgChild3ShortName;
// labelName = posMaster.orgChild3.orgChild3Name+" "+posMaster.orgChild3.orgChild3Code + "00"+" "+posMaster.orgChild3.orgChild3ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1192,7 +1188,6 @@ export class PositionController extends Controller {
) {
body.type = 4;
shortName = posMaster.orgChild4.orgChild4ShortName;
// labelName = posMaster.orgChild4.orgChild4Name+" "+posMaster.orgChild4.orgChild4Code + "00"+" "+posMaster.orgChild4.orgChild4ShortName;
}
return {
@ -1214,7 +1209,6 @@ export class PositionController extends Controller {
? null
: `${posMaster.next_holder.prefix}${posMaster.next_holder.firstName} ${posMaster.next_holder.lastName}`,
orgShortname: shortName,
// labelName: labelName,
isSit: posMaster.isSit,
profilePosition: profile == null || profile.position == null ? null : profile.position,
profilePostype: type == null || type.posTypeName == null ? null : type.posTypeName,
@ -1571,17 +1565,19 @@ export class PositionController extends Controller {
...type3LastPosMasterNo,
...type4LastPosMasterNo,
];
console.log("allLast>>>>>>>>:",allLastPosMasterNo);
console.log("type>>>>>>>>:",requestBody.type);
console.log("data>>>>>>>>:",type2LastPosMasterNo);
const maxPosMasterNo = Math.max(
...allLastPosMasterNo.map((pos) => pos.posMasterNo),
0
);
console.log("max>>>>>>>>:",maxPosMasterNo);
const maxPosMasterOrder = Math.max(
...allLastPosMasterNo.map((pos) => pos.posMasterOrder),
0
);
posMaster.posMasterNo = maxPosMasterNo + 1;
posMaster.posMasterNo = maxPosMasterOrder + 1;
posMaster.createdUserId = request.user.sub;
posMaster.createdFullName = request.user.name;
posMaster.lastUpdateUserId = request.user.sub;