no message
This commit is contained in:
parent
b7ae2e35a4
commit
fd0c421dd9
1 changed files with 42 additions and 24 deletions
|
|
@ -1093,7 +1093,7 @@ export class CommandController extends Controller {
|
||||||
: null;
|
: null;
|
||||||
if (issue == null) {
|
if (issue == null) {
|
||||||
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
||||||
where: { orgRevisionIsCurrent: false, orgRevisionIsDraft: true },
|
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
relations: ["posMasters", "posMasters.orgRoot"],
|
relations: ["posMasters", "posMasters.orgRoot"],
|
||||||
});
|
});
|
||||||
if (orgRevisionActive != null) {
|
if (orgRevisionActive != null) {
|
||||||
|
|
@ -1104,8 +1104,8 @@ export class CommandController extends Controller {
|
||||||
});
|
});
|
||||||
if (profile != null) {
|
if (profile != null) {
|
||||||
issue =
|
issue =
|
||||||
orgRevisionActive?.posMasters?.filter((x) => x.next_holderId == profile.id)[0]?.orgRoot
|
orgRevisionActive?.posMasters?.filter((x) => x.current_holderId == profile.id)[0]
|
||||||
?.orgRootName || null;
|
?.orgRoot?.orgRootName || null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1159,24 +1159,6 @@ export class CommandController extends Controller {
|
||||||
let _command: any = [];
|
let _command: any = [];
|
||||||
const path = this.commandTypePath(command.commandType.code);
|
const path = this.commandTypePath(command.commandType.code);
|
||||||
if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||||
console.log(
|
|
||||||
command.commandRecives
|
|
||||||
.filter((x) => x.refId != null)
|
|
||||||
.map((x) => ({
|
|
||||||
refId: x.refId,
|
|
||||||
Sequence: x.order,
|
|
||||||
CitizenId: x.citizenId,
|
|
||||||
Prefix: x.prefix,
|
|
||||||
FirstName: x.firstName,
|
|
||||||
LastName: x.lastName,
|
|
||||||
Amount: x.amount,
|
|
||||||
PositionSalaryAmount: x.positionSalaryAmount,
|
|
||||||
MouthSalaryAmount: x.mouthSalaryAmount,
|
|
||||||
RemarkHorizontal: x.remarkHorizontal,
|
|
||||||
RemarkVertical: x.remarkVertical,
|
|
||||||
CommandYear: command.commandYear,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, path + "/attachment", {
|
.PostData(request, path + "/attachment", {
|
||||||
refIds: command.commandRecives
|
refIds: command.commandRecives
|
||||||
|
|
@ -1201,10 +1183,47 @@ export class CommandController extends Controller {
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
|
let issue =
|
||||||
|
command.isBangkok == "OFFICE"
|
||||||
|
? "สำนักปลัดกรุงเทพมหานคร"
|
||||||
|
: command.isBangkok == "BANGKOK"
|
||||||
|
? "กรุงเทพมหานคร"
|
||||||
|
: null;
|
||||||
|
if (issue == null) {
|
||||||
|
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
||||||
|
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
|
relations: ["posMasters", "posMasters.orgRoot"],
|
||||||
|
});
|
||||||
|
if (orgRevisionActive != null) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
keycloak: command.createdUserId.toString(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (profile != null) {
|
||||||
|
issue =
|
||||||
|
orgRevisionActive?.posMasters?.filter((x) => x.current_holderId == profile.id)[0]
|
||||||
|
?.orgRoot?.orgRootName || null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (issue == null) issue = "...................................";
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: command.commandType.fileAttachment,
|
template: command.commandType.fileAttachment,
|
||||||
reportName: "xlsx-report",
|
reportName: "xlsx-report",
|
||||||
data: { data: _command },
|
data: {
|
||||||
|
data: _command,
|
||||||
|
issuerOrganizationName: issue,
|
||||||
|
commandNo: command.commandNo == null ? "" : Extension.ToThaiNumber(command.commandNo),
|
||||||
|
commandYear:
|
||||||
|
command.commandYear == null
|
||||||
|
? ""
|
||||||
|
: Extension.ToThaiNumber(Extension.ToThaiYear(command.commandYear).toString()),
|
||||||
|
commandExcecuteDate:
|
||||||
|
command.commandExcecuteDate == null
|
||||||
|
? ""
|
||||||
|
: Extension.ToThaiNumber(Extension.ToThaiFullDate2(command.commandExcecuteDate)),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2602,8 +2621,7 @@ export class CommandController extends Controller {
|
||||||
"" + posMasterAct.posMasterChild?.current_holder?.firstName ??
|
"" + posMasterAct.posMasterChild?.current_holder?.firstName ??
|
||||||
"" + " " + posMasterAct.posMasterChild?.current_holder?.lastName ??
|
"" + " " + posMasterAct.posMasterChild?.current_holder?.lastName ??
|
||||||
null,
|
null,
|
||||||
organization: _organization,
|
oc: (posMasterAct.posMasterChild?.current_holder?.position ?? null) + "/" + _organization,
|
||||||
position: posMasterAct.posMasterChild?.current_holder?.position ?? null,
|
|
||||||
postype: posMasterAct.posMasterChild?.current_holder?.posType?.posTypeName ?? null,
|
postype: posMasterAct.posMasterChild?.current_holder?.posType?.posTypeName ?? null,
|
||||||
poslevel: posMasterAct.posMasterChild?.current_holder?.posLevel?.posLevelName ?? null,
|
poslevel: posMasterAct.posMasterChild?.current_holder?.posLevel?.posLevelName ?? null,
|
||||||
organizationNew: _organizationNew,
|
organizationNew: _organizationNew,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue