Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2024-04-24 17:47:36 +07:00
commit 2784054e2f
3 changed files with 33 additions and 11 deletions

View file

@ -1038,7 +1038,7 @@ export class PositionController extends Controller {
position.positionExecutiveField = x.posDictExecutiveField;
position.positionArea = x.posDictArea;
position.isSpecial = x.isSpecial;
position.positionIsSelected = false;
position.positionIsSelected = x.positionIsSelected;
position.posMasterId = posMaster.id;
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;

View file

@ -306,7 +306,7 @@ export class ProfileController extends Controller {
bloodGroup: null,
posLevel: null,
posType: null,
org: null
org: null,
},
],
total: 1,
@ -444,32 +444,32 @@ export class ProfileController extends Controller {
_data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null
? null
: _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild1;
const child2 =
_data.current_holders == null ||
_data.current_holders.length == 0 ||
_data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null
? null
: _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild2;
const child3 =
_data.current_holders == null ||
_data.current_holders.length == 0 ||
_data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null
? null
: _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild3;
const child4 =
_data.current_holders == null ||
_data.current_holders.length == 0 ||
_data.current_holders.find((x) => x.orgRevisionId == findRevision.id) == null
? null
: _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4;
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`;
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`;
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`;
return {
id: _data.id,
@ -647,7 +647,7 @@ export class ProfileController extends Controller {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
}
const _profile = {
const _profile: any = {
profileId: profile.id,
prefix: profile.prefix,
rank: profile.rank,
@ -731,7 +731,26 @@ export class ProfileController extends Controller {
? null
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
.orgChild4Name,
node: null,
nodeId: null,
};
if (_profile.child4Id != null) {
_profile.node = 4;
_profile.nodeId = _profile.child4Id;
} else if (_profile.child3Id != null) {
_profile.node = 3;
_profile.nodeId = _profile.child3Id;
} else if (_profile.child2Id != null) {
_profile.node = 2;
_profile.nodeId = _profile.child2Id;
} else if (_profile.child1Id != null) {
_profile.node = 1;
_profile.nodeId = _profile.child1Id;
} else if (_profile.rootId != null) {
_profile.node = 0;
_profile.nodeId = _profile.rootId;
}
return new HttpSuccess(_profile);
}

View file

@ -101,6 +101,9 @@ export class CreatePosDict {
@Column()
isSpecial: boolean;
@Column()
positionIsSelected?: boolean | null;
}
export class CreatePosDictExe {