แก้ชื่อ report2

This commit is contained in:
Kittapath 2024-02-12 09:50:04 +07:00
parent 0819836932
commit 748c91747e
2 changed files with 56 additions and 4 deletions

View file

@ -252,6 +252,13 @@ export class OrganizationController extends Controller {
delete item.id;
const posMaster = Object.assign(new PosMaster(), item);
posMaster.positions = [];
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
posMaster.next_holderId = item.current_holderId;
} else {
posMaster.next_holderId = null;
posMaster.isSit = false;
}
posMaster.current_holderId = null;
posMaster.orgRevisionId = revision.id;
posMaster.orgRootId = data.id;
posMaster.createdUserId = request.user.sub;
@ -266,6 +273,9 @@ export class OrganizationController extends Controller {
delete pos.id;
const position = Object.assign(new Position(), pos);
position.posMasterId = posMaster.id;
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
position.positionIsSelected = false;
}
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;
position.createdAt = new Date();
@ -305,6 +315,13 @@ export class OrganizationController extends Controller {
delete item.id;
const posMaster = Object.assign(new PosMaster(), item);
posMaster.positions = [];
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
posMaster.next_holderId = item.current_holderId;
} else {
posMaster.next_holderId = null;
posMaster.isSit = false;
}
posMaster.current_holderId = null;
posMaster.orgRevisionId = revision.id;
posMaster.orgRootId = data.id;
posMaster.orgChild1Id = data1.id;
@ -320,6 +337,9 @@ export class OrganizationController extends Controller {
delete pos.id;
const position = Object.assign(new Position(), pos);
position.posMasterId = posMaster.id;
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
position.positionIsSelected = false;
}
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;
position.createdAt = new Date();
@ -360,6 +380,13 @@ export class OrganizationController extends Controller {
delete item.id;
const posMaster = Object.assign(new PosMaster(), item);
posMaster.positions = [];
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
posMaster.next_holderId = item.current_holderId;
} else {
posMaster.next_holderId = null;
posMaster.isSit = false;
}
posMaster.current_holderId = null;
posMaster.orgRevisionId = revision.id;
posMaster.orgRootId = data.id;
posMaster.orgChild1Id = data1.id;
@ -376,6 +403,9 @@ export class OrganizationController extends Controller {
delete pos.id;
const position = Object.assign(new Position(), pos);
position.posMasterId = posMaster.id;
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
position.positionIsSelected = false;
}
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;
position.createdAt = new Date();
@ -419,6 +449,13 @@ export class OrganizationController extends Controller {
delete item.id;
const posMaster = Object.assign(new PosMaster(), item);
posMaster.positions = [];
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
posMaster.next_holderId = item.current_holderId;
} else {
posMaster.next_holderId = null;
posMaster.isSit = false;
}
posMaster.current_holderId = null;
posMaster.orgRevisionId = revision.id;
posMaster.orgRootId = data.id;
posMaster.orgChild1Id = data1.id;
@ -436,6 +473,9 @@ export class OrganizationController extends Controller {
delete pos.id;
const position = Object.assign(new Position(), pos);
position.posMasterId = posMaster.id;
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
position.positionIsSelected = false;
}
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;
position.createdAt = new Date();
@ -478,6 +518,15 @@ export class OrganizationController extends Controller {
delete item.id;
const posMaster = Object.assign(new PosMaster(), item);
posMaster.positions = [];
if (
requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON"
) {
posMaster.next_holderId = item.current_holderId;
} else {
posMaster.next_holderId = null;
posMaster.isSit = false;
}
posMaster.current_holderId = null;
posMaster.orgRevisionId = revision.id;
posMaster.orgRootId = data.id;
posMaster.orgChild1Id = data1.id;
@ -496,6 +545,9 @@ export class OrganizationController extends Controller {
delete pos.id;
const position = Object.assign(new Position(), pos);
position.posMasterId = posMaster.id;
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
position.positionIsSelected = false;
}
position.createdUserId = request.user.sub;
position.createdFullName = request.user.name;
position.createdAt = new Date();

View file

@ -44,13 +44,13 @@ export class ReportController extends Controller {
private child4Repository = AppDataSource.getRepository(OrgChild4);
/**
* API
* API Report2
*
* @summary ORG_029 - (ADMIN) #32
* @summary Report2
*
*/
@Get("position")
async findPosition() {
@Get("report2")
async findReport2() {
try {
const orgRevision = await this.orgRevisionRepository.findOne({
where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },