From 5e1cc75f57c487f09f76a2a8b3e9221532e3d502 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Thu, 7 Sep 2023 20:50:25 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_data_statistics.go | 173 ++++++++ app/admin/hdl/hdl_home_page.go | 12 +- ...ntral_kitchen_for_school_export_records.go | 30 ++ .../md/md_central_kitchen_for_school_order.go | 1 + app/admin/md/md_nursing_home_order.go | 1 + .../svc_self_support_for_school.go | 3 - .../svc_central_kitchen_for_school_order.go | 1 + .../svc/order/svc_nursing_home_package_ord.go | 1 + app/admin/svc/svc_data_statisstics.go | 387 ++++++++++++++++++ app/db/db_nursing_home_export_records.go | 107 +++++ ..._self_support_for_school_export_records.go | 107 +++++ app/db/db_user_identity.go | 1 + app/db/model/nursing_home_export_records.go | 11 + .../self_support_for_school_export_records.go | 11 + app/router/admin_router.go | 16 +- cmd/task/main.go | 2 +- go.mod | 1 + ..._2023-09-01-2023-09-301694086532916.xlsx | Bin 0 -> 5716 bytes 18 files changed, 854 insertions(+), 11 deletions(-) create mode 100644 app/admin/svc/svc_data_statisstics.go create mode 100644 app/db/db_nursing_home_export_records.go create mode 100644 app/db/db_self_support_for_school_export_records.go create mode 100644 app/db/model/nursing_home_export_records.go create mode 100644 app/db/model/self_support_for_school_export_records.go create mode 100644 static/export/nursing_home/订单列表_2023-09-01-2023-09-301694086532916.xlsx diff --git a/app/admin/hdl/hdl_data_statistics.go b/app/admin/hdl/hdl_data_statistics.go index 6357a4a..b10ba5b 100644 --- a/app/admin/hdl/hdl_data_statistics.go +++ b/app/admin/hdl/hdl_data_statistics.go @@ -3,10 +3,12 @@ package hdl import ( "applet/app/admin/lib/validate" "applet/app/admin/md" + "applet/app/admin/svc" "applet/app/db" "applet/app/e" "applet/app/utils" "github.com/gin-gonic/gin" + "os" ) func CentralKitchenForSchoolDataStatisticsList(c *gin.Context) { @@ -104,6 +106,177 @@ func CentralKitchenForSchoolDataStatisticsExport(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } + e.OutSuc(c, map[string]interface{}{ + "msg": "导出成功,请稍后刷新数据列表", + }, nil) + return +} + +func NursingHomeDataStatisticsList(c *gin.Context) { + var req md.NursingHomeExportRecordsListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.Limit == 0 { + req.Limit = 10 + } + if req.Page == 0 { + req.Page = 10 + } + + nursingHomeExportRecordsDb := db.NursingHomeExportRecordsDb{} + nursingHomeExportRecordsDb.Set() + list, total, err := nursingHomeExportRecordsDb.NursingHomeExportRecordsList(req) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + + e.OutSuc(c, map[string]interface{}{ + "list": list, + "total": total, + "kind": []map[string]interface{}{ + { + "name": "订单列表", + "value": 1, + }, + { + "name": "退款申请表", + "value": 2, + }, + { + "name": "预定统计表", + "value": 3, + }, + }, + }, nil) + return +} + +func NursingHomeDataStatisticsDelete(c *gin.Context) { + id := c.Param("id") + nursingHomeExportRecordsDb := db.NursingHomeExportRecordsDb{} + nursingHomeExportRecordsDb.Set() + centralKitchenForSchoolExportRecords, err := nursingHomeExportRecordsDb.GetNursingHomeExportRecords(utils.StrToInt(id)) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if centralKitchenForSchoolExportRecords == nil { + e.OutErr(c, e.ERR_NO_DATA, "未查询到相关记录") + return + } + os.RemoveAll("./static" + centralKitchenForSchoolExportRecords.DownloadPath) //移除文件 + _, err = nursingHomeExportRecordsDb.NursingHomeExportRecordsDelete(id) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + e.OutSuc(c, "success", nil) + return +} + +func NursingHomeDataStatisticsExport(c *gin.Context) { + var req md.NursingHomeDataStatisticsExportReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + + go svc.NursingHomeDataStatisticsExport(req) + + e.OutSuc(c, map[string]interface{}{ + "msg": "导出成功,请稍后刷新数据列表", + }, nil) + return +} + +func SelfSupportForSchoolDataStatisticsList(c *gin.Context) { + var req md.SelfSupportForSchoolExportRecordsListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.Limit == 0 { + req.Limit = 10 + } + if req.Page == 0 { + req.Page = 10 + } + + selfSupportForSchoolExportRecordsDb := db.SelfSupportForSchoolExportRecordsDb{} + selfSupportForSchoolExportRecordsDb.Set() + list, total, err := selfSupportForSchoolExportRecordsDb.SelfSupportForSchoolExportRecordsList(req) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + + e.OutSuc(c, map[string]interface{}{ + "list": list, + "total": total, + "kind": []map[string]interface{}{ + { + "name": "学生列表", + "value": 1, + }, + { + "name": "老师列表", + "value": 2, + }, + { + "name": "消费明细表", + "value": 3, + }, + }, + }, nil) + return +} + +func SelfSupportForSchoolDataStatisticsDelete(c *gin.Context) { + id := c.Param("id") + selfSupportForSchoolExportRecordsDb := db.SelfSupportForSchoolExportRecordsDb{} + selfSupportForSchoolExportRecordsDb.Set() + selfSupportForSchoolExportRecords, err := selfSupportForSchoolExportRecordsDb.GetSelfSupportForSchoolExportRecords(utils.StrToInt(id)) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if selfSupportForSchoolExportRecords == nil { + e.OutErr(c, e.ERR_NO_DATA, "未查询到相关记录") + return + } + os.RemoveAll("./static" + selfSupportForSchoolExportRecords.DownloadPath) //移除文件 + _, err = selfSupportForSchoolExportRecordsDb.SelfSupportForSchoolExportRecordsDelete(id) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + e.OutSuc(c, "success", nil) + return +} + +func SelfSupportForSchoolDataStatisticsExport(c *gin.Context) { + var req md.SelfSupportForSchoolDataStatisticsExportReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + + go svc.SelfSupportForSchoolDataStatisticsExport(req) e.OutSuc(c, map[string]interface{}{ "msg": "导出成功,请稍后刷新数据列表", diff --git a/app/admin/hdl/hdl_home_page.go b/app/admin/hdl/hdl_home_page.go index 33773f3..5ea328c 100644 --- a/app/admin/hdl/hdl_home_page.go +++ b/app/admin/hdl/hdl_home_page.go @@ -16,10 +16,10 @@ import ( func HomePageIndex(c *gin.Context) { now := time.Now() - todayStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()).Format("2006-01-02 15:04:05") //今日开始时间 - todayEnd := time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location()).Format("2006-01-02 15:04:05") //今日结束时间 - sql1 := fmt.Sprintf("SELECT sum('trade_amount') as total FROM self_support_for_school_ord where order_status = 2 and face_time >= '%s' and face_time < '%s'", todayStart, todayEnd) //统计今日"自营-学校"收益 - sql2 := fmt.Sprintf("SELECT sum('total_price') as total FROM central_kitchen_for_school_package_ord where state = 1 and create_at >= '%s' and create_at < '%s'", todayStart, todayEnd) //统计今日"央厨-学校"收益 + todayStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()).Format("2006-01-02 15:04:05") //今日开始时间 + todayEnd := time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location()).Format("2006-01-02 15:04:05") //今日结束时间 + sql1 := fmt.Sprintf("SELECT sum(trade_amount) as total FROM self_support_for_school_ord where order_status = 2 and face_time >= '%s' and face_time < '%s'", todayStart, todayEnd) //统计今日"自营-学校"收益 + sql2 := fmt.Sprintf("SELECT sum(total_price) as total FROM central_kitchen_for_school_package_ord where state = 1 and create_at >= '%s' and create_at < '%s'", todayStart, todayEnd) //统计今日"央厨-学校"收益 mapArr1, err := db.QueryNativeString(db.Db, sql1) if err != nil { e.OutErr(c, e.ERR, err.Error()) @@ -108,8 +108,8 @@ func ThisWeekData(c *gin.Context) { day := now.AddDate(0, 0, i).Format("2006-01-02") //7日前 dayStart := now.AddDate(0, 0, i).Format("2006-01-02 15:04:05") dayEnd := now.AddDate(0, 0, i+1).Format("2006-01-02 15:04:05") - sql1 := fmt.Sprintf("SELECT sum('trade_amount') as total FROM self_support_for_school_ord where order_status = 2 and face_time >= '%s' and face_time < '%s'", dayStart, dayEnd) //统计今日"自营-学校"收益 - sql2 := fmt.Sprintf("SELECT sum('total_price') as total FROM central_kitchen_for_school_package_ord where state = 1 and create_at >= '%s' and create_at < '%s'", dayStart, dayEnd) //统计今日"央厨-学校"收益 + sql1 := fmt.Sprintf("SELECT sum(trade_amount) as total FROM self_support_for_school_ord where order_status = 2 and face_time >= '%s' and face_time < '%s'", dayStart, dayEnd) //统计今日"自营-学校"收益 + sql2 := fmt.Sprintf("SELECT sum(total_price) as total FROM central_kitchen_for_school_package_ord where state = 1 and create_at >= '%s' and create_at < '%s'", dayStart, dayEnd) //统计今日"央厨-学校"收益 mapArr1, err := db.QueryNativeString(db.Db, sql1) if err != nil { e.OutErr(c, e.ERR, err.Error()) 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 75e6099..95e5b2c 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 @@ -14,3 +14,33 @@ type CentralKitchenForSchoolDataStatisticsExportReq struct { EndDate string `json:"end_date" binding:"required" label:"截止时间"` EnterpriseId int `json:"enterprise_id" label:"校企id"` } + +type NursingHomeExportRecordsListReq struct { + Page int `json:"page" label:"页码"` + Kind int `json:"kind" label:"导出类型"` + Limit int `json:"limit" label:"每页数量"` + StartDate string `json:"start_date" label:"起始时间"` + EndDate string `json:"end_date" label:"截止时间"` +} + +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"` +} + +type SelfSupportForSchoolExportRecordsListReq struct { + Page int `json:"page" label:"页码"` + Kind int `json:"kind" label:"导出类型"` + Limit int `json:"limit" label:"每页数量"` + StartDate string `json:"start_date" label:"起始时间"` + EndDate string `json:"end_date" label:"截止时间"` +} + +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"` +} diff --git a/app/admin/md/md_central_kitchen_for_school_order.go b/app/admin/md/md_central_kitchen_for_school_order.go index ff470fb..93f4d7b 100644 --- a/app/admin/md/md_central_kitchen_for_school_order.go +++ b/app/admin/md/md_central_kitchen_for_school_order.go @@ -14,6 +14,7 @@ type CentralKitchenForSchoolOrderRefundListResp struct { Amount string `json:"amount" label:"退款金额"` State int `json:"state" label:"退款订单状态"` CreateAt string `json:"create_at" label:"申请时间"` + RefundDate string `json:"refund_date" label:"退款时间"` Memo string `json:"memo" label:"备注"` } diff --git a/app/admin/md/md_nursing_home_order.go b/app/admin/md/md_nursing_home_order.go index 04a8a10..f300966 100644 --- a/app/admin/md/md_nursing_home_order.go +++ b/app/admin/md/md_nursing_home_order.go @@ -12,6 +12,7 @@ type NursingHomeOrderRefundListResp struct { Amount string `json:"amount" label:"退款金额"` State int `json:"state" label:"退款订单状态"` CreateAt string `json:"create_at" label:"申请时间"` + RefundDate string `json:"refund_date" label:"退款时间"` Memo string `json:"memo" label:"备注"` } diff --git a/app/admin/svc/enterprise_manage/svc_self_support_for_school.go b/app/admin/svc/enterprise_manage/svc_self_support_for_school.go index 30ddbf0..1d24b77 100644 --- a/app/admin/svc/enterprise_manage/svc_self_support_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_self_support_for_school.go @@ -335,9 +335,6 @@ func SelfSupportForSchoolTeacherList(req md.SelfSupportForSchoolTeacherListReq) var m []*db.UserIdentityWithUser count, err = sess. Join("LEFT", "user", "user_identity.uid = user.id"). - Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). - Join("LEFT", "class", "class_with_user.class_id = class.id"). - Join("LEFT", "grade", "class.grade_id = grade.id"). Join("LEFT", "self_support_for_user_face_info", "user_identity.id = self_support_for_user_face_info.user_identity_id"). Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) if err != nil { diff --git a/app/admin/svc/order/svc_central_kitchen_for_school_order.go b/app/admin/svc/order/svc_central_kitchen_for_school_order.go index 9414ad9..33a3208 100644 --- a/app/admin/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/admin/svc/order/svc_central_kitchen_for_school_order.go @@ -139,6 +139,7 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR Amount: v.CentralKitchenForSchoolUserRefundDay.Amount, State: v.CentralKitchenForSchoolUserRefundDay.State, CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt, + RefundDate: v.CentralKitchenForSchoolUserRefundDay.RefundDate, Memo: v.CentralKitchenForSchoolUserRefundDay.Memo, }) } diff --git a/app/admin/svc/order/svc_nursing_home_package_ord.go b/app/admin/svc/order/svc_nursing_home_package_ord.go index 6402bd5..081ca07 100644 --- a/app/admin/svc/order/svc_nursing_home_package_ord.go +++ b/app/admin/svc/order/svc_nursing_home_package_ord.go @@ -80,6 +80,7 @@ func NursingHomeOrderRefundList(req md.NursingHomeOrderRefundListReq) (resp []md Amount: v.NursingHomeUserRefundDay.Amount, State: v.NursingHomeUserRefundDay.State, CreateAt: v.NursingHomeUserRefundDay.CreateAt, + RefundDate: v.NursingHomeUserRefundDay.RefundDate, Memo: v.NursingHomeUserRefundDay.Memo, }) } diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go new file mode 100644 index 0000000..de09966 --- /dev/null +++ b/app/admin/svc/svc_data_statisstics.go @@ -0,0 +1,387 @@ +package svc + +import ( + "applet/app/admin/md" + "applet/app/db" + "applet/app/db/model" + "applet/app/enum" + "applet/app/utils" + "applet/app/utils/logx" + "encoding/json" + "github.com/360EntSecGroup-Skylar/excelize" + "strconv" + "time" +) + +func NursingHomeDataStatisticsExport(req md.NursingHomeDataStatisticsExportReq) { + var titleList []string + var fileName string + var now = time.Now() + xlsx := excelize.NewFile() + xlsx.SetSheetRow("Sheet1", "A1", &titleList) + switch req.Kind { + case 1: + //订单列表 + fileName = "/export/nursing_home/订单列表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + + //查找订单数据 + sess := db.Db.Desc("nursing_home_package_ord.id") + if req.EnterpriseId != 0 { + sess.And("nursing_home_package_ord.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("nursing_home_package_ord.create_at >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("nursing_home_package_ord.create_at <= ?", req.EndDate) + } + var m []*db.NursingHomePackageOrdWithUserIdentity + _, err := sess. + Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "enterprise", "enterprise.id = nursing_home_package_ord.enterprise_id"). + Join("LEFT", "user", "user.id = nursing_home_package_ord.uid"). + FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + titleList = []string{"单位名称", "用户身份名称", "用户手机号", "购买类型", "总价", "商户订单号", "支付状态", "购买时间"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var kind string //1:按年购买 2:按月购买 3:按天购买 4:补餐 + switch v.NursingHomePackageOrd.Kind { + case 1: + kind = "按年购买" + break + case 2: + kind = "按月购买" + break + case 3: + kind = "按天购买" + break + case 4: + kind = "补餐" + break + } + + var state string //0:待支付 1:支付成功 2:支付失败 + switch v.NursingHomePackageOrd.State { + case enum.NursingHomePackageOrdStateForWait: + state = enum.NursingHomePackageOrdState.String(enum.NursingHomePackageOrdStateForWait) + break + case enum.NursingHomePackageOrdStateForSuccess: + state = enum.NursingHomePackageOrdState.String(enum.NursingHomePackageOrdStateForWait) + break + case enum.NursingHomePackageOrdStateForFail: + state = enum.NursingHomePackageOrdState.String(enum.NursingHomePackageOrdStateForFail) + break + } + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Enterprise.Name, v.NursingHomePackageOrd.UserIdentityName, v.User.Phone, kind, v.NursingHomePackageOrd.TotalPrice, + v.NursingHomePackageOrd.OutTradeNo, state, v.NursingHomePackageOrd.CreateAt}) + j++ + } + xlsx.SaveAs("./static" + fileName) + break + case 2: + //退款申请表 + fileName = "/export/nursing_home/退款申请表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + var m []*db.NursingHomeUserRefundDayWithData + sess := db.Db.Desc("nursing_home_user_refund_day.id") + if req.EnterpriseId != 0 { + sess.And("enterprise.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("nursing_home_user_refund_day.create_at >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("nursing_home_user_refund_day.create_at <= ?", req.EndDate) + } + _, err := sess. + Join("LEFT", "nursing_home_user_with_day", "nursing_home_user_refund_day.records_id = nursing_home_user_with_day.id"). + Join("LEFT", "nursing_home_package_ord", "nursing_home_user_refund_day.out_trade_no = nursing_home_package_ord.out_trade_no"). + Join("LEFT", "user_identity", "nursing_home_user_with_day.identity_id = user_identity.id"). + Join("LEFT", "user", "user_identity.uid = user.id"). + Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id"). + Desc("nursing_home_user_refund_day.id"). + FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + + titleList = []string{"退款单号", "所属订单号", "单位名称", "用户身份名称", "用户手机号", "就餐类型", "就餐时间", "金额", "状态", "退款时间"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var kind string //就餐类型(1:早餐 2:午餐 3:晚餐) + switch v.NursingHomeUserWithDay.Kind { + case enum.NursingHomeUserWithDayKindForBreakfast: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForBreakfast) + break + case enum.NursingHomeUserWithDayKindForLunch: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForLunch) + break + case enum.NursingHomeUserWithDayKindForDinner: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForDinner) + break + } + + var state string //状态(1:审核中 2:审核通过 3:审核拒绝 4:退款已完成) + switch v.NursingHomeUserRefundDay.State { + case enum.NursingHomeUserRefundDayStateForAuditing: + state = enum.NursingHomeUserRefundDayState.String(enum.NursingHomeUserRefundDayStateForAuditing) + break + case enum.NursingHomeUserRefundDayStateForAuditPass: + state = enum.NursingHomeUserRefundDayState.String(enum.NursingHomeUserRefundDayStateForAuditPass) + break + case enum.NursingHomeUserRefundDayStateForAuditReject: + state = enum.NursingHomeUserRefundDayState.String(enum.NursingHomeUserRefundDayStateForAuditReject) + break + case enum.NursingHomeUserRefundDayStateForAuditComplete: + state = enum.NursingHomeUserRefundDayState.String(enum.NursingHomeUserRefundDayStateForAuditComplete) + break + } + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.NursingHomeUserRefundDay.OutRequestNo, v.NursingHomeUserRefundDay.OutTradeNo, v.Enterprise.Name, + v.NursingHomePackageOrd.UserIdentityName, v.User.Phone, kind, v.NursingHomeUserWithDay.Date, v.NursingHomeUserRefundDay.Amount, state, v.NursingHomeUserRefundDay.RefundDate}) + j++ + } + xlsx.SaveAs("./static" + fileName + ".xlsx") + break + case 3: + //预定统计表 + fileName = "/export/nursing_home/预定统计表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + var m []*db.NursingHomePackageOrdForReserveWithUserIdentity + sess := db.Db.Desc("nursing_home_package_ord_for_reserve.id") + if req.EnterpriseId != 0 { + sess.And("enterprise.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("nursing_home_package_ord_for_reserve.meal_time_start >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("nursing_home_package_ord_for_reserve.meal_time_start <= ?", req.EndDate) + } + _, err := sess. + Join("LEFT", "nursing_home_package_ord", "nursing_home_package_ord_for_reserve.out_trade_no = nursing_home_package_ord.out_trade_no"). + Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). + Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). + Join("LEFT", "user", "user.id = user_identity.uid").FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + + titleList = []string{"所属订单号", "单位名称", "用户身份名称", "用户手机号", "预定类型", "预定月份", "就餐时间-开始", "就餐时间-截止"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var kind string //预定类型(1:早餐 2:午餐 3:晚餐) + switch v.NursingHomePackageOrdForReserve.Kind { + case enum.NursingHomeUserWithDayKindForBreakfast: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForBreakfast) + break + case enum.NursingHomeUserWithDayKindForLunch: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForLunch) + break + case enum.NursingHomeUserWithDayKindForDinner: + kind = enum.NursingHomeUserWithDayKind.String(enum.NursingHomeUserWithDayKindForDinner) + break + } + + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.NursingHomePackageOrdForReserve.OutTradeNo, v.Enterprise.Name, v.NursingHomePackageOrd.UserIdentityName, + v.User.Phone, kind, v.NursingHomePackageOrdForReserve.ReserveMonth, v.NursingHomePackageOrdForReserve.MealTimeStart, v.NursingHomePackageOrdForReserve.MealTimeEnd}) + j++ + } + xlsx.SaveAs("./static" + fileName + ".xlsx") + break + } + //新增数据 + nursingHomeExportRecordsDb := db.NursingHomeExportRecordsDb{} + nursingHomeExportRecordsDb.Set() + marshal, _ := json.Marshal(req) + nursingHomeExportRecordsDb.NursingHomeExportRecordsInsert(&model.NursingHomeExportRecords{ + Name: fileName, + DownloadPath: fileName, + Kind: req.Kind, + ReqContent: string(marshal), + CreateAt: now.Format("2006-01-02 15:04:05"), + UpdateAt: now.Format("2006-01-02 15:04:05"), + }) +} + +func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataStatisticsExportReq) { + var titleList []string + var fileName string + var now = time.Now() + xlsx := excelize.NewFile() + xlsx.SetSheetRow("Sheet1", "A1", &titleList) + switch req.Kind { + case 1: + //学生列表 + fileName = "/export/self_support_for_school/学生列表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + + //查找订单数据 + sess := db.Db.Desc("user_identity.id") + sess.And("identity =?", enum.UserIdentityForSelfSupportForStudent) + if req.EnterpriseId != 0 { + sess.And("user_identity.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("user_identity.create_at >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("user_identity.create_at <= ?", req.EndDate) + } + var m []*db.UserIdentityWithUser + _, err := sess. + Join("LEFT", "user", "user_identity.uid = user.id"). + Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id"). + Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). + Join("LEFT", "class", "class_with_user.class_id = class.id"). + Join("LEFT", "grade", "class.grade_id = grade.id"). + Join("LEFT", "self_support_for_user_face_info", "user_identity.id = self_support_for_user_face_info.user_identity_id"). + FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + titleList = []string{"单位名称", "姓名", "身份证号", "家长电话", "采脸方式", "支付状态", "刷脸状态", "年级", "班级", "注册时间"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var kind string //采集人脸方式(1:个采 2:集采) + switch v.SelfSupportForUserFaceInfo.CollectFaceType { + case 1: + kind = "个采" + break + case 2: + kind = "集采" + break + } + + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Enterprise.Name, v.UserIdentity.Name, v.UserIdentity.IdNo, v.User.Phone, kind, + v.SelfSupportForUserFaceInfo.SchoolFacePaymentStatus, v.SelfSupportForUserFaceInfo.SchoolFacePassStatus, v.Grade.Name, v.Class.Name, v.UserIdentity.CreateAt}) + j++ + } + xlsx.SaveAs("./static" + fileName) + break + case 2: + //教师列表 + fileName = "/export/self_support_for_school/教师列表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + + //查找订单数据 + sess := db.Db.Desc("user_identity.id") + sess.And("identity =?", enum.UserIdentityForSelfSupportForTeacher) + if req.EnterpriseId != 0 { + sess.And("user_identity.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("user_identity.create_at >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("user_identity.create_at <= ?", req.EndDate) + } + var m []*db.UserIdentityWithUser + _, err := sess. + Join("LEFT", "user", "user_identity.uid = user.id"). + Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id"). + Join("LEFT", "self_support_for_user_face_info", "user_identity.id = self_support_for_user_face_info.user_identity_id"). + FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + titleList = []string{"单位名称", "姓名", "身份证号", "电话", "采脸方式", "支付状态", "刷脸状态", "注册时间"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var kind string //采集人脸方式(1:个采 2:集采) + switch v.SelfSupportForUserFaceInfo.CollectFaceType { + case 1: + kind = "个采" + break + case 2: + kind = "集采" + break + } + + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Enterprise.Name, v.UserIdentity.Name, v.UserIdentity.IdNo, v.User.Phone, kind, + v.SelfSupportForUserFaceInfo.SchoolFacePaymentStatus, v.SelfSupportForUserFaceInfo.SchoolFacePassStatus, v.UserIdentity.CreateAt}) + j++ + } + xlsx.SaveAs("./static" + fileName) + break + case 3: + //消费明细表 + fileName = "/export/self_support_for_school/消费明细表_" + req.StartDate + "-" + req.EndDate + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" + var m []*db.SelfSupportForSchoolOrdWithUserIdentity + sess := db.Db.Desc("self_support_for_school_ord.id") + if req.EnterpriseId != 0 { + sess.And("self_support_for_school_ord.enterprise_id =?", req.EnterpriseId) + } + if req.StartDate != "" { + sess.And("self_support_for_school_ord.face_time >= ?", req.StartDate) + } + if req.EndDate != "" { + sess.And("self_support_for_school_ord.face_time <= ?", req.EndDate) + } + _, err := sess. + Join("LEFT", "user_identity", "self_support_for_school_ord.user_identity_id = user_identity.id"). + Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). + Join("LEFT", "user", "user.id = user_identity.uid"). + Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). + Join("LEFT", "class", "class_with_user.class_id = class.id"). + Join("LEFT", "grade", "class.grade_id = grade.id"). + FindAndCount(&m) + if err != nil { + logx.Error(err) + println("<<<>>>>Error:::", err.Error()) + return + } + + titleList = []string{"订单编号", "支付交易号", "用户手机号", "就餐人姓名", "学校名称", "年级", "班级", "金额", "支付状态", "就餐时间", "设备编号", "身份"} + j := 2 //表头被第一行用了,只能从第二行开始 + for _, v := range m { + var state string //支付状态(0:待支付 1:支付成功) + switch v.SelfSupportForSchoolOrd.OrderStatus { + case 0: + state = "待支付" + break + case 1: + state = "支付成功" + break + } + + var identity string + switch enum.UserIdentityForSelfSupportForTeacher { + case enum.UserIdentityForSelfSupportForTeacher: + identity = enum.UserIdentity.String(enum.UserIdentityForSelfSupportForTeacher) + break + case enum.UserIdentityForSelfSupportForStudent: + identity = enum.UserIdentity.String(enum.UserIdentityForSelfSupportForStudent) + break + default: + identity = "未知" + } + + xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.SelfSupportForSchoolOrd.OutOrderNo, v.SelfSupportForSchoolOrd.TradeNo, v.UserIdentity.Name, v.Enterprise.Name, + v.Grade.Name, v.Class.Name, v.SelfSupportForSchoolOrd.TradeAmount, state, v.SelfSupportForSchoolOrd.FaceTime, v.SelfSupportForSchoolOrd.DeviceSn, identity}) + j++ + } + xlsx.SaveAs("./static" + fileName + ".xlsx") + break + } + //新增数据 + selfSupportForSchoolExportRecordsDb := db.SelfSupportForSchoolExportRecordsDb{} + selfSupportForSchoolExportRecordsDb.Set() + marshal, _ := json.Marshal(req) + selfSupportForSchoolExportRecordsDb.SelfSupportForSchoolExportRecordsInsert(&model.SelfSupportForSchoolExportRecords{ + Name: fileName, + DownloadPath: fileName, + Kind: req.Kind, + ReqContent: string(marshal), + CreateAt: now.Format("2006-01-02 15:04:05"), + UpdateAt: now.Format("2006-01-02 15:04:05"), + }) +} diff --git a/app/db/db_nursing_home_export_records.go b/app/db/db_nursing_home_export_records.go new file mode 100644 index 0000000..9d695ef --- /dev/null +++ b/app/db/db_nursing_home_export_records.go @@ -0,0 +1,107 @@ +package db + +import ( + "applet/app/admin/md" + "applet/app/db/model" + "applet/app/utils/logx" + "reflect" + "xorm.io/xorm" +) + +type NursingHomeExportRecordsDb struct { + Db *xorm.Engine `json:"db"` +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) Set() { // set方法 + nursingHomeExportRecordsDb.Db = Db +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) GetNursingHomeExportRecords(id int) (m *model.NursingHomeExportRecords, err error) { + m = new(model.NursingHomeExportRecords) + has, err := nursingHomeExportRecordsDb.Db.Where("id =?", id).Get(m) + if err != nil { + return nil, logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) GetNursingHomeExportRecordsByMonth(year, month string) (m *model.NursingHomeExportRecords, err error) { + m = new(model.NursingHomeExportRecords) + has, err := nursingHomeExportRecordsDb.Db.Where("year =? and month =?", year, month).Get(m) + if err != nil { + return nil, logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) FindNursingHomeExportRecords() (*[]model.NursingHomeExportRecords, error) { + var m []model.NursingHomeExportRecords + if err := nursingHomeExportRecordsDb.Db.Desc("id").Find(&m); err != nil { + return nil, logx.Error(err) + } + return &m, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) NursingHomeExportRecordsInsert(m *model.NursingHomeExportRecords) (int, error) { + _, err := nursingHomeExportRecordsDb.Db.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) NursingHomeExportRecordsInsertBySession(session *xorm.Session, m *model.NursingHomeExportRecords) (int, error) { + _, err := session.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) NursingHomeExportRecordsDelete(id interface{}) (int64, error) { + if reflect.TypeOf(id).Kind() == reflect.Slice { + return Db.In("id", id).Delete(model.NursingHomeExportRecords{}) + } else { + return Db.Where("id = ?", id).Delete(model.NursingHomeExportRecords{}) + } +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) NursingHomeExportRecordsUpdateBySession(session *xorm.Session, id interface{}, m *model.NursingHomeExportRecords, forceColums ...string) (int64, error) { + var ( + affected int64 + err error + ) + if forceColums != nil { + affected, err = session.Where("id=?", id).Cols(forceColums...).Update(m) + } else { + affected, err = session.Where("id=?", id).Update(m) + } + if err != nil { + return 0, err + } + return affected, nil +} + +func (nursingHomeExportRecordsDb *NursingHomeExportRecordsDb) NursingHomeExportRecordsList(req md.NursingHomeExportRecordsListReq) (m []model.NursingHomeExportRecords, total int64, err error) { + sess := nursingHomeExportRecordsDb.Db.Desc("id") + if req.Kind != 0 { + sess.And("kind =?", req.Kind) + } + if req.StartDate != "" { + sess.And("create_at >=?", req.StartDate) + } + if req.EndDate != "" { + sess.And("create_at <=?", req.EndDate) + } + total, err = sess.Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) + if err != nil { + return + } + return +} diff --git a/app/db/db_self_support_for_school_export_records.go b/app/db/db_self_support_for_school_export_records.go new file mode 100644 index 0000000..6cd1520 --- /dev/null +++ b/app/db/db_self_support_for_school_export_records.go @@ -0,0 +1,107 @@ +package db + +import ( + "applet/app/admin/md" + "applet/app/db/model" + "applet/app/utils/logx" + "reflect" + "xorm.io/xorm" +) + +type SelfSupportForSchoolExportRecordsDb struct { + Db *xorm.Engine `json:"db"` +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) Set() { // set方法 + selfSupportForSchoolExportRecordsDb.Db = Db +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) GetSelfSupportForSchoolExportRecords(id int) (m *model.SelfSupportForSchoolExportRecords, err error) { + m = new(model.SelfSupportForSchoolExportRecords) + has, err := selfSupportForSchoolExportRecordsDb.Db.Where("id =?", id).Get(m) + if err != nil { + return nil, logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) GetSelfSupportForSchoolExportRecordsByMonth(year, month string) (m *model.SelfSupportForSchoolExportRecords, err error) { + m = new(model.SelfSupportForSchoolExportRecords) + has, err := selfSupportForSchoolExportRecordsDb.Db.Where("year =? and month =?", year, month).Get(m) + if err != nil { + return nil, logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) FindSelfSupportForSchoolExportRecords() (*[]model.SelfSupportForSchoolExportRecords, error) { + var m []model.SelfSupportForSchoolExportRecords + if err := selfSupportForSchoolExportRecordsDb.Db.Desc("id").Find(&m); err != nil { + return nil, logx.Error(err) + } + return &m, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) SelfSupportForSchoolExportRecordsInsert(m *model.SelfSupportForSchoolExportRecords) (int, error) { + _, err := selfSupportForSchoolExportRecordsDb.Db.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) SelfSupportForSchoolExportRecordsInsertBySession(session *xorm.Session, m *model.SelfSupportForSchoolExportRecords) (int, error) { + _, err := session.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) SelfSupportForSchoolExportRecordsDelete(id interface{}) (int64, error) { + if reflect.TypeOf(id).Kind() == reflect.Slice { + return Db.In("id", id).Delete(model.SelfSupportForSchoolExportRecords{}) + } else { + return Db.Where("id = ?", id).Delete(model.SelfSupportForSchoolExportRecords{}) + } +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) SelfSupportForSchoolExportRecordsUpdateBySession(session *xorm.Session, id interface{}, m *model.SelfSupportForSchoolExportRecords, forceColums ...string) (int64, error) { + var ( + affected int64 + err error + ) + if forceColums != nil { + affected, err = session.Where("id=?", id).Cols(forceColums...).Update(m) + } else { + affected, err = session.Where("id=?", id).Update(m) + } + if err != nil { + return 0, err + } + return affected, nil +} + +func (selfSupportForSchoolExportRecordsDb *SelfSupportForSchoolExportRecordsDb) SelfSupportForSchoolExportRecordsList(req md.SelfSupportForSchoolExportRecordsListReq) (m []model.SelfSupportForSchoolExportRecords, total int64, err error) { + sess := selfSupportForSchoolExportRecordsDb.Db.Desc("id") + if req.Kind != 0 { + sess.And("kind =?", req.Kind) + } + if req.StartDate != "" { + sess.And("create_at >=?", req.StartDate) + } + if req.EndDate != "" { + sess.And("create_at <=?", req.EndDate) + } + total, err = sess.Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) + if err != nil { + return + } + return +} diff --git a/app/db/db_user_identity.go b/app/db/db_user_identity.go index 272f3e8..1b148a5 100644 --- a/app/db/db_user_identity.go +++ b/app/db/db_user_identity.go @@ -190,6 +190,7 @@ type UserIdentityWithUser struct { model.Class `xorm:"extends"` model.Grade `xorm:"extends"` model.SelfSupportForUserFaceInfo `xorm:"extends"` + model.Enterprise `xorm:"extends"` } func (UserIdentityWithUser) TableName() string { diff --git a/app/db/model/nursing_home_export_records.go b/app/db/model/nursing_home_export_records.go new file mode 100644 index 0000000..9f57e30 --- /dev/null +++ b/app/db/model/nursing_home_export_records.go @@ -0,0 +1,11 @@ +package model + +type NursingHomeExportRecords struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"` + DownloadPath string `json:"download_path" xorm:"not null default '' comment('下载地址') VARCHAR(255)"` + Kind int `json:"kind" xorm:"not null default 0 comment('类型(1:订单列表 2:退款申请表 3:学校预定统计表 4:班级明细表 5:退款明细表 6:收款统计表 7:班级收款明细表 8:学校预定数量统计表)') TINYINT(1)"` + ReqContent string `json:"req_content" xorm:"TEXT"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` +} diff --git a/app/db/model/self_support_for_school_export_records.go b/app/db/model/self_support_for_school_export_records.go new file mode 100644 index 0000000..29fe5bc --- /dev/null +++ b/app/db/model/self_support_for_school_export_records.go @@ -0,0 +1,11 @@ +package model + +type SelfSupportForSchoolExportRecords struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"` + DownloadPath string `json:"download_path" xorm:"not null default '' comment('下载地址') VARCHAR(255)"` + Kind int `json:"kind" xorm:"not null default 0 comment('类型(1:订单列表 2:退款申请表 3:预定统计表)') TINYINT(1)"` + ReqContent string `json:"req_content" xorm:"TEXT"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` +} diff --git a/app/router/admin_router.go b/app/router/admin_router.go index 99655da..984fa51 100644 --- a/app/router/admin_router.go +++ b/app/router/admin_router.go @@ -101,7 +101,15 @@ func rFinanceManage(r *gin.RouterGroup) { func rDataStatistics(r *gin.RouterGroup) { r.POST("/centralKitchenForSchool/export", hdl2.CentralKitchenForSchoolDataStatisticsExport) //数据统计-(央厨-学校)-导出 r.POST("/centralKitchenForSchool/list", hdl2.CentralKitchenForSchoolDataStatisticsList) //数据统计-(央厨-学校)-列表 - r.DELETE("/centralKitchenForSchool/delete/:id", hdl2.CentralKitchenForSchoolDataStatisticsDelete) //数据统计-(央厨-学校)-列表 + r.DELETE("/centralKitchenForSchool/delete/:id", hdl2.CentralKitchenForSchoolDataStatisticsDelete) //数据统计-(央厨-学校)-删除 + + r.POST("/nursingHome/export", hdl2.NursingHomeDataStatisticsExport) //数据统计-(养老院)-导出 + r.POST("/nursingHome/list", hdl2.NursingHomeDataStatisticsList) //数据统计-(养老院)-列表 + r.DELETE("/nursingHome/delete/:id", hdl2.NursingHomeDataStatisticsDelete) //数据统计-(养老院)-删除 + + r.POST("/selfSupportForSchool/export", hdl2.SelfSupportForSchoolDataStatisticsExport) //数据统计-(自营-学校)-导出 + r.POST("/selfSupportForSchool/list", hdl2.SelfSupportForSchoolDataStatisticsList) //数据统计-(自营-学校)-列表 + r.DELETE("/selfSupportForSchool/delete/:id", hdl2.SelfSupportForSchoolDataStatisticsDelete) //数据统计-(自营-学校)-删除 } @@ -189,6 +197,9 @@ func rEnterpriseManage(r *gin.RouterGroup) { r.POST("/selfSupportForSchool/arrearsOrdDebtCancel", hdl.SelfSupportForSchoolArrearsOrdDebtCancel) //"自营-学校"撤销欠款 r.GET("/selfSupportForSchool/educateSceneKidsClose", hdl.SelfSupportForSchoolEducateSceneKidsClose) //"自营-学校"人脸识别关闭 r.GET("/selfSupportForSchool/educateFacepayClose", hdl.SelfSupportForSchoolEducateFacepayClose) //"自营-学校"刷脸支付关闭 + //r.POST("/selfSupportForSchool/statisticsExport", hdl2.SelfSupportForSchoolDataStatisticsExport) //"自营-学校-数据统计"-导出 + //r.POST("/selfSupportForSchool/statisticsList", hdl2.SelfSupportForSchoolDataStatisticsList) //"自营-学校-数据统计"-列表 + //r.DELETE("/selfSupportForSchool/statisticsDelete/:id", hdl2.SelfSupportForSchoolDataStatisticsDelete) //"自营-学校-数据统计"-删除 r.POST("/nursingHome/userUpdate", hdl.NursingHomeUserUpdate) //"养老院"用户编辑 r.POST("/nursingHome/userDelete", hdl.NursingHomeUserDelete) //"养老院"用户删除 @@ -206,6 +217,9 @@ func rEnterpriseManage(r *gin.RouterGroup) { r.GET("/detailNursingHomePackage", hdl.DetailNursingHomePackage) //"养老院-套餐" 详情 r.POST("/saveNursingHomePackage", hdl.SaveNursingHomePackage) //新增/编辑 "养老院-套餐" r.DELETE("/deleteNursingHomePackage/:id", hdl.DeleteNursingHomePackage) //删除 "养老院-套餐" + //r.POST("/nursingHome/statisticsExport", hdl2.NursingHomeDataStatisticsExport) //"养老院-数据统计"-导出 + //r.POST("/nursingHome/statisticsList", hdl2.NursingHomeDataStatisticsList) //"养老院-数据统计"-列表 + //r.DELETE("/nursingHome/statisticsDelete/:id", hdl2.NursingHomeDataStatisticsDelete) //"养老院-数据统计"-删除 } func rRole(r *gin.RouterGroup) { diff --git a/cmd/task/main.go b/cmd/task/main.go index 6da7e4f..6af5024 100644 --- a/cmd/task/main.go +++ b/cmd/task/main.go @@ -1,7 +1,7 @@ package main import ( - "applet/app/admin/db" + "applet/app/db" "fmt" "os" "os/signal" diff --git a/go.mod b/go.mod index 09a1263..1a96e84 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module applet go 1.15 require ( + github.com/360EntSecGroup-Skylar/excelize v1.4.1 github.com/boombuler/barcode v1.0.1 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/forgoer/openssl v0.0.0-20201023062029-c3112b0c8700 diff --git a/static/export/nursing_home/订单列表_2023-09-01-2023-09-301694086532916.xlsx b/static/export/nursing_home/订单列表_2023-09-01-2023-09-301694086532916.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..028d77834e01ec963e83a3b44cc97f91d8037027 GIT binary patch literal 5716 zcmaJ_1yGc2*G9Vg6(mLJSW;3zx~02gVG*P|M5IKJ?(XjHZlnaHLrP#-mJX?JdHo&z z{J-}-&&>18?CgDJ?(3X$opT)}IRr#PI8@m4rxC+`aI@ zt#f8ptTx2qP!3%0KCnTX6F-&9i$<;2)Vboky8wG9r7mG9a15KdB#R+RNCb#^De+2( zY!V`EdhtdSUCf-kx-yimThNQnQ>d%Q0lHkJLO;Dp8a4M50LJMs6^4j!QrY$4YH@^5 zQx95Dxm}em;h|_4iwofu4gpaq2H+Qi4bZV;h3L0bNQ$R!ITHO>^&8wnAN!APn>gLB zuN_iU3^9*jv`_IOI+{LgdrfqxXP!lDAycBBnP*N`{7GZd5?`)a3&cPR&aIk~95=3u zE6$l`ePa-4qb&*MIBD67)6dy2DkgJi25irzr3P;}M87x8kn8CfGP%2D*3{X{=RgEY z7EfsuMyl`5b2K-F>I}4e`ds)qk*!y2CovVxyFxG2B$mZr<}8|v9jB;POJ5ax;We#^ zZd|1vG=^u{u@1dc<=d_KZ9$qL3)texnWnY}UfXvm@a*Yjk^rNDIR_8;W?m<+i<*&j zYcOlJ25YCO>(eL?B~mnXw7c^oEuEKQb~6u@jb>OSJ3U4Pf}b-3KC(PLTZt(Q{g~q4 zv7L*kaVlI_J|%K`brp@eLvXyX85x0JLKdBXSD5> zy+Tvjs6Y8)c;sS^4(IM_D|?b|<(X4vB%F64Lmo1~Y+0 zjq7x%B8B&I6b%9}xp9*64Zr8L#BfZFg7R>TQvydHl`(}0_8N;S$3Tppm8{o*muQoM z^d0 zOgcDlG*G`Pfjx*SOxg3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