แก้ caption ไอดี
This commit is contained in:
parent
c1599e9d41
commit
da6f901b81
10 changed files with 27 additions and 117 deletions
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
|
|
@ -75,7 +75,7 @@ export class BloodGroupController extends Controller {
|
|||
) {
|
||||
const bloodGroup = await this.bloodGroupRepository.findOne({ where: { id: id } });
|
||||
if (!bloodGroup) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลกรุ๊ปเลือดนี้");
|
||||
}
|
||||
|
||||
const checkName = await this.bloodGroupRepository.findOne({
|
||||
|
|
@ -106,7 +106,7 @@ export class BloodGroupController extends Controller {
|
|||
where: { id },
|
||||
});
|
||||
if (!delBloodGroup) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลกรุ๊ปเลือดนี้");
|
||||
}
|
||||
|
||||
await this.bloodGroupRepository.delete({ id: id });
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export class EducationLevelController extends Controller {
|
|||
) {
|
||||
const educationLevel = await this.educationLevelRepository.findOne({ where: { id: id } });
|
||||
if (!educationLevel) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับการศึกษานี้");
|
||||
}
|
||||
|
||||
const checkName = await this.educationLevelRepository.findOne({
|
||||
|
|
@ -106,7 +106,7 @@ export class EducationLevelController extends Controller {
|
|||
where: { id },
|
||||
});
|
||||
if (!delEducationLevel) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับการศึกษานี้");
|
||||
}
|
||||
await this.educationLevelRepository.delete({ id: id });
|
||||
return new HttpSuccess();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export class GenderController extends Controller {
|
|||
) {
|
||||
const _gender = await this.genderRepository.findOne({ where: { id: id } });
|
||||
if (!_gender) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลเพศนี้");
|
||||
}
|
||||
const checkName = await this.genderRepository.findOne({
|
||||
where: { id: Not(id), name: requestBody.name },
|
||||
|
|
@ -148,7 +148,7 @@ export class GenderController extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!_delGender) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลเพศนี้");
|
||||
}
|
||||
await this.genderRepository.delete(_delGender.id);
|
||||
return new HttpSuccess();
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ export class OrgRootController extends Controller {
|
|||
if (!orgRoot) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลโครงสร้างระดับ Root ตามไอดีนี้ :" + id,
|
||||
"ไม่พบข้อมูลโครงสร้างระดับ Root นี้",
|
||||
);
|
||||
}
|
||||
orgRoot.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -222,7 +222,7 @@ export class OrgRootController extends Controller {
|
|||
if (!orgRoot) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลโครงสร้างระดับ Root ตามไอดีนี้ :" + id,
|
||||
"ไม่พบข้อมูลโครงสร้างระดับ Root นี้"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export class PosExecutiveController extends Controller {
|
|||
) {
|
||||
const posExecutive = await this.posExecutiveRepository.findOne({ where: { id: id } });
|
||||
if (!posExecutive) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งทางการบริหารนี้");
|
||||
}
|
||||
|
||||
const checkName = await this.posExecutiveRepository.findOne({
|
||||
|
|
@ -108,7 +108,7 @@ export class PosExecutiveController extends Controller {
|
|||
where: { id },
|
||||
});
|
||||
if (!delPosExecutive) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งทางการบริหารนี้");
|
||||
}
|
||||
await this.positionRepository.delete({ posExecutiveId: id });
|
||||
await this.posExecutiveRepository.delete({ id });
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export class PosLevelController extends Controller {
|
|||
if (!chkPosTypeId) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูล posTypeId ไอดีนี้ : " + requestBody.posTypeId,
|
||||
"ไม่พบข้อมูลประเภทตำแหน่งนี้"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ export class PosLevelController extends Controller {
|
|||
) {
|
||||
const posLevel = await this.posLevelRepository.findOne({ where: { id } });
|
||||
if (!posLevel) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่ง");
|
||||
}
|
||||
|
||||
const chkPosTypeId = await this.posTypeRepository.findOne({
|
||||
|
|
@ -129,7 +129,7 @@ export class PosLevelController extends Controller {
|
|||
if (!chkPosTypeId) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูล posTypeId ไอดีนี้ : " + requestBody.posTypeId,
|
||||
"ไม่พบข้อมูลประเภทตำแหน่งนี้"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ export class PosLevelController extends Controller {
|
|||
async deleteLevel(@Path() id: string) {
|
||||
const delPosLevel = await this.posLevelRepository.findOne({ where: { id } });
|
||||
if (!delPosLevel) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับตำแหน่งนี้");
|
||||
}
|
||||
await this.posLevelRepository.remove(delPosLevel);
|
||||
return new HttpSuccess();
|
||||
|
|
@ -204,7 +204,7 @@ export class PosLevelController extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!getPosType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||
}
|
||||
|
||||
const mapPosLevel = {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ export class PosTypeController extends Controller {
|
|||
) {
|
||||
const posType = await this.posTypeRepository.findOne({ where: { id } });
|
||||
if (!posType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||
}
|
||||
const chkPosTypeName = await this.posTypeRepository.findOne({ where: {
|
||||
id: Not(id),
|
||||
|
|
@ -130,7 +130,7 @@ export class PosTypeController extends Controller {
|
|||
async deleteType(@Path() id: string) {
|
||||
const delPosType = await this.posTypeRepository.findOne({ where: { id } });
|
||||
if (!delPosType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||
}
|
||||
const IdExitsInLevel = await this.posLevelRepository.find({
|
||||
where: { posTypeId: id }
|
||||
|
|
@ -178,7 +178,7 @@ export class PosTypeController extends Controller {
|
|||
where: { id: id }
|
||||
});
|
||||
if (!getPosType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||
}
|
||||
|
||||
const mapGetPosType = {
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ export class PositionController extends Controller {
|
|||
async delete(@Path() id: string) {
|
||||
const delPosDict = await this.posDictRepository.findOne({ where: { id } });
|
||||
if (!delPosDict) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งในสายงานนี้");
|
||||
}
|
||||
await this.posDictRepository.remove(delPosDict);
|
||||
return new HttpSuccess();
|
||||
|
|
@ -914,7 +914,7 @@ export class PositionController extends Controller {
|
|||
// relations: ["position"],
|
||||
});
|
||||
if (!delPosMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งในสายงานนี้");
|
||||
}
|
||||
await this.positionRepository.delete({ posMasterId: id });
|
||||
await this.posMasterRepository.delete({ id });
|
||||
|
|
@ -1387,7 +1387,7 @@ export class PositionController extends Controller {
|
|||
where: { id },
|
||||
});
|
||||
if (!posMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
||||
}
|
||||
const posMasters = await this.posMasterRepository.find({
|
||||
where: {
|
||||
|
|
@ -1525,15 +1525,6 @@ export class PositionController extends Controller {
|
|||
if (requestBody.isNode === true) {
|
||||
switch (requestBody.type) {
|
||||
case 0: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgRootId: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: { orgRootId: requestBody.id },
|
||||
});
|
||||
|
|
@ -1564,15 +1555,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 1: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild1Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: { orgChild1Id: requestBody.id },
|
||||
});
|
||||
|
|
@ -1603,15 +1585,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 2: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild2Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: { orgChild2Id: requestBody.id },
|
||||
});
|
||||
|
|
@ -1642,15 +1615,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 3: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild3Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: { orgChild3Id: requestBody.id },
|
||||
});
|
||||
|
|
@ -1681,15 +1645,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 4: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild4Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: { orgChild4Id: requestBody.id },
|
||||
});
|
||||
|
|
@ -1725,15 +1680,6 @@ export class PositionController extends Controller {
|
|||
} else {
|
||||
switch (requestBody.type) {
|
||||
case 0: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgRootId: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRootId: requestBody.id,
|
||||
|
|
@ -1786,15 +1732,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 1: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild1Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRootId: Not(IsNull()) || Not(""),
|
||||
|
|
@ -1847,15 +1784,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 2: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild2Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRootId: Not(IsNull()) || Not(""),
|
||||
|
|
@ -1908,15 +1836,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 3: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild3Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRootId: Not(IsNull()) || Not(""),
|
||||
|
|
@ -1969,15 +1888,6 @@ export class PositionController extends Controller {
|
|||
break;
|
||||
}
|
||||
case 4: {
|
||||
// const NodeId = await this.posMasterRepository.findOne({
|
||||
// where: { orgChild4Id: requestBody.id },
|
||||
// });
|
||||
// if (!NodeId) {
|
||||
// throw new HttpError(
|
||||
// HttpStatusCode.NOT_FOUND,
|
||||
// "ไม่พบข้อมูลตามไอดีนี้ : " + requestBody.id,
|
||||
// );
|
||||
// }
|
||||
totalPosition = await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRootId: Not(IsNull()) || Not(""),
|
||||
|
|
@ -2060,7 +1970,7 @@ export class PositionController extends Controller {
|
|||
if (!dataMaster) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลไอดีนี้ : " + requestBody.posMaster,
|
||||
"ไม่พบข้อมูลตำแหน่งนี้"
|
||||
);
|
||||
}
|
||||
dataMaster.positions.forEach(async (position) => {
|
||||
|
|
@ -2093,7 +2003,7 @@ export class PositionController extends Controller {
|
|||
relations: ["positions"],
|
||||
});
|
||||
if (!dataMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
||||
}
|
||||
await this.posMasterRepository.update(id, {
|
||||
isSit: false,
|
||||
|
|
@ -2134,7 +2044,7 @@ export class PositionController extends Controller {
|
|||
if (!dataPublish) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลไอดีนี้(publishPositionId) : " + requestBody.publishPositionId,
|
||||
"ไม่พบข้อมูลตำแหน่งนี้",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -2146,7 +2056,7 @@ export class PositionController extends Controller {
|
|||
if (!dataDraft) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"ไม่พบข้อมูลไอดีนี้(draftPositionId) : " + requestBody.draftPositionId,
|
||||
"ไม่พบข้อมูลตำแหน่งนี้"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ export class PrefixController extends Controller {
|
|||
) {
|
||||
const _prefix = await this.prefixRepository.findOne({ where: { id: id } });
|
||||
if (!_prefix) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำนำหน้าชื่อนี้");
|
||||
}
|
||||
const checkName = await this.prefixRepository.findOne({
|
||||
where: { id: Not(id), name: requestBody.name },
|
||||
|
|
@ -162,7 +162,7 @@ export class PrefixController extends Controller {
|
|||
where: { id: id },
|
||||
});
|
||||
if (!_delPrefix) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตามไอดีนี้ : " + id);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำนำหน้าชื่อนี้");
|
||||
}
|
||||
try {
|
||||
await this.prefixRepository.delete(_delPrefix.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue