diff --git a/app/admin/hdl/hdl_data_statistics.go b/app/admin/hdl/hdl_data_statistics.go index b10ba5b..6b780d4 100644 --- a/app/admin/hdl/hdl_data_statistics.go +++ b/app/admin/hdl/hdl_data_statistics.go @@ -106,6 +106,17 @@ func CentralKitchenForSchoolDataStatisticsExport(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } + if req.EnterpriseId != 0 { + enterpriseDb := db.EnterpriseDb{} + enterpriseDb.Set() + enterprise, err1 := enterpriseDb.GetEnterprise(req.EnterpriseId) + if err1 != nil { + e.OutErr(c, e.ERR_DB_ORM, err1.Error()) + return + } + req.EnterpriseName = enterprise.Name + } + e.OutSuc(c, map[string]interface{}{ "msg": "导出成功,请稍后刷新数据列表", }, nil) @@ -190,6 +201,17 @@ func NursingHomeDataStatisticsExport(c *gin.Context) { return } + if req.EnterpriseId != 0 { + enterpriseDb := db.EnterpriseDb{} + enterpriseDb.Set() + enterprise, err1 := enterpriseDb.GetEnterprise(req.EnterpriseId) + if err1 != nil { + e.OutErr(c, e.ERR_DB_ORM, err1.Error()) + return + } + req.EnterpriseName = enterprise.Name + } + go svc.NursingHomeDataStatisticsExport(req) e.OutSuc(c, map[string]interface{}{ @@ -276,6 +298,17 @@ func SelfSupportForSchoolDataStatisticsExport(c *gin.Context) { return } + if req.EnterpriseId != 0 { + enterpriseDb := db.EnterpriseDb{} + enterpriseDb.Set() + enterprise, err1 := enterpriseDb.GetEnterprise(req.EnterpriseId) + if err1 != nil { + e.OutErr(c, e.ERR_DB_ORM, err1.Error()) + return + } + req.EnterpriseName = enterprise.Name + } + go svc.SelfSupportForSchoolDataStatisticsExport(req) e.OutSuc(c, map[string]interface{}{ diff --git a/app/admin/md/md_central_kitchen_for_school_export_records.go b/app/admin/md/md_central_kitchen_for_school_export_records.go index 95e5b2c..259f976 100644 --- a/app/admin/md/md_central_kitchen_for_school_export_records.go +++ b/app/admin/md/md_central_kitchen_for_school_export_records.go @@ -9,10 +9,11 @@ type CentralKitchenForSchoolExportRecordsListReq struct { } type CentralKitchenForSchoolDataStatisticsExportReq struct { - Kind int `json:"kind" binding:"required" label:"导出类型"` - StartDate string `json:"start_date" binding:"required" label:"起始时间"` - EndDate string `json:"end_date" binding:"required" label:"截止时间"` - EnterpriseId int `json:"enterprise_id" label:"校企id"` + Kind int `json:"kind" binding:"required" label:"导出类型"` + StartDate string `json:"start_date" binding:"required" label:"起始时间"` + EndDate string `json:"end_date" binding:"required" label:"截止时间"` + EnterpriseId int `json:"enterprise_id" label:"校企id"` + EnterpriseName string `json:"enterprise_name" label:"校企名称"` } type NursingHomeExportRecordsListReq struct { @@ -24,10 +25,11 @@ type NursingHomeExportRecordsListReq struct { } type NursingHomeDataStatisticsExportReq struct { - Kind int `json:"kind" binding:"required" label:"导出类型"` - StartDate string `json:"start_date" binding:"required" label:"起始时间"` - EndDate string `json:"end_date" binding:"required" label:"截止时间"` - EnterpriseId int `json:"enterprise_id" binding:"required" label:"校企id"` + Kind int `json:"kind" binding:"required" label:"导出类型"` + StartDate string `json:"start_date" binding:"required" label:"起始时间"` + EndDate string `json:"end_date" binding:"required" label:"截止时间"` + EnterpriseId int `json:"enterprise_id" label:"校企id"` + EnterpriseName string `json:"enterprise_name" label:"校企名称"` } type SelfSupportForSchoolExportRecordsListReq struct { @@ -39,8 +41,9 @@ type SelfSupportForSchoolExportRecordsListReq struct { } type SelfSupportForSchoolDataStatisticsExportReq struct { - Kind int `json:"kind" binding:"required" label:"导出类型"` - StartDate string `json:"start_date" binding:"required" label:"起始时间"` - EndDate string `json:"end_date" binding:"required" label:"截止时间"` - EnterpriseId int `json:"enterprise_id" label:"校企id"` + Kind int `json:"kind" binding:"required" label:"导出类型"` + StartDate string `json:"start_date" binding:"required" label:"起始时间"` + EndDate string `json:"end_date" binding:"required" label:"截止时间"` + EnterpriseId int `json:"enterprise_id" label:"校企id"` + EnterpriseName string `json:"enterprise_name" label:"校企名称"` }