Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
092c4bc6e1
2 changed files with 23 additions and 3 deletions
|
|
@ -701,6 +701,15 @@ 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.createdFullName = request.user.name;
|
||||
posMaster.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -769,6 +778,7 @@ export class PositionController extends Controller {
|
|||
if (!posMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลอัตรากำลัง");
|
||||
}
|
||||
|
||||
posMaster.posMasterNo = requestBody.posMasterNo;
|
||||
posMaster.posMasterNoPrefix = requestBody.posMasterNoPrefix;
|
||||
posMaster.posMasterNoSuffix = requestBody.posMasterNoSuffix;
|
||||
|
|
@ -918,7 +928,14 @@ 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,
|
||||
"ไม่สามารถเพิ่มข้อมูลชื่อตำแหน่งซ้ำกันได้",
|
||||
);
|
||||
}
|
||||
// const chk_SName0 = await this.posMasterRepository.findOne({
|
||||
// where: {
|
||||
// orgRevisionId: posMaster.orgRevisionId,
|
||||
|
|
@ -1021,7 +1038,7 @@ export class PositionController extends Controller {
|
|||
position.positionExecutiveField = x.posDictExecutiveField;
|
||||
position.positionArea = x.posDictArea;
|
||||
position.isSpecial = x.isSpecial;
|
||||
position.positionIsSelected = false;
|
||||
position.positionIsSelected = x.positionIsSelected;
|
||||
position.posMasterId = posMaster.id;
|
||||
position.createdUserId = request.user.sub;
|
||||
position.createdFullName = request.user.name;
|
||||
|
|
@ -1167,7 +1184,7 @@ export class PositionController extends Controller {
|
|||
orgChild3Id: body.id,
|
||||
};
|
||||
if (!body.isAll) {
|
||||
checkChildConditions = {
|
||||
checkChildConditions = {
|
||||
orgChild4Id: IsNull(),
|
||||
};
|
||||
searchShortName = `CONCAT(orgChild3.orgChild3ShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ export class CreatePosDict {
|
|||
|
||||
@Column()
|
||||
isSpecial: boolean;
|
||||
|
||||
@Column()
|
||||
positionIsSelected?: boolean | null;
|
||||
}
|
||||
|
||||
export class CreatePosDictExe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue