refactor: 重构项目结构并优化类型定义
- 移除extension模块,将功能迁移至node-agent - 修复类型导出问题,使用export type明确类型导出 - 统一数据库连接方式,从直接导入改为使用config/database - 更新文档中的项目结构描述 - 添加多个服务的实用方法,如getForecast、getBalances等 - 修复类型错误和TS1205警告 - 优化RedisService调用方式 - 添加新的实体类型定义 - 更新审计日志格式,统一字段命名
This commit is contained in:
@@ -127,7 +127,7 @@ export const B2BTradeBatchOrder: React.FC = () => {
|
||||
|
||||
const parseUploadedFile = async (file: any) => {
|
||||
try {
|
||||
const items = await b2bTradeDataSource.parseOrderFile(file, selectedCustomer);
|
||||
const items = await b2bTradeDataSource.parseUploadFile(file, selectedCustomer?.id || '');
|
||||
setOrderItems(items);
|
||||
setCurrentStep(1);
|
||||
message.success('File parsed successfully');
|
||||
@@ -143,9 +143,11 @@ export const B2BTradeBatchOrder: React.FC = () => {
|
||||
const handleValidateItems = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const result = await b2bTradeDataSource.validateOrderItems(orderItems);
|
||||
setOrderItems(result.items);
|
||||
message.success(`Validation complete: ${result.validCount} valid, ${result.invalidCount} invalid`);
|
||||
const result = await b2bTradeDataSource.validateItems(orderItems);
|
||||
setOrderItems(result);
|
||||
const validCount = result.filter(i => i.status === 'VALID').length;
|
||||
const invalidCount = result.filter(i => i.status === 'INVALID').length;
|
||||
message.success(`Validation complete: ${validCount} valid, ${invalidCount} invalid`);
|
||||
} catch (error) {
|
||||
message.error('Validation failed');
|
||||
} finally {
|
||||
@@ -163,10 +165,9 @@ export const B2BTradeBatchOrder: React.FC = () => {
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
await b2bTradeDataSource.submitBatchOrder({
|
||||
await b2bTradeDataSource.createBatchOrder({
|
||||
customerId: values.customerId,
|
||||
items: validItems,
|
||||
note: values.note,
|
||||
});
|
||||
|
||||
message.success('Batch order submitted successfully');
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
Card,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
Select,
|
||||
Button,
|
||||
Table,
|
||||
@@ -132,6 +133,7 @@ export const ContractManage: React.FC = () => {
|
||||
status: 'ACTIVE',
|
||||
startDate: '2026-01-01',
|
||||
endDate: '2026-12-31',
|
||||
totalAmount: 500000.00,
|
||||
totalValue: 500000.00,
|
||||
currency: 'USD',
|
||||
signedDate: '2025-12-15',
|
||||
@@ -151,6 +153,7 @@ export const ContractManage: React.FC = () => {
|
||||
status: 'ACTIVE',
|
||||
startDate: '2026-02-01',
|
||||
endDate: '2028-01-31',
|
||||
totalAmount: 0,
|
||||
totalValue: 0,
|
||||
currency: 'USD',
|
||||
signedDate: '2026-01-20',
|
||||
@@ -167,9 +170,10 @@ export const ContractManage: React.FC = () => {
|
||||
customerName: 'Global Import Inc.',
|
||||
title: 'Purchase Agreement Q2',
|
||||
type: 'PURCHASE',
|
||||
status: 'PENDING_SIGN',
|
||||
status: 'PENDING_REVIEW',
|
||||
startDate: '2026-04-01',
|
||||
endDate: '2026-06-30',
|
||||
totalAmount: 150000.00,
|
||||
totalValue: 150000.00,
|
||||
currency: 'USD',
|
||||
attachments: ['purchase_agreement.pdf'],
|
||||
@@ -187,6 +191,7 @@ export const ContractManage: React.FC = () => {
|
||||
status: 'EXPIRED',
|
||||
startDate: '2025-01-01',
|
||||
endDate: '2025-12-31',
|
||||
totalAmount: 350000.00,
|
||||
totalValue: 350000.00,
|
||||
currency: 'USD',
|
||||
signedDate: '2025-01-05',
|
||||
@@ -661,7 +666,7 @@ export const ContractManage: React.FC = () => {
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Value">
|
||||
{selectedContract.totalValue > 0 ? `$${selectedContract.totalValue.toLocaleString()}` : '-'}
|
||||
{selectedContract.totalValue != null ? `$${selectedContract.totalValue.toLocaleString()}` : '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Start Date">{selectedContract.startDate}</Descriptions.Item>
|
||||
<Descriptions.Item label="End Date">{selectedContract.endDate}</Descriptions.Item>
|
||||
@@ -675,11 +680,11 @@ export const ContractManage: React.FC = () => {
|
||||
<Descriptions.Item label="Updated">{selectedContract.updatedAt}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
{selectedContract.attachments.length > 0 && (
|
||||
{selectedContract.attachments && selectedContract.attachments.length > 0 && (
|
||||
<>
|
||||
<Divider>Attachments</Divider>
|
||||
<Space>
|
||||
{selectedContract.attachments.map((file, index) => (
|
||||
{selectedContract.attachments.map((file: string, index: number) => (
|
||||
<Button
|
||||
key={index}
|
||||
icon={<DownloadOutlined />}
|
||||
|
||||
Reference in New Issue
Block a user