From 31c2470c6da8f040b32b6e0792490cddf170aed4 Mon Sep 17 00:00:00 2001 From: cabbage <281119120@qq.com> Date: Fri, 23 May 2025 15:44:31 +0800 Subject: [PATCH] =?UTF-8?q?##=20=E9=A1=B6=E7=82=B9=E5=A5=96=E9=87=91?= =?UTF-8?q?=E6=8B=A8=E6=AF=94=E5=88=97=E8=A1=A8=E7=BB=9F=E8=AE=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CuBonusVertexStatisController.java | 602 ++---------------- .../statis/vo/CuBonusVertexStatisVO.java | 47 +- .../statis/CuBonusVertexStatisMapper.xml | 356 +++++------ 3 files changed, 216 insertions(+), 789 deletions(-) diff --git a/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/controller/manager/CuBonusVertexStatisController.java b/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/controller/manager/CuBonusVertexStatisController.java index bce2e369..3091bed9 100644 --- a/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/controller/manager/CuBonusVertexStatisController.java +++ b/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/controller/manager/CuBonusVertexStatisController.java @@ -1,16 +1,13 @@ package com.hzs.member.statis.controller.manager; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; + import cn.hutool.core.collection.CollectionUtil; import com.hzs.common.core.annotation.AccessPermissions; import com.hzs.common.core.annotation.Log; -import com.hzs.common.core.constant.CountryConstants; import com.hzs.common.core.constant.msg.FinanceMsgConstants; import com.hzs.common.core.domain.R; import com.hzs.common.core.enums.EOperationBusiness; import com.hzs.common.core.enums.EOperationMethod; import com.hzs.common.core.enums.EOperationModule; -import com.hzs.common.core.enums.EOrderType; import com.hzs.common.core.utils.DateUtils; import com.hzs.common.core.utils.StringUtils; import com.hzs.common.core.utils.poi.ExcelUtil; @@ -33,9 +30,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; -import java.math.RoundingMode; import java.time.temporal.ChronoUnit; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -65,629 +60,106 @@ public class CuBonusVertexStatisController extends BaseController { } /** - * 奖金拨比列表 + * 顶点奖金拨比列表统计 **/ @AccessPermissions("TopPerformance") @GetMapping("/list") @Log(module = EOperationModule.BONUS_DIAL_RATIO, business = EOperationBusiness.BONUS_DIAL_VERTEX_RATIO_LIST, method = EOperationMethod.SELECT) public TableDataInfo list(CuBonusVertexStatisVO cuBonusVertexStatisVO) { Integer pkCountry = SecurityUtils.getPkCountry(); - List slList; R currency = iCurrencyServiceApi.getCurrency(pkCountry); - BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); - R chCurrency = iCurrencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); - BigDecimal chRate = chCurrency.getData().getInExchangeRate() == null ? BigDecimal.ONE : chCurrency.getData().getInExchangeRate(); - cuBonusVertexStatisVO.setRate(exchangeRate); BigDecimal cent = new BigDecimal(100); + BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); + cuBonusVertexStatisVO.setRate(exchangeRate); cuBonusVertexStatisVO.setPerCent(exchangeRate.multiply(cent)); cuBonusVertexStatisVO.setPkCountry(pkCountry); + //默认查询当前日期的前一天 Date date = DateUtils.currentDate(); - if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) || - StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { + if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) + || StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { cuBonusVertexStatisVO.setStartDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); cuBonusVertexStatisVO.setEndDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); } - //查询奖金扣项配置参数 0.8 - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - List bonus = iCuBonusVertexStatisService.bonusDeductlist(cuBonusVertexStatisVO); - if (CollectionUtil.isNotEmpty(bonus)) { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE.subtract(bonus.get(0).getBackRatio())); - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } - - List orderTypeList = new ArrayList<>(); - orderTypeList.add(EOrderType.REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue()); - cuBonusVertexStatisVO.setOrderTypeList(orderTypeList); - //查询分红比例配置 - cuBonusVertexStatisVO.setDividendRatio(BigDecimal.ZERO); - //查询顶点会员 - List vertexList = iCuBonusVertexStatisService.vertexList(cuBonusVertexStatisVO.getPkVertex()); - CuBonusVertexStatisVO cvs = BeanUtil.copyProperties(cuBonusVertexStatisVO, CuBonusVertexStatisVO.class); - for (CuBonusVertexStatisVO ve : vertexList) { - cvs.setPkVertex(ve.getPkVertex()); - } startPage(); //查询中国奖金拨比列表 - slList = iCuBonusVertexStatisService.queryCuBonusStatis(cuBonusVertexStatisVO); + List slList = iCuBonusVertexStatisService.queryCuBonusStatis(cuBonusVertexStatisVO); if (CollectionUtil.isNotEmpty(slList)) { - - slList.forEach(itm -> { - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - //重新算首购拨比 - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0) { - BigDecimal mainBonusRate = cent.multiply((itm.getMainBonus()).multiply(currency.getData().getInExchangeRate())); - mainBonusRate = mainBonusRate.divide(itm.getFirstPurchaseAll(), 4, RoundingMode.HALF_UP); - itm.setMainBonusRate(mainBonusRate); - itm.setMainBonusPvRate(itm.getMainBonusPvRate().divide(itm.getFirstPurchaseAll(), 4, RoundingMode.HALF_UP)); - } - //重新算总拨比 - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0 || - itm.getRepurchaseAllAmount().compareTo(BigDecimal.ZERO) > 0) { - BigDecimal totalBonusRate = cent.multiply((itm.getTotalBonus()).multiply(currency.getData().getInExchangeRate())); - totalBonusRate = totalBonusRate.divide(itm.getFirstPurchaseAll().add(itm.getRepurchaseAllAmount()), 4, RoundingMode.HALF_UP); - itm.setTotalBonusRate(totalBonusRate); - } - //首购拨出金额 - itm.setMainBonus((itm.getMainBonus()).multiply(currency.getData().getInExchangeRate())); - itm.setTotalBonus((itm.getTotalBonus()).multiply(currency.getData().getInExchangeRate())); - //奖金 - if (itm.getIntroduceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setIntroduceBonus(itm.getIntroduceBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setOrgBonus(itm.getOrgBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getLeaderBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setLeaderBonus(itm.getLeaderBonus().multiply(currency.getData().getInExchangeRate())); - } - - if (itm.getServiceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setServiceBonus(itm.getServiceBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getHiFunIncome().compareTo(BigDecimal.ZERO) > 0) { - itm.setHiFunIncome(itm.getHiFunIncome().multiply(currency.getData().getInExchangeRate())); - } - - if (itm.getRepurRangeBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurRangeBonus(itm.getRepurRangeBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getRepurOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurOrgBonus(itm.getRepurOrgBonus().multiply(currency.getData().getInExchangeRate())); - } - itm.setRepurBonus(itm.getRepurBonus().multiply(currency.getData().getInExchangeRate())); - } - //国外转为人民币 - if (!pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - //订单金额 - if (itm.getMainRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainRegAmount(itm.getMainRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getMainUpAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainUpAmount(itm.getMainUpAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getAgentRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setAgentRegAmount(itm.getAgentRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getAgentUpAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setAgentUpAmount(itm.getAgentUpAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0) { - itm.setFirstPurchaseAll(itm.getFirstPurchaseAll().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getMainRepurAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainRepurAmount(itm.getMainRepurAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getHifansRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setHifansRegAmount(itm.getHifansRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getRepurchaseAllAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurchaseAllAmount(itm.getRepurchaseAllAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - //奖金 - if (itm.getIntroduceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setIntroduceBonus(itm.getIntroduceBonus().multiply(chRate)); - } - if (itm.getOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setOrgBonus(itm.getOrgBonus().multiply(chRate)); - } - if (itm.getLeaderBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setLeaderBonus(itm.getLeaderBonus().multiply(chRate)); - } - if (itm.getShareBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setShareBonus(itm.getShareBonus().multiply(chRate)); - } - if (itm.getServiceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setServiceBonus(itm.getServiceBonus().multiply(chRate)); - } - if (itm.getRepurRangeBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurRangeBonus(itm.getRepurRangeBonus().multiply(chRate)); - } - if (itm.getRepurOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurOrgBonus(itm.getRepurOrgBonus().multiply(chRate)); - } - if (itm.getMainBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainBonus(itm.getMainBonus().multiply(chRate)); - } - if (itm.getRepurBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurBonus(itm.getRepurBonus().multiply(chRate)); - } - if (itm.getTotalBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setTotalBonus(itm.getTotalBonus().multiply(chRate)); - } - } + slList.forEach(item -> { + item.setMainRegAmount(item.getMainRegAmount().add(item.getSpecialRegisterAmount())); + item.setMainUpAmount(item.getMainUpAmount().add(item.getSpecialUpgradeAmount())); + item.setMainRepurAmount(item.getMainRepurAmount().add(item.getSpecialRepurchaseAmount())); }); } return getDataTable(slList); } /** - * 导出奖金拨比列表 + * 顶点奖金拨比列表统计导出 **/ @Log(module = EOperationModule.BONUS_DIAL_RATIO, business = EOperationBusiness.BONUS_DIAL_RATIO_LIST, method = EOperationMethod.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, CuBonusVertexStatisVO cuBonusVertexStatisVO) { Integer pkCountry = SecurityUtils.getPkCountry(); - List slList = null; - CuBonusVertexStatisVO subtotal = null; R currency = iCurrencyServiceApi.getCurrency(pkCountry); - BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); - R chCurrency = iCurrencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); - BigDecimal chRate = chCurrency.getData().getInExchangeRate() == null ? BigDecimal.ONE : chCurrency.getData().getInExchangeRate(); - cuBonusVertexStatisVO.setRate(exchangeRate); BigDecimal cent = new BigDecimal(100); + BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); + cuBonusVertexStatisVO.setRate(exchangeRate); cuBonusVertexStatisVO.setPerCent(exchangeRate.multiply(cent)); cuBonusVertexStatisVO.setPkCountry(pkCountry); - //默认查询当前日期的前一天 + + // 默认查询当前日期的前一天 Date date = DateUtils.currentDate(); - if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) || - StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { + if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) + || StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { cuBonusVertexStatisVO.setStartDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); cuBonusVertexStatisVO.setEndDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); } - //查询奖金扣项配置参数 0.8 - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - List bonus = iCuBonusVertexStatisService.bonusDeductlist(cuBonusVertexStatisVO); - if (CollectionUtil.isNotEmpty(bonus)) { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE.subtract(bonus.get(0).getBackRatio())); - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } -// //查询天数 -// Integer days = DateUtils.betweenDay(DateUtils.parseDate(cuBonusVertexStatisVO.getStartDate()), DateUtils.parseDate(cuBonusVertexStatisVO.getEndDate())); -// if (days == 0) { -// days = 1; -// } - List orderTypeList = new ArrayList<>(); - orderTypeList.add(EOrderType.REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue()); - cuBonusVertexStatisVO.setOrderTypeList(orderTypeList); - //查询分红比例配置 - cuBonusVertexStatisVO.setDividendRatio(BigDecimal.ZERO); - //查询顶点会员 - List vertexList = iCuBonusVertexStatisService.vertexList(cuBonusVertexStatisVO.getPkVertex()); - for (CuBonusVertexStatisVO ve : vertexList) { - CuBonusVertexStatisVO cvs = BeanUtil.copyProperties(cuBonusVertexStatisVO, CuBonusVertexStatisVO.class); - cvs.setPkVertex(ve.getPkVertex()); - } - - startPage(); - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - slList = iCuBonusVertexStatisService.queryCuBonusStatis(cuBonusVertexStatisVO); - //合计 - subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO); - subtotal.setShareBonusSum(cuBonusVertexStatisVO.getOrderAchieve()); - } + List slList = iCuBonusVertexStatisService.queryCuBonusStatis(cuBonusVertexStatisVO); if (CollectionUtil.isNotEmpty(slList)) { - slList.forEach(itm -> { - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - if (itm.getIntroduceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setIntroduceBonus(itm.getIntroduceBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setOrgBonus(itm.getOrgBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getLeaderBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setLeaderBonus(itm.getLeaderBonus().multiply(currency.getData().getInExchangeRate())); - } - String creationTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, itm.getCreationTime()); - //重新算首购拨比 - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0) { - BigDecimal mainBonusRate = cent.multiply((itm.getMainBonus()).multiply(currency.getData().getInExchangeRate())); - mainBonusRate = mainBonusRate.divide(itm.getFirstPurchaseAll(), 4, RoundingMode.HALF_UP); - itm.setMainBonusRate(mainBonusRate); - } - //重新算总拨比 - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0 || - itm.getRepurchaseAllAmount().compareTo(BigDecimal.ZERO) > 0) { - BigDecimal totalBonusRate = cent.multiply((itm.getTotalBonus()).multiply(currency.getData().getInExchangeRate())); - totalBonusRate = totalBonusRate.divide(itm.getFirstPurchaseAll().add(itm.getRepurchaseAllAmount()), 4, RoundingMode.HALF_UP); - itm.setTotalBonusRate(totalBonusRate); - } - //首购拨出金额 - itm.setMainBonus((itm.getMainBonus()).multiply(currency.getData().getInExchangeRate())); - itm.setTotalBonus((itm.getTotalBonus()).multiply(currency.getData().getInExchangeRate())); - - if (itm.getServiceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setServiceBonus(itm.getServiceBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getHiFunIncome().compareTo(BigDecimal.ZERO) > 0) { - itm.setHiFunIncome(itm.getHiFunIncome().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getRepurRangeBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurRangeBonus(itm.getRepurRangeBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getRepurOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurOrgBonus(itm.getRepurOrgBonus().multiply(currency.getData().getInExchangeRate())); - } - if (itm.getRepurBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurBonus(itm.getRepurBonus().multiply(chRate)); - } - - } - //国外转为人民币 - if (pkCountry != CountryConstants.CHINA_COUNTRY) { - //订单金额 - if (itm.getMainRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainRegAmount(itm.getMainRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getMainUpAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainUpAmount(itm.getMainUpAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getAgentRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setAgentRegAmount(itm.getAgentRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getAgentUpAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setAgentUpAmount(itm.getAgentUpAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getFirstPurchaseAll().compareTo(BigDecimal.ZERO) > 0) { - itm.setFirstPurchaseAll(itm.getFirstPurchaseAll().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getMainRepurAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainRepurAmount(itm.getMainRepurAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getHifansRegAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setHifansRegAmount(itm.getHifansRegAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (itm.getRepurchaseAllAmount().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurchaseAllAmount(itm.getRepurchaseAllAmount().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - //奖金 - if (itm.getIntroduceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setIntroduceBonus(itm.getIntroduceBonus().multiply(chRate)); - } - if (itm.getOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setOrgBonus(itm.getOrgBonus().multiply(chRate)); - } - if (itm.getLeaderBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setLeaderBonus(itm.getLeaderBonus().multiply(chRate)); - } - if (itm.getShareBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setShareBonus(itm.getShareBonus().multiply(chRate)); - } - if (itm.getServiceBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setServiceBonus(itm.getServiceBonus().multiply(chRate)); - } - if (itm.getRepurRangeBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurRangeBonus(itm.getRepurRangeBonus().multiply(chRate)); - } - if (itm.getRepurOrgBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurOrgBonus(itm.getRepurOrgBonus().multiply(chRate)); - } - if (itm.getMainBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setMainBonus(itm.getMainBonus().multiply(chRate)); - } - if (itm.getRepurBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setRepurBonus(itm.getRepurBonus().multiply(chRate)); - } - if (itm.getTotalBonus().compareTo(BigDecimal.ZERO) > 0) { - itm.setTotalBonus(itm.getTotalBonus().multiply(chRate)); - } - } + slList.forEach(item -> { + item.setMainRegAmount(item.getMainRegAmount().add(item.getSpecialRegisterAmount())); + item.setMainUpAmount(item.getMainUpAmount().add(item.getSpecialUpgradeAmount())); + item.setMainRepurAmount(item.getMainRepurAmount().add(item.getSpecialRepurchaseAmount())); }); } - //合计 - if (subtotal == null) { - subtotal = new CuBonusVertexStatisVO(); - } + // 合计 + CuBonusVertexStatisVO subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO); subtotal.setMemberCode("合计"); - if (!pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - if (subtotal.getIntroduceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setIntroduceBonus(subtotal.getIntroduceBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setOrgBonus(subtotal.getOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getLeaderBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setLeaderBonus(subtotal.getLeaderBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getShareBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setShareBonus(subtotal.getShareBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getServiceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setServiceBonus(subtotal.getServiceBonusSum().multiply(currency.getData().getInExchangeRate())); - } - - if (subtotal.getRepurRangeBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getRepurOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - } - subtotal.setMainBonusSum(subtotal.getMainBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setRepurBonus(subtotal.getRepurBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setTotalBonus((subtotal.getTotalBonusSum().add(subtotal.getShareBonusSum())).multiply(currency.getData().getInExchangeRate())); - } - //国外转为人民币 - if (!pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - //订单金额 - if (subtotal.getMainRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainRegAmountSum(subtotal.getMainRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getMainUpAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainUpAmountSum(subtotal.getMainUpAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getAgentRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setAgentRegAmountSum(subtotal.getAgentRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getAgentUpAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setAgentUpAmountSum(subtotal.getAgentUpAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getFirstPurchaseAllSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setFirstPurchaseAllSum(subtotal.getFirstPurchaseAllSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getMainRepurAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainRepurAmountSum(subtotal.getMainRepurAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getHifansRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setHifansRegAmountSum(subtotal.getHifansRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getRepurchaseAllAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurchaseAllAmountSum(subtotal.getRepurchaseAllAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - //奖金 - if (subtotal.getIntroduceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setIntroduceBonusSum(subtotal.getIntroduceBonusSum().multiply(chRate)); - } - if (subtotal.getOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setOrgBonusSum(subtotal.getOrgBonusSum().multiply(chRate)); - } - if (subtotal.getLeaderBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setLeaderBonusSum(subtotal.getLeaderBonusSum().multiply(chRate)); - } - if (subtotal.getShareBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setShareBonusSum(subtotal.getShareBonusSum().multiply(chRate)); - } - if (subtotal.getServiceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setServiceBonusSum(subtotal.getServiceBonusSum().multiply(chRate)); - } - if (subtotal.getRepurRangeBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurRangeBonusSum(subtotal.getRepurRangeBonusSum().multiply(chRate)); - } - if (subtotal.getRepurOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurOrgBonusSum(subtotal.getRepurOrgBonusSum().multiply(chRate)); - } - if (subtotal.getMainBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainBonusSum(subtotal.getMainBonusSum().multiply(chRate)); - } - if (subtotal.getRepurBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurBonusSum(subtotal.getRepurBonusSum().multiply(chRate)); - } - if (subtotal.getTotalBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setTotalBonusSum((subtotal.getTotalBonusSum().add(subtotal.getShareBonusSum())).multiply(chRate)); - } - } - subtotal.setIntroduceBonus(subtotal.getIntroduceBonusSum()); - subtotal.setOrgBonus(subtotal.getOrgBonusSum()); - subtotal.setLeaderBonus(subtotal.getLeaderBonusSum()); - subtotal.setShareBonus(subtotal.getShareBonusSum()); - subtotal.setServiceBonus(subtotal.getServiceBonusSum()); - subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum()); - subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum()); - subtotal.setMainBonus(subtotal.getMainBonusSum()); - subtotal.setMainBonusRate(subtotal.getMainBonusRateSum()); - subtotal.setRepurBonus(subtotal.getRepurBonusSum()); - subtotal.setRepurBonusRate(subtotal.getRepurBonusRateSum()); - subtotal.setTotalBonus(subtotal.getTotalBonusSum()); - subtotal.setMainRegAmount(subtotal.getMainRegAmountSum()); - subtotal.setMainUpAmount(subtotal.getMainUpAmountSum()); - subtotal.setAgentRegAmount(subtotal.getAgentRegAmountSum()); - subtotal.setAgentUpAmount(subtotal.getAgentUpAmountSum()); - subtotal.setFirstPurchaseAll(subtotal.getFirstPurchaseAllSum()); - subtotal.setMainRepurAmount(subtotal.getMainRepurAmountSum()); - subtotal.setHifansRegAmount(subtotal.getHifansRegAmountSum()); - subtotal.setRepurchaseAllAmount(subtotal.getRepurchaseAllAmountSum()); - subtotal.setTotalBonusRate(subtotal.getTotalBonusRateSum()); - subtotal.setMainBonusPvRate(subtotal.getMainBonusPvRateSum()); - subtotal.setRepurBonusPvRate(subtotal.getRepurBonusPvRateSum()); - } else { - subtotal.setMainBonusRate(subtotal.getMainBonusRateSum()); - subtotal.setRepurBonusRate(subtotal.getRepurBonusRateSum()); - subtotal.setIntroduceBonus(subtotal.getIntroduceBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setOrgBonus(subtotal.getOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setLeaderBonus(subtotal.getLeaderBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setShareBonus(subtotal.getShareBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setServiceBonus(subtotal.getServiceBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setMainBonus(subtotal.getMainBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setRepurBonus(subtotal.getRepurBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setTotalBonus((subtotal.getTotalBonusSum()).multiply(currency.getData().getInExchangeRate())); - subtotal.setMainRegAmount(subtotal.getMainRegAmountSum()); - subtotal.setMainUpAmount(subtotal.getMainUpAmountSum()); - subtotal.setAgentRegAmount(subtotal.getAgentRegAmountSum()); - subtotal.setAgentUpAmount(subtotal.getAgentUpAmountSum()); - subtotal.setFirstPurchaseAll(subtotal.getFirstPurchaseAllSum()); - subtotal.setMainRepurAmount(subtotal.getMainRepurAmountSum()); - subtotal.setHifansRegAmount(subtotal.getHifansRegAmountSum()); - subtotal.setRepurchaseAllAmount(subtotal.getRepurchaseAllAmountSum()); - subtotal.setTotalBonusRate(subtotal.getTotalBonusRateSum()); - subtotal.setMainBonusPvRate(subtotal.getMainBonusPvRateSum()); - subtotal.setRepurBonusPvRate(subtotal.getRepurBonusPvRateSum()); - } slList.add(subtotal); + ExcelUtil util = new ExcelUtil<>(CuBonusVertexStatisVO.class); util.exportExcel(response, slList, "拨比列表"); } /** - * 奖金拨比列表合计 + * 顶点奖金拨比列表统计合计 **/ @AccessPermissions("TopPerformance") @GetMapping("/subtotal") @Log(module = EOperationModule.BONUS_DIAL_RATIO, business = EOperationBusiness.BONUS_DIAL_RATIO_LIST, method = EOperationMethod.SELECT) public AjaxResult subtotal(CuBonusVertexStatisVO cuBonusVertexStatisVO) { Integer pkCountry = SecurityUtils.getPkCountry(); - CuBonusVertexStatisVO subtotal; R currency = iCurrencyServiceApi.getCurrency(pkCountry); - BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); - R chCurrency = iCurrencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); - BigDecimal chRate = chCurrency.getData().getInExchangeRate() == null ? BigDecimal.ONE : chCurrency.getData().getInExchangeRate(); - cuBonusVertexStatisVO.setRate(exchangeRate); BigDecimal cent = new BigDecimal(100); + BigDecimal exchangeRate = currency.getData().getInExchangeRate() == null ? BigDecimal.ONE : currency.getData().getInExchangeRate(); + cuBonusVertexStatisVO.setRate(exchangeRate); cuBonusVertexStatisVO.setPerCent(exchangeRate.multiply(cent)); cuBonusVertexStatisVO.setPkCountry(pkCountry); + + // 默认查询当前日期的前一天 Date date = DateUtils.currentDate(); - //默认查询当前日期的前一天 - if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) || - StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { + if (StringUtils.isEmpty(cuBonusVertexStatisVO.getStartDate()) + || StringUtils.isEmpty(cuBonusVertexStatisVO.getEndDate())) { cuBonusVertexStatisVO.setStartDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); cuBonusVertexStatisVO.setEndDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date)); } - //查询奖金扣项配置参数 0.8 - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - List bonus = iCuBonusVertexStatisService.bonusDeductlist(cuBonusVertexStatisVO); - if (CollectionUtil.isNotEmpty(bonus)) { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE.subtract(bonus.get(0).getBackRatio())); - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } - } else { - cuBonusVertexStatisVO.setBackRatio(BigDecimal.ONE); - } - //查询所有顶点会员 - List vertexList = iCuBonusVertexStatisService.vertexList(cuBonusVertexStatisVO.getPkVertex()); - //查询体系订单分红业绩 - List orderTypeList = new ArrayList<>(); - orderTypeList.add(EOrderType.REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue()); - orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue()); - cuBonusVertexStatisVO.setOrderTypeList(orderTypeList); - if (CollectionUtil.isNotEmpty(vertexList)) { - for (CuBonusVertexStatisVO ve : vertexList) { - CuBonusVertexStatisVO cvs = BeanUtil.copyProperties(cuBonusVertexStatisVO, CuBonusVertexStatisVO.class); - cvs.setPkVertex(ve.getPkVertex()); - } - } - - cuBonusVertexStatisVO.setDividendRatio(BigDecimal.ZERO); - startPage(); //查询合计 - subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO); - if (subtotal != null && pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - if (subtotal.getIntroduceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setIntroduceBonusSum(subtotal.getIntroduceBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setOrgBonusSum(subtotal.getOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getLeaderBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setLeaderBonusSum(subtotal.getLeaderBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (cuBonusVertexStatisVO.getOrderAchieve().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setShareBonusSum(cuBonusVertexStatisVO.getOrderAchieve().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getServiceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setServiceBonusSum(subtotal.getServiceBonusSum().multiply(currency.getData().getInExchangeRate())); - } - - if (subtotal.getRepurRangeBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurRangeBonusSum(subtotal.getRepurRangeBonusSum().multiply(currency.getData().getInExchangeRate())); - } - if (subtotal.getRepurOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurOrgBonusSum(subtotal.getRepurOrgBonusSum().multiply(currency.getData().getInExchangeRate())); - } - subtotal.setMainBonusSum(subtotal.getMainBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setRepurBonusSum(subtotal.getRepurBonusSum().multiply(currency.getData().getInExchangeRate())); - subtotal.setTotalBonusSum(subtotal.getTotalBonusSum().multiply(currency.getData().getInExchangeRate())); - } - //国外转为人民币 - if (subtotal != null && !pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - //订单金额 - if (subtotal.getMainRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainRegAmountSum(subtotal.getMainRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getMainUpAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainUpAmountSum(subtotal.getMainUpAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getAgentRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setAgentRegAmountSum(subtotal.getAgentRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getAgentUpAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setAgentUpAmountSum(subtotal.getAgentUpAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getFirstPurchaseAllSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setFirstPurchaseAllSum(subtotal.getFirstPurchaseAllSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getMainRepurAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainRepurAmountSum(subtotal.getMainRepurAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getHifansRegAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setHifansRegAmountSum(subtotal.getHifansRegAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - if (subtotal.getRepurchaseAllAmountSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurchaseAllAmountSum(subtotal.getRepurchaseAllAmountSum().divide(currency.getData().getInExchangeRate(), 4, RoundingMode.HALF_UP).multiply(chRate)); - } - //奖金 - if (subtotal.getIntroduceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setIntroduceBonusSum(subtotal.getIntroduceBonusSum().multiply(chRate)); - } - if (subtotal.getOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setOrgBonusSum(subtotal.getOrgBonusSum().multiply(chRate)); - } - if (subtotal.getLeaderBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setLeaderBonusSum(subtotal.getLeaderBonusSum().multiply(chRate)); - } - if (subtotal.getShareBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setShareBonusSum(subtotal.getShareBonusSum().multiply(chRate)); - } - if (subtotal.getServiceBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setServiceBonusSum(subtotal.getServiceBonusSum().multiply(chRate)); - } - if (subtotal.getRepurRangeBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurRangeBonusSum(subtotal.getRepurRangeBonusSum().multiply(chRate)); - } - if (subtotal.getRepurOrgBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurOrgBonusSum(subtotal.getRepurOrgBonusSum().multiply(chRate)); - } - if (subtotal.getMainBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setMainBonusSum(subtotal.getMainBonusSum().multiply(chRate)); - } - if (subtotal.getRepurBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setRepurBonusSum(subtotal.getRepurBonusSum().multiply(chRate)); - } - if (subtotal.getTotalBonusSum().compareTo(BigDecimal.ZERO) > 0) { - subtotal.setTotalBonusSum(subtotal.getTotalBonusSum().multiply(chRate)); - } - } + CuBonusVertexStatisVO subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO); return AjaxResult.success(subtotal); } @@ -701,11 +173,11 @@ public class CuBonusVertexStatisController extends BaseController { } List vertexList = iCuBonusVertexStatisService.vertexList(null); List pkVertexList = vertexList.stream().map(CuBonusVertexStatisVO::getPkVertex).collect(Collectors.toList()); - //删除数据 + // 删除数据 if (CollectionUtil.isNotEmpty(pkVertexList)) { iCuBonusVertexStatisService.delStatis(startDate, endDate, pkVertexList); } - //重新统计 + // 重新统计 Boolean b = iCuBonusVertexStatisService.anewStatisHistoryBonus(startDate, endDate); return AjaxResult.success(b); } diff --git a/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/vo/CuBonusVertexStatisVO.java b/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/vo/CuBonusVertexStatisVO.java index fe333240..f99be784 100644 --- a/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/vo/CuBonusVertexStatisVO.java +++ b/bd-business/bd-business-member/src/main/java/com/hzs/member/statis/vo/CuBonusVertexStatisVO.java @@ -87,6 +87,12 @@ public class CuBonusVertexStatisVO implements Serializable { */ @BigDecimalFormat private BigDecimal specialUpgradeAmount = BigDecimal.ZERO; + /** + * 特殊复购 + */ + @BigDecimalFormat + private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO; + /** * 虚拟订单金额(¥) */ @@ -96,14 +102,12 @@ public class CuBonusVertexStatisVO implements Serializable { /** * 云代理注册金额 */ - @Excel(name = "云代注册(¥)", scale = 2) @BigDecimalFormat private BigDecimal agentRegAmount = BigDecimal.ZERO; /** * 云代理升级新增金额 */ - @Excel(name = "云代升级(¥)", scale = 2) @BigDecimalFormat private BigDecimal agentUpAmount = BigDecimal.ZERO; @@ -135,7 +139,6 @@ public class CuBonusVertexStatisVO implements Serializable { /** * 分红收益(¥) */ - @Excel(name = "分红收益(¥)", scale = 2) @BigDecimalFormat private BigDecimal shareBonus = BigDecimal.ZERO; /** @@ -169,22 +172,15 @@ public class CuBonusVertexStatisVO implements Serializable { @BigDecimalFormat private BigDecimal cooperateAmount = BigDecimal.ZERO; - /** - * 特殊复购 - */ - @BigDecimalFormat - private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO; /** * 福利订单 */ @BigDecimalFormat private BigDecimal welfareOrder = BigDecimal.ZERO; - /** * 海粉注册金额(¥) */ - @Excel(name = "海粉专区(¥)", scale = 2) @BigDecimalFormat private BigDecimal hifansRegAmount = BigDecimal.ZERO; /** @@ -303,13 +299,23 @@ public class CuBonusVertexStatisVO implements Serializable { */ @BigDecimalFormat private BigDecimal mainRegAmountSum = BigDecimal.ZERO; - /** * 升级新增金额(¥)小计 */ @BigDecimalFormat private BigDecimal mainUpAmountSum = BigDecimal.ZERO; + /** + * 特殊注册新增金额(¥)小计 + */ + @BigDecimalFormat + private BigDecimal specialRegisterAmountSum = BigDecimal.ZERO; + /** + * 特殊升级新增金额(¥)小计 + */ + @BigDecimalFormat + private BigDecimal specialUpgradeAmountSum = BigDecimal.ZERO; + /** * 云代理注册金额小计 */ @@ -358,6 +364,12 @@ public class CuBonusVertexStatisVO implements Serializable { */ @BigDecimalFormat private BigDecimal mainRepurAmountSum = BigDecimal.ZERO; + /** + * 特殊复购新增金额小计(¥)(复购专区) + */ + @BigDecimalFormat + private BigDecimal specialRepurchaseAmountSum = BigDecimal.ZERO; + /** * 嗨粉注册金额小计(¥) */ @@ -378,6 +390,11 @@ public class CuBonusVertexStatisVO implements Serializable { */ @BigDecimalFormat private BigDecimal repurOrgBonusSum = BigDecimal.ZERO; + /** + * 复购辅导收益(¥)小计 + */ + @BigDecimalFormat + private BigDecimal repurLeaderBonusSum = BigDecimal.ZERO; /** * 首购拨出金额合计 @@ -398,21 +415,20 @@ public class CuBonusVertexStatisVO implements Serializable { private BigDecimal mainBonusPvRateSum = BigDecimal.ZERO; /** - * 小计 - * (复购直推收益+复购级差收益+复购拓展收益)*80% +海粉直推 + * 小计 (复购直推收益+复购级差收益+复购拓展收益)*80% +海粉直推 * (复购级差+复购拓展 ) *0.8 +海粉直推 */ @BigDecimalFormat private BigDecimal repurBonusSum = BigDecimal.ZERO; /** - * 小计 (复购级差+复购拓展 ) *0.8 +海粉直推 + * 小计 (复购级差+复购拓展 ) *0.8 +海粉直推 * 复购拨出比例(%) = (((复购直推收益+复购级差收益+复购拓展收益)*80%)+海粉直推)/复购总奖金(复购订单+海粉订单) */ @BigDecimalFormat private BigDecimal repurBonusRateSum = BigDecimal.ZERO; /** - * 小计 (复购级差+复购拓展 ) *0.8 +海粉直推 + * 小计 (复购级差+复购拓展 ) *0.8 +海粉直推 * 复购PV拨出比例(%) = (((复购直推收益+复购级差收益+复购拓展收益)*80%)+海粉直推)/复购总奖金(复购订单+海粉订单) */ @BigDecimalFormat @@ -452,7 +468,6 @@ public class CuBonusVertexStatisVO implements Serializable { */ private Long pkTeamCode; - /** * 注册新增PV MAIN_REG_PV */ diff --git a/bd-business/bd-business-member/src/main/resources/mapper/member/statis/CuBonusVertexStatisMapper.xml b/bd-business/bd-business-member/src/main/resources/mapper/member/statis/CuBonusVertexStatisMapper.xml index fae4897f..8387fbcc 100644 --- a/bd-business/bd-business-member/src/main/resources/mapper/member/statis/CuBonusVertexStatisMapper.xml +++ b/bd-business/bd-business-member/src/main/resources/mapper/member/statis/CuBonusVertexStatisMapper.xml @@ -64,58 +64,47 @@ - - - CREATION_TIME - , - PK_COUNTRY, - DEL_FLAG, - PK_ID, STATIS_TYPE, PERIOD, START_DATE, END_DATE, MAIN_REG_AMOUNT, MAIN_UP_AMOUNT, MAIN_REPUR_AMOUNT, HIFANS_REG_AMOUNT, INTRODUCE_BONUS, ORG_BONUS, LEADER_BONUS, SHARE_BONUS, SERVICE_BONUS, HI_FUN_INCOME, REPUR_RANGE_BONUS, REPUR_ORG_BONUS, MAIN_BONUS, REPUR_BONUS, PK_BD_VERTEX, PK_TEAM_CODE, HAI_FUN_INCOME, GIFT_ORDER, SPECIAL_REGISTER_AMOUNT, SPECIAL_UPGRADE_AMOUNT, CLOUD_COLLEGE_AMOUNT, MALL_AMOUNT, MAKER_GIFT_AMOUNT, EMPOWERMENT_GIFT_AMOUNT, COOPERATE_AMOUNT, SPECIAL_REPURCHASE_AMOUNT, HAI_FUN_UPGRADE_AMOUNT, REPUR_PUSH_INCOME, MAKER_DIRECT, MAKER_SHARE, THIRD_ORDER, FICTITIOUS_AMOUNT, MAKER_ORDER, WELFARE_ORDER, MAIN_REG_PV, MAIN_UP_PV, MAIN_REPUR_PV, SPECIAL_REGISTER_PV, SPECIAL_UPGRADE_PV, SPECIAL_REPURCHASE_PV, FICTITIOUS_PV, HIFANS_REG_PV, HAI_FUN_UPGRADE_PV, CLOUD_COLLEGE_PV, MALL_PV, EMPOWERMENT_GIFT_PV, COOPERATE_PV, MAKER_ORDER_PV, MAKER_GIFT_PV, WELFARE_ORDER_PV - - - + - + - +