作者 yangfu

Merge branch 'dev' into test

  1 +package query
  2 +
  3 +type ExcelDataFieldsQuery struct {
  4 + //操作人
  5 + // 业务编码
  6 + Code string `form:"code"`
  7 +}
@@ -9,6 +9,7 @@ import ( @@ -9,6 +9,7 @@ import (
9 "github.com/linmadan/egglib-go/core/application" 9 "github.com/linmadan/egglib-go/core/application"
10 "github.com/linmadan/egglib-go/utils/excel" 10 "github.com/linmadan/egglib-go/utils/excel"
11 "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/command"
  12 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/query"
12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService" 14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService"
14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user" 15 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
@@ -300,9 +301,9 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import @@ -300,9 +301,9 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
300 }, nil 301 }, nil
301 } 302 }
302 303
303 -func (srv ExcelDataService) GetExcelDataFields(code string) (interface{}, error) { 304 +func (srv ExcelDataService) GetExcelDataFields(param *query.ExcelDataFieldsQuery) (interface{}, error) {
304 dataFileds := []DataFieldOptions{} 305 dataFileds := []DataFieldOptions{}
305 - switch code { 306 + switch param.Code {
306 case domain.ExportCompanyUser: 307 case domain.ExportCompanyUser:
307 dataFileds = (ExportCompanyUserData{}).AllFields() 308 dataFileds = (ExportCompanyUserData{}).AllFields()
308 case domain.ExportCooperationUser: 309 case domain.ExportCooperationUser:
@@ -353,5 +353,8 @@ func (controller *ExcelDataController) ExportManufactureWorkshopAttendanceStatic @@ -353,5 +353,8 @@ func (controller *ExcelDataController) ExportManufactureWorkshopAttendanceStatic
353 353
354 //GetExcelDataFields 获取导出excel数据的可选字段 354 //GetExcelDataFields 获取导出excel数据的可选字段
355 func (controller *ExcelDataController) GetExcelDataFields() { 355 func (controller *ExcelDataController) GetExcelDataFields() {
356 - 356 + code := controller.GetString(":code")
  357 + var excelService = service.NewExcelDataService(nil)
  358 + data, _ := excelService.GetExcelDataFields(&query.ExcelDataFieldsQuery{Code: code})
  359 + controller.Response(data, nil)
357 } 360 }
@@ -21,4 +21,7 @@ func init() { @@ -21,4 +21,7 @@ func init() {
21 web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport") 21 web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
22 web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport") 22 web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport")
23 web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate") 23 web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate")
  24 +
  25 + web.Router("/v1/web/file-export/fields/:code", &web_client.ExcelDataController{}, "Get:GetExcelDataFields")
  26 +
24 } 27 }