@chenchaolong/plugin-trade-compliance-workbench 1.0.206 → 1.0.208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/document-text-extractor.d.ts.map +1 -1
- package/dist/lib/adapters/document-text-extractor.js +2 -1
- package/dist/lib/adapters/document-text-extractor.js.map +1 -1
- package/dist/lib/domain/purchase-draft-cleanup.d.ts +26 -0
- package/dist/lib/domain/purchase-draft-cleanup.d.ts.map +1 -0
- package/dist/lib/domain/purchase-draft-cleanup.js +43 -0
- package/dist/lib/domain/purchase-draft-cleanup.js.map +1 -0
- package/dist/lib/import-jobs/contract-worksheet-selection.d.ts +33 -0
- package/dist/lib/import-jobs/contract-worksheet-selection.d.ts.map +1 -0
- package/dist/lib/import-jobs/contract-worksheet-selection.js +51 -0
- package/dist/lib/import-jobs/contract-worksheet-selection.js.map +1 -0
- package/dist/lib/import-jobs/purchase-spreadsheet-review.d.ts +8 -0
- package/dist/lib/import-jobs/purchase-spreadsheet-review.d.ts.map +1 -0
- package/dist/lib/import-jobs/purchase-spreadsheet-review.js +23 -0
- package/dist/lib/import-jobs/purchase-spreadsheet-review.js.map +1 -0
- package/dist/lib/import-jobs/spreadsheet-contract-facts.d.ts.map +1 -1
- package/dist/lib/import-jobs/spreadsheet-contract-facts.js +4 -3
- package/dist/lib/import-jobs/spreadsheet-contract-facts.js.map +1 -1
- package/dist/lib/packing/packing-source-display.js +1 -1
- package/dist/lib/packing/packing-source-display.js.map +1 -1
- package/dist/lib/packing/shared-package-layout.d.ts +5 -0
- package/dist/lib/packing/shared-package-layout.d.ts.map +1 -0
- package/dist/lib/packing/shared-package-layout.js +68 -0
- package/dist/lib/packing/shared-package-layout.js.map +1 -0
- package/dist/lib/public-dto.d.ts.map +1 -1
- package/dist/lib/public-dto.js +2 -1
- package/dist/lib/public-dto.js.map +1 -1
- package/dist/lib/remote-components/trade-compliance-workbench/app.css +1 -1
- package/dist/lib/remote-components/trade-compliance-workbench/app.js +4 -4
- package/dist/lib/remote-ui/components/source-file-preview.d.ts +2 -1
- package/dist/lib/remote-ui/components/source-file-preview.d.ts.map +1 -1
- package/dist/lib/remote-ui/components/source-file-preview.js +7 -5
- package/dist/lib/remote-ui/components/source-file-preview.js.map +1 -1
- package/dist/lib/remote-ui/pages/procurement-contracts.css +8 -0
- package/dist/lib/remote-ui/pages/procurement.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/procurement.js +27 -4
- package/dist/lib/remote-ui/pages/procurement.js.map +1 -1
- package/dist/lib/remote-ui/procurement-contracts.d.ts +2 -0
- package/dist/lib/remote-ui/procurement-contracts.d.ts.map +1 -1
- package/dist/lib/remote-ui/procurement-contracts.js.map +1 -1
- package/dist/lib/remote-ui/purchase-review-adapter.d.ts.map +1 -1
- package/dist/lib/remote-ui/purchase-review-adapter.js +4 -1
- package/dist/lib/remote-ui/purchase-review-adapter.js.map +1 -1
- package/dist/lib/sales-file.service.d.ts.map +1 -1
- package/dist/lib/sales-file.service.js +4 -2
- package/dist/lib/sales-file.service.js.map +1 -1
- package/dist/lib/workbench.middleware.d.ts +4 -4
- package/dist/lib/workbench.service.d.ts.map +1 -1
- package/dist/lib/workbench.service.js +16 -3
- package/dist/lib/workbench.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -34,7 +34,9 @@ import { formatBeijingDateTime } from './remote-ui/date-time.js';
|
|
|
34
34
|
import { TradeComplianceSchemaMaintenance } from './schema-maintenance.js';
|
|
35
35
|
import { PACKING_IMPORT_ACTIVE_STATUSES, packingImportTaskDto, packingImportTargets } from './packing/packing-import-task.contract.js';
|
|
36
36
|
import { DemoDataSeedMarker } from './demo-data.entity.js';
|
|
37
|
-
import { extractSpreadsheetContractFacts,
|
|
37
|
+
import { extractSpreadsheetContractFacts, applyCustomerSpreadsheetFacts } from './import-jobs/spreadsheet-contract-facts.js';
|
|
38
|
+
import { preparePurchaseSpreadsheetDraft } from './import-jobs/purchase-spreadsheet-review.js';
|
|
39
|
+
import { cleanPurchaseDraftPayload } from './domain/purchase-draft-cleanup.js';
|
|
38
40
|
const DEFAULT_IMPORT_ISSUE_EXPORT_MAX_ROWS = 50_000;
|
|
39
41
|
const HARD_IMPORT_ISSUE_EXPORT_MAX_ROWS = 100_000;
|
|
40
42
|
const CUSTOMER_REANALYSIS_TIMEOUT_MS = 20 * 60 * 1000;
|
|
@@ -754,6 +756,15 @@ let TradeComplianceWorkbenchService = class TradeComplianceWorkbenchService {
|
|
|
754
756
|
throw new DomainError(DomainErrorCodes.NOT_FOUND, '解析任务不存在');
|
|
755
757
|
task = await this.recoverExpiredCatalogReviewLeases(scope, task) ?? task;
|
|
756
758
|
const publicTask = (await this.publicImportTaskDtos([task]))[0];
|
|
759
|
+
if (task.documentType === 'PURCHASE_CONTRACT' && task.status === 'AWAITING_REVIEW' && task.resultPayload && this.storage && ['XLSX', 'XLS'].includes(task.sourceFileFormat)) {
|
|
760
|
+
const source = await this.storage.read(task.sourceFileId).catch(() => null);
|
|
761
|
+
if (source) {
|
|
762
|
+
try {
|
|
763
|
+
publicTask.resultPayload = preparePurchaseSpreadsheetDraft(task.resultPayload, source);
|
|
764
|
+
}
|
|
765
|
+
catch { /* Source coordinates are optional; a migrated/corrupt source must not prevent reviewing an existing draft. */ }
|
|
766
|
+
}
|
|
767
|
+
}
|
|
757
768
|
if (!task.resultEntityId)
|
|
758
769
|
return { task: publicTask };
|
|
759
770
|
if (task.documentType === 'CONTROLLED_CATALOG') {
|
|
@@ -2711,13 +2722,15 @@ let TradeComplianceWorkbenchService = class TradeComplianceWorkbenchService {
|
|
|
2711
2722
|
if (source) {
|
|
2712
2723
|
const facts = extractSpreadsheetContractFacts(source);
|
|
2713
2724
|
if (version === 'PURCHASE_DRAFT_V1' && Array.isArray(effectivePayload.lines))
|
|
2714
|
-
effectivePayload =
|
|
2725
|
+
effectivePayload = preparePurchaseSpreadsheetDraft(effectivePayload, source);
|
|
2715
2726
|
if (version === 'CUSTOMER_CONTRACT_DRAFT_V1' && effectivePayload.contract && typeof effectivePayload.contract === 'object')
|
|
2716
2727
|
effectivePayload = { ...effectivePayload, contract: applyCustomerSpreadsheetFacts(effectivePayload.contract, facts) };
|
|
2717
2728
|
}
|
|
2718
2729
|
}
|
|
2719
2730
|
if (version === 'CUSTOMER_CONTRACT_DRAFT_V1')
|
|
2720
2731
|
effectivePayload = normalizeCustomerContractDraftPayload(effectivePayload);
|
|
2732
|
+
if (version === 'PURCHASE_DRAFT_V1')
|
|
2733
|
+
effectivePayload = cleanPurchaseDraftPayload(effectivePayload);
|
|
2721
2734
|
if (task.status === 'AWAITING_REVIEW') {
|
|
2722
2735
|
const replaceablePurchaseDraft = task.documentType === 'PURCHASE_CONTRACT' && task.resultEntityId == null && version === 'PURCHASE_DRAFT_V1';
|
|
2723
2736
|
if (!replaceablePurchaseDraft || canonicalJson(task.resultPayload ?? null) === canonicalJson(effectivePayload))
|
|
@@ -2753,7 +2766,7 @@ let TradeComplianceWorkbenchService = class TradeComplianceWorkbenchService {
|
|
|
2753
2766
|
}
|
|
2754
2767
|
async savePurchaseDraft(scope, importTaskId, draft) {
|
|
2755
2768
|
await this.ensureProcurementSchema();
|
|
2756
|
-
const normalizedDraft = normalizePurchaseDraftDates(draft);
|
|
2769
|
+
const normalizedDraft = normalizePurchaseDraftDates(cleanPurchaseDraftPayload(draft));
|
|
2757
2770
|
assertPurchaseDraft(normalizedDraft);
|
|
2758
2771
|
const confirmedById = requiredId(scope.userId, '当前用户标识');
|
|
2759
2772
|
const confirmedAt = new Date();
|