R33-1 R33-3: 收口采购资产差旅事务超时
这个提交包含在:
+17
-15
@@ -957,7 +957,7 @@ async function assetsRoutes(fastify) {
|
||||
await ensureLegalEntityAvailable(tx, payload.legalEntityId);
|
||||
await ensureCostCenterAvailable(tx, payload.costCenterId, payload.legalEntityId);
|
||||
await ensureAssigneeEmployee(tx, payload.assigneeEmployeeId ?? null);
|
||||
const purchaseRequest = await ensureApprovedPurchaseRequest(tx, payload.purchaseRequestId ?? null);
|
||||
await ensureApprovedPurchaseRequest(tx, payload.purchaseRequestId ?? null);
|
||||
|
||||
const issued = await issueDocumentNumber(tx, {
|
||||
documentType: "asset_card",
|
||||
@@ -998,23 +998,25 @@ async function assetsRoutes(fastify) {
|
||||
});
|
||||
}
|
||||
|
||||
await tx.auditLog.create({
|
||||
data: buildAuditLogData(request, {
|
||||
actorId: request.employee.id,
|
||||
action: "ASSET_CARD_CREATED",
|
||||
targetType: "asset_card",
|
||||
targetId: created.id,
|
||||
extra: {
|
||||
assetNo: created.asset_no,
|
||||
purchaseRequestId: purchaseRequest?.id ?? null,
|
||||
assigneeEmployeeId: created.assignee_employee_id ?? null,
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
return created;
|
||||
});
|
||||
|
||||
void fastify.prisma.auditLog.create({
|
||||
data: buildAuditLogData(request, {
|
||||
actorId: request.employee.id,
|
||||
action: "ASSET_CARD_CREATED",
|
||||
targetType: "asset_card",
|
||||
targetId: asset.id,
|
||||
extra: {
|
||||
assetNo: asset.asset_no,
|
||||
purchaseRequestId: asset.purchase_request_id ?? null,
|
||||
assigneeEmployeeId: asset.assignee_employee_id ?? null,
|
||||
},
|
||||
}),
|
||||
}).catch((error) => {
|
||||
fastify.log.error({ err: error, assetId: asset.id }, "Failed to write asset create audit log");
|
||||
});
|
||||
|
||||
await runAssetLedgerSummaryErpSyncSafely({
|
||||
prisma: fastify.prisma,
|
||||
config: fastify.config,
|
||||
|
||||
在新工单中引用
屏蔽一个用户