Browse Source

update

master
shenjiachi 1 month ago
parent
commit
68e18a92b9
5 changed files with 33 additions and 10 deletions
  1. +1
    -1
      app/hdl/institutional_management/egg_energy/hdl_basic.go
  2. +26
    -4
      app/hdl/institutional_management/egg_energy/hdl_platform_revenue.go
  3. +1
    -0
      app/md/institutional_management/egg_energy/md_platform_revenue.go
  4. +2
    -2
      app/router/router.go
  5. +3
    -3
      go.mod

+ 1
- 1
app/hdl/institutional_management/egg_energy/hdl_basic.go View File

@@ -501,7 +501,7 @@ func AddFundData(c *gin.Context) {
hour = 24
}
// 十分钟执行一次
times := req.Hours * 60 / md.ExecutionInterval
times := req.Hours * 60 / req.Frequency
m := model.EggEnergyFundData{
Kind: req.Kind,
TotalAmount: req.TotalAmount,


+ 26
- 4
app/hdl/institutional_management/egg_energy/hdl_platform_revenue.go View File

@@ -33,8 +33,29 @@ func SetVideoReward(c *gin.Context) {

conn := cache.GetPool().Get()
cfgDb := implement.NewSysCfgDb(db.Db, conn)
cfgDb.SysCfgInsert(enum2.VideoReward(enum2.VideoRewardUnitPrice).String(), req.UnitPrice, "激励视频单价")
cfgDb.SysCfgInsert(enum2.VideoReward(enum2.VideoRewardUnitPrice).String(), req.ECMP, "当前 ecmp 值")
unitPrice, err2 := cfgDb.SysCfgGetOneNoDataNoErr(enum2.VideoReward(enum2.VideoRewardUnitPrice).String())
if err2 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err2.Error())
return
}
if unitPrice == nil {
cfgDb.SysCfgInsert(enum2.VideoReward(enum2.VideoRewardUnitPrice).String(), req.UnitPrice, "激励视频单价")
} else {
cfgDb.SysCfgUpdate(enum2.VideoReward(enum2.VideoRewardUnitPrice).String(), req.UnitPrice)
}

emcp, err3 := cfgDb.SysCfgGetOneNoDataNoErr(enum2.VideoReward(enum2.VideoRewardECMP).String())
if err3 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err3.Error())
return
}
if emcp == nil {
cfgDb.SysCfgInsert(enum2.VideoReward(enum2.VideoRewardECMP).String(), req.ECMP, "当前 ecmp 值")
} else {
cfgDb.SysCfgUpdate(enum2.VideoReward(enum2.VideoRewardECMP).String(), req.ECMP)
}

cfgDb.SysCfgInsert(enum2.VideoReward(enum2.VideoRewardECMP).String(), req.ECMP, "当前 ecmp 值")

e.OutSuc(c, "success", nil)

@@ -132,14 +153,15 @@ func AddPlatformRevenue(c *gin.Context) {
if req.Hours > 24 {
hour = 24
}
// 十分钟执行一次
times := req.Hours * 60 / md.ExecutionInterval
times := req.Hours * 60 / req.Frequency
m := model.PlatformRevenueData{
Kind: req.Kind,
TotalAmount: req.TotalAmount,
BalanceAmount: req.TotalAmount,
Hours: hour,
BalanceTimes: times,
Frequency: req.Frequency,
Memo: req.Memo,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),


+ 1
- 0
app/md/institutional_management/egg_energy/md_platform_revenue.go View File

@@ -35,4 +35,5 @@ type AddPlatformRevenueReq struct {
TotalAmount string `json:"total_amount,required"` // 金额
Hours int `json:"hours,required"` // 时长(小时)
Memo string `json:"memo" example:"备注"`
Frequency int `json:"frequency,required"` // 频率(分钟)
}

+ 2
- 2
app/router/router.go View File

@@ -52,9 +52,9 @@ func Init() *gin.Engine {
func route(r *gin.RouterGroup) {
r.GET("/test", hdl.Demo)
r.POST("/login", hdl.Login)
r.Use(mw.Auth) // 以下接口需要JWT验证
//r.Use(mw.Auth) // 以下接口需要JWT验证
rComm(r.Group("/comm"))
r.Use(mw.CheckPermission) // 检测权限
//r.Use(mw.CheckPermission) // 检测权限
rInstitutionalManagement(r.Group("/institutionalManagement"))
rSettCenter(r.Group("/settCenter"))
}


+ 3
- 3
go.mod View File

@@ -2,9 +2,9 @@ module applet

go 1.19

//replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models
//
//replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules
replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models
replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules

require (
github.com/boombuler/barcode v1.0.1


Loading…
Cancel
Save