From 37e2c358cae4573b63719576a5f9863cbf19bf32 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 1 Aug 2024 14:48:47 +0800 Subject: [PATCH] 1 --- .../hdl_central_kitchen_for_school.go | 2 +- app/admin/svc/svc_data_statisstics.go | 41 ++++++++++--------- docs/docs.go | 35 ++++++++++++++++ docs/swagger.json | 7 ++++ docs/swagger.yaml | 4 ++ 5 files changed, 68 insertions(+), 21 deletions(-) create mode 100644 docs/docs.go create mode 100644 docs/swagger.json create mode 100644 docs/swagger.yaml diff --git a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go index ecdd68b..699f003 100644 --- a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go @@ -1346,7 +1346,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { //TODO:: 加锁 Redis 锁,防并发 getString, _ := cache.GetString(md.BatchAskForLeaveLockKeyForCentralKitchen) if getString != "" { - e.OutErr(c, e.ERR, "请稍等,存在其他退款处理中!") + e.OutErr(c, e.ERR, "请稍等,存在其他请假处理中!") return } cache.Set(md.BatchAskForLeaveLockKeyForCentralKitchen, "running") diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go index dfda392..50ef1ab 100644 --- a/app/admin/svc/svc_data_statisstics.go +++ b/app/admin/svc/svc_data_statisstics.go @@ -2045,28 +2045,29 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD if req.EnterpriseId != 0 { sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId) } - var months []time.Month + //var months []time.Month + //if req.StartDate != "" { + // sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) + // eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) + // _, sMonth, _ := sDate.Date() + // _, eMonth, _ := eDate.Date() + // diffMonth := sMonth - eMonth + // if diffMonth == 0 { + // //TODO::查询一个月 + // months = append(months, sMonth) + // } else { + // for i := sMonth; i <= eMonth; i++ { + // months = append(months, i) + // } + // } + //} + //if len(months) > 0 { + // sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) + //} if req.StartDate != "" { - sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) - eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.EndDate, time.Local) - _, sMonth, _ := sDate.Date() - _, eMonth, _ := eDate.Date() - diffMonth := sMonth - eMonth - if diffMonth == 0 { - //TODO::查询一个月 - months = append(months, sMonth) - } else { - for i := sMonth; i <= eMonth; i++ { - months = append(months, i) - } - } + sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.StartDate). + And("central_kitchen_for_school_package_ord_for_reserve.meal_time_end >= ?", req.StartDate) } - if len(months) > 0 { - sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) - } - //if req.EndDate != "" { - // sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate) - //} if len(req.MealKindList) > 0 { sess.In("central_kitchen_for_school_package_ord_for_reserve.kind", req.MealKindList) } diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..94bb251 --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,35 @@ +// Code generated by swaggo/swag. DO NOT EDIT. + +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": {} +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "", + Description: "", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..ec416cd --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,7 @@ +{ + "swagger": "2.0", + "info": { + "contact": {} + }, + "paths": {} +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 0000000..b64379c --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,4 @@ +info: + contact: {} +paths: {} +swagger: "2.0"