feat: 完成 PRD 差距与修复,新增审核流与日志清理功能,支持出库信息与动态字段,优化 C 端用户体验
This commit is contained in:
@@ -8,11 +8,21 @@ import { buildPage } from '../common/utils/pagination.util';
|
||||
import { PaginationDto } from '../common/dto/pagination.dto';
|
||||
|
||||
class QueryLogQueryDto extends PaginationDto {
|
||||
@ApiPropertyOptional({ description: '关键词(短码)' })
|
||||
@ApiPropertyOptional({ description: '关键词(短码 / 追溯码 / SKU / 档案编号)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
keyword?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'SKU' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
sku?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '批次编号' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
batchNo?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '查询结果', enum: QueryResult })
|
||||
@IsOptional()
|
||||
@IsEnum(QueryResult)
|
||||
@@ -39,7 +49,16 @@ export class QueryLogController {
|
||||
@ApiOperation({ summary: '查询日志列表' })
|
||||
async list(@Query() query: QueryLogQueryDto) {
|
||||
const where: Prisma.QueryLogWhereInput = {};
|
||||
if (query.keyword) where.shortCode = { contains: query.keyword };
|
||||
if (query.keyword) {
|
||||
where.OR = [
|
||||
{ shortCode: { contains: query.keyword } },
|
||||
{ code: { contains: query.keyword } },
|
||||
{ sku: { contains: query.keyword } },
|
||||
{ archiveNo: { contains: query.keyword } },
|
||||
];
|
||||
}
|
||||
if (query.sku) where.sku = { contains: query.sku };
|
||||
if (query.batchNo) where.batchNo = { contains: query.batchNo };
|
||||
if (query.result) where.queryResult = query.result;
|
||||
if (query.startTime || query.endTime) {
|
||||
where.queriedAt = {};
|
||||
|
||||
Reference in New Issue
Block a user