ผูกสิดข้อมูลหลัก
This commit is contained in:
parent
f9fce4ba25
commit
92b2291c4b
15 changed files with 702 additions and 514 deletions
|
|
@ -69,7 +69,7 @@ export class kpiCapacityController extends Controller {
|
|||
},
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionCreate(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionCreate(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiCapacity = Object.assign(new KpiCapacity(), {
|
||||
type: requestBody.type,
|
||||
name: requestBody.name,
|
||||
|
|
@ -134,7 +134,7 @@ export class kpiCapacityController extends Controller {
|
|||
},
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiCapacity = await this.kpiCapacityRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -285,7 +285,8 @@ export class kpiCapacityController extends Controller {
|
|||
},
|
||||
],
|
||||
})
|
||||
async GetKpiCapacityById(@Path() id: string) {
|
||||
async GetKpiCapacityById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiCapacity = await this.kpiCapacityRepository.findOne({
|
||||
where: { id: id },
|
||||
select: ["type", "name", "description"],
|
||||
|
|
@ -315,11 +316,13 @@ export class kpiCapacityController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async listKpiCapacity(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("type") type?: string,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
const [kpiCapacity, total] = await AppDataSource.getRepository(KpiCapacity)
|
||||
.createQueryBuilder("kpiCapacity")
|
||||
.leftJoinAndSelect("kpiCapacity.kpiCapacityDetails", "kpiCapacityDetail")
|
||||
|
|
@ -360,7 +363,7 @@ export class kpiCapacityController extends Controller {
|
|||
*/
|
||||
@Delete("{id}")
|
||||
async deleteKpiCapacity(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionDelete(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiCapacity = await this.kpiCapacityRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
|
|
@ -18,7 +14,7 @@ import {
|
|||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { Like, Not } from "typeorm";
|
||||
import { Like } from "typeorm";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import { KpiEvaluation, updateKpiEvaluation } from "../entities/kpiEvaluation";
|
||||
import permission from "../interfaces/permission";
|
||||
|
|
@ -43,7 +39,7 @@ export class kpiEvaluationController extends Controller {
|
|||
@Body() requestBody: updateKpiEvaluation[],
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_COMPETENCY");
|
||||
const updatedIds: string[] = [];
|
||||
|
||||
for (const item of requestBody) {
|
||||
|
|
@ -70,10 +66,12 @@ export class kpiEvaluationController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async listKpiEvaluation(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
let whereClause: any = {};
|
||||
|
||||
if (keyword !== undefined && keyword !== "") {
|
||||
|
|
|
|||
|
|
@ -43,11 +43,8 @@ export class kpiGroupController extends Controller {
|
|||
@Example({
|
||||
nameGroupKPI: "string", //ชื่อกลุ่มงาน
|
||||
})
|
||||
async createKpiGroup(
|
||||
@Body() requestBody: createKpiGroup,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionCreate(request,"SYS_EVA_COMPETENCY");
|
||||
async createKpiGroup(@Body() requestBody: createKpiGroup, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionCreate(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiGroup = Object.assign(new KpiGroup(), requestBody);
|
||||
const chkkpinameGroup = await this.kpiGroupRepository.findOne({
|
||||
where: {
|
||||
|
|
@ -75,7 +72,7 @@ export class kpiGroupController extends Controller {
|
|||
@Body() requestBody: updateKpiGroup,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiGroup = await this.kpiGroupRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -86,7 +83,7 @@ export class kpiGroupController extends Controller {
|
|||
const chkkpinameGroup = await this.kpiGroupRepository.findOne({
|
||||
where: {
|
||||
nameGroupKPI: requestBody.nameGroupKPI,
|
||||
id: Not(id)
|
||||
id: Not(id),
|
||||
},
|
||||
});
|
||||
if (chkkpinameGroup) {
|
||||
|
|
@ -107,7 +104,8 @@ export class kpiGroupController extends Controller {
|
|||
@Example({
|
||||
nameGroupKPI: "string", //ชื่อกลุ่มงาน
|
||||
})
|
||||
async KpiGroupById(@Path() id: string) {
|
||||
async KpiGroupById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiGroup = await this.kpiGroupRepository.findOne({
|
||||
where: { id: id },
|
||||
select: ["nameGroupKPI"],
|
||||
|
|
@ -124,7 +122,7 @@ export class kpiGroupController extends Controller {
|
|||
*/
|
||||
@Delete("{id}")
|
||||
async deleteKpiGroup(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request,"SYS_EVA_COMPETENCY");
|
||||
await new permission().PermissionDelete(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiGroup = await this.kpiGroupRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -143,10 +141,12 @@ export class kpiGroupController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async listKpiGroup(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
let whereClause: any = {};
|
||||
|
||||
if (keyword !== undefined && keyword !== "") {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
|
|
@ -18,9 +17,9 @@ import {
|
|||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { Like, Not, In, Brackets } from "typeorm";
|
||||
import { In, Brackets } from "typeorm";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import { KpiLink, createKpiLink, updateKpiLink } from "../entities/kpiLink";
|
||||
import { KpiLink, createKpiLink } from "../entities/kpiLink";
|
||||
import { KpiGroup } from "../entities/kpiGroup";
|
||||
import { KpiCapacity } from "../entities/kpiCapacity";
|
||||
import { Position } from "../entities/position";
|
||||
|
|
@ -165,7 +164,8 @@ export class kpiLinkController extends Controller {
|
|||
* @param id
|
||||
*/
|
||||
@Get("{id}")
|
||||
async KpiLinkById(@Path() id: string) {
|
||||
async KpiLinkById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
const kpiLink = await this.kpiLinkRepository.findOne({
|
||||
where: { id: id },
|
||||
relations: ["positions", "kpiCapacitys", "kpiGroup"],
|
||||
|
|
@ -224,10 +224,12 @@ export class kpiLinkController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async listKpiLink(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
const [_kpiLink, _total] = await AppDataSource.getRepository(KpiLink)
|
||||
.createQueryBuilder("kpiLink")
|
||||
.leftJoinAndSelect("kpiLink.kpiGroup", "kpiGroup")
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
|
|
@ -22,7 +20,7 @@ import HttpStatusCode from "../interfaces/http-status";
|
|||
import { KpiPlan, createKpiPlan, updateKpiPlan } from "../entities/kpiPlan";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
import { KpiPeriod } from "../entities/kpiPeriod";
|
||||
import { Brackets, IsNull, Not } from "typeorm";
|
||||
import { Brackets, IsNull } from "typeorm";
|
||||
import { KpiPlanHistory } from "../entities/kpiPlanHistory";
|
||||
import { KpiSpecial } from "../entities/kpiSpecial";
|
||||
import { KpiRole } from "../entities/kpiRole";
|
||||
|
|
@ -48,11 +46,8 @@ export class kpiPlanController extends Controller {
|
|||
* @param request
|
||||
*/
|
||||
@Post()
|
||||
async createKpiPlan(
|
||||
@Body() requestBody: createKpiPlan,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionCreate(request,"SYS_EVA_INDICATOR");
|
||||
async createKpiPlan(@Body() requestBody: createKpiPlan, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionCreate(request, "SYS_EVA_INDICATOR");
|
||||
const kpiPlan = Object.assign(new KpiPlan(), requestBody);
|
||||
if (requestBody.year != null && requestBody.period != null) {
|
||||
const kpiPeriod = await this.kpiPeriodRepository
|
||||
|
|
@ -212,7 +207,7 @@ export class kpiPlanController extends Controller {
|
|||
@Body() requestBody: updateKpiPlan,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_INDICATOR");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_INDICATOR");
|
||||
const kpiPlan = await this.kpiPlanRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -294,7 +289,8 @@ export class kpiPlanController extends Controller {
|
|||
* @param id Guid, *Id ตัวชี้วัดตามแผนฯ
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetKpiPlanById(@Path() id: string) {
|
||||
async GetKpiPlanById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
const kpiPlan = await this.kpiPlanRepository.findOne({
|
||||
where: { id: id },
|
||||
relations: { kpiPeriod: true },
|
||||
|
|
@ -398,6 +394,7 @@ export class kpiPlanController extends Controller {
|
|||
*/
|
||||
@Post("search")
|
||||
async listKpiPlan(
|
||||
@Request() request: RequestWithUser,
|
||||
@Body()
|
||||
requestBody: {
|
||||
page: number;
|
||||
|
|
@ -411,6 +408,7 @@ export class kpiPlanController extends Controller {
|
|||
// isNull?: boolean | false;
|
||||
},
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
let condition = "";
|
||||
let parameters: any = {};
|
||||
if (requestBody.isAll === false) {
|
||||
|
|
@ -506,7 +504,7 @@ export class kpiPlanController extends Controller {
|
|||
*/
|
||||
@Delete("{id}")
|
||||
async deleteKpiPlan(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request,"SYS_EVA_INDICATOR");
|
||||
await new permission().PermissionDelete(request, "SYS_EVA_INDICATOR");
|
||||
const kpiPlan = await this.kpiPlanRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -592,7 +590,8 @@ export class kpiPlanController extends Controller {
|
|||
* @param id Guid, *Id ประวัดิตัวชี้วัดตามแผน
|
||||
*/
|
||||
@Get("history/{id}")
|
||||
async GetHistory(@Path() id: string) {
|
||||
async GetHistory(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
const kpiPlanHistory = await this.kpiPlanHistoryRepository.find({
|
||||
where: { kpiPlanId: id },
|
||||
order: {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import {
|
|||
updateKpiUserReasonEvaluation,
|
||||
} from "../entities/kpiUserEvaluationReasonCapacity";
|
||||
import { KpiUserEvaluationReasonDevelopment } from "../entities/kpiUserEvaluationReasonDevelopment";
|
||||
import { KpiUserEvaluation } from "../entities/kpiUserEvaluation";
|
||||
import { KpiUserRole } from "../entities/kpiUserRole";
|
||||
import { KpiUserSpecial } from "../entities/kpiUserSpecial";
|
||||
import { KpiUserCapacity } from "../entities/kpiUserCapacity";
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
|
|
@ -44,11 +42,8 @@ export class kpiRoleController extends Controller {
|
|||
* @param request
|
||||
*/
|
||||
@Post()
|
||||
async createKpiRole(
|
||||
@Body() requestBody: createKpiRole,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionCreate(request,"SYS_EVA_INDICATOR");
|
||||
async createKpiRole(@Body() requestBody: createKpiRole, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionCreate(request, "SYS_EVA_INDICATOR");
|
||||
const kpiRole = Object.assign(new KpiRole(), requestBody);
|
||||
if (requestBody.year != null && requestBody.period != null) {
|
||||
const kpiPeriod = await this.kpiPeriodRepository
|
||||
|
|
@ -205,7 +200,7 @@ export class kpiRoleController extends Controller {
|
|||
@Body() requestBody: updateKpiRole,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_INDICATOR");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_INDICATOR");
|
||||
const kpiRole = await this.kpiRoleRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -269,7 +264,8 @@ export class kpiRoleController extends Controller {
|
|||
* @param id Guid, *Id ตัวชี้วัดตามตำแหน่ง
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetKpiRoleById(@Path() id: string) {
|
||||
async GetKpiRoleById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
const kpiRole = await this.kpiRoleRepository.findOne({
|
||||
where: { id: id },
|
||||
relations: { kpiPeriod: true },
|
||||
|
|
@ -343,6 +339,7 @@ export class kpiRoleController extends Controller {
|
|||
*/
|
||||
@Post("search")
|
||||
async listKpiRole(
|
||||
@Request() request: RequestWithUser,
|
||||
@Body()
|
||||
requestBody: {
|
||||
page: number;
|
||||
|
|
@ -357,6 +354,7 @@ export class kpiRoleController extends Controller {
|
|||
// isNull?: boolean | false;
|
||||
},
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
let condition = "";
|
||||
let parameters: any = {};
|
||||
if (requestBody.isAll === false) {
|
||||
|
|
@ -468,8 +466,8 @@ export class kpiRoleController extends Controller {
|
|||
* @param id
|
||||
*/
|
||||
@Delete("{id}")
|
||||
async deleteKpiRole(@Path() id: string,@Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request,"SYS_EVA_INDICATOR");
|
||||
async deleteKpiRole(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request, "SYS_EVA_INDICATOR");
|
||||
const kpiRole = await this.kpiRoleRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -559,7 +557,8 @@ export class kpiRoleController extends Controller {
|
|||
* @param id Guid, *Id ประวัดิตัวชี้วัดตามตำแหน่ง
|
||||
*/
|
||||
@Get("history/{id}")
|
||||
async GetHistory(@Path() id: string) {
|
||||
async GetHistory(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
const kpiRoleHistory = await this.kpiRoleHistoryRepository.find({
|
||||
where: { kpiRoleId: id },
|
||||
order: {
|
||||
|
|
|
|||
|
|
@ -10,18 +10,15 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import { KpiSpecial, CreateKpiSpecial, UpdateKpiSpecial } from "../entities/kpiSpecial";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
import { Brackets, IsNull, Like, Not } from "typeorm";
|
||||
import { Brackets, Not } from "typeorm";
|
||||
import permission from "../interfaces/permission";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
@Route("api/v1/kpi/special")
|
||||
|
|
@ -45,7 +42,7 @@ export class kpiSpecialController extends Controller {
|
|||
@Body() requestBody: CreateKpiSpecial,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionCreate(request,"SYS_EVA_INDICATOR");
|
||||
await new permission().PermissionCreate(request, "SYS_EVA_INDICATOR");
|
||||
const chk_kpiSpecial = await this.kpiSpecialRepository.findOne({
|
||||
where: {
|
||||
including: String(requestBody.including),
|
||||
|
|
@ -82,7 +79,7 @@ export class kpiSpecialController extends Controller {
|
|||
@Body() requestBody: UpdateKpiSpecial,
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_EVA_INDICATOR");
|
||||
await new permission().PermissionUpdate(request, "SYS_EVA_INDICATOR");
|
||||
const kpiSpecial = await this.kpiSpecialRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -115,7 +112,8 @@ export class kpiSpecialController extends Controller {
|
|||
* @param id Guid, *Id ตัวชี้วัด Special
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetKpiSpecialById(@Path() id: string) {
|
||||
async GetKpiSpecialById(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
const KpiSpecial = await this.kpiSpecialRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -156,6 +154,7 @@ export class kpiSpecialController extends Controller {
|
|||
*/
|
||||
@Post("search")
|
||||
async listKpiSpecial(
|
||||
@Request() request: RequestWithUser,
|
||||
@Body()
|
||||
requestBody: {
|
||||
page: number;
|
||||
|
|
@ -165,6 +164,7 @@ export class kpiSpecialController extends Controller {
|
|||
keyword?: string | null;
|
||||
},
|
||||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_INDICATOR");
|
||||
// let condition: any = {};
|
||||
// if (requestBody.keyword !== undefined && requestBody.keyword !== "") {
|
||||
// condition = {
|
||||
|
|
@ -216,8 +216,8 @@ export class kpiSpecialController extends Controller {
|
|||
* @param id
|
||||
*/
|
||||
@Delete("{id}")
|
||||
async deleteKpiSpecial(@Path() id: string, @Request() request: RequestWithUser,) {
|
||||
await new permission().PermissionDelete(request,"SYS_EVA_INDICATOR");
|
||||
async deleteKpiSpecial(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request, "SYS_EVA_INDICATOR");
|
||||
const kpiSpecial = await this.kpiSpecialRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,11 +10,9 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
ArrayValidator,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
|
|
@ -23,11 +21,9 @@ import HttpStatusCode from "../interfaces/http-status";
|
|||
import { KpiCapacity } from "../entities/kpiCapacity";
|
||||
import { KpiUserEvaluation } from "../entities/kpiUserEvaluation";
|
||||
import { KpiUserCapacity, KpiUserCapacityDataPoint } from "../entities/kpiUserCapacity";
|
||||
import { Like, In, Not } from "typeorm";
|
||||
import { Double } from "typeorm/browser";
|
||||
import { Not } from "typeorm";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import permission from "../interfaces/permission";
|
||||
import { request } from "axios";
|
||||
|
||||
@Route("api/v1/kpi/user/capacity")
|
||||
@Tags("kpiUserCapacity")
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
} from "../entities/kpiUserDevelopment";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { KpiUserEvaluation } from "../entities/kpiUserEvaluation";
|
||||
import { Not, Like, Brackets } from "typeorm";
|
||||
import { Not, Brackets } from "typeorm";
|
||||
import { DevelopmentProject } from "../entities/developmentProject";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import permission from "../interfaces/permission";
|
||||
|
|
|
|||
|
|
@ -10,11 +10,9 @@ import {
|
|||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
ArrayValidator,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
|
|
@ -31,7 +29,7 @@ import {
|
|||
updateKpiUserReqEditEvaluation,
|
||||
updateKpiUserResultEvaluation,
|
||||
} from "../entities/kpiUserEvaluation";
|
||||
import { Like, In, Brackets, IsNull, Not } from "typeorm";
|
||||
import { In, Brackets, IsNull, Not } from "typeorm";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
import { KpiCapacity } from "../entities/kpiCapacity";
|
||||
import { Position } from "../entities/position";
|
||||
|
|
@ -249,27 +247,27 @@ export class KpiUserEvaluationController extends Controller {
|
|||
qb.orWhere("kpiUserEvaluation.prefix LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.firstName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.lastName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.org LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.position LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.posTypeName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.posLevelName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere(conditionFullName, {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.firstName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.lastName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.org LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.position LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.posTypeName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere("kpiUserEvaluation.posLevelName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere(conditionFullName, {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
});
|
||||
}),
|
||||
)
|
||||
.orderBy("kpiUserEvaluation.createdAt", "ASC")
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ import {
|
|||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Patch,
|
||||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ import {
|
|||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Patch,
|
||||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
Body,
|
||||
Path,
|
||||
Request,
|
||||
Example,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Query,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue