This commit is contained in:
AdisakKanthawilang 2025-03-11 16:12:32 +07:00
parent 7d572b18d2
commit f31ecf1c2b
11 changed files with 349 additions and 19 deletions

View file

@ -230,6 +230,7 @@ export class OrgChild4Controller extends Controller {
if (!child4) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
}
const _null:any = null;
const before = structuredClone(child4);
child4.lastUpdateUserId = request.user.sub;
child4.lastUpdateFullName = request.user.name;
@ -239,7 +240,22 @@ export class OrgChild4Controller extends Controller {
child4.orgChild2Id = String(child3IdExits?.orgChild2Id);
child4.orgRevisionId = String(child3IdExits?.orgRevisionId);
child4.orgChild3Id = String(child3IdExits?.id);
this.child4Repository.merge(child4, requestBody);
this.child4Repository.merge(child4, {
orgChild4Name: requestBody.orgChild4Name,
orgChild4ShortName: requestBody.orgChild4ShortName,
orgChild4Code: requestBody.orgChild4Code,
orgChild4Rank: requestBody.orgChild4Rank != null ? requestBody.orgChild4Rank : _null,
orgChild4RankSub: requestBody.orgChild4RankSub,
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,
orgChild4PhoneEx: requestBody.orgChild4PhoneEx,
orgChild4PhoneIn: requestBody.orgChild4PhoneIn,
orgChild4Fax: requestBody.orgChild4Fax,
responsibility: requestBody.responsibility ?? "",
misId: requestBody.misId,
});
await this.child4Repository.save(child4, { data: request });
setLogDataDiff(request, { before, after: child4 });
return new HttpSuccess();