作者 yangfu

Merge branch 'dev' into test

package query
type ExcelDataFieldsQuery struct {
//操作人
// 业务编码
Code string `form:"code"`
}
... ...
... ... @@ -9,6 +9,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/excel"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService"
"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
}, nil
}
func (srv ExcelDataService) GetExcelDataFields(code string) (interface{}, error) {
func (srv ExcelDataService) GetExcelDataFields(param *query.ExcelDataFieldsQuery) (interface{}, error) {
dataFileds := []DataFieldOptions{}
switch code {
switch param.Code {
case domain.ExportCompanyUser:
dataFileds = (ExportCompanyUserData{}).AllFields()
case domain.ExportCooperationUser:
... ...
... ... @@ -353,5 +353,8 @@ func (controller *ExcelDataController) ExportManufactureWorkshopAttendanceStatic
//GetExcelDataFields 获取导出excel数据的可选字段
func (controller *ExcelDataController) GetExcelDataFields() {
code := controller.GetString(":code")
var excelService = service.NewExcelDataService(nil)
data, _ := excelService.GetExcelDataFields(&query.ExcelDataFieldsQuery{Code: code})
controller.Response(data, nil)
}
... ...
... ... @@ -21,4 +21,7 @@ func init() {
web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport")
web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate")
web.Router("/v1/web/file-export/fields/:code", &web_client.ExcelDataController{}, "Get:GetExcelDataFields")
}
... ...