Merge branch 'develop' into adiDev
This commit is contained in:
commit
92c6c01438
3 changed files with 29 additions and 21 deletions
|
|
@ -2203,24 +2203,24 @@ export class EmployeePositionController extends Controller {
|
||||||
const positionOld = await this.employeePositionRepository.findOne({
|
const positionOld = await this.employeePositionRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posMasterId: posMasterOld?.id,
|
posMasterId: posMasterOld?.id,
|
||||||
positionIsSelected: true
|
positionIsSelected: true,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
if (positionOld != null) {
|
if (positionOld != null) {
|
||||||
positionOld.positionIsSelected = false
|
positionOld.positionIsSelected = false;
|
||||||
await this.employeePositionRepository.save(positionOld);
|
await this.employeePositionRepository.save(positionOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkPosition = await this.employeePositionRepository.find({
|
const checkPosition = await this.employeePositionRepository.find({
|
||||||
where: {
|
where: {
|
||||||
posMasterId: body.posmasterId,
|
posMasterId: body.posmasterId,
|
||||||
positionIsSelected: true
|
positionIsSelected: true,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
if (checkPosition.length > 0) {
|
if (checkPosition.length > 0) {
|
||||||
const clearPosition = checkPosition.map(positions => ({
|
const clearPosition = checkPosition.map((positions) => ({
|
||||||
...positions,
|
...positions,
|
||||||
positionIsSelected: false
|
positionIsSelected: false,
|
||||||
}));
|
}));
|
||||||
await this.employeePositionRepository.save(clearPosition);
|
await this.employeePositionRepository.save(clearPosition);
|
||||||
}
|
}
|
||||||
|
|
@ -2239,11 +2239,15 @@ export class EmployeePositionController extends Controller {
|
||||||
const positionNew = await this.employeePositionRepository.findOne({
|
const positionNew = await this.employeePositionRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
id: body.positionId,
|
id: body.positionId,
|
||||||
posMasterId: body.posmasterId
|
posMasterId: body.posmasterId,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
if(positionNew != null) {
|
if (positionNew != null) {
|
||||||
positionNew.positionIsSelected = true
|
positionNew.positionIsSelected = true;
|
||||||
|
profile.posLevel = positionNew.posLevel;
|
||||||
|
profile.posType = positionNew.posType;
|
||||||
|
profile.position = positionNew.positionName;
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
await this.employeePositionRepository.save(positionNew);
|
await this.employeePositionRepository.save(positionNew);
|
||||||
}
|
}
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
|
|
@ -3417,6 +3417,10 @@ export class PositionController extends Controller {
|
||||||
});
|
});
|
||||||
if (positionNew != null) {
|
if (positionNew != null) {
|
||||||
positionNew.positionIsSelected = true;
|
positionNew.positionIsSelected = true;
|
||||||
|
profile.posLevel = positionNew.posLevel;
|
||||||
|
profile.posType = positionNew.posType;
|
||||||
|
profile.position = positionNew.positionName;
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
await this.positionRepository.save(positionNew);
|
await this.positionRepository.save(positionNew);
|
||||||
}
|
}
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
|
|
@ -7,45 +7,45 @@ import { AuthRole } from "./AuthRole";
|
||||||
export class AuthRoleAttr extends EntityBase {
|
export class AuthRoleAttr extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "",
|
comment: "ความเป็นเจ้าของ (Ownership)",
|
||||||
length: 255,
|
length: 255,
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
attrOwnership: string;
|
attrOwnership: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "",
|
comment: "สิทธิ์ดำเนินการ (Permission) การ Create",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
attrIsCreate: boolean;
|
attrIsCreate: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "",
|
comment: "สิทธิ์ดำเนินการ (Permission) การ List",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
attrIsList: boolean;
|
attrIsList: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "",
|
comment: "สิทธิ์ดำเนินการ (Permission) การ Get",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
attrIsGet: boolean;
|
attrIsGet: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "",
|
comment: "สิทธิ์ดำเนินการ (Permission) การ Update",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
attrIsUpdate: boolean;
|
attrIsUpdate: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "",
|
comment: "สิทธิ์ดำเนินการ (Permission) การ Delete",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
attrIsDelete: boolean;
|
attrIsDelete: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "",
|
comment: "สิทธิการเข้าถึง(Privilege)",
|
||||||
length: 255,
|
length: 255,
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue