...
|
...
|
@@ -6,6 +6,7 @@ import ( |
|
|
"path/filepath"
|
|
|
|
|
|
"github.com/beego/beego/v2/server/web/context"
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/linmadan/egglib-go/utils/excel"
|
|
|
"github.com/linmadan/egglib-go/web/beego"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/ecelData/command"
|
...
|
...
|
@@ -41,7 +42,8 @@ func (controller *ExcelDataController) FileImport() { |
|
|
excelService := service.NewExcelDataService(nil)
|
|
|
r, ext, err = controller.GetFileWithExt()
|
|
|
if err != nil {
|
|
|
controller.Response(nil, err)
|
|
|
e := application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
controller.Response(nil, e)
|
|
|
return
|
|
|
}
|
|
|
cmd := &command.ImportDataCommand{}
|
...
|
...
|
@@ -63,7 +65,7 @@ func (controller *ExcelDataController) FileImport() { |
|
|
case "ImportAttendance":
|
|
|
data, err = excelService.ImportDataAttendance(cmd)
|
|
|
default:
|
|
|
err = fmt.Errorf("导入不存在 Code:%v", cmd.Code)
|
|
|
err = application.ThrowError(application.BUSINESS_ERROR, fmt.Sprintf("导入不存在 Code:%v", cmd.Code))
|
|
|
}
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
|