瀏覽代碼

wip:ordercode处理

fuwencai 1 年之前
父節點
當前提交
e978552af7

+ 2 - 2
src/jfw/modules/publicapply/src/activityday/dao/orderInfo.go

@@ -5,7 +5,6 @@ import (
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"app.yhyue.com/moapp/jypkg/public"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
 	"database/sql"
 	"encoding/json"
@@ -16,6 +15,7 @@ import (
 	autil "jy/src/jfw/modules/publicapply/src/activityday/util"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/util"
 	"strings"
 	"time"
 )
@@ -67,7 +67,7 @@ func (r *RaffleInfo) InsertDataOrder(tx *sql.Tx, jyPrize string) (orderCode stri
 		err = fmt.Errorf(r.Prize.Name, "赋权限内容异常:", r.Prize.JyPrize)
 		return
 	}
-	orderCode = <-public.VarOrderCode.Pool
+	orderCode = util.GetOrderCode()
 	insertM := map[string]interface{}{
 		"order_money":          orderMoney, //订单金额 单位分
 		"order_status":         1,          //订单状态 0未支付 1已支付

+ 3 - 0
src/jfw/modules/publicapply/src/config/config.go

@@ -2,6 +2,7 @@ package config
 
 import (
 	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"app.yhyue.com/moapp/jypkg/compatible"
 	"app.yhyue.com/moapp/jypkg/middleground"
 	"github.com/gogf/gf/v2/frame/g"
@@ -100,4 +101,6 @@ func init() {
 		RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
 		RegEntManageApplication(g.Cfg().MustGet(ctx, "entManageApplication").String()).
 		RegJyPoints(g.Cfg().MustGet(ctx, "jyPointKey").String())
+	jy.OrderCodePoolInit()
+
 }

+ 0 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -2,7 +2,6 @@ module jy/src/jfw/modules/publicapply/src
 
 go 1.21
 
-toolchain go1.22.4
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66

+ 5 - 0
src/jfw/modules/publicapply/src/util/util.go

@@ -293,3 +293,8 @@ func GetMD5(data string) string {
 	encryptedData := hex.EncodeToString(hash[:])
 	return encryptedData
 }
+
+// 创建订单号
+func GetOrderCode() string {
+	return <-jy.VarOrderCode.Pool
+}