no message
This commit is contained in:
parent
542df70eb7
commit
eef0f87b5c
1 changed files with 25 additions and 25 deletions
|
|
@ -127,7 +127,7 @@ export class OrgChild1Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgChild1Rank");
|
||||
}
|
||||
|
||||
if (rootIdExits.orgRootRankSub != "DISTRICT" && rootIdExits.orgRootRankSub != "OFFICE") {
|
||||
if (rootIdExits.orgRootRankSub == "BUREAU") {
|
||||
const chkCode = await this.child1Repository.findOne({
|
||||
where: {
|
||||
orgRevisionId: rootIdExits.orgRevisionId,
|
||||
|
|
@ -252,30 +252,30 @@ export class OrgChild1Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||
}
|
||||
|
||||
// if (rootIdExits.orgRootRankSub != "DISTRICT" && rootIdExits.orgRootRankSub != "OFFICE") {
|
||||
// const chkCode = await this.child1Repository.findOne({
|
||||
// where: {
|
||||
// id: Not(id),
|
||||
// orgRevisionId: rootIdExits.orgRevisionId,
|
||||
// orgRootId: requestBody.orgRootId,
|
||||
// orgChild1Code: requestBody.orgChild1Code,
|
||||
// },
|
||||
// });
|
||||
// if (chkCode != null) {
|
||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสส่วนราชการนี้มีอยู่ในระบบแล้ว");
|
||||
// }
|
||||
// const chkShort = await this.child1Repository.findOne({
|
||||
// where: {
|
||||
// id: Not(id),
|
||||
// orgRevisionId: rootIdExits.orgRevisionId,
|
||||
// orgRootId: requestBody.orgRootId,
|
||||
// orgChild1ShortName: requestBody.orgChild1ShortName,
|
||||
// },
|
||||
// });
|
||||
// if (chkShort != null) {
|
||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "อักษรย่อนี้มีอยู่ในระบบแล้ว");
|
||||
// }
|
||||
// }
|
||||
if (rootIdExits.orgRootRankSub == "BUREAU") {
|
||||
const chkCode = await this.child1Repository.findOne({
|
||||
where: {
|
||||
id: Not(id),
|
||||
orgRevisionId: rootIdExits.orgRevisionId,
|
||||
orgRootId: requestBody.orgRootId,
|
||||
orgChild1Code: requestBody.orgChild1Code,
|
||||
},
|
||||
});
|
||||
if (chkCode != null) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสส่วนราชการนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
const chkShort = await this.child1Repository.findOne({
|
||||
where: {
|
||||
id: Not(id),
|
||||
orgRevisionId: rootIdExits.orgRevisionId,
|
||||
orgRootId: requestBody.orgRootId,
|
||||
orgChild1ShortName: requestBody.orgChild1ShortName,
|
||||
},
|
||||
});
|
||||
if (chkShort != null) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "อักษรย่อนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
}
|
||||
|
||||
// if(requestBody.orgChild1Code == rootIdExits.orgRootCode){
|
||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "รหัสส่วนราชการนี้ซ้ำกับรหัสหน่วยงาน");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue