This commit is contained in:
Mrx
2026-03-19 11:07:52 +08:00
parent baa45a8a05
commit faf4b7f6a7
6 changed files with 32 additions and 4 deletions

View File

@@ -733,6 +733,9 @@ func (s *CertificationApplicationServiceImpl) AdminListSubmitRecords(
Page: query.Page,
PageSize: query.PageSize,
ManualReviewStatus: query.ManualReviewStatus,
CompanyName: query.CompanyName,
LegalPersonPhone: query.LegalPersonPhone,
LegalPersonName: query.LegalPersonName,
}
result, err := s.enterpriseInfoSubmitRecordRepo.List(ctx, filter)
if err != nil {

View File

@@ -198,4 +198,7 @@ type AdminListSubmitRecordsQuery struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
ManualReviewStatus string `json:"manual_review_status" form:"manual_review_status"` // pending, approved, rejected空为全部
CompanyName string `json:"company_name" form:"company_name"` // 企业名称(模糊搜索)
LegalPersonPhone string `json:"legal_person_phone" form:"legal_person_phone"` // 法人手机号
LegalPersonName string `json:"legal_person_name" form:"legal_person_name"` // 法人姓名(模糊搜索)
}

View File

@@ -8,6 +8,9 @@ import (
// ListSubmitRecordsFilter 提交记录列表筛选
type ListSubmitRecordsFilter struct {
ManualReviewStatus string // pending, approved, rejected空表示全部
CompanyName string // 企业名称(模糊搜索)
LegalPersonPhone string // 法人手机号
LegalPersonName string // 法人姓名(模糊搜索)
Page int
PageSize int
}

View File

@@ -95,6 +95,15 @@ func (r *GormEnterpriseInfoSubmitRecordRepository) List(ctx context.Context, fil
if filter.ManualReviewStatus != "" {
db = db.Where("manual_review_status = ?", filter.ManualReviewStatus)
}
if filter.CompanyName != "" {
db = db.Where("company_name LIKE ?", "%"+filter.CompanyName+"%")
}
if filter.LegalPersonPhone != "" {
db = db.Where("legal_person_phone = ?", filter.LegalPersonPhone)
}
if filter.LegalPersonName != "" {
db = db.Where("legal_person_name LIKE ?", "%"+filter.LegalPersonName+"%")
}
var total int64
if err := db.Count(&total).Error; err != nil {
return nil, err
@@ -111,6 +120,15 @@ func (r *GormEnterpriseInfoSubmitRecordRepository) List(ctx context.Context, fil
if filter.ManualReviewStatus != "" {
q = q.Where("manual_review_status = ?", filter.ManualReviewStatus)
}
if filter.CompanyName != "" {
q = q.Where("company_name LIKE ?", "%"+filter.CompanyName+"%")
}
if filter.LegalPersonPhone != "" {
q = q.Where("legal_person_phone = ?", filter.LegalPersonPhone)
}
if filter.LegalPersonName != "" {
q = q.Where("legal_person_name LIKE ?", "%"+filter.LegalPersonName+"%")
}
err := q.Order("submit_at DESC").Offset(offset).Limit(filter.PageSize).Find(&records).Error
if err != nil {
return nil, err

View File

@@ -34,6 +34,7 @@ type DailyRateLimitConfig struct {
BlockedCountries []string `mapstructure:"blocked_countries"` // 被阻止的国家/地区
EnableProxyCheck bool `mapstructure:"enable_proxy_check"` // 是否检查代理
MaxConcurrent int `mapstructure:"max_concurrent"` // 最大并发请求数
// 路径排除配置
ExcludePaths []string `mapstructure:"exclude_paths"` // 排除频率限制的路径
// 域名排除配置

View File

@@ -637,8 +637,8 @@ func validateEnterpriseName(fl validator.FieldLevel) bool {
hasValidSuffix = true
break
}
// 同时检查括号内的企业类型,如:(个体工商户)、(分公司)
if strings.HasSuffix(trimmedName, ""+suffix+"") {
// 同时检查括号内的企业类型,支持中英文括号,如:(个体工商户)、(个体工商户)、(分公司)、(分公司)
if strings.HasSuffix(trimmedName, ""+suffix+"") || strings.HasSuffix(trimmedName, "("+suffix+")") {
hasValidSuffix = true
break
}
@@ -921,8 +921,8 @@ func ValidateEnterpriseName(enterpriseName string) error {
hasValidSuffix = true
break
}
// 同时检查括号内的企业类型,如:(个体工商户)、(分公司)
if strings.HasSuffix(trimmedName, ""+suffix+"") {
// 同时检查括号内的企业类型,支持中英文括号,如:(个体工商户)、(个体工商户)、(分公司)、(分公司)
if strings.HasSuffix(trimmedName, ""+suffix+"") || strings.HasSuffix(trimmedName, "("+suffix+")") {
hasValidSuffix = true
break
}