fix
This commit is contained in:
parent
ce2114131d
commit
cac73b483b
1 changed files with 28 additions and 16 deletions
|
|
@ -236,23 +236,35 @@ async function handler(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||
|
||||
try {
|
||||
const allRefIds = new Set<string>();
|
||||
const chunks = chunkArray(
|
||||
command.commandRecives.filter((x) => x.refId != null).map((x) => ({
|
||||
refId: x.refId,
|
||||
commandNo: command.commandNo,
|
||||
commandYear: command.commandYear,
|
||||
commandId: command.id,
|
||||
remark: command.positionDetail,
|
||||
amount: x.amount,
|
||||
amountSpecial: x.amountSpecial,
|
||||
positionSalaryAmount: x.positionSalaryAmount,
|
||||
mouthSalaryAmount: x.mouthSalaryAmount,
|
||||
commandCode: command.commandType.commandCode,
|
||||
commandName: command.commandType.name,
|
||||
commandDateAffect: command.commandExcecuteDate,
|
||||
commandDateSign: command.commandAffectDate,
|
||||
})),
|
||||
50
|
||||
command.commandRecives
|
||||
.filter((x) => x.refId != null)
|
||||
.map((x) => {
|
||||
const key = `${x.refId}-${command.id}`;
|
||||
if (allRefIds.has(key)) {
|
||||
return null;
|
||||
}
|
||||
allRefIds.add(key);
|
||||
|
||||
return {
|
||||
refId: x.refId,
|
||||
commandNo: command.commandNo,
|
||||
commandYear: command.commandYear,
|
||||
commandId: command.id,
|
||||
remark: command.positionDetail,
|
||||
amount: x.amount,
|
||||
amountSpecial: x.amountSpecial,
|
||||
positionSalaryAmount: x.positionSalaryAmount,
|
||||
mouthSalaryAmount: x.mouthSalaryAmount,
|
||||
commandCode: command.commandType.commandCode,
|
||||
commandName: command.commandType.name,
|
||||
commandDateAffect: command.commandExcecuteDate,
|
||||
commandDateSign: command.commandAffectDate,
|
||||
};
|
||||
})
|
||||
.filter(Boolean),
|
||||
20
|
||||
);
|
||||
|
||||
for (const chunk of chunks) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue