From b77e324a8f00a251ae2237ac8497e2618ebbca75 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 13 Nov 2024 19:57:16 +0800 Subject: [PATCH] update --- .../deal_available_green_energy_points.go | 18 ++++++++++++++++-- .../enum/available_egg_energy_points_flow.go | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/rule/egg_energy/deal_available_green_energy_points.go b/rule/egg_energy/deal_available_green_energy_points.go index 30b4c47..879ea22 100644 --- a/rule/egg_energy/deal_available_green_energy_points.go +++ b/rule/egg_energy/deal_available_green_energy_points.go @@ -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 //公益慈善 diff --git a/rule/egg_energy/enum/available_egg_energy_points_flow.go b/rule/egg_energy/enum/available_egg_energy_points_flow.go index 3addab8..1cfd702 100644 --- a/rule/egg_energy/enum/available_egg_energy_points_flow.go +++ b/rule/egg_energy/enum/available_egg_energy_points_flow.go @@ -13,6 +13,7 @@ const ( PlatformProfitability MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums + CapitalInjection ) func (kind EggEnergyAvailableEnergyFlowKind) String() string {