From da6f901b81f1ac30c2c5eabbd894b3626830b582 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 28 Feb 2024 14:00:38 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20caption=20?= =?UTF-8?q?=E0=B9=84=E0=B8=AD=E0=B8=94=E0=B8=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/slnx.sqlite | Bin 0 -> 98304 bytes src/controllers/BloodGroupController.ts | 4 +- src/controllers/EducationLevelController.ts | 4 +- src/controllers/GenderController.ts | 4 +- src/controllers/OrgRootController.ts | 4 +- src/controllers/PosExecutiveController.ts | 4 +- src/controllers/PosLevelController.ts | 10 +- src/controllers/PosTypeController.ts | 6 +- src/controllers/PositionController.ts | 104 ++------------------ src/controllers/PrefixController.ts | 4 +- 10 files changed, 27 insertions(+), 117 deletions(-) create mode 100644 .vs/slnx.sqlite diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0f43a31d1457f0031ad2b0ba0850830acd264928 GIT binary patch literal 98304 zcmeHweRLbwmEV9E48CV5i4^z&Nzj)?NCJhg832+cnIa(x7R7H$mSq|q0s|5jJ}3aB zq%_?e*|DA28#n3cX}6nn{J!3=4r=&v0(E5L-bON8xwm~U`MSO5JkPtIbA8uo zXQu5R>3XYcrt87=x*+ZE8U$R((wqBOXW(MQc5}L1D@xaAZ&VlSl`*MQu9aKmdMz*i zT3b3@u1L9JKG#Wz8=c9H%w$d9U04-SYz4otjp!HMzbYVH3+Ru z2+EMIeJ5Cs*9#)rpELDq>rX%x8m(7WtF?AHzbAb2h}Rj&!@kPneT6M8h_#y37!?c4 zQoh}Ed6!uQedb+eWv|@#wtXkG%uX)E=*)YDk zp4r5XQx>$7&264z+HrW?jUDEl`HQ-(jgwOS-DHg_s5!6N(6;|OZ}PbtD-b2sNTm*; z?!38jRcf}x>dHb01&_Jhd5EMCuaG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ys{bLNZTNf~~MpYL4X_o8A zRIS_oQwpozM4x^)vIa*OYCr1G;KZ8VzytCWfvGyH&O52`@SlM(cDnO~Jblp1UY821 zt@4^_(Ej6^J!9npT6?YA{`+OtB=~u~Zer~?Ca)r5DOwsPB^avL=3*AX>$FaH#AO8F+C_{s>#L0dg0)Zex;-(5O2C*i(n`J2 zLZ91g)GHNiS3s577iFjvmXW=-v((TLhB_%rY5v<;GBhmD6M1rHiExCWMxZZ~Pj?pG zdzhhkU9_{%oG)O>jzv3+K-#5!Vo&0_I&#P*oQVx7f?cFR)*+r(P=J=i}wOYRKG zVc`6Y&ip;Q4(u5~fh@=^nv->vSB zfk7115T{tINY~&mLo_vB{{V_iE~X4$v2Bz@xE9k`fqrztaxoJ6i%9TYbDhyAGth=b zJ6U541muAV+9uVNdbcxFKTJbhK@mYy8SIqAI`+sNBVH9w%0|6DH>@CZJOu=HSsVj1R+Q8L#{a559 zGyVfy!^^E|MPnU(oS_Pkd_m=6sI>C&Xfi3NWxEw)T3#-HLWV{w6`v|IR8!IAGtp>F j$i!|@X@%Yvar(*F$H`@esw#azxf;ru8<(q1HJ1Mic~0az literal 0 HcmV?d00001 diff --git a/src/controllers/BloodGroupController.ts b/src/controllers/BloodGroupController.ts index cfb9447b..4b844438 100644 --- a/src/controllers/BloodGroupController.ts +++ b/src/controllers/BloodGroupController.ts @@ -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 }); diff --git a/src/controllers/EducationLevelController.ts b/src/controllers/EducationLevelController.ts index 66169e24..600fb37e 100644 --- a/src/controllers/EducationLevelController.ts +++ b/src/controllers/EducationLevelController.ts @@ -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(); diff --git a/src/controllers/GenderController.ts b/src/controllers/GenderController.ts index ee1a21a9..3d31db6d 100644 --- a/src/controllers/GenderController.ts +++ b/src/controllers/GenderController.ts @@ -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(); diff --git a/src/controllers/OrgRootController.ts b/src/controllers/OrgRootController.ts index 3983ef45..17dd2a67 100644 --- a/src/controllers/OrgRootController.ts +++ b/src/controllers/OrgRootController.ts @@ -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 นี้" ); } diff --git a/src/controllers/PosExecutiveController.ts b/src/controllers/PosExecutiveController.ts index 2910d1e0..5aaaa7ff 100644 --- a/src/controllers/PosExecutiveController.ts +++ b/src/controllers/PosExecutiveController.ts @@ -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 }); diff --git a/src/controllers/PosLevelController.ts b/src/controllers/PosLevelController.ts index 9b1396df..d111615a 100644 --- a/src/controllers/PosLevelController.ts +++ b/src/controllers/PosLevelController.ts @@ -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 = { diff --git a/src/controllers/PosTypeController.ts b/src/controllers/PosTypeController.ts index 5617415c..c09e8ec8 100644 --- a/src/controllers/PosTypeController.ts +++ b/src/controllers/PosTypeController.ts @@ -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 = { diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 10ac2429..b09d4184 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -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, + "ไม่พบข้อมูลตำแหน่งนี้" ); } diff --git a/src/controllers/PrefixController.ts b/src/controllers/PrefixController.ts index 0fbac024..b61448e5 100644 --- a/src/controllers/PrefixController.ts +++ b/src/controllers/PrefixController.ts @@ -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);