|
@@ -1,8 +1,12 @@ |
|
|
package hdl |
|
|
package hdl |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"applet/app/customer/md" |
|
|
|
|
|
"applet/app/customer/svc" |
|
|
"applet/app/db" |
|
|
"applet/app/db" |
|
|
|
|
|
"applet/app/db/model" |
|
|
"applet/app/e" |
|
|
"applet/app/e" |
|
|
|
|
|
"applet/app/enum" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
|
"time" |
|
|
"time" |
|
@@ -10,6 +14,43 @@ import ( |
|
|
|
|
|
|
|
|
// Demo 测试 |
|
|
// Demo 测试 |
|
|
func Demo(c *gin.Context) { |
|
|
func Demo(c *gin.Context) { |
|
|
|
|
|
var m []model.CentralKitchenForSchoolPackageOrd |
|
|
|
|
|
sess := db.Db.Desc("id").Where("state =1") |
|
|
|
|
|
sess.Find(&m) |
|
|
|
|
|
sysCfgDb := db.SysCfgDb{} |
|
|
|
|
|
sysCfgDb.Set() |
|
|
|
|
|
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.JsapiPayAppAutToken, enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey) |
|
|
|
|
|
|
|
|
|
|
|
centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{} |
|
|
|
|
|
for _, v := range m { |
|
|
|
|
|
err2, result := svc.CurlAlipayTradeQuery(md.CurlAlipayTradeQueryReq{ |
|
|
|
|
|
Config: struct { |
|
|
|
|
|
PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"` |
|
|
|
|
|
PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"` |
|
|
|
|
|
PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"` |
|
|
|
|
|
}{ |
|
|
|
|
|
PayAliAppId: sysCfg[enum.OpenAlipayAppid], |
|
|
|
|
|
PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey], |
|
|
|
|
|
PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey], |
|
|
|
|
|
}, |
|
|
|
|
|
OutTradeNo: v.OutTradeNo, |
|
|
|
|
|
AppAuthToken: sysCfg[enum.JsapiPayAppAutToken], |
|
|
|
|
|
}) |
|
|
|
|
|
if err2 != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR, err2.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
centralKitchenForSchoolPackageOrd.Set(v.OutTradeNo) |
|
|
|
|
|
v.CreateAt = result.Date |
|
|
|
|
|
update, err := centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(&v, "create_at") |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println(">>>>>>>>>>>>", v.OutTradeNo, update) |
|
|
|
|
|
} |
|
|
|
|
|
return |
|
|
qrcodeWithBatchRecordsDb := db.AdminDb{} |
|
|
qrcodeWithBatchRecordsDb := db.AdminDb{} |
|
|
qrcodeWithBatchRecordsDb.Set() |
|
|
qrcodeWithBatchRecordsDb.Set() |
|
|
data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001) |
|
|
data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001) |
|
|