f
This commit is contained in:
@@ -490,20 +490,20 @@ type IVYZ2A8BReq struct {
|
||||
|
||||
type QYGL4YABReq struct {
|
||||
EntName string `json:"ent_name" validate:"required,min=1,validEnterpriseName"`
|
||||
LegalPerson string `json:"legal_person" validate:"required,min=1,validName"`
|
||||
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
||||
Name string `json:"name" validate:"required,min=1,validName"`
|
||||
}
|
||||
|
||||
type QYGL3YSBReq struct {
|
||||
Name string `json:"name" validate:"required,min=1,validName"`
|
||||
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||
EntName string `json:"ent_name" validate:"required,min=1,validEnterpriseName"`
|
||||
LegalPerson string `json:"legal_person" validate:"required,min=1,validName"`
|
||||
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||
}
|
||||
|
||||
type QYGL2YSBReq struct {
|
||||
LegalPerson string `json:"legal_person" validate:"required,min=1,validName"`
|
||||
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||
Name string `json:"name" validate:"required,min=1,validName"`
|
||||
}
|
||||
|
||||
type IVYZ7C9DReq struct {
|
||||
|
||||
@@ -21,7 +21,7 @@ func ProcessQYGL2YSBRequest(ctx context.Context, params []byte, deps *processors
|
||||
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||
}
|
||||
reqFormData := map[string]interface{}{
|
||||
"legalPerson": paramsDto.Name,
|
||||
"legalPerson": paramsDto.LegalPerson,
|
||||
"creditNo": paramsDto.EntCode,
|
||||
}
|
||||
apiPath := "/v4/company/two/check" // 接口路径,根据数脉文档填写(如 v4/xxx)
|
||||
|
||||
@@ -21,7 +21,7 @@ func ProcessQYGL3YSBRequest(ctx context.Context, params []byte, deps *processors
|
||||
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||
}
|
||||
reqFormData := map[string]interface{}{
|
||||
"legalPerson": paramsDto.Name,
|
||||
"legalPerson": paramsDto.LegalPerson,
|
||||
"companyName": paramsDto.EntName,
|
||||
"creditNo": paramsDto.EntCode,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func ProcessQYGL4YABRequest(ctx context.Context, params []byte, deps *processors
|
||||
}
|
||||
reqFormData := map[string]interface{}{
|
||||
"idCard": paramsDto.IDCard,
|
||||
"legalPerson": paramsDto.Name,
|
||||
"legalPerson": paramsDto.LegalPerson,
|
||||
"companyName": paramsDto.EntName,
|
||||
"creditNo": paramsDto.EntCode,
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ func (s *ProductManagementService) GetAllProductsForDictionary(ctx context.Conte
|
||||
options := interfaces.ListOptions{
|
||||
Page: 1,
|
||||
PageSize: 1000, // 获取所有产品
|
||||
Sort: "sort", // 使用 products 表的 sort 字段,排序后再按分类分组
|
||||
Sort: "category.sort", // 按分类的排序字段排序
|
||||
Order: "asc",
|
||||
}
|
||||
|
||||
@@ -461,20 +461,5 @@ func (s *ProductManagementService) GetAllProductsForDictionary(ctx context.Conte
|
||||
return nil, fmt.Errorf("获取产品字典数据失败: %w", err)
|
||||
}
|
||||
|
||||
// 预加载分类信息
|
||||
for _, product := range products {
|
||||
if product.CategoryID != "" {
|
||||
category, _ := s.categoryRepo.GetByID(ctx, product.CategoryID)
|
||||
product.Category = &category
|
||||
}
|
||||
|
||||
if product.SubCategoryID != nil && *product.SubCategoryID != "" {
|
||||
subCategory, err := s.subCategoryRepo.GetByID(ctx, *product.SubCategoryID)
|
||||
if err == nil && subCategory != nil {
|
||||
product.SubCategory = subCategory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return products, nil
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ func (r *GormProductRepository) ListProducts(ctx context.Context, query *queries
|
||||
}
|
||||
|
||||
// 预加载分类信息并获取数据
|
||||
if err := dbQuery.Preload("Category").Find(&productEntities).Error; err != nil {
|
||||
if err := dbQuery.Preload("Category").Preload("SubCategory").Find(&productEntities).Error; err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user