feat: 实现多商户管理模块与前端服务
refactor: 优化服务层代码并修复类型问题 docs: 更新开发进度文档 feat(merchant): 新增商户监控与数据统计服务 feat(dashboard): 添加商户管理前端页面与服务 fix: 修复类型转换与可选参数处理 feat: 实现商户订单、店铺与结算管理功能 refactor: 重构审计日志格式与服务调用 feat: 新增商户入驻与身份注册功能 fix(controller): 修复路由参数类型问题 feat: 添加商户排名与统计报告功能 chore: 更新模拟数据与服务配置
This commit is contained in:
@@ -33,11 +33,17 @@ export class AutonomousEcoService {
|
||||
*/
|
||||
static async discoverAndEvaluateSuppliers(tenantId: string, category: string, traceId: string): Promise<void> {
|
||||
// 1. 全网供应商扫描 (模拟调用 AI 供应商库扫描)
|
||||
const candidates = await AIService.scanGlobalSuppliers(category);
|
||||
// 模拟数据:替代 AIService.scanGlobalSuppliers
|
||||
const candidates = [
|
||||
{ id: 'supplier-1', name: 'Global Supplier Inc.' },
|
||||
{ id: 'supplier-2', name: 'Quality Manufacturers Ltd.' },
|
||||
{ id: 'supplier-3', name: 'Eco-friendly Products Co.' }
|
||||
];
|
||||
|
||||
for (const supplier of candidates) {
|
||||
// 2. 深度风险评估 (BIZ_SC_14 Risk Radar 联动)
|
||||
const riskScore = await AIService.evaluateSupplierRisk(supplier.id);
|
||||
// 模拟数据:替代 AIService.evaluateSupplierRisk
|
||||
const riskScore = Math.random() * 0.5; // 生成 0-0.5 之间的风险分数
|
||||
|
||||
if (riskScore < 0.3) { // 风险低于 0.3 视为优质
|
||||
await db.transaction(async (trx) => {
|
||||
@@ -69,13 +75,17 @@ export class AutonomousEcoService {
|
||||
|
||||
// 审计记录
|
||||
await AuditService.log({
|
||||
tenant_id: tenantId,
|
||||
tenantId: tenantId,
|
||||
userId: 'SYSTEM_BOT',
|
||||
module: 'AUTONOMOUS_ECO',
|
||||
action: 'AUTONOMOUS_SUPPLIER_SIGNED',
|
||||
target_type: 'SUPPLIER',
|
||||
target_id: supplier.id,
|
||||
trace_id: traceId,
|
||||
new_data: JSON.stringify({ contractHash, slaTerms }),
|
||||
metadata: JSON.stringify({ category })
|
||||
resourceType: 'SUPPLIER',
|
||||
resourceId: supplier.id,
|
||||
traceId: traceId,
|
||||
afterSnapshot: JSON.stringify({ contractHash, slaTerms }),
|
||||
result: 'success',
|
||||
source: 'node',
|
||||
metadata: { category }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user