This commit is contained in:
parent
34759d26a7
commit
09fd606b86
1 changed files with 29 additions and 26 deletions
|
|
@ -1475,6 +1475,9 @@ export class PositionController extends Controller {
|
||||||
if (posMaster.orgRevision?.orgRevisionIsCurrent == true && !posMaster.isSit) {
|
if (posMaster.orgRevision?.orgRevisionIsCurrent == true && !posMaster.isSit) {
|
||||||
const _position = requestBody.positions.find((p) => p.positionIsSelected == true);
|
const _position = requestBody.positions.find((p) => p.positionIsSelected == true);
|
||||||
if (_position) {
|
if (_position) {
|
||||||
|
const _posExecutive = _position.posExecutiveId
|
||||||
|
? await this.posExecutiveRepository.findOne({ where: { id: _position.posExecutiveId } })
|
||||||
|
: null;
|
||||||
const current_holderId: any = posMaster.current_holderId;
|
const current_holderId: any = posMaster.current_holderId;
|
||||||
const _profile = await this.profileRepository.findOne({
|
const _profile = await this.profileRepository.findOne({
|
||||||
where: { id: current_holderId },
|
where: { id: current_holderId },
|
||||||
|
|
@ -1484,7 +1487,7 @@ export class PositionController extends Controller {
|
||||||
_profile.posTypeId = _position.posTypeId;
|
_profile.posTypeId = _position.posTypeId;
|
||||||
_profile.posLevelId = _position.posLevelId;
|
_profile.posLevelId = _position.posLevelId;
|
||||||
_profile.positionField = _position.posDictField ?? _null;
|
_profile.positionField = _position.posDictField ?? _null;
|
||||||
_profile.posExecutive = _position.posExecutiveId ?? _null;
|
_profile.posExecutive = _posExecutive?.posExecutiveName ?? _null;
|
||||||
_profile.positionArea = _position.posDictArea ?? _null;
|
_profile.positionArea = _position.posDictArea ?? _null;
|
||||||
_profile.positionExecutiveField = _position.posDictExecutiveField ?? _null;
|
_profile.positionExecutiveField = _position.posDictExecutiveField ?? _null;
|
||||||
await this.profileRepository.save(_profile);
|
await this.profileRepository.save(_profile);
|
||||||
|
|
@ -2418,7 +2421,7 @@ export class PositionController extends Controller {
|
||||||
? _data.child1[0] != null
|
? _data.child1[0] != null
|
||||||
? "posMaster.orgChild1Id IN (:...child1)"
|
? "posMaster.orgChild1Id IN (:...child1)"
|
||||||
: // : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}`
|
: // : `posMaster.orgChild1Id is ${_data.privilege == "PARENT" ? "not null" : "null"}`
|
||||||
`posMaster.orgChild1Id is null`
|
`posMaster.orgChild1Id is null`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{ child1: _data.child1 },
|
{ child1: _data.child1 },
|
||||||
)
|
)
|
||||||
|
|
@ -2980,50 +2983,50 @@ export class PositionController extends Controller {
|
||||||
const type0LastPosMasterNo =
|
const type0LastPosMasterNo =
|
||||||
requestBody.type == 0
|
requestBody.type == 0
|
||||||
? await this.posMasterRepository.find({
|
? await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgRootId: requestBody.id,
|
orgRootId: requestBody.id,
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type1LastPosMasterNo =
|
const type1LastPosMasterNo =
|
||||||
requestBody.type == 1
|
requestBody.type == 1
|
||||||
? await this.posMasterRepository.find({
|
? await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild1Id: requestBody.id,
|
orgChild1Id: requestBody.id,
|
||||||
orgChild2Id: IsNull(),
|
orgChild2Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type2LastPosMasterNo =
|
const type2LastPosMasterNo =
|
||||||
requestBody.type == 2
|
requestBody.type == 2
|
||||||
? await this.posMasterRepository.find({
|
? await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild2Id: requestBody.id,
|
orgChild2Id: requestBody.id,
|
||||||
orgChild3Id: IsNull(),
|
orgChild3Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type3LastPosMasterNo =
|
const type3LastPosMasterNo =
|
||||||
requestBody.type == 3
|
requestBody.type == 3
|
||||||
? await this.posMasterRepository.find({
|
? await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild3Id: requestBody.id,
|
orgChild3Id: requestBody.id,
|
||||||
orgChild4Id: IsNull(),
|
orgChild4Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type4LastPosMasterNo =
|
const type4LastPosMasterNo =
|
||||||
requestBody.type == 4
|
requestBody.type == 4
|
||||||
? await this.posMasterRepository.find({
|
? await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild4Id: requestBody.id,
|
orgChild4Id: requestBody.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const allLastPosMasterNo = [
|
const allLastPosMasterNo = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue