ตัดการเพิ่มฟิว order ไปก่อนและฟิว code validate เฉพาะ root และ child 1
This commit is contained in:
parent
2dc74fc7d2
commit
aca680f4f4
10 changed files with 204 additions and 274 deletions
|
|
@ -1,21 +1,21 @@
|
||||||
import { AppDataSource } from "../database/data-source";
|
import { AppDataSource } from "../database/data-source";
|
||||||
import { OrgChild1, CreateOrgChild1, UpdateOrgChild1 } from "../entities/OrgChild1";
|
import { OrgChild1, CreateOrgChild1, UpdateOrgChild1 } from "../entities/OrgChild1";
|
||||||
import { OrgChild2 } from "../entities/OrgChild2";
|
import { OrgChild2 } from "../entities/OrgChild2";
|
||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Delete,
|
Delete,
|
||||||
Get,
|
Get,
|
||||||
Path,
|
Path,
|
||||||
Post,
|
Post,
|
||||||
Put,
|
Put,
|
||||||
Response,
|
Response,
|
||||||
Route,
|
Route,
|
||||||
SuccessResponse,
|
SuccessResponse,
|
||||||
Tags,
|
Tags,
|
||||||
Query,
|
Query,
|
||||||
Request,
|
Request,
|
||||||
Security,
|
Security,
|
||||||
} from "tsoa";
|
} from "tsoa";
|
||||||
import HttpStatusCode from "../interfaces/http-status";
|
import HttpStatusCode from "../interfaces/http-status";
|
||||||
import HttpSuccess from "../interfaces/http-success";
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
|
|
@ -41,57 +41,52 @@ export class OrgChild1Controller {
|
||||||
async save(
|
async save(
|
||||||
@Body() requestBody: CreateOrgChild1,
|
@Body() requestBody: CreateOrgChild1,
|
||||||
@Request() request: { user: Record<string, any> },
|
@Request() request: { user: Record<string, any> },
|
||||||
){
|
) {
|
||||||
try {
|
try {
|
||||||
const chkOrder = await this.child1Repository.findOne({ where: { orgRootId:requestBody.orgRootId, orgChild1Order:requestBody.orgChild1Order }});
|
const chkCode = await this.child1Repository.findOne({
|
||||||
if (chkOrder != null){
|
where: { orgRootId: requestBody.orgRootId, orgChild1Code: requestBody.orgChild1Code },
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
});
|
||||||
}
|
if (chkCode != null) {
|
||||||
const chkCode = await this.child1Repository.findOne({ where: { orgRootId:requestBody.orgRootId, orgChild1Code:requestBody.orgChild1Code }});
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
||||||
if (chkCode != null){
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const child1 = Object.assign(new OrgChild1(), requestBody) as OrgChild1;
|
|
||||||
child1.orgChild1Name = requestBody.orgChild1Name
|
|
||||||
child1.createdUserId = request.user.sub
|
|
||||||
child1.createdFullName = request.user.name
|
|
||||||
child1.createdAt = new Date()
|
|
||||||
child1.lastUpdateUserId = request.user.sub
|
|
||||||
child1.lastUpdateFullName= request.user.name
|
|
||||||
child1.lastUpdatedAt = new Date()
|
|
||||||
await this.child1Repository.save(child1);
|
|
||||||
return new HttpSuccess();
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
// return new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, String(error))
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
const child1 = Object.assign(new OrgChild1(), requestBody) as OrgChild1;
|
||||||
|
child1.orgChild1Name = requestBody.orgChild1Name;
|
||||||
|
child1.createdUserId = request.user.sub;
|
||||||
|
child1.createdFullName = request.user.name;
|
||||||
|
child1.createdAt = new Date();
|
||||||
|
child1.lastUpdateUserId = request.user.sub;
|
||||||
|
child1.lastUpdateFullName = request.user.name;
|
||||||
|
child1.lastUpdatedAt = new Date();
|
||||||
|
await this.child1Repository.save(child1);
|
||||||
|
return new HttpSuccess();
|
||||||
|
} catch (error) {
|
||||||
|
// return new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, String(error))
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API แก้ไขโครงสร้างระดับ1
|
* API แก้ไขโครงสร้างระดับ1
|
||||||
*
|
*
|
||||||
* @summary ORG_005 - แก้ไขโครงสร้างระดับ1 (ADMIN) #5
|
* @summary ORG_005 - แก้ไขโครงสร้างระดับ1 (ADMIN) #5
|
||||||
*
|
*
|
||||||
* @param {string} id id สร้างโครงสร้างระดับ1
|
* @param {string} id id สร้างโครงสร้างระดับ1
|
||||||
*/
|
*/
|
||||||
@Put("{id}")
|
@Put("{id}")
|
||||||
async Edit(
|
async Edit(
|
||||||
@Path() id: string,
|
@Path() id: string,
|
||||||
@Body() requestBody: UpdateOrgChild1,
|
@Body() requestBody: UpdateOrgChild1,
|
||||||
@Request() request: { user: Record<string, any> },
|
@Request() request: { user: Record<string, any> },
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const chkOrder = await this.child1Repository.findOne({ where: { id: id, orgChild1Order:requestBody.orgChild1Order }});
|
const chkCode = await this.child1Repository.findOne({
|
||||||
if (chkOrder != null){
|
where: { id: id, orgChild1Code: requestBody.orgChild1Code },
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
});
|
||||||
}
|
if (chkCode != null) {
|
||||||
const chkCode = await this.child1Repository.findOne({ where: { id: id, orgChild1Code:requestBody.orgChild1Code }});
|
|
||||||
if (chkCode != null){
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
||||||
}
|
}
|
||||||
const child1 = await this.child1Repository.findOne({ where: { id } });
|
const child1 = await this.child1Repository.findOne({ where: { id } });
|
||||||
if (!child1){
|
if (!child1) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
}
|
}
|
||||||
child1.lastUpdateUserId = request.user.sub;
|
child1.lastUpdateUserId = request.user.sub;
|
||||||
|
|
@ -110,20 +105,21 @@ export class OrgChild1Controller {
|
||||||
*
|
*
|
||||||
* @summary ORG_006 - ลบโครงสร้างระดับ1 (ADMIN) #6
|
* @summary ORG_006 - ลบโครงสร้างระดับ1 (ADMIN) #6
|
||||||
*
|
*
|
||||||
* @param {string} id id สร้างโครงสร้างระดับ1
|
* @param {string} id id สร้างโครงสร้างระดับ1
|
||||||
*/
|
*/
|
||||||
@Delete("{id}")
|
@Delete("{id}")
|
||||||
async delete(
|
async delete(@Path() id: string) {
|
||||||
@Path() id: string,
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
const child1 = await this.child1Repository.findOne({ where: { id } });
|
const child1 = await this.child1Repository.findOne({ where: { id } });
|
||||||
if (!child1) {
|
if (!child1) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
}
|
}
|
||||||
const exitsChild2 = await this.child2Repository.findOne({ where: { orgChild1Id: id } });
|
const exitsChild2 = await this.child2Repository.findOne({ where: { orgChild1Id: id } });
|
||||||
if(exitsChild2){
|
if (exitsChild2) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้ เนื่องจาก id ผูกกับโครงสร้างระดับ2");
|
throw new HttpError(
|
||||||
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
"ไม่สามารถลบได้ เนื่องจาก id ผูกกับโครงสร้างระดับ2",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
await this.child1Repository.remove(child1);
|
await this.child1Repository.remove(child1);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
@ -131,5 +127,4 @@ export class OrgChild1Controller {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export class OrgChild2Controller extends Controller {
|
||||||
orgChild2Name: "string", //ชื่อหน่วยงาน
|
orgChild2Name: "string", //ชื่อหน่วยงาน
|
||||||
orgChild2ShortName: "string", //อักษรย่อ
|
orgChild2ShortName: "string", //อักษรย่อ
|
||||||
orgChild2Code: "string", //รหัสหน่วยงาน
|
orgChild2Code: "string", //รหัสหน่วยงาน
|
||||||
orgChild2Order: "number", //ลำดับที่ของหน่วยงาน
|
// orgChild2Order: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgChild2PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgChild2PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgChild2PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgChild2PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgChild2Fax: "string", //หมายเลขโทรสาร
|
orgChild2Fax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -62,23 +62,12 @@ export class OrgChild2Controller extends Controller {
|
||||||
if (!orgChild2) {
|
if (!orgChild2) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgChild2Repository.findOne({
|
|
||||||
where: { orgChild1Id: requestBody.orgChild1Id, orgChild2Order: requestBody.orgChild2Order },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgChild2Repository.findOne({
|
|
||||||
where: { orgChild1Id: requestBody.orgChild1Id, orgChild2Code: requestBody.orgChild2Code },
|
|
||||||
});
|
|
||||||
if (chkCode != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
if (orgChild1) {
|
if (orgChild1) {
|
||||||
orgChild2.orgChild2Name = requestBody.orgChild2Name;
|
orgChild2.orgChild2Name = requestBody.orgChild2Name;
|
||||||
orgChild2.orgChild2ShortName = requestBody.orgChild2ShortName;
|
orgChild2.orgChild2ShortName = requestBody.orgChild2ShortName;
|
||||||
orgChild2.orgChild2Code = requestBody.orgChild2Code;
|
orgChild2.orgChild2Code = requestBody.orgChild2Code;
|
||||||
orgChild2.orgChild2Order = requestBody.orgChild2Order;
|
// orgChild2.orgChild2Order = requestBody.orgChild2Order;
|
||||||
orgChild2.orgChild2PhoneEx = requestBody.orgChild2PhoneEx;
|
orgChild2.orgChild2PhoneEx = requestBody.orgChild2PhoneEx;
|
||||||
orgChild2.orgChild2PhoneIn = requestBody.orgChild2PhoneIn;
|
orgChild2.orgChild2PhoneIn = requestBody.orgChild2PhoneIn;
|
||||||
orgChild2.orgChild2Fax = requestBody.orgChild2Fax;
|
orgChild2.orgChild2Fax = requestBody.orgChild2Fax;
|
||||||
|
|
@ -113,7 +102,7 @@ export class OrgChild2Controller extends Controller {
|
||||||
orgChild2Name: "string", //ชื่อหน่วยงาน
|
orgChild2Name: "string", //ชื่อหน่วยงาน
|
||||||
orgChild2ShortName: "string", //อักษรย่อ
|
orgChild2ShortName: "string", //อักษรย่อ
|
||||||
orgChild2Code: "string", //รหัสหน่วยงาน
|
orgChild2Code: "string", //รหัสหน่วยงาน
|
||||||
orgChild2Order: "number", //ลำดับที่ของหน่วยงาน
|
// orgChild2Order: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgChild2PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgChild2PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgChild2PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgChild2PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgChild2Fax: "string", //หมายเลขโทรสาร
|
orgChild2Fax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -135,23 +124,12 @@ export class OrgChild2Controller extends Controller {
|
||||||
if (!orgChild2) {
|
if (!orgChild2) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgChild2Repository.findOne({
|
|
||||||
where: { orgChild2Order: requestBody.orgChild2Order },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgChild2Repository.findOne({
|
|
||||||
where: { orgChild2Code: requestBody.orgChild2Code },
|
|
||||||
});
|
|
||||||
if (chkCode != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
if (orgChild1) {
|
if (orgChild1) {
|
||||||
orgChild2.orgChild2Name = requestBody.orgChild2Name;
|
orgChild2.orgChild2Name = requestBody.orgChild2Name;
|
||||||
orgChild2.orgChild2ShortName = requestBody.orgChild2ShortName;
|
orgChild2.orgChild2ShortName = requestBody.orgChild2ShortName;
|
||||||
orgChild2.orgChild2Code = requestBody.orgChild2Code;
|
orgChild2.orgChild2Code = requestBody.orgChild2Code;
|
||||||
orgChild2.orgChild2Order = requestBody.orgChild2Order;
|
// orgChild2.orgChild2Order = requestBody.orgChild2Order;
|
||||||
orgChild2.orgChild2PhoneEx = requestBody.orgChild2PhoneEx;
|
orgChild2.orgChild2PhoneEx = requestBody.orgChild2PhoneEx;
|
||||||
orgChild2.orgChild2PhoneIn = requestBody.orgChild2PhoneIn;
|
orgChild2.orgChild2PhoneIn = requestBody.orgChild2PhoneIn;
|
||||||
orgChild2.orgChild2Fax = requestBody.orgChild2Fax;
|
orgChild2.orgChild2Fax = requestBody.orgChild2Fax;
|
||||||
|
|
@ -188,7 +166,10 @@ export class OrgChild2Controller extends Controller {
|
||||||
if (!orgChild3) {
|
if (!orgChild3) {
|
||||||
await this.orgChild2Repository.remove(orgChild2);
|
await this.orgChild2Repository.remove(orgChild2);
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบข้อมูลได้");
|
throw new HttpError(
|
||||||
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
"ไม่สามารถลบข้อมูลได้เมื่อมีข้อมูลโครงสร้างระดับ3",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
import { AppDataSource } from "../database/data-source";
|
import { AppDataSource } from "../database/data-source";
|
||||||
import { OrgChild2 } from "../entities/OrgChild2";
|
import { OrgChild2 } from "../entities/OrgChild2";
|
||||||
import { OrgChild3, CreateOrgChild3, UpdateOrgChild3 } from "../entities/OrgChild3";
|
import { OrgChild3, CreateOrgChild3, UpdateOrgChild3 } from "../entities/OrgChild3";
|
||||||
import { OrgChild4 } from "../entities/OrgChild4";
|
import { OrgChild4 } from "../entities/OrgChild4";
|
||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Delete,
|
Delete,
|
||||||
Get,
|
Get,
|
||||||
Path,
|
Path,
|
||||||
Post,
|
Post,
|
||||||
Put,
|
Put,
|
||||||
Response,
|
Response,
|
||||||
Route,
|
Route,
|
||||||
SuccessResponse,
|
SuccessResponse,
|
||||||
Tags,
|
Tags,
|
||||||
Query,
|
Query,
|
||||||
Request,
|
Request,
|
||||||
Security,
|
Security,
|
||||||
} from "tsoa";
|
} from "tsoa";
|
||||||
import HttpStatusCode from "../interfaces/http-status";
|
import HttpStatusCode from "../interfaces/http-status";
|
||||||
import HttpSuccess from "../interfaces/http-success";
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
|
|
@ -29,116 +29,101 @@ import HttpError from "../interfaces/http-error";
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
||||||
export class OrgChild3Controller {
|
export class OrgChild3Controller {
|
||||||
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
||||||
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
||||||
private child4Repository = AppDataSource.getRepository(OrgChild4);
|
private child4Repository = AppDataSource.getRepository(OrgChild4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API สร้างโครงสร้างระดับ3
|
* API สร้างโครงสร้างระดับ3
|
||||||
*
|
*
|
||||||
* @summary ORG_010 - สร้างโครงสร้างระดับ3 (ADMIN) #10
|
* @summary ORG_010 - สร้างโครงสร้างระดับ3 (ADMIN) #10
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Post()
|
@Post()
|
||||||
async save(
|
async save(
|
||||||
@Body() requestBody: CreateOrgChild3,
|
@Body() requestBody: CreateOrgChild3,
|
||||||
@Request() request: { user: Record<string, any> },
|
@Request() request: { user: Record<string, any> },
|
||||||
){
|
) {
|
||||||
try {
|
try {
|
||||||
const chkOrder = await this.child3Repository.findOne({ where: { orgChild2Id:requestBody.orgChild2Id, orgChild3Order:requestBody.orgChild3Order }});
|
//BE ใช้ orgChild2Id หา orgChild1Id, orgRootId
|
||||||
if (chkOrder != null){
|
const child2 = await this.child2Repository.findOne({
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
where: { id: requestBody.orgChild2Id },
|
||||||
}
|
});
|
||||||
const chkCode = await this.child3Repository.findOne({ where: { orgChild2Id:requestBody.orgChild2Id, orgChild3Code:requestBody.orgChild3Code }});
|
if (!child2) {
|
||||||
if (chkCode != null){
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
}
|
||||||
}
|
const child3 = Object.assign(new OrgChild3(), requestBody) as OrgChild3;
|
||||||
//BE ใช้ orgChild2Id หา orgChild1Id, orgRootId
|
child3.orgChild3Name = requestBody.orgChild3Name;
|
||||||
const child2 = await this.child2Repository.findOne({ where: { id :requestBody.orgChild2Id }});
|
child3.createdUserId = request.user.sub;
|
||||||
if(!child2){
|
child3.createdFullName = request.user.name;
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
child3.createdAt = new Date();
|
||||||
}
|
child3.lastUpdateUserId = request.user.sub;
|
||||||
const child3 = Object.assign(new OrgChild3(), requestBody) as OrgChild3;
|
child3.lastUpdateFullName = request.user.name;
|
||||||
child3.orgChild3Name = requestBody.orgChild3Name
|
child3.lastUpdatedAt = new Date();
|
||||||
child3.createdUserId = request.user.sub
|
(child3.orgRootId = String(child2?.orgRootId)),
|
||||||
child3.createdFullName = request.user.name
|
(child3.orgChild1Id = String(child2?.orgChild1Id)),
|
||||||
child3.createdAt = new Date()
|
await this.child3Repository.save(child3);
|
||||||
child3.lastUpdateUserId = request.user.sub
|
return new HttpSuccess();
|
||||||
child3.lastUpdateFullName= request.user.name
|
} catch (error) {
|
||||||
child3.lastUpdatedAt = new Date()
|
return error;
|
||||||
child3.orgRootId = String(child2?.orgRootId),
|
|
||||||
child3.orgChild1Id = String(child2?.orgChild1Id),
|
|
||||||
await this.child3Repository.save(child3);
|
|
||||||
return new HttpSuccess();
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API แก้ไขโครงสร้างระดับ3
|
* API แก้ไขโครงสร้างระดับ3
|
||||||
*
|
*
|
||||||
* @summary ORG_011 - แก้ไขโครงสร้างระดับ3 (ADMIN) #11
|
* @summary ORG_011 - แก้ไขโครงสร้างระดับ3 (ADMIN) #11
|
||||||
*
|
*
|
||||||
* @param {string} id id สร้างโครงสร้างระดับ3
|
* @param {string} id id สร้างโครงสร้างระดับ3
|
||||||
*/
|
*/
|
||||||
@Put("{id}")
|
@Put("{id}")
|
||||||
async Edit(
|
async Edit(
|
||||||
@Path() id: string,
|
@Path() id: string,
|
||||||
@Body() requestBody: UpdateOrgChild3,
|
@Body() requestBody: UpdateOrgChild3,
|
||||||
@Request() request: { user: Record<string, any> },
|
@Request() request: { user: Record<string, any> },
|
||||||
){
|
) {
|
||||||
try {
|
try {
|
||||||
const chkOrder = await this.child3Repository.findOne({ where: { id: id, orgChild3Order:requestBody.orgChild3Order, }});
|
const child3 = await this.child3Repository.findOne({ where: { id } });
|
||||||
if (chkOrder != null){
|
if (!child3) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
}
|
}
|
||||||
const chkCode = await this.child3Repository.findOne({ where: { id: id, orgChild3Code:requestBody.orgChild3Code }});
|
|
||||||
if (chkCode != null){
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const child3 = await this.child3Repository.findOne({ where: { id } });
|
|
||||||
if (!child3){
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
|
||||||
}
|
|
||||||
|
|
||||||
child3.lastUpdateUserId = request.user.sub;
|
child3.lastUpdateUserId = request.user.sub;
|
||||||
child3.lastUpdateFullName = request.user.name;
|
child3.lastUpdateFullName = request.user.name;
|
||||||
child3.lastUpdatedAt = new Date();
|
child3.lastUpdatedAt = new Date();
|
||||||
this.child3Repository.merge(child3, requestBody);
|
this.child3Repository.merge(child3, requestBody);
|
||||||
await this.child3Repository.save(child3);
|
await this.child3Repository.save(child3);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return error;
|
return error;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API ลบโครงสร้างระดับ3
|
* API ลบโครงสร้างระดับ3
|
||||||
*
|
*
|
||||||
* @summary ORG_012 - ลบโครงสร้างระดับ3 (ADMIN) #12
|
* @summary ORG_012 - ลบโครงสร้างระดับ3 (ADMIN) #12
|
||||||
*
|
*
|
||||||
* @param {string} id id สร้างโครงสร้างระดับ3
|
* @param {string} id id สร้างโครงสร้างระดับ3
|
||||||
*/
|
*/
|
||||||
@Delete("{id}")
|
@Delete("{id}")
|
||||||
async delete(
|
async delete(@Path() id: string) {
|
||||||
@Path() id: string,
|
try {
|
||||||
){
|
const child3 = await this.child3Repository.findOne({ where: { id } });
|
||||||
try {
|
if (!child3) {
|
||||||
const child3 = await this.child3Repository.findOne({ where: { id } });
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
if (!child3) {
|
}
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
const exitsChild4 = await this.child4Repository.findOne({ where: { orgChild3Id: id } });
|
||||||
}
|
if (exitsChild4) {
|
||||||
const exitsChild4 = await this.child4Repository.findOne({ where: { orgChild3Id: id } });
|
throw new HttpError(
|
||||||
if(exitsChild4){
|
HttpStatusCode.NOT_FOUND,
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้ เนื่องจาก id ผูกกับโครงสร้างระดับ4");
|
"ไม่สามารถลบได้ เนื่องจาก id ผูกกับโครงสร้างระดับ4",
|
||||||
}
|
);
|
||||||
await this.child3Repository.remove(child3);
|
}
|
||||||
return new HttpSuccess();
|
await this.child3Repository.remove(child3);
|
||||||
} catch (error) {
|
return new HttpSuccess();
|
||||||
return error;
|
} catch (error) {
|
||||||
}
|
return error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ export class OrgChild4Controller extends Controller {
|
||||||
orgChild4Name: "string", //ชื่อหน่วยงาน
|
orgChild4Name: "string", //ชื่อหน่วยงาน
|
||||||
orgChild4ShortName: "string", //อักษรย่อ
|
orgChild4ShortName: "string", //อักษรย่อ
|
||||||
orgChild4Code: "string", //รหัสหน่วยงาน
|
orgChild4Code: "string", //รหัสหน่วยงาน
|
||||||
orgChild4Order: "number", //ลำดับที่ของหน่วยงาน
|
// orgChild4Order: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgChild4Fax: "string", //หมายเลขโทรสาร
|
orgChild4Fax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -51,11 +51,10 @@ export class OrgChild4Controller extends Controller {
|
||||||
async create(
|
async create(
|
||||||
@Body()
|
@Body()
|
||||||
requestBody: CreateOrgChild4,
|
requestBody: CreateOrgChild4,
|
||||||
// @Request() request: { user: Record<string, any> },
|
@Request() request: { user: Record<string, any> },
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
console.log("child3Id:"+requestBody.orgChild3Id);
|
|
||||||
|
|
||||||
const orgChild3 = await this.orgChild3Repository.findOne({
|
const orgChild3 = await this.orgChild3Repository.findOne({
|
||||||
where: { id: requestBody.orgChild3Id },
|
where: { id: requestBody.orgChild3Id },
|
||||||
});
|
});
|
||||||
|
|
@ -63,23 +62,12 @@ export class OrgChild4Controller extends Controller {
|
||||||
if (!orgChild4) {
|
if (!orgChild4) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgChild4Repository.findOne({
|
|
||||||
where: { orgChild3Id: requestBody.orgChild3Id, orgChild4Order: requestBody.orgChild4Order },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgChild4Repository.findOne({
|
|
||||||
where: { orgChild3Id: requestBody.orgChild3Id, orgChild4Code: requestBody.orgChild4Code },
|
|
||||||
});
|
|
||||||
if (chkCode != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
if (orgChild3) {
|
if (orgChild3) {
|
||||||
orgChild4.orgChild4Name = requestBody.orgChild4Name;
|
orgChild4.orgChild4Name = requestBody.orgChild4Name;
|
||||||
orgChild4.orgChild4ShortName = requestBody.orgChild4ShortName;
|
orgChild4.orgChild4ShortName = requestBody.orgChild4ShortName;
|
||||||
orgChild4.orgChild4Code = requestBody.orgChild4Code;
|
orgChild4.orgChild4Code = requestBody.orgChild4Code;
|
||||||
orgChild4.orgChild4Order = requestBody.orgChild4Order;
|
// orgChild4.orgChild4Order = requestBody.orgChild4Order;
|
||||||
orgChild4.orgChild4PhoneEx = requestBody.orgChild4PhoneEx;
|
orgChild4.orgChild4PhoneEx = requestBody.orgChild4PhoneEx;
|
||||||
orgChild4.orgChild4PhoneIn = requestBody.orgChild4PhoneIn;
|
orgChild4.orgChild4PhoneIn = requestBody.orgChild4PhoneIn;
|
||||||
orgChild4.orgChild4Fax = requestBody.orgChild4Fax;
|
orgChild4.orgChild4Fax = requestBody.orgChild4Fax;
|
||||||
|
|
@ -88,10 +76,10 @@ export class OrgChild4Controller extends Controller {
|
||||||
orgChild4.orgChild1Id = orgChild3.orgChild1Id;
|
orgChild4.orgChild1Id = orgChild3.orgChild1Id;
|
||||||
orgChild4.orgChild2Id = orgChild3.orgChild2Id;
|
orgChild4.orgChild2Id = orgChild3.orgChild2Id;
|
||||||
orgChild4.orgChild3Id = orgChild3.id;
|
orgChild4.orgChild3Id = orgChild3.id;
|
||||||
// orgChild4.createdUserId = request.user.sub;
|
orgChild4.createdUserId = request.user.sub;
|
||||||
// orgChild4.createdFullName = request.user.name;
|
orgChild4.createdFullName = request.user.name;
|
||||||
// orgChild4.lastUpdateUserId = request.user.sub;
|
orgChild4.lastUpdateUserId = request.user.sub;
|
||||||
// orgChild4.lastUpdateFullName = request.user.name;
|
orgChild4.lastUpdateFullName = request.user.name;
|
||||||
await this.orgChild4Repository.save(orgChild4);
|
await this.orgChild4Repository.save(orgChild4);
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีโครงสร้างระดับ3");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีโครงสร้างระดับ3");
|
||||||
|
|
@ -116,7 +104,7 @@ export class OrgChild4Controller extends Controller {
|
||||||
orgChild4Name: "string", //ชื่อหน่วยงาน
|
orgChild4Name: "string", //ชื่อหน่วยงาน
|
||||||
orgChild4ShortName: "string", //อักษรย่อ
|
orgChild4ShortName: "string", //อักษรย่อ
|
||||||
orgChild4Code: "string", //รหัสหน่วยงาน
|
orgChild4Code: "string", //รหัสหน่วยงาน
|
||||||
orgChild4Order: "number", //ลำดับที่ของหน่วยงาน
|
// orgChild4Order: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgChild4PhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgChild4PhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgChild4Fax: "string", //หมายเลขโทรสาร
|
orgChild4Fax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -138,23 +126,12 @@ export class OrgChild4Controller extends Controller {
|
||||||
if (!orgChild4) {
|
if (!orgChild4) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgChild4Repository.findOne({
|
|
||||||
where: { orgChild4Order: requestBody.orgChild4Order },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgChild4Repository.findOne({
|
|
||||||
where: { orgChild4Code: requestBody.orgChild4Code },
|
|
||||||
});
|
|
||||||
if (chkCode != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
if (orgChild3) {
|
if (orgChild3) {
|
||||||
orgChild4.orgChild4Name = requestBody.orgChild4Name;
|
orgChild4.orgChild4Name = requestBody.orgChild4Name;
|
||||||
orgChild4.orgChild4ShortName = requestBody.orgChild4ShortName;
|
orgChild4.orgChild4ShortName = requestBody.orgChild4ShortName;
|
||||||
orgChild4.orgChild4Code = requestBody.orgChild4Code;
|
orgChild4.orgChild4Code = requestBody.orgChild4Code;
|
||||||
orgChild4.orgChild4Order = requestBody.orgChild4Order;
|
// orgChild4.orgChild4Order = requestBody.orgChild4Order;
|
||||||
orgChild4.orgChild4PhoneEx = requestBody.orgChild4PhoneEx;
|
orgChild4.orgChild4PhoneEx = requestBody.orgChild4PhoneEx;
|
||||||
orgChild4.orgChild4PhoneIn = requestBody.orgChild4PhoneIn;
|
orgChild4.orgChild4PhoneIn = requestBody.orgChild4PhoneIn;
|
||||||
orgChild4.orgChild4Fax = requestBody.orgChild4Fax;
|
orgChild4.orgChild4Fax = requestBody.orgChild4Fax;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export class OrgRootController extends Controller {
|
||||||
orgRootName: "string", //ชื่อหน่วยงาน
|
orgRootName: "string", //ชื่อหน่วยงาน
|
||||||
orgRootShortName: "string", //อักษรย่อ
|
orgRootShortName: "string", //อักษรย่อ
|
||||||
orgRootCode: "string", //รหัสหน่วยงาน
|
orgRootCode: "string", //รหัสหน่วยงาน
|
||||||
orgRootOrder: "number", //ลำดับที่ของหน่วยงาน
|
// orgRootOrder: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgRootPhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgRootPhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgRootPhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgRootPhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgRootFax: "string", //หมายเลขโทรสาร
|
orgRootFax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -56,12 +56,7 @@ export class OrgRootController extends Controller {
|
||||||
if (!orgRoot) {
|
if (!orgRoot) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgRootRepository.findOne({
|
|
||||||
where: { orgRootOrder: requestBody.orgRootOrder },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgRootRepository.findOne({
|
const chkCode = await this.orgRootRepository.findOne({
|
||||||
where: { orgRootCode: requestBody.orgRootCode },
|
where: { orgRootCode: requestBody.orgRootCode },
|
||||||
});
|
});
|
||||||
|
|
@ -71,13 +66,13 @@ export class OrgRootController extends Controller {
|
||||||
orgRoot.orgRootName = requestBody.orgRootName;
|
orgRoot.orgRootName = requestBody.orgRootName;
|
||||||
orgRoot.orgRootShortName = requestBody.orgRootShortName;
|
orgRoot.orgRootShortName = requestBody.orgRootShortName;
|
||||||
orgRoot.orgRootCode = requestBody.orgRootCode;
|
orgRoot.orgRootCode = requestBody.orgRootCode;
|
||||||
orgRoot.orgRootOrder = requestBody.orgRootOrder;
|
// orgRoot.orgRootOrder = requestBody.orgRootOrder;
|
||||||
orgRoot.orgRootPhoneEx = requestBody.orgRootPhoneEx;
|
orgRoot.orgRootPhoneEx = requestBody.orgRootPhoneEx;
|
||||||
orgRoot.orgRootPhoneIn = requestBody.orgRootPhoneIn;
|
orgRoot.orgRootPhoneIn = requestBody.orgRootPhoneIn;
|
||||||
orgRoot.orgRootFax = requestBody.orgRootFax;
|
orgRoot.orgRootFax = requestBody.orgRootFax;
|
||||||
orgRoot.orgRootIsNormal = requestBody.orgRootIsNormal;
|
orgRoot.orgRootIsNormal = requestBody.orgRootIsNormal;
|
||||||
orgRoot.createdUserId = request.user.sub
|
orgRoot.createdUserId = request.user.sub;
|
||||||
orgRoot.createdFullName = request.user.name
|
orgRoot.createdFullName = request.user.name;
|
||||||
orgRoot.lastUpdateUserId = request.user.sub;
|
orgRoot.lastUpdateUserId = request.user.sub;
|
||||||
orgRoot.lastUpdateFullName = request.user.name;
|
orgRoot.lastUpdateFullName = request.user.name;
|
||||||
await this.orgRootRepository.save(orgRoot);
|
await this.orgRootRepository.save(orgRoot);
|
||||||
|
|
@ -101,7 +96,7 @@ export class OrgRootController extends Controller {
|
||||||
orgRootName: "string", //ชื่อหน่วยงาน
|
orgRootName: "string", //ชื่อหน่วยงาน
|
||||||
orgRootShortName: "string", //อักษรย่อ
|
orgRootShortName: "string", //อักษรย่อ
|
||||||
orgRootCode: "string", //รหัสหน่วยงาน
|
orgRootCode: "string", //รหัสหน่วยงาน
|
||||||
orgRootOrder: "number", //ลำดับที่ของหน่วยงาน
|
// orgRootOrder: "number", //ลำดับที่ของหน่วยงาน
|
||||||
orgRootPhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgRootPhoneEx: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgRootPhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgRootPhoneIn: "string", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgRootFax: "string", //หมายเลขโทรสาร
|
orgRootFax: "string", //หมายเลขโทรสาร
|
||||||
|
|
@ -119,23 +114,18 @@ export class OrgRootController extends Controller {
|
||||||
if (!orgRoot) {
|
if (!orgRoot) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const chkOrder = await this.orgRootRepository.findOne({
|
|
||||||
where: { orgRootOrder: requestBody.orgRootOrder },
|
|
||||||
});
|
|
||||||
if (chkOrder != null) {
|
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ลำดับที่ของหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
|
||||||
}
|
|
||||||
const chkCode = await this.orgRootRepository.findOne({
|
const chkCode = await this.orgRootRepository.findOne({
|
||||||
where: { orgRootCode: requestBody.orgRootCode },
|
where: { orgRootCode: requestBody.orgRootCode },
|
||||||
});
|
});
|
||||||
if (chkCode != null) {
|
if (chkCode != null) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
||||||
}
|
}
|
||||||
|
|
||||||
orgRoot.orgRootName = requestBody.orgRootName;
|
orgRoot.orgRootName = requestBody.orgRootName;
|
||||||
orgRoot.orgRootShortName = requestBody.orgRootShortName;
|
orgRoot.orgRootShortName = requestBody.orgRootShortName;
|
||||||
orgRoot.orgRootCode = requestBody.orgRootCode;
|
orgRoot.orgRootCode = requestBody.orgRootCode;
|
||||||
orgRoot.orgRootOrder = requestBody.orgRootOrder;
|
// orgRoot.orgRootOrder = requestBody.orgRootOrder;
|
||||||
orgRoot.orgRootPhoneEx = requestBody.orgRootPhoneEx;
|
orgRoot.orgRootPhoneEx = requestBody.orgRootPhoneEx;
|
||||||
orgRoot.orgRootPhoneIn = requestBody.orgRootPhoneIn;
|
orgRoot.orgRootPhoneIn = requestBody.orgRootPhoneIn;
|
||||||
orgRoot.orgRootFax = requestBody.orgRootFax;
|
orgRoot.orgRootFax = requestBody.orgRootFax;
|
||||||
|
|
@ -170,7 +160,10 @@ export class OrgRootController extends Controller {
|
||||||
if (!orgChild1) {
|
if (!orgChild1) {
|
||||||
await this.orgRootRepository.remove(orgRoot);
|
await this.orgRootRepository.remove(orgRoot);
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบข้อมูลได้");
|
throw new HttpError(
|
||||||
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
"ไม่สามารถลบข้อมูลได้เมื่อมีข้อมูลโครงสร้างระดับ1",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
@ -178,5 +171,4 @@ export class OrgRootController extends Controller {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,13 +109,13 @@ export class CreateOrgChild1 {
|
||||||
orgChild1ShortName: string;
|
orgChild1ShortName: string;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild1Code: string;
|
orgChild1Code?: string;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild1Rank: string;
|
orgChild1Rank: string;
|
||||||
|
|
||||||
@Column()
|
// @Column()
|
||||||
orgChild1Order: number;
|
// orgChild1Order?: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild1PhoneEx: string;
|
orgChild1PhoneEx: string;
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,8 @@ export class CreateOrgChild2 {
|
||||||
@Column()
|
@Column()
|
||||||
orgChild2Rank: string;
|
orgChild2Rank: string;
|
||||||
|
|
||||||
@Column()
|
// @Column()
|
||||||
orgChild2Order: number;
|
// orgChild2Order: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild2PhoneEx: string;
|
orgChild2PhoneEx: string;
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,8 @@ export class CreateOrgChild3 {
|
||||||
@Column()
|
@Column()
|
||||||
orgChild3Rank: string;
|
orgChild3Rank: string;
|
||||||
|
|
||||||
@Column()
|
// @Column()
|
||||||
orgChild3Order: number;
|
// orgChild3Order: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild3PhoneEx: string;
|
orgChild3PhoneEx: string;
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ export class CreateOrgChild4 {
|
||||||
@Column()
|
@Column()
|
||||||
orgChild4Rank: string;
|
orgChild4Rank: string;
|
||||||
|
|
||||||
@Column()
|
// @Column()
|
||||||
orgChild4Order: number;
|
// orgChild4Order: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgChild4PhoneEx: string;
|
orgChild4PhoneEx: string;
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,8 @@ export class CreateOrgRoot {
|
||||||
@Column()
|
@Column()
|
||||||
orgRootRank: OrgRootRank;
|
orgRootRank: OrgRootRank;
|
||||||
|
|
||||||
@Column()
|
// @Column()
|
||||||
orgRootOrder: number;
|
// orgRootOrder: number;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
orgRootPhoneEx: string;
|
orgRootPhoneEx: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue