作者 tangxuhui
提交者 yangfu

添加 选择列导出

  1 +package query
  2 +
  3 +type ExcelDataFieldsQuery struct {
  4 + //操作人
  5 + // 业务编码
  6 + Code string `form:"code"`
  7 +}
@@ -8,6 +8,7 @@ import ( @@ -8,6 +8,7 @@ import (
8 "github.com/linmadan/egglib-go/core/application" 8 "github.com/linmadan/egglib-go/core/application"
9 "github.com/linmadan/egglib-go/utils/excel" 9 "github.com/linmadan/egglib-go/utils/excel"
10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/query"
11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService" 13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService"
13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" 14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
@@ -215,9 +216,9 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import @@ -215,9 +216,9 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
215 }, nil 216 }, nil
216 } 217 }
217 218
218 -func (srv ExcelDataService) GetExcelDataFields(code string) (interface{}, error) { 219 +func (srv ExcelDataService) GetExcelDataFields(param *query.ExcelDataFieldsQuery) (interface{}, error) {
219 dataFileds := []DataFieldOptions{} 220 dataFileds := []DataFieldOptions{}
220 - switch code { 221 + switch param.Code {
221 case domain.ExportCompanyUser: 222 case domain.ExportCompanyUser:
222 dataFileds = (ExportCompanyUserData{}).AllFields() 223 dataFileds = (ExportCompanyUserData{}).AllFields()
223 case domain.ExportCooperationUser: 224 case domain.ExportCooperationUser:
@@ -293,5 +293,8 @@ func (controller *ExcelDataController) ExportCooperationUser() { @@ -293,5 +293,8 @@ func (controller *ExcelDataController) ExportCooperationUser() {
293 293
294 //GetExcelDataFields 获取导出excel数据的可选字段 294 //GetExcelDataFields 获取导出excel数据的可选字段
295 func (controller *ExcelDataController) GetExcelDataFields() { 295 func (controller *ExcelDataController) GetExcelDataFields() {
296 - 296 + code := controller.GetString(":code")
  297 + var excelService = service.NewExcelDataService(nil)
  298 + data, _ := excelService.GetExcelDataFields(&query.ExcelDataFieldsQuery{Code: code})
  299 + controller.Response(data, nil)
297 } 300 }
@@ -15,4 +15,7 @@ func init() { @@ -15,4 +15,7 @@ func init() {
15 web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport") 15 web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
16 web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport") 16 web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport")
17 web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate") 17 web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate")
  18 +
  19 + web.Router("/v1/web/file-export/fields/:code", &web_client.ExcelDataController{}, "Get:GetExcelDataFields")
  20 +
18 } 21 }