shenjiachi 2 veckor sedan
förälder
incheckning
27dcf49d17
4 ändrade filer med 43 tillägg och 8 borttagningar
  1. +26
    -0
      enum/user_wallet_fllow.go
  2. +16
    -2
      rule/egg_energy/deal_available_green_energy_points.go
  3. +1
    -0
      rule/egg_energy/enum/available_egg_energy_points_flow.go
  4. +0
    -6
      rule/egg_energy/md/mq.go

+ 26
- 0
enum/user_wallet_fllow.go Visa fil

@@ -0,0 +1,26 @@
package enum

// UserWalletFlowTransferType 用户钱包流水-类型
type UserWalletFlowTransferType int

const (
AdministratorOperationAddBalance UserWalletFlowTransferType = iota + 1
AdministratorOperationSubBalance
EggEnergyExchangeAccountBalance
AccountBalanceExchangeEggEnergy
)

func (kind UserWalletFlowTransferType) String() string {
switch kind {
case AdministratorOperationAddBalance:
return "管理员操作增加余额"
case AdministratorOperationSubBalance:
return "管理员操作扣除余额"
case EggEnergyExchangeAccountBalance:
return "蛋蛋能量兑换余额"
case AccountBalanceExchangeEggEnergy:
return "余额兑换蛋蛋能量"
default:
return "未知状态"
}
}

+ 16
- 2
rule/egg_energy/deal_available_green_energy_points.go Visa fil

@@ -13,7 +13,6 @@ import (
)

func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreData *model.EggEnergyCoreData, req md2.DealAvailableEggEnergyCoinReq) error {

if eggEnergyCoreData == nil { //TODO::存在使用风险
// 查找 `egg_energy_core_data` 基础设置
eggEnergyCoreDataModel, cb, err := svc.GetEggEnergyCoreData(session.Engine())
@@ -90,7 +89,6 @@ func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreDa
eggEnergyAvailableEnergyFlow.AfterDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums
break
case int(enum.EggEnergyExchangeAccountBalance): //蛋蛋能量兑换余额
//查找`egg_energy_basic_setting` 基础设置
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(session.Engine())
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
"key": "is_open",
@@ -246,6 +244,22 @@ func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreDa
eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds
eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantFundValues = marketplaceMerchantFunds.Sub(amountValue).RoundFloor(8).String()

eggEnergyAvailableEnergyFlow.BeforeDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee //发展委员会
eggEnergyAvailableEnergyFlow.AfterDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee
eggEnergyAvailableEnergyFlow.BeforePublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity //公益慈善
eggEnergyAvailableEnergyFlow.AfterPublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity
eggEnergyAvailableEnergyFlow.BeforeStarLevelDividendsValues = eggEnergyCoreData.StarLevelDividends //星级分红
eggEnergyAvailableEnergyFlow.AfterStarLevelDividendsValues = eggEnergyCoreData.StarLevelDividends
eggEnergyAvailableEnergyFlow.BeforeCommunityDividends = eggEnergyCoreData.CommunityDividends //社区分红
eggEnergyAvailableEnergyFlow.AfterCommunityDividends = eggEnergyCoreData.CommunityDividends
eggEnergyAvailableEnergyFlow.BeforeDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums //销毁数量
eggEnergyAvailableEnergyFlow.AfterDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums
break
case int(enum.CapitalInjection): //资金汇入
eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantValues = eggEnergyCoreData.MarketplaceMerchantNums //市商数量
eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantValues = eggEnergyCoreData.MarketplaceMerchantNums
eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds //市商资金
eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds
eggEnergyAvailableEnergyFlow.BeforeDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee //发展委员会
eggEnergyAvailableEnergyFlow.AfterDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee
eggEnergyAvailableEnergyFlow.BeforePublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity //公益慈善


+ 1
- 0
rule/egg_energy/enum/available_egg_energy_points_flow.go Visa fil

@@ -13,6 +13,7 @@ const (
PlatformProfitability
MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds
MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums
CapitalInjection
)

func (kind EggEnergyAvailableEnergyFlowKind) String() string {


+ 0
- 6
rule/egg_energy/md/mq.go Visa fil

@@ -5,17 +5,11 @@ const EggEnergyExchange = "egg.energy"
const (
EggEnergyRoutKeyForStarLevelDividend = "star_level_dividend" // 星级分红
EggEnergyRoutKeyForSettlementPublicGiveActivityCoin = "settlement_public_give_activity_coin" // 计算观看激励视屏得到活跃积分
EggEnergyRoutKeyForReadyExchangeGreenEnergyToPerson = "ready_exchange_egg_energy_to_person" // 准备兑换个人蛋蛋能量
EggEnergyRoutKeyForStartExchangeGreenEnergyToPerson = "start_exchange_egg_energy_to_person" // 开始兑换个人蛋蛋能量
EggEnergyRoutKeyForAutoExchangeGreenEnergyToPerson = "auto_exchange_egg_energy_to_person" // 自动兑换个人蛋蛋能量
EggEnergyRoutKeyForReadyExchangeGreenEnergyToTeam = "ready_exchange_egg_energy_to_team" // 自动兑换团队蛋蛋能量
EggEnergyRoutKeyForStartExchangeGreenEnergyToTeam = "start_exchange_egg_energy_to_team" // 开始兑换团队蛋蛋能量
EggEnergyRoutKeyForAutoExchangeGreenEnergyToTeam = "auto_exchange_egg_energy_to_team" // 自动兑换团队蛋蛋能量

EggEnergyRoutKeyForSignIn = "sign_in" // 签到
EggEnergyRoutKeyForSignInUpdateRecords = "sign_in_update_records" // 签到更新记录
EggEnergyRoutKeyForRewardUserCoin = "reward_user_coin" // 奖励用户虚拟币

)

type EggEnergyStructForSignIn struct {


Laddar…
Avbryt
Spara