Kaynağa Gözat

update

master
dengbiao 3 ay önce
ebeveyn
işleme
0d35287905
5 değiştirilmiş dosya ile 20 ekleme ve 15 silme
  1. +2
    -2
      rule/one_circles/one_circles_auto_adjust_prices.go
  2. +1
    -1
      rule/one_circles/one_circles_community_dividends.go
  3. +3
    -2
      rule/one_circles/one_circles_deal_available_green_energy_points.go
  4. +13
    -9
      rule/one_circles/one_circles_sign_in_green_energy_settlement.go
  5. +1
    -1
      rule/one_circles/one_circles_star_level_dividends.go

+ 2
- 2
rule/one_circles/one_circles_auto_adjust_prices.go Dosyayı Görüntüle

@@ -62,7 +62,7 @@ func AutoAdjustPrice(engine *xorm.Engine, masterId string) (err error) {
}

// 市商数量 减少、原始数量 增加、原始资金 减少、市商资金 增加
err = DealAvailableGreenEnergyCoin(session, int(enum.MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds), zhios_order_relate_utils.StrToFloat64(marketplaceMerchantsNumsExchangeMarketplaceMerchantsFundValue.String()), zhios_order_relate_utils.StrToFloat64(amount), enum.MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds.String(), oneCirclesGreenEnergyBasicSetting, afterPriceValue)
err = DealAvailableGreenEnergyCoin(session, int(enum.MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds), zhios_order_relate_utils.StrToFloat64(marketplaceMerchantsNumsExchangeMarketplaceMerchantsFundValue.String()), zhios_order_relate_utils.StrToFloat64(amount), enum.MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds.String(), oneCirclesGreenEnergyBasicSetting, afterPriceValue, masterId)
if err != nil {
fmt.Println("err:::::22222", err)
_ = session.Rollback()
@@ -78,7 +78,7 @@ func AutoAdjustPrice(engine *xorm.Engine, masterId string) (err error) {
return err1
}
// 市商数量 增加、原始数量 减少、原始资金 增加、市商资金 减少
err = DealAvailableGreenEnergyCoin(session, int(enum.MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums), zhios_order_relate_utils.StrToFloat64(greenEnergy), zhios_order_relate_utils.StrToFloat64(marketplaceMerchantsFundExchangeMarketplaceMerchantsNumsValue.String()), enum.MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums.String(), oneCirclesGreenEnergyBasicSetting, afterPriceValue)
err = DealAvailableGreenEnergyCoin(session, int(enum.MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums), zhios_order_relate_utils.StrToFloat64(greenEnergy), zhios_order_relate_utils.StrToFloat64(marketplaceMerchantsFundExchangeMarketplaceMerchantsNumsValue.String()), enum.MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums.String(), oneCirclesGreenEnergyBasicSetting, afterPriceValue, masterId)
if err != nil {
fmt.Println("err:::::44444", err)
_ = session.Rollback()


+ 1
- 1
rule/one_circles/one_circles_community_dividends.go Dosyayı Görüntüle

@@ -84,7 +84,7 @@ func CommunityDividends(engine *xorm.Engine, masterId string) (err error) {
}
//6、 减少“社区分红”钱包中的值
totalDividend, _ := totalValue.Float64()
err = DealAvailableGreenEnergyCoin(session, int(enum.CommunityDividends), totalDividend, 0, enum.CommunityDividends.String(), nil, masterId)
err = DealAvailableGreenEnergyCoin(session, int(enum.CommunityDividends), totalDividend, 0, enum.CommunityDividends.String(), nil, "", masterId)
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::444444", err)


+ 3
- 2
rule/one_circles/one_circles_deal_available_green_energy_points.go Dosyayı Görüntüle

@@ -12,10 +12,11 @@ import (
"xorm.io/xorm"
)

func DealAvailableGreenEnergyCoin(session *xorm.Session, kind int, amount, amountFee float64, title string, chain *model.OneCirclesGreenEnergyBasicSetting, nowPriceValue string) error {
func DealAvailableGreenEnergyCoin(session *xorm.Session, kind int, amount, amountFee float64, title string, chain *model.OneCirclesGreenEnergyBasicSetting, nowPriceValue, masterId string) error {
if chain == nil {
// 查找 `one_circles_green_energy_basic_setting` 基础设置
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(session.Engine(), nowPriceValue)
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(session.Engine(), masterId)
nowPriceValue = oneCirclesGreenEnergyBasicSetting.NowPrice
if err != nil {
return err
}


+ 13
- 9
rule/one_circles/one_circles_sign_in_green_energy_settlement.go Dosyayı Görüntüle

@@ -8,7 +8,6 @@ import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/enum"
md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles/svc"
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx"
"encoding/json"
@@ -74,13 +73,17 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, ch *rabbi

func HandleSettlementSignInGreenEnergy(ch *rabbit.Channel, engine *xorm.Engine, masterId string, id int64, uid int, endTime string) (err error) {
//1、查找 `one_circles_green_energy_basic_setting` 基础设置
oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId)
if err != nil {
return
}
if cb != nil {
defer cb() // 释放锁
}
oneCirclesGreenEnergyBasicSetting, err := db.OneCirclesGreenEnergyBasicSettingGetOneByParams(engine, map[string]interface{}{
"key": "is_open",
"value": 1,
})
//oneCirclesGreenEnergyBasicSetting, cb, err := svc.GetPrice(engine, masterId)
//if err != nil {
// return
//}
//if cb != nil {
// defer cb() // 释放锁
//}

var teamRewardSetting *md2.TeamRewardSettingStruct
err = json.Unmarshal([]byte(oneCirclesGreenEnergyBasicSetting.TeamReward), &teamRewardSetting)
@@ -194,7 +197,8 @@ func HandleSettlementSignInGreenEnergy(ch *rabbit.Channel, engine *xorm.Engine,

//5、减少“活跃赠送” 中的绿色能量
if reduceTotalGreenEnergy > 0 {
err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice)
//err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice)
err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, 0, enum.SignInReward.String(), nil, "", masterId)
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::55555", err)


+ 1
- 1
rule/one_circles/one_circles_star_level_dividends.go Dosyayı Görüntüle

@@ -288,7 +288,7 @@ func SettlementStarLevelDividends(engine *xorm.Engine, masterId string, ch *rabb

//6、 减少“星级分红”中的绿色能量
totalDividend, _ := totalDividendValue.Float64()
err = DealAvailableGreenEnergyCoin(session, int(enum.SettlementStarLevelDividends), totalDividend, 0, enum.SettlementStarLevelDividends.String(), nil, masterId)
err = DealAvailableGreenEnergyCoin(session, int(enum.SettlementStarLevelDividends), totalDividend, 0, enum.SettlementStarLevelDividends.String(), nil, "", masterId)
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::9999999", err)


Yükleniyor…
İptal
Kaydet