Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2024-09-18 17:59:06 +07:00
commit 3c881d531c
3 changed files with 35 additions and 33 deletions

View file

@ -255,7 +255,6 @@ export class CommandTypeController extends Controller {
_commandType.lastUpdateUserId = request.user.sub;
_commandType.lastUpdateFullName = request.user.name;
_commandType.lastUpdatedAt = new Date();
this.commandTypeRepository.merge(_commandType, requestBody);
await this.commandTypeRepository.save(_commandType);
return new HttpSuccess(_commandType.id);
}
@ -282,7 +281,6 @@ export class CommandTypeController extends Controller {
_commandType.lastUpdateUserId = request.user.sub;
_commandType.lastUpdateFullName = request.user.name;
_commandType.lastUpdatedAt = new Date();
this.commandTypeRepository.merge(_commandType, requestBody);
await this.commandTypeRepository.save(_commandType);
return new HttpSuccess(_commandType.id);
}

View file

@ -4061,6 +4061,7 @@ export class ProfileController extends Controller {
firstName: profile.firstName,
lastName: profile.lastName,
citizenId: profile.citizenId,
birthDate: profile.birthDate,
position: profile.position,
leaveDate: profile.dateLeave,
posMasterNo: posMaster == null ? null : posMaster.posMasterNo,

View file

@ -1,4 +1,4 @@
import { Controller, Get, Route, Security, Tags, SuccessResponse, Response } from "tsoa";
import { Controller, Get, Route, Security, Tags, SuccessResponse, Response, Path } from "tsoa";
import { AppDataSource } from "../database/data-source";
import HttpSuccess from "../interfaces/http-success";
import HttpStatusCode from "../interfaces/http-status";
@ -33,19 +33,20 @@ export class ReportController extends Controller {
* @summary Report1
*
*/
@Get("report1")
async findReport1() {
const orgRevision = await this.orgRevisionRepository.findOne({
where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
relations: ["orgRoots"],
});
if (!orgRevision) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
@Get("report1/{rootId}")
async findReport1(@Path() rootId: string) {
// const orgRevision = await this.orgRevisionRepository.findOne({
// where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
// relations: ["orgRoots"],
// });
// if (!orgRevision) {
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
// }
const orgRootData = await this.orgRootRepository.find({
where: {
orgRevisionId: orgRevision.id,
id: rootId,
// orgRevisionId: orgRevision.id,
},
order: { orgRootOrder: "ASC" },
relations: [
@ -681,19 +682,20 @@ export class ReportController extends Controller {
* @summary Report2
*
*/
@Get("report2")
async findReport2() {
const orgRevision = await this.orgRevisionRepository.findOne({
where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
relations: ["orgRoots"],
});
if (!orgRevision) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
@Get("report2/{rootId}")
async findReport2(@Path() rootId: string) {
// const orgRevision = await this.orgRevisionRepository.findOne({
// where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
// relations: ["orgRoots"],
// });
// if (!orgRevision) {
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
// }
const orgRootData = await this.orgRootRepository.find({
where: {
orgRevisionId: orgRevision.id,
id: rootId,
// orgRevisionId: orgRevision.id,
},
order: { orgRootOrder: "ASC" },
relations: [
@ -2848,19 +2850,20 @@ export class ReportController extends Controller {
* @summary Report3
*
*/
@Get("report3")
async findReport3() {
const orgRevision = await this.orgRevisionRepository.findOne({
where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
relations: ["orgRoots"],
});
if (!orgRevision) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
@Get("report3/{rootId}")
async findReport3(@Path() rootId: string) {
// const orgRevision = await this.orgRevisionRepository.findOne({
// where: { orgRevisionIsDraft: true, orgRevisionIsCurrent: false },
// relations: ["orgRoots"],
// });
// if (!orgRevision) {
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
// }
const orgRootData = await this.orgRootRepository.find({
where: {
orgRevisionId: orgRevision.id,
id: rootId,
// orgRevisionId: orgRevision.id,
},
order: { orgRootOrder: "ASC" },
relations: [