Merge branch 'develop' into adiDev
This commit is contained in:
commit
7649770b43
4 changed files with 1263 additions and 3 deletions
|
|
@ -2642,7 +2642,7 @@ export class ImportDataController extends Controller {
|
|||
rowCount++;
|
||||
_item.posNumCodeSit = OFFICER.POS_NUM_CODE_SIT;
|
||||
_item.posNumCodeSitAbb = OFFICER.POS_NUM_CODE_SIT_ABB;
|
||||
await this.profileRepo.save(_item);
|
||||
await this.salaryRepo.save(_item);
|
||||
console.log(rowCount);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export class PermissionProfileController extends Controller {
|
|||
@Get()
|
||||
async GetActiveRootIdAdmin(@Request() request: RequestWithUser) {
|
||||
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
||||
where: { orgRevisionIsCurrent: false, orgRevisionIsDraft: true },
|
||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
relations: ["posMasters"],
|
||||
});
|
||||
if (!orgRevisionActive) return new HttpSuccess([]);
|
||||
|
|
@ -439,6 +439,8 @@ export class PermissionProfileController extends Controller {
|
|||
id: _data.id,
|
||||
profileId: _data.profileId,
|
||||
orgRootId: _data.orgRootId,
|
||||
isCheck: _data.isCheck,
|
||||
isEdit: _data.isEdit,
|
||||
orgNew: _data.orgRootTree.orgRootName,
|
||||
avatar: _data.profileTree.avatar,
|
||||
avatarName: _data.profileTree.avatarName,
|
||||
|
|
@ -467,7 +469,7 @@ export class PermissionProfileController extends Controller {
|
|||
@Post()
|
||||
async Post(
|
||||
@Request() request: RequestWithUser,
|
||||
@Body() requestBody: { nodeId: string; personId: string[] },
|
||||
@Body() requestBody: { nodeId: string; personId: string[]; isEdit: boolean; isCheck: boolean },
|
||||
) {
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
|
|
@ -508,6 +510,8 @@ export class PermissionProfileController extends Controller {
|
|||
const _permissionProfile = profile.map((profile) => {
|
||||
const permission = new PermissionProfile();
|
||||
permission.orgRootId = requestBody.nodeId;
|
||||
permission.isEdit = requestBody.isEdit;
|
||||
permission.isCheck = requestBody.isCheck;
|
||||
permission.profileId = profile.id;
|
||||
permission.createdUserId = request.user.sub;
|
||||
permission.createdFullName = request.user.name;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,18 @@ export class PermissionProfile extends EntityBase {
|
|||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
comment: "สิทธิ์การแก้ไข",
|
||||
default: false,
|
||||
})
|
||||
isEdit: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "สิทธิ์การตรวจสอบ",
|
||||
default: false,
|
||||
})
|
||||
isCheck: boolean;
|
||||
|
||||
@ManyToOne(() => OrgRoot, (orgRoot) => orgRoot.permissionProfileRoots)
|
||||
@JoinColumn({ name: "orgRootId" })
|
||||
orgRootTree: OrgRoot;
|
||||
|
|
|
|||
1244
src/migration/1742958824719-update_permission_addEdit.ts
Normal file
1244
src/migration/1742958824719-update_permission_addEdit.ts
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue