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.positionExecutiveField = x.posDictExecutiveField;
position.positionArea = x.posDictArea; position.positionArea = x.posDictArea;
position.isSpecial = x.isSpecial; position.isSpecial = x.isSpecial;
position.positionIsSelected = false; position.positionIsSelected = x.positionIsSelected;
position.posMasterId = posMaster.id; position.posMasterId = posMaster.id;
position.createdUserId = request.user.sub; position.createdUserId = request.user.sub;
position.createdFullName = request.user.name; position.createdFullName = request.user.name;

View file

@ -306,7 +306,7 @@ export class ProfileController extends Controller {
bloodGroup: null, bloodGroup: null,
posLevel: null, posLevel: null,
posType: null, posType: null,
org: null org: null,
}, },
], ],
total: 1, total: 1,
@ -466,10 +466,10 @@ export class ProfileController extends Controller {
? null ? null
: _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4; : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4;
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/` let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`;
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/` let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`;
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/` let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/` let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`;
return { return {
id: _data.id, id: _data.id,
@ -647,7 +647,7 @@ export class ProfileController extends Controller {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง"); throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
} }
const _profile = { const _profile: any = {
profileId: profile.id, profileId: profile.id,
prefix: profile.prefix, prefix: profile.prefix,
rank: profile.rank, rank: profile.rank,
@ -731,7 +731,26 @@ export class ProfileController extends Controller {
? null ? null
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4 : profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4
.orgChild4Name, .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); return new HttpSuccess(_profile);
} }

View file

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