fix
This commit is contained in:
parent
bd17564ab7
commit
0e8ca0b1d8
1 changed files with 6 additions and 13 deletions
|
|
@ -621,16 +621,17 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgRevisionId = orgRoot.orgRevisionId;
|
posMaster.orgRevisionId = orgRoot.orgRevisionId;
|
||||||
SName = orgRoot.orgRootShortName;
|
SName = orgRoot.orgRootShortName;
|
||||||
}
|
}
|
||||||
|
// let fullPosMasterNo = String((requestBody.posMasterNoPrefix).trim() + (requestBody.posMasterNo) + (requestBody.posMasterNoSuffix).trim());
|
||||||
|
// let searchShortName = `CONCAT(posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
||||||
const chk_SName0 = await this.posMasterRepository.findOne({
|
const chk_SName0 = await this.posMasterRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
orgRoot: { orgRootShortName: SName },
|
orgRoot: { orgRootShortName: SName },
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
posMasterNo: requestBody.posMasterNo,
|
|
||||||
},
|
},
|
||||||
relations: ["orgRoot"],
|
relations: ["orgRoot"],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (chk_SName0 != null) {
|
if (chk_SName0 != null) {
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
|
|
@ -700,14 +701,6 @@ export class PositionController extends Controller {
|
||||||
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
"ไม่สามารถใส่เลขที่ตำแหน่งซ้ำกันได้",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// let fullPosMasterNo = String((requestBody.posMasterNoPrefix).trim() + (requestBody.posMasterNo) + (requestBody.posMasterNoSuffix).trim());
|
|
||||||
// if (fullPosMasterNo === String(requestBody.posMasterNo)) {
|
|
||||||
// throw new HttpError(
|
|
||||||
// HttpStatusCode.INTERNAL_SERVER_ERROR,
|
|
||||||
// "ไม่สามารถใส่ข้อมูลซ้ำกันได้",
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
posMaster.createdUserId = request.user.sub;
|
posMaster.createdUserId = request.user.sub;
|
||||||
|
|
@ -1394,9 +1387,9 @@ export class PositionController extends Controller {
|
||||||
orgChild2Id: posMaster.orgChild2Id,
|
orgChild2Id: posMaster.orgChild2Id,
|
||||||
orgChild3Id: posMaster.orgChild3Id,
|
orgChild3Id: posMaster.orgChild3Id,
|
||||||
orgChild4Id: posMaster.orgChild4Id,
|
orgChild4Id: posMaster.orgChild4Id,
|
||||||
posMasterNoPrefix: posMaster.posMasterNoPrefix,
|
posMasterNoPrefix: posMaster.posMasterNoPrefix ? posMaster.posMasterNoPrefix : null,
|
||||||
posMasterNo: posMaster.posMasterNo,
|
posMasterNo: posMaster.posMasterNo ? posMaster.posMasterNo : null,
|
||||||
posMasterNoSuffix: posMaster.posMasterNoSuffix,
|
posMasterNoSuffix: posMaster.posMasterNoSuffix ? posMaster.posMasterNoSuffix : null,
|
||||||
reason: posMaster.reason,
|
reason: posMaster.reason,
|
||||||
fullNameCurrentHolder:
|
fullNameCurrentHolder:
|
||||||
posMaster.current_holder == null
|
posMaster.current_holder == null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue