org root add responsibility

This commit is contained in:
kittapath 2025-03-14 13:26:37 +07:00
parent 11c79abc31
commit 856315b7bc
8 changed files with 74 additions and 45 deletions

View file

@ -54,6 +54,7 @@ export class OrgChild1Controller {
}
const getOrgChild1 = {
orgChild1Id: orgChild1.id,
responsibility: orgChild1.responsibility,
orgRootName: orgChild1.orgRoot.orgRootName,
orgName: `${orgChild1.orgChild1Name}/${orgChild1.orgRoot.orgRootName}`,
orgChild1Name: orgChild1.orgChild1Name,
@ -323,23 +324,23 @@ export class OrgChild1Controller {
// if(requestBody.orgChild1ShortName == rootIdExits.orgRootShortName){
// throw new HttpError(HttpStatusCode.NOT_FOUND, "อักษรย่อนี้ซ้ำกับอักษรย่อหน่วยงาน");
// }
const _null:any = null;
const _null: any = null;
const before = structuredClone(child1);
child1.lastUpdateUserId = request.user.sub;
child1.lastUpdateFullName = request.user.name;
child1.lastUpdatedAt = new Date();
child1.orgRevisionId = String(rootIdExits?.orgRevisionId);
child1.orgRootId = String(rootIdExits?.id);
child1.responsibility = child1.responsibility || "";
this.child1Repository.merge(child1,{
this.child1Repository.merge(child1, {
orgChild1Name: requestBody.orgChild1Name,
orgChild1ShortName: requestBody.orgChild1ShortName,
orgChild1Code: requestBody.orgChild1Code,
DEPARTMENT_CODE: requestBody.DEPARTMENT_CODE != null ? requestBody.DEPARTMENT_CODE : _null,
DIVISION_CODE: requestBody.DIVISION_CODE != null ? requestBody.DIVISION_CODE : _null,
SECTION_CODE: requestBody.SECTION_CODE != null ? requestBody.SECTION_CODE : _null,
JOB_CODE: requestBody.JOB_CODE != null ? requestBody.JOB_CODE : _null,
DEPARTMENT_CODE: requestBody.DEPARTMENT_CODE != null ? requestBody.DEPARTMENT_CODE : _null,
DIVISION_CODE: requestBody.DIVISION_CODE != null ? requestBody.DIVISION_CODE : _null,
SECTION_CODE: requestBody.SECTION_CODE != null ? requestBody.SECTION_CODE : _null,
JOB_CODE: requestBody.JOB_CODE != null ? requestBody.JOB_CODE : _null,
isOfficer: requestBody.isOfficer,
isInformation: requestBody.isInformation,
orgChild1PhoneEx: requestBody.orgChild1PhoneEx,