@@ -22,8 +22,24 @@ import ( | |||||
// Demo 测试 | // Demo 测试 | ||||
func Demo(c *gin.Context) { | func Demo(c *gin.Context) { | ||||
var m []model.CentralKitchenForSchoolUserWithDay | |||||
eg := db.Db | eg := db.Db | ||||
var mm []model.UserIdentity | |||||
if err1 := eg.Where("state = 1").Asc("id").Find(&mm); err1 != nil { | |||||
e.OutErr(c, e.ERR, err1.Error()) | |||||
return | |||||
} | |||||
for _, v := range mm { | |||||
var m []model.CentralKitchenForSchoolUserWithDay | |||||
if err1 := eg.Where("identity_id = ?", v.Id).And("state =1 and enterprise_id !=?", v.EnterpriseId).Find(&m); err1 != nil { | |||||
e.OutErr(c, e.ERR, err1.Error()) | |||||
return | |||||
} | |||||
if len(m) > 0 { | |||||
utils.FilePutContents("demo_demo", utils.SerializeStr(v)) | |||||
} | |||||
} | |||||
return | |||||
var m []model.CentralKitchenForSchoolUserWithDay | |||||
if err1 := eg.Where("state = 3").Asc("id").Find(&m); err1 != nil { | if err1 := eg.Where("state = 3").Asc("id").Find(&m); err1 != nil { | ||||
e.OutErr(c, e.ERR, err1.Error()) | e.OutErr(c, e.ERR, err1.Error()) | ||||
return | return | ||||
@@ -6,8 +6,10 @@ import ( | |||||
svc2 "applet/app/customer/svc" | svc2 "applet/app/customer/svc" | ||||
svc "applet/app/customer/svc/order" | svc "applet/app/customer/svc/order" | ||||
"applet/app/db" | "applet/app/db" | ||||
"applet/app/db/model" | |||||
"applet/app/e" | "applet/app/e" | ||||
"applet/app/enum" | "applet/app/enum" | ||||
"applet/app/utils" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
) | ) | ||||
@@ -25,13 +27,39 @@ func SelfSupportForSchoolOrderList(c *gin.Context) { | |||||
e.OutErr(c, e.ERR, err.Error()) | e.OutErr(c, e.ERR, err.Error()) | ||||
return | return | ||||
} | } | ||||
tradeAmountTotal, err := svc.SupportOrderStatistic(req) | tradeAmountTotal, err := svc.SupportOrderStatistic(req) | ||||
if err != nil { | if err != nil { | ||||
e.OutErr(c, e.ERR, err.Error()) | e.OutErr(c, e.ERR, err.Error()) | ||||
return | return | ||||
} | } | ||||
var deviceList []*model.Device | |||||
err = db.Db.Where("1 = 1").Find(&deviceList) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR, err.Error()) | |||||
return | |||||
} | |||||
var merchantList []*model.Merchant | |||||
err = db.Db.Where("1 = 1").Find(&merchantList) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR, err.Error()) | |||||
return | |||||
} | |||||
var merchantListMapping = map[int]model.Merchant{} | |||||
for _, v := range merchantList { | |||||
merchantListMapping[v.Id] = *v | |||||
} | |||||
var merchantWithDeviceListMapping = map[string]model.Merchant{} | |||||
for _, v := range deviceList { | |||||
merchantWithDeviceListMapping[v.DeviceSn] = merchantListMapping[v.MerchantId] | |||||
} | |||||
for _, v := range list { | |||||
v.MerchantName = merchantWithDeviceListMapping[v.DeviceSn].Name | |||||
} | |||||
utils.FilePutContents("SelfSupportForSchoolOrderList", utils.SerializeStr(list)) | |||||
e.OutSuc(c, map[string]interface{}{ | e.OutSuc(c, map[string]interface{}{ | ||||
"list": list, | "list": list, | ||||
"total": total, | "total": total, | ||||
@@ -236,6 +236,7 @@ func rEnterpriseManage(r *gin.RouterGroup) { | |||||
r.POST("/selfSupportForSchool/importTeacher", hdl.SelfSupportForSchoolImportTeacher) //"自营-学校"导入老师 | r.POST("/selfSupportForSchool/importTeacher", hdl.SelfSupportForSchoolImportTeacher) //"自营-学校"导入老师 | ||||
r.GET("/selfSupportForSchool/downloadTemplateExcel", hdl.SelfSupportForSchoolDownloadTemplateExcel) //"自营-学校"下载表格模板 | r.GET("/selfSupportForSchool/downloadTemplateExcel", hdl.SelfSupportForSchoolDownloadTemplateExcel) //"自营-学校"下载表格模板 | ||||
r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表 | r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表 | ||||
r.POST("/selfSupportForSchool/ordRefund", hdl.SelfSupportForSchoolOrdRefund) //财务管理-(自营-学校)订单退款 | |||||
r.Any("/selfSupportForSchool/ordListExport", hdl.SelfSupportForSchoolOrdListExport) //"自营-学校"订单列表-导出 | r.Any("/selfSupportForSchool/ordListExport", hdl.SelfSupportForSchoolOrdListExport) //"自营-学校"订单列表-导出 | ||||
r.POST("/selfSupportForSchool/consumeLimit", hdl.SelfSupportForSchoolConsumeLimit) //"自营-学校"消费限制-编辑 | r.POST("/selfSupportForSchool/consumeLimit", hdl.SelfSupportForSchoolConsumeLimit) //"自营-学校"消费限制-编辑 | ||||
r.POST("/selfSupportForSchool/consumeLimitList", hdl.SelfSupportForSchoolConsumeLimitList) //"自营-学校"消费限制-列表 | r.POST("/selfSupportForSchool/consumeLimitList", hdl.SelfSupportForSchoolConsumeLimitList) //"自营-学校"消费限制-列表 | ||||