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 OrgChild2Controller extends Controller {
if (!child2) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
}
const _null:any = null;
const before = structuredClone(child2);
child2.lastUpdateUserId = request.user.sub;
child2.lastUpdateFullName = request.user.name;
@ -237,7 +238,22 @@ export class OrgChild2Controller extends Controller {
child2.orgRootId = String(child1IdExits?.orgRootId);
child2.orgRevisionId = String(child1IdExits?.orgRevisionId);
child2.orgChild1Id = String(child1IdExits?.id);
this.child2Repository.merge(child2, requestBody);
this.child2Repository.merge(child2, {
orgChild2Name: requestBody.orgChild2Name,
orgChild2ShortName: requestBody.orgChild2ShortName,
orgChild2Code: requestBody.orgChild2Code,
orgChild2Rank: requestBody.orgChild2Rank != null ? requestBody.orgChild2Rank : _null,
orgChild2RankSub: requestBody.orgChild2RankSub,
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,
orgChild2PhoneEx: requestBody.orgChild2PhoneEx,
orgChild2PhoneIn: requestBody.orgChild2PhoneIn,
orgChild2Fax: requestBody.orgChild2Fax,
responsibility: requestBody.responsibility ?? "",
misId: requestBody.misId,
});
await this.child2Repository.save(child2, { data: request });
setLogDataDiff(request, { before, after: child2 });
return new HttpSuccess();