## 福利专区去掉;处理见点、区域奖金拨比;

This commit is contained in:
cabbage 2025-07-25 15:41:13 +08:00
parent fd40966f15
commit 0b68ed7d48
24 changed files with 404 additions and 567 deletions

View File

@ -3,17 +3,17 @@ package com.hzs.member.statis;
import com.hzs.common.core.domain.R; import com.hzs.common.core.domain.R;
/** /**
* @description: 奖金拨比统计 * 奖金拨比统计
**/ **/
public interface ICuBonusStatisServiceApi { public interface ICuBonusStatisServiceApi {
/** /**
* @description: 统计历史奖金拨比 * 统计历史奖金拨比
**/ **/
R<Boolean> statsHistoryBonus(String startDate, String endDate); R<Boolean> statsHistoryBonus(String startDate, String endDate);
/** /**
* @description: 删除奖金拨比统计数据 * 删除奖金拨比统计数据
**/ **/
R<Boolean> delStats(String startDate, String endDate); R<Boolean> delStats(String startDate, String endDate);

View File

@ -8,12 +8,12 @@ import com.hzs.common.core.domain.R;
public interface ICuBonusVertexStatisServiceApi { public interface ICuBonusVertexStatisServiceApi {
/** /**
* @description: 7天重算顶点奖金拨比统计 * 7天重算顶点奖金拨比统计
**/ **/
R<Boolean> anewStatsHistoryBonus(String startDate, String endDate); R<Boolean> anewStatsHistoryBonus(String startDate, String endDate);
/** /**
* @description: 删除奖金拨比统计数据 * 删除奖金拨比统计数据
**/ **/
R<?> delStats(String startDate, String endDate); R<?> delStats(String startDate, String endDate);

View File

@ -360,8 +360,6 @@ public class CuMemberAssessServiceImpl extends ServiceImpl<CuMemberAssessMapper,
if (EAssessmentType.REPURCHASE_ASSESS.getValue() == assessmentType) { if (EAssessmentType.REPURCHASE_ASSESS.getValue() == assessmentType) {
orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue()); orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue()); orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
} else {
orderTypeList.add(EOrderType.WELFARE_ORDER.getValue());
} }
// 更新考核值期初是上月考核表的当月剩余业绩 // 更新考核值期初是上月考核表的当月剩余业绩
// 获取结算日月初第一天获取期间 // 获取结算日月初第一天获取期间

View File

@ -33,14 +33,10 @@ import java.util.Optional;
public class ApiCuMemberAssessController extends BaseController { public class ApiCuMemberAssessController extends BaseController {
@DubboReference @DubboReference
ICurrencyServiceApi currencyServiceApi; ICurrencyServiceApi iCurrencyServiceApi;
private ICuMemberAssessService cuMemberAssessService;
@Autowired @Autowired
public void setCuMemberAssessService(ICuMemberAssessService cuMemberAssessService) { private ICuMemberAssessService iCuMemberAssessService;
this.cuMemberAssessService = cuMemberAssessService;
}
/** /**
* 考核明细复购考核分红考核 * 考核明细复购考核分红考核
@ -67,9 +63,6 @@ public class ApiCuMemberAssessController extends BaseController {
// 复购考核 // 复购考核
orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue()); orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue()); orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
} else if (cuMemberAssessVO.getAssessType() == EAssessmentType.SHARE_ASSESS.getValue()) {
// 分红考核
orderTypeList.add(EOrderType.WELFARE_ORDER.getValue());
} }
//默认查询当月 //默认查询当月
@ -86,10 +79,10 @@ public class ApiCuMemberAssessController extends BaseController {
cuMemberAssessVO.setEndDateTradeTime(DateUtils.afterDate(1, ChronoUnit.DAYS, date)); cuMemberAssessVO.setEndDateTradeTime(DateUtils.afterDate(1, ChronoUnit.DAYS, date));
} }
List<CuMemberAssessVO> monthList = cuMemberAssessService.getMemberAssessMonthList(cuMemberAssessVO); List<CuMemberAssessVO> monthList = iCuMemberAssessService.getMemberAssessMonthList(cuMemberAssessVO);
startPage(); startPage();
List<CuMemberAssessVO> list = cuMemberAssessService.selectAssessList(cuMemberAssessVO, orderTypeList); List<CuMemberAssessVO> list = iCuMemberAssessService.selectAssessList(cuMemberAssessVO, orderTypeList);
if (!monthList.isEmpty() && !list.isEmpty()) { if (!monthList.isEmpty() && !list.isEmpty()) {
for (CuMemberAssessVO mo : monthList) { for (CuMemberAssessVO mo : monthList) {
for (CuMemberAssessVO ca : list) { for (CuMemberAssessVO ca : list) {
@ -108,7 +101,7 @@ public class ApiCuMemberAssessController extends BaseController {
} }
if (!list.isEmpty()) { if (!list.isEmpty()) {
R<CurrencyDTO> currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
final EChangeType purAsseAdd = EChangeType.PURCHASE_ASSESSMENT_ADD; final EChangeType purAsseAdd = EChangeType.PURCHASE_ASSESSMENT_ADD;
final EChangeType purAsseDeduct = EChangeType.PURCHASE_ASSESSMENT_DEDUCT; final EChangeType purAsseDeduct = EChangeType.PURCHASE_ASSESSMENT_DEDUCT;
final EChangeType shareAsseAdd = EChangeType.SHARE_ASSESSMENT_ADD; final EChangeType shareAsseAdd = EChangeType.SHARE_ASSESSMENT_ADD;
@ -163,10 +156,6 @@ public class ApiCuMemberAssessController extends BaseController {
// 复购订单 // 复购订单
item.setChangeType(purAsseAdd.getValue()); item.setChangeType(purAsseAdd.getValue());
item.setTradeAchieveSign("+" + tradeAchieve); item.setTradeAchieveSign("+" + tradeAchieve);
} else if (orderType == EOrderType.WELFARE_ORDER.getValue()) {
// 福利订单
item.setChangeType(shareAsseAdd.getValue());
item.setTradeAchieveSign("+" + tradeAchieve);
} }
} }
}); });
@ -233,24 +222,14 @@ public class ApiCuMemberAssessController extends BaseController {
orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue()); orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
cuMemberAssessVO.setOrderTypeList(orderTypeList); cuMemberAssessVO.setOrderTypeList(orderTypeList);
CuMemberAssessVO order = cuMemberAssessService.getOrderAssessList(cuMemberAssessVO); CuMemberAssessVO order = iCuMemberAssessService.getOrderAssessList(cuMemberAssessVO);
if (StringUtils.isNotNull(order)) { if (StringUtils.isNotNull(order)) {
monthSurplus = monthSurplus.add(order.getOrderAchieve()); monthSurplus = monthSurplus.add(order.getOrderAchieve());
} }
if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) {
R<CurrencyDTO> currency = currencyServiceApi.getCurrency(pkCountry); R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(pkCountry);
monthSurplus = monthSurplus.multiply(currency.getData().getInExchangeRate()); monthSurplus = monthSurplus.multiply(currency.getData().getInExchangeRate());
} }
} else if (EAssessmentType.SHARE_ASSESS.getValue() == assessType) {
// 分红考核
orderTypeList.add(EOrderType.WELFARE_ORDER.getValue());
cuMemberAssessVO.setOrderTypeList(orderTypeList);
CuMemberAssessVO order = cuMemberAssessService.getOrderAssessList(cuMemberAssessVO);
BigDecimal orderAchieve = BigDecimal.ZERO;
if (StringUtils.isNotNull(order)) {
monthSurplus = monthSurplus.add(order.getOrderAssAchieve()).add(orderAchieve);
}
} }
return AjaxResult.success(monthSurplus); return AjaxResult.success(monthSurplus);
} }

View File

@ -189,6 +189,8 @@ public class CuBonusStatisController extends BaseController {
subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum()); subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum());
subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum()); subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum());
subtotal.setRepurLeaderBonus(subtotal.getRepurLeaderBonusSum()); subtotal.setRepurLeaderBonus(subtotal.getRepurLeaderBonusSum());
subtotal.setGlobalPointsBonus(subtotal.getGlobalPointsBonusSum());
subtotal.setStoreIncomeBonus(subtotal.getStoreIncomeBonusSum());
subtotal.setMainBonus(subtotal.getMainBonusSum()); subtotal.setMainBonus(subtotal.getMainBonusSum());
subtotal.setMainBonusRate(subtotal.getMainBonusRateSum()); subtotal.setMainBonusRate(subtotal.getMainBonusRateSum());
subtotal.setRepurBonus(subtotal.getRepurBonusSum()); subtotal.setRepurBonus(subtotal.getRepurBonusSum());

View File

@ -95,6 +95,39 @@ public class CuBonusVertexStatisController extends BaseController {
return getDataTable(slList); return getDataTable(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();
R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(pkCountry);
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())) {
cuBonusVertexStatisVO.setStartDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date));
cuBonusVertexStatisVO.setEndDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date));
}
//查询合计
CuBonusVertexStatisVO subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO);
if (null != subtotal) {
subtotal.setMainRegAmountSum(subtotal.getMainRegAmountSum().add(subtotal.getSpecialRegisterAmountSum()));
subtotal.setMainUpAmountSum(subtotal.getMainUpAmountSum().add(subtotal.getSpecialUpgradeAmountSum()));
subtotal.setMainRepurAmountSum(subtotal.getMainRepurAmountSum().add(subtotal.getSpecialRepurchaseAmountSum()));
}
return AjaxResult.success(subtotal);
}
/** /**
* 顶点奖金拨比列表统计导出 * 顶点奖金拨比列表统计导出
**/ **/
@ -144,6 +177,8 @@ public class CuBonusVertexStatisController extends BaseController {
subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum()); subtotal.setRepurRangeBonus(subtotal.getRepurRangeBonusSum());
subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum()); subtotal.setRepurOrgBonus(subtotal.getRepurOrgBonusSum());
subtotal.setRepurLeaderBonus(subtotal.getRepurLeaderBonusSum()); subtotal.setRepurLeaderBonus(subtotal.getRepurLeaderBonusSum());
subtotal.setGlobalPointsBonus(subtotal.getGlobalPointsBonusSum());
subtotal.setStoreIncomeBonus(subtotal.getStoreIncomeBonusSum());
subtotal.setMainBonus(subtotal.getMainBonusSum()); subtotal.setMainBonus(subtotal.getMainBonusSum());
subtotal.setMainBonusRate(subtotal.getMainBonusRateSum()); subtotal.setMainBonusRate(subtotal.getMainBonusRateSum());
subtotal.setRepurBonus(subtotal.getRepurBonusSum()); subtotal.setRepurBonus(subtotal.getRepurBonusSum());
@ -157,39 +192,6 @@ public class CuBonusVertexStatisController extends BaseController {
util.exportExcel(response, slList, "拨比列表"); 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();
R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(pkCountry);
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())) {
cuBonusVertexStatisVO.setStartDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date));
cuBonusVertexStatisVO.setEndDate(DateUtils.beforeDateStr(1, ChronoUnit.DAYS, DateUtils.YYYY_MM_DD, date));
}
//查询合计
CuBonusVertexStatisVO subtotal = iCuBonusVertexStatisService.queryCuBonusSumStatis(cuBonusVertexStatisVO);
if (null != subtotal) {
subtotal.setMainRegAmountSum(subtotal.getMainRegAmountSum().add(subtotal.getSpecialRegisterAmountSum()));
subtotal.setMainUpAmountSum(subtotal.getMainUpAmountSum().add(subtotal.getSpecialUpgradeAmountSum()));
subtotal.setMainRepurAmountSum(subtotal.getMainRepurAmountSum().add(subtotal.getSpecialRepurchaseAmountSum()));
}
return AjaxResult.success(subtotal);
}
/** /**
* 统计历史奖金拨比数据, 手动统计某一天 * 统计历史奖金拨比数据, 手动统计某一天
**/ **/

View File

@ -77,12 +77,12 @@ public class CuBonusVertexStatisTotalController extends BaseController {
CuBonusVertexStaticTotalVO mapTouch = new CuBonusVertexStaticTotalVO(); CuBonusVertexStaticTotalVO mapTouch = new CuBonusVertexStaticTotalVO();
mapTouch.setPkVertex(ve.getPkVertex()); mapTouch.setPkVertex(ve.getPkVertex());
//查询顶点拓展封顶人数 // 查询顶点拓展封顶人数
CuBonusVertexStaticTotalVO orgTopNumber = iCuBonusVertexStatisService.queryOrgTopNumber(cvs); CuBonusVertexStaticTotalVO orgTopNumber = iCuBonusVertexStatisService.queryOrgTopNumber(cvs);
if (orgTopNumber != null) { if (orgTopNumber != null) {
mapTouch.setOrgTopNumber(orgTopNumber.getOrgTopNumber()); mapTouch.setOrgTopNumber(orgTopNumber.getOrgTopNumber());
} }
//查询顶点拓展平均碰次和拓展最高碰次 // 查询顶点拓展平均碰次和拓展最高碰次
CuBonusVertexStaticTotalVO touch = iCuBonusVertexStatisService.queryTouch(cvs); CuBonusVertexStaticTotalVO touch = iCuBonusVertexStatisService.queryTouch(cvs);
if (touch != null) { if (touch != null) {
mapTouch.setOrgAvTouch(touch.getOrgAvTouch()); mapTouch.setOrgAvTouch(touch.getOrgAvTouch());
@ -112,6 +112,8 @@ public class CuBonusVertexStatisTotalController extends BaseController {
itm.setRepurRangeBonusRate(itm.getRepurRangeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurRangeBonusRate(itm.getRepurRangeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setRepurOrgBonusRate(itm.getRepurOrgBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurOrgBonusRate(itm.getRepurOrgBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setRepurLeaderBonusRate(itm.getRepurLeaderBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurLeaderBonusRate(itm.getRepurLeaderBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setGlobalPointsBonusRate(itm.getGlobalPointsBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setStoreIncomeBonusRate(itm.getStoreIncomeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
} }
}); });
} }
@ -192,6 +194,8 @@ public class CuBonusVertexStatisTotalController extends BaseController {
itm.setRepurRangeBonusRate(itm.getRepurRangeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurRangeBonusRate(itm.getRepurRangeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setRepurOrgBonusRate(itm.getRepurOrgBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurOrgBonusRate(itm.getRepurOrgBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setRepurLeaderBonusRate(itm.getRepurLeaderBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP)); itm.setRepurLeaderBonusRate(itm.getRepurLeaderBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setGlobalPointsBonusRate(itm.getGlobalPointsBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
itm.setStoreIncomeBonusRate(itm.getStoreIncomeBonus().multiply(cuBonusVertexStaticTotalVO.getPerCent()).divide(itm.getRepurchaseAllAmount(), 4, RoundingMode.HALF_UP));
} }
}); });
} }

View File

@ -13,22 +13,22 @@ import java.util.List;
public interface CuBonusVertexStatisMapper extends BaseMapper<CuBonusVertexStatis> { public interface CuBonusVertexStatisMapper extends BaseMapper<CuBonusVertexStatis> {
/** /**
* @description: 奖金拨比列表 * 奖金拨比列表
**/ **/
List<CuBonusVertexStatisVO> queryCuBonusStatis(CuBonusVertexStatisVO cuBonusVertexStatisVO); List<CuBonusVertexStatisVO> queryCuBonusStatis(CuBonusVertexStatisVO cuBonusVertexStatisVO);
/** /**
* @description: 查询顶点奖金拨比汇总 * 查询顶点奖金拨比汇总
**/ **/
List<CuBonusVertexStaticTotalVO> queryCuBonusStatisTotal(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO); List<CuBonusVertexStaticTotalVO> queryCuBonusStatisTotal(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO);
/** /**
* @description: 顶点奖金拨比汇总查询总和 * 顶点奖金拨比汇总查询总和
**/ **/
CuBonusVertexStaticTotalVO queryCuBonusStatisSum(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO); CuBonusVertexStaticTotalVO queryCuBonusStatisSum(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO);
/** /**
* @description: 查询时间内奖金拨比顶点会员 * 查询时间内奖金拨比顶点会员
**/ **/
List<CuBonusVertexStaticTotalVO> queryCuBonusVertex(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO); List<CuBonusVertexStaticTotalVO> queryCuBonusVertex(CuBonusVertexStaticTotalVO cuBonusVertexStaticTotalVO);
@ -43,55 +43,40 @@ public interface CuBonusVertexStatisMapper extends BaseMapper<CuBonusVertexStati
CuBonusVertexStaticTotalVO queryTouch(CuBonusVertexStatisVO cuBonusVertexStatisVO); CuBonusVertexStaticTotalVO queryTouch(CuBonusVertexStatisVO cuBonusVertexStatisVO);
/** /**
* @description: 奖金拨比列表统计小计最后一行 * 奖金拨比列表统计小计最后一行
**/ **/
CuBonusVertexStatisVO queryCuBonusSumStatis(CuBonusVertexStatisVO CuBonusVertexStatisVO); CuBonusVertexStatisVO queryCuBonusSumStatis(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/** /**
* @description: 查询小于当天全部已支付或撤单订单信息 * 查询小于当天全部已支付或撤单订单信息
**/ **/
List<CuBonusVertexStatisVO> querySaOrderByLessDay(CuBonusVertexStatisVO CuBonusVertexStatisVO); List<CuBonusVertexStatisVO> querySaOrderByLessDay(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/** /**
* @description: 7天重算查询订单 * 7天重算查询订单
**/ **/
List<CuBonusVertexStatisVO> queryAnewSaOrderByLessDay(CuBonusVertexStatisVO CuBonusVertexStatisVO); List<CuBonusVertexStatisVO> queryAnewSaOrderByLessDay(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/** /**
* @description: 删除奖金拨比统计表数据 * 删除奖金拨比统计表数据
**/ **/
Boolean delStatis(@Param("startDate") String startDate, Boolean delStatis(@Param("startDate") String startDate,
@Param("endDate") String endDate, @Param("endDate") String endDate,
@Param("pkVertexList") List<Integer> pkVertexList); @Param("pkVertexList") List<Integer> pkVertexList);
/** /**
* @description: 查询奖金扣项配置参数 * 查询7天重算奖金查询
**/
List<CuBonusVertexStatisVO> bonusDeductlist(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/**
* @description: 查询中国奖金
**/
List<CuBonusVertexStatisVO> queryChinaCountryBonus(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/**
* @description: 查询7天重算奖金查询
**/ **/
List<CuBonusVertexStatisVO> queryVertexChinaCountryBonus(CuBonusVertexStatisVO CuBonusVertexStatisVO); List<CuBonusVertexStatisVO> queryVertexChinaCountryBonus(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/** /**
* @description: 查询生效国外国家列表 * 查询有效顶点
**/
List<CuBonusVertexStatisVO> countrylist(CuBonusVertexStatisVO CuBonusVertexStatisVO);
/**
* @description: 查询有效顶点
**/ **/
List<CuBonusVertexStatisVO> vertexList(@Param("pkVertex") Integer pkVertex); List<CuBonusVertexStatisVO> vertexList(@Param("pkVertex") Integer pkVertex);
/** /**
* @description: 查询当天团队统计数据 * 查询当天团队统计数据
**/ **/
List<CuBonusVertexStatis> getCuBonusStatis(CuBonusVertexStatis CuBonusVertexStatis); List<CuBonusVertexStatis> getCuBonusStatis(CuBonusVertexStatis CuBonusVertexStatis);

View File

@ -22,17 +22,11 @@ public class ICuBonusVertexStatisServiceProvider implements ICuBonusVertexStatis
@Autowired @Autowired
private ICuBonusVertexStatisService iCuBonusVertexStatisService; private ICuBonusVertexStatisService iCuBonusVertexStatisService;
/**
* @description: 7天重算顶点奖金拨比统计
**/
@Override @Override
public R<Boolean> anewStatsHistoryBonus(String startDate, String endDate) { public R<Boolean> anewStatsHistoryBonus(String startDate, String endDate) {
return R.ok(iCuBonusVertexStatisService.anewStatisHistoryBonus(startDate, endDate)); return R.ok(iCuBonusVertexStatisService.anewStatisHistoryBonus(startDate, endDate));
} }
/**
* @description: 删除奖金拨比统计数据
**/
@Override @Override
public R<?> delStats(String startDate, String endDate) { public R<?> delStats(String startDate, String endDate) {
List<CuBonusVertexStatisVO> vertexList = iCuBonusVertexStatisService.vertexList(null); List<CuBonusVertexStatisVO> vertexList = iCuBonusVertexStatisService.vertexList(null);

View File

@ -57,21 +57,6 @@ public interface ICuBonusVertexStatisService extends IService<CuBonusVertexStati
**/ **/
Boolean delStatis(String startDate, String endDate, List<Integer> pkVertexList); Boolean delStatis(String startDate, String endDate, List<Integer> pkVertexList);
/**
* 查询奖金扣项配置参数
**/
List<CuBonusVertexStatisVO> bonusDeductlist(CuBonusVertexStatisVO cuBonusVertexStatisVO);
/**
* 查询中国奖金
**/
List<CuBonusVertexStatisVO> queryChinaCountryBonus(CuBonusVertexStatisVO cuBonusVertexStatisVO);
/**
* 查询生效国外国家列表
**/
List<CuBonusVertexStatisVO> countrylist(CuBonusVertexStatisVO cuBonusVertexStatisVO);
/** /**
* 查询所有体系 * 查询所有体系
**/ **/

View File

@ -147,11 +147,6 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
oldSo.setSpecialRepurchaseAmount(addOrInitializeAmount(oldSo.getSpecialRepurchaseAmount(), newSo.getOrderAmount(), type)); oldSo.setSpecialRepurchaseAmount(addOrInitializeAmount(oldSo.getSpecialRepurchaseAmount(), newSo.getOrderAmount(), type));
oldSo.setSpecialRepurchasePv(addOrInitializeAmount(oldSo.getSpecialRepurchasePv(), newSo.getOrderAchieve(), type)); oldSo.setSpecialRepurchasePv(addOrInitializeAmount(oldSo.getSpecialRepurchasePv(), newSo.getOrderAchieve(), type));
break; break;
case WELFARE_ORDER:
// 福利订单
oldSo.setWelfareOrder(addOrInitializeAmount(oldSo.getWelfareOrder(), newSo.getOrderAmount(), type));
oldSo.setWelfareOrderPv(addOrInitializeAmount(oldSo.getWelfareOrderPv(), newSo.getOrderAchieve(), type));
break;
default: default:
break; break;
} }
@ -207,6 +202,14 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
// 复购直推收益 // 复购直推收益
oldBon.setRepurPushIncome(addOrInitializeAmount(oldBon.getRepurPushIncome(), newBon.getRealIncome(), 2)); oldBon.setRepurPushIncome(addOrInitializeAmount(oldBon.getRepurPushIncome(), newBon.getRealIncome(), 2));
break; break;
case REPURCHASE_POINT_INCOME:
// 复购见点收益
oldBon.setGlobalPointsBonus(addOrInitializeAmount(oldBon.getGlobalPointsBonus(), newBon.getRealIncome(), 2));
break;
case REPURCHASE_AREA_INCOME:
// 复购区域收益
oldBon.setStoreIncomeBonus(addOrInitializeAmount(oldBon.getStoreIncomeBonus(), newBon.getRealIncome(), 2));
break;
} }
return oldBon; return oldBon;
} }
@ -219,7 +222,7 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
if (cb.getPkCountry() == null) { if (cb.getPkCountry() == null) {
continue; continue;
} }
//查询体系是否添加 // 查询体系是否添加
CuBonusStatis bs = new CuBonusStatis(); CuBonusStatis bs = new CuBonusStatis();
bs.setPkBdVertex(cb.getPkVertex()); bs.setPkBdVertex(cb.getPkVertex());
bs.setPkTeamCode(cb.getPkTeamCode()); bs.setPkTeamCode(cb.getPkTeamCode());
@ -236,10 +239,11 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
bs.setRepurLeaderBonus(cb.getRepurLeaderBonus()); bs.setRepurLeaderBonus(cb.getRepurLeaderBonus());
bs.setRepurCouponSubtotal(cb.getRepurCouponSubtotal()); bs.setRepurCouponSubtotal(cb.getRepurCouponSubtotal());
bs.setRepurPushIncome(cb.getRepurPushIncome()); bs.setRepurPushIncome(cb.getRepurPushIncome());
//嗨粉直推收益
bs.setHiFunIncome(cb.getHiFunIncome()); bs.setHiFunIncome(cb.getHiFunIncome());
bs.setCalFirAchieve(cb.getCalFirAchieve()); bs.setCalFirAchieve(cb.getCalFirAchieve());
bs.setCalRepAchieve(cb.getCalRepAchieve()); bs.setCalRepAchieve(cb.getCalRepAchieve());
bs.setGlobalPointsBonus(cb.getGlobalPointsBonus());
bs.setStoreIncomeBonus(cb.getStoreIncomeBonus());
// 查询数据库判断记录是否存在 // 查询数据库判断记录是否存在
List<CuBonusStatis> existingRecord = getCuBonusStatis(bs); List<CuBonusStatis> existingRecord = getCuBonusStatis(bs);
@ -272,57 +276,36 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
} }
} }
/**
* 奖金拨比列表
**/
@Override @Override
public List<CuBonusStatisVO> queryCuBonusStatis(CuBonusStatisVO cuBonusStatisVO) { public List<CuBonusStatisVO> queryCuBonusStatis(CuBonusStatisVO cuBonusStatisVO) {
return baseMapper.queryCuBonusStatis(cuBonusStatisVO); return baseMapper.queryCuBonusStatis(cuBonusStatisVO);
} }
/**
* 查询体系合计的订单业绩
**/
@Override @Override
public CuBonusStatisVO queryOrderAchieveSum(CuBonusStatisVO cuBonusStatisVO) { public CuBonusStatisVO queryOrderAchieveSum(CuBonusStatisVO cuBonusStatisVO) {
return baseMapper.queryOrderAchieveSum(cuBonusStatisVO); return baseMapper.queryOrderAchieveSum(cuBonusStatisVO);
} }
/**
* 奖金拨比列表统计小计最后一行
**/
@Override @Override
public CuBonusStatisVO queryCuBonusSumStatis(CuBonusStatisVO cuBonusStatisVO) { public CuBonusStatisVO queryCuBonusSumStatis(CuBonusStatisVO cuBonusStatisVO) {
return baseMapper.queryCuBonusSumStatis(cuBonusStatisVO); return baseMapper.queryCuBonusSumStatis(cuBonusStatisVO);
} }
/**
* 查询个人奖金拨比
**/
@Override @Override
public CuBonusSinglePersonStatisVO bonusSingleSum(CuBonusSinglePersonStatisVO csps) { public CuBonusSinglePersonStatisVO bonusSingleSum(CuBonusSinglePersonStatisVO csps) {
return baseMapper.bonusSingleSum(csps); return baseMapper.bonusSingleSum(csps);
} }
/**
* 奖金拨比图表
**/
@Override @Override
public List<CuBonusStatisChartVO> queryCuBonusStatisChart(CuBonusStatisChartVO chartVO) { public List<CuBonusStatisChartVO> queryCuBonusStatisChart(CuBonusStatisChartVO chartVO) {
return baseMapper.queryCuBonusStatisChart(chartVO); return baseMapper.queryCuBonusStatisChart(chartVO);
} }
/**
* 奖金拨比图表合计
**/
@Override @Override
public CuBonusStatisChartVO queryCuBonusSumStatisChart(CuBonusStatisChartVO chartVO) { public CuBonusStatisChartVO queryCuBonusSumStatisChart(CuBonusStatisChartVO chartVO) {
return baseMapper.queryCuBonusSumStatisChart(chartVO); return baseMapper.queryCuBonusSumStatisChart(chartVO);
} }
/**
* 查询奖金拨比图形数据-柱形图
**/
@Override @Override
public CuBonusStatisColumnarVO pillarRatio(CuBonusStatisColumnarVO columnarVO) { public CuBonusStatisColumnarVO pillarRatio(CuBonusStatisColumnarVO columnarVO) {
// 查询当年的数据 // 查询当年的数据
@ -348,18 +331,12 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
return thisYear; return thisYear;
} }
/**
* 查询一年注册升级复购嗨粉合计
**/
@Override @Override
public CuBonusStatisColumnarVO queryYearData(CuBonusStatisColumnarVO columnarVO) { public CuBonusStatisColumnarVO queryYearData(CuBonusStatisColumnarVO columnarVO) {
Optional<CuBonusStatisColumnarVO> opt = Optional.ofNullable(baseMapper.queryYearData(columnarVO)); Optional<CuBonusStatisColumnarVO> opt = Optional.ofNullable(baseMapper.queryYearData(columnarVO));
return opt.orElse(null); return opt.orElse(null);
} }
/**
* 查询奖金拨比(饼状图)
**/
@Override @Override
public CuBonusStatisRoundVO queryDiallingRatio(CuBonusStatisRoundVO roundVO) { public CuBonusStatisRoundVO queryDiallingRatio(CuBonusStatisRoundVO roundVO) {
return baseMapper.queryDiallingRatio(roundVO); return baseMapper.queryDiallingRatio(roundVO);
@ -433,11 +410,10 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
} }
} }
//存入订单信息 // 存入订单信息
saveBonusStatis(soAll); saveBonusStatis(soAll);
//存入国内奖金信息 // 存入国内奖金信息
saveBonusStatisAchieve(acAll); saveBonusStatisAchieve(acAll);
return true; return true;
} }
@ -461,5 +437,4 @@ public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, C
return baseMapper.vertexList(); return baseMapper.vertexList();
} }
} }

View File

@ -55,13 +55,13 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean anewStatisHistoryBonus(String startDate, String endDate) { public Boolean anewStatisHistoryBonus(String startDate, String endDate) {
//查询顶点会员 // 查询顶点会员
List<CuBonusVertexStatisVO> vertexList = vertexList(null); List<CuBonusVertexStatisVO> vertexList = vertexList(null);
//会员订单信息 // 会员订单信息
List<CuBonusVertexStatisVO> orachListAll = new ArrayList<>(); List<CuBonusVertexStatisVO> orachListAll = new ArrayList<>();
//查询新增订单 // 查询新增订单
CuBonusVertexStatisVO cbs = new CuBonusVertexStatisVO(); CuBonusVertexStatisVO cbs = new CuBonusVertexStatisVO();
//日期集合 // 日期集合
List<String> dates = getDatesInRange(startDate, endDate); List<String> dates = getDatesInRange(startDate, endDate);
for (String date : dates) { for (String date : dates) {
int period = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(date).getPkId(); int period = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(date).getPkId();
@ -77,13 +77,14 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
cbs.setPkCountry(CountryConstants.CHINA_COUNTRY); cbs.setPkCountry(CountryConstants.CHINA_COUNTRY);
for (CuBonusVertexStatisVO ve : vertexList) { for (CuBonusVertexStatisVO ve : vertexList) {
cbs.setPkVertex(ve.getPkVertex()); cbs.setPkVertex(ve.getPkVertex());
List<CuBonusVertexStatisVO> orachList = baseMapper.queryAnewSaOrderByLessDay(cbs); List<CuBonusVertexStatisVO> tmpList = baseMapper.queryAnewSaOrderByLessDay(cbs);
orachListAll.addAll(orachList); orachListAll.addAll(tmpList);
} }
//先查中国订单 // 查询所有体系
Map<Date, List<CuBonusVertexStatisVO>> orachListMap = orachListAll.stream().collect(Collectors.groupingBy(CuBonusVertexStatisVO::getCreationTime));
//查询所有体系
if (CollectionUtil.isNotEmpty(orachListAll)) { if (CollectionUtil.isNotEmpty(orachListAll)) {
// 先查中国订单
Map<Date, List<CuBonusVertexStatisVO>> orachListMap = orachListAll.stream().collect(Collectors.groupingBy(CuBonusVertexStatisVO::getCreationTime));
if (CollectionUtil.isNotEmpty(vertexList)) { if (CollectionUtil.isNotEmpty(vertexList)) {
for (Map.Entry<Date, List<CuBonusVertexStatisVO>> entry : orachListMap.entrySet()) { for (Map.Entry<Date, List<CuBonusVertexStatisVO>> entry : orachListMap.entrySet()) {
for (CuBonusVertexStatisVO ve : vertexList) { for (CuBonusVertexStatisVO ve : vertexList) {
@ -96,15 +97,15 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
} }
} }
} }
//累加好的数据存入acAll // 累加好的数据存入acAll
List<CuBonusVertexStatisVO> acAll = new ArrayList<>(); List<CuBonusVertexStatisVO> acAll = new ArrayList<>();
if (CollectionUtil.isNotEmpty(vertexList)) { if (CollectionUtil.isNotEmpty(vertexList)) {
for (CuBonusVertexStatisVO ve : vertexList) { for (CuBonusVertexStatisVO ve : vertexList) {
cbs.setPkVertex(ve.getPkVertex()); cbs.setPkVertex(ve.getPkVertex());
//查询中国统计奖金 // 查询中国统计奖金
List<CuBonusVertexStatisVO> listCn = baseMapper.queryVertexChinaCountryBonus(cbs); List<CuBonusVertexStatisVO> listCn = baseMapper.queryVertexChinaCountryBonus(cbs);
Map<Date, List<CuBonusVertexStatisVO>> listCnMap = listCn.stream().collect(Collectors.groupingBy(CuBonusVertexStatisVO::getCreationTime));
if (CollectionUtil.isNotEmpty(listCn)) { if (CollectionUtil.isNotEmpty(listCn)) {
Map<Date, List<CuBonusVertexStatisVO>> listCnMap = listCn.stream().collect(Collectors.groupingBy(CuBonusVertexStatisVO::getCreationTime));
for (Map.Entry<Date, List<CuBonusVertexStatisVO>> entry : listCnMap.entrySet()) { for (Map.Entry<Date, List<CuBonusVertexStatisVO>> entry : listCnMap.entrySet()) {
CuBonusVertexStatisVO oldSo = new CuBonusVertexStatisVO(); CuBonusVertexStatisVO oldSo = new CuBonusVertexStatisVO();
for (CuBonusVertexStatisVO cb : entry.getValue()) { for (CuBonusVertexStatisVO cb : entry.getValue()) {
@ -119,9 +120,9 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
} }
} }
} }
//存入订单信息 // 存入订单信息
saveBonusStatis(soAll); saveBonusStatis(soAll);
//存入国内奖金信息 // 存入国内奖金信息
saveBonusStatisAchieve(acAll); saveBonusStatisAchieve(acAll);
} }
return true; return true;
@ -132,11 +133,6 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
return baseMapper.delStatis(startDate, endDate, pkVertexList); return baseMapper.delStatis(startDate, endDate, pkVertexList);
} }
@Override
public List<CuBonusVertexStatisVO> bonusDeductlist(CuBonusVertexStatisVO cuBonusVertexStatisVO) {
return baseMapper.bonusDeductlist(cuBonusVertexStatisVO);
}
@Override @Override
public List<CuBonusVertexStatisVO> queryCuBonusStatis(CuBonusVertexStatisVO cuBonusVertexStatisVO) { public List<CuBonusVertexStatisVO> queryCuBonusStatis(CuBonusVertexStatisVO cuBonusVertexStatisVO) {
return baseMapper.queryCuBonusStatis(cuBonusVertexStatisVO); return baseMapper.queryCuBonusStatis(cuBonusVertexStatisVO);
@ -219,15 +215,18 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
// 复购直推收益 // 复购直推收益
oldBon.setRepurPushIncome(addOrInitializeAmount(oldBon.getRepurPushIncome(), newBon.getRealIncome(), 2)); oldBon.setRepurPushIncome(addOrInitializeAmount(oldBon.getRepurPushIncome(), newBon.getRealIncome(), 2));
break; break;
case REPURCHASE_POINT_INCOME:
// 复购见点收益
oldBon.setGlobalPointsBonus(addOrInitializeAmount(oldBon.getGlobalPointsBonus(), newBon.getRealIncome(), 2));
break;
case REPURCHASE_AREA_INCOME:
// 复购区域收益
oldBon.setStoreIncomeBonus(addOrInitializeAmount(oldBon.getStoreIncomeBonus(), newBon.getRealIncome(), 2));
break;
} }
return oldBon; return oldBon;
} }
@Override
public List<CuBonusVertexStatisVO> countrylist(CuBonusVertexStatisVO cuBonusVertexStatisVO) {
return baseMapper.countrylist(cuBonusVertexStatisVO);
}
@Override @Override
public List<CuBonusVertexStatisVO> vertexList(Integer pkVertex) { public List<CuBonusVertexStatisVO> vertexList(Integer pkVertex) {
return baseMapper.vertexList(pkVertex); return baseMapper.vertexList(pkVertex);
@ -283,11 +282,6 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
oldSo.setSpecialRepurchaseAmount(addOrInitializeAmount(oldSo.getSpecialRepurchaseAmount(), newSo.getOrderAmount(), type)); oldSo.setSpecialRepurchaseAmount(addOrInitializeAmount(oldSo.getSpecialRepurchaseAmount(), newSo.getOrderAmount(), type));
oldSo.setSpecialRepurchasePv(addOrInitializeAmount(oldSo.getSpecialRepurchasePv(), newSo.getOrderAchieve(), type)); oldSo.setSpecialRepurchasePv(addOrInitializeAmount(oldSo.getSpecialRepurchasePv(), newSo.getOrderAchieve(), type));
break; break;
case WELFARE_ORDER:
// 福利订单
oldSo.setWelfareOrder(addOrInitializeAmount(oldSo.getWelfareOrder(), newSo.getOrderAmount(), type));
oldSo.setWelfareOrderPv(addOrInitializeAmount(oldSo.getWelfareOrderPv(), newSo.getOrderAchieve(), type));
break;
default: default:
break; break;
} }
@ -319,6 +313,8 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
bs.setHiFunIncome(cb.getHiFunIncome()); bs.setHiFunIncome(cb.getHiFunIncome());
bs.setCalFirAchieve(cb.getCalFirAchieve()); bs.setCalFirAchieve(cb.getCalFirAchieve());
bs.setCalRepAchieve(cb.getCalRepAchieve()); bs.setCalRepAchieve(cb.getCalRepAchieve());
bs.setGlobalPointsBonus(cb.getGlobalPointsBonus());
bs.setStoreIncomeBonus(cb.getStoreIncomeBonus());
// 查询数据库判断记录是否存在 // 查询数据库判断记录是否存在
List<CuBonusVertexStatis> existingRecord = getCuBonusStatis(bs); List<CuBonusVertexStatis> existingRecord = getCuBonusStatis(bs);
@ -400,11 +396,6 @@ public class CuBonusVertexStatisServiceImpl extends ServiceImpl<CuBonusVertexSta
} }
} }
@Override
public List<CuBonusVertexStatisVO> queryChinaCountryBonus(CuBonusVertexStatisVO cuBonusVertexStatisVO) {
return baseMapper.queryChinaCountryBonus(cuBonusVertexStatisVO);
}
// 获取或初始化金额 // 获取或初始化金额
private BigDecimal addOrInitializeAmount(BigDecimal currentAmount, BigDecimal newAmount, int type) { private BigDecimal addOrInitializeAmount(BigDecimal currentAmount, BigDecimal newAmount, int type) {
if (type == 1) { if (type == 1) {

View File

@ -63,17 +63,17 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal repurBonusPvRate = BigDecimal.ZERO; private BigDecimal repurBonusPvRate = BigDecimal.ZERO;
/** /**
* 注册新增金额 * 注册新增金额
*/ */
@BigDecimalFormat @BigDecimalFormat
@Excel(name = "注册专区(¥)", scale = 2) @Excel(name = "注册专区", scale = 2)
private BigDecimal mainRegAmount = BigDecimal.ZERO; private BigDecimal mainRegAmount = BigDecimal.ZERO;
/** /**
* 升级新增金额 * 升级新增金额
*/ */
@BigDecimalFormat @BigDecimalFormat
@Excel(name = "升级专区(¥)", scale = 2) @Excel(name = "升级专区", scale = 2)
private BigDecimal mainUpAmount = BigDecimal.ZERO; private BigDecimal mainUpAmount = BigDecimal.ZERO;
/** /**
@ -83,7 +83,7 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal specialRegisterAmount = BigDecimal.ZERO; private BigDecimal specialRegisterAmount = BigDecimal.ZERO;
/** /**
* 特殊注册新增金额小计 * 特殊注册新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialRegisterAmountSum = BigDecimal.ZERO; private BigDecimal specialRegisterAmountSum = BigDecimal.ZERO;
@ -94,56 +94,56 @@ public class CuBonusStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialUpgradeAmount = BigDecimal.ZERO; private BigDecimal specialUpgradeAmount = BigDecimal.ZERO;
/** /**
* 特殊升级新增金额小计 * 特殊升级新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialUpgradeAmountSum = BigDecimal.ZERO; private BigDecimal specialUpgradeAmountSum = BigDecimal.ZERO;
/** /**
* 虚拟订单金额 * 虚拟订单金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal fictitiousAmount = BigDecimal.ZERO; private BigDecimal fictitiousAmount = BigDecimal.ZERO;
/** /**
* 首购总金额 注册金额+升级金额+礼包订单1万礼包 * 首购总金额 注册金额+升级金额+礼包订单1万礼包
*/ */
@Excel(name = "首购金额(¥)", scale = 2) @Excel(name = "首购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal firstPurchaseAll = BigDecimal.ZERO; private BigDecimal firstPurchaseAll = BigDecimal.ZERO;
/** /**
* 直推收益 * 直推收益
*/ */
@Excel(name = "直推收益(¥)", scale = 2) @Excel(name = "直推收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonus = BigDecimal.ZERO; private BigDecimal introduceBonus = BigDecimal.ZERO;
/** /**
* 拓展收益 * 拓展收益
*/ */
@Excel(name = "拓展收益(¥)", scale = 2) @Excel(name = "拓展收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonus = BigDecimal.ZERO; private BigDecimal orgBonus = BigDecimal.ZERO;
/** /**
* 辅导收益 * 辅导收益
*/ */
@Excel(name = "辅导收益(¥)", scale = 2) @Excel(name = "辅导收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonus = BigDecimal.ZERO; private BigDecimal leaderBonus = BigDecimal.ZERO;
/** /**
* 分红收益 * 分红收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal shareBonus = BigDecimal.ZERO; private BigDecimal shareBonus = BigDecimal.ZERO;
/** /**
* 服务补贴 * 服务补贴
*/ */
@Excel(name = "服务补贴(¥)", scale = 2) @Excel(name = "服务补贴", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal serviceBonus = BigDecimal.ZERO; private BigDecimal serviceBonus = BigDecimal.ZERO;
/** /**
* 复购新增金额(复购专区) * 复购新增金额(复购专区)
*/ */
@Excel(name = "复购专区(¥)", scale = 2) @Excel(name = "复购专区", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRepurAmount = BigDecimal.ZERO; private BigDecimal mainRepurAmount = BigDecimal.ZERO;
@ -171,7 +171,7 @@ public class CuBonusStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO; private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO;
/** /**
* 特殊复购新增金额小计(复购专区) * 特殊复购新增金额小计(复购专区)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialRepurchaseAmountSum = BigDecimal.ZERO; private BigDecimal specialRepurchaseAmountSum = BigDecimal.ZERO;
@ -184,44 +184,57 @@ public class CuBonusStatisVO implements Serializable {
/** /**
* 海粉注册金额 * 海粉注册金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal hifansRegAmount = BigDecimal.ZERO; private BigDecimal hifansRegAmount = BigDecimal.ZERO;
/** /**
* 海粉升级(海粉升级订单) * 海粉升级(海粉升级订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal haiFunUpgradeAmount = BigDecimal.ZERO; private BigDecimal haiFunUpgradeAmount = BigDecimal.ZERO;
/** /**
* 复购总金额 复购订单+海粉订单+海粉复购订单 * 复购总金额 复购订单+海粉订单+海粉复购订单
*/ */
@Excel(name = "复购金额(¥)", scale = 2) @Excel(name = "复购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurchaseAllAmount = BigDecimal.ZERO; private BigDecimal repurchaseAllAmount = BigDecimal.ZERO;
/** /**
* 复购级差收益 * 复购级差收益
*/ */
@Excel(name = "复购级差收益(¥)", scale = 2) @Excel(name = "复购级差收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonus = BigDecimal.ZERO; private BigDecimal repurRangeBonus = BigDecimal.ZERO;
/** /**
* 复购拓展收益 * 复购拓展收益
*/ */
@Excel(name = "复购拓展收益(¥)", scale = 2) @Excel(name = "复购拓展收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonus = BigDecimal.ZERO; private BigDecimal repurOrgBonus = BigDecimal.ZERO;
/** /**
* 复购辅导收益 * 复购辅导收益
*/ */
@Excel(name = "复购辅导收益(¥)", scale = 2) @Excel(name = "复购辅导收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonus = BigDecimal.ZERO; private BigDecimal repurLeaderBonus = BigDecimal.ZERO;
/**
* 复购见点收益
*/
@Excel(name = "复购见点收益", scale = 2)
@BigDecimalFormat
private BigDecimal globalPointsBonus = BigDecimal.ZERO;
/**
* 复购区域收益
*/
@Excel(name = "复购区域收益", scale = 2)
@BigDecimalFormat
private BigDecimal storeIncomeBonus = BigDecimal.ZERO;
/** /**
* (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8+=实际拨出之和 * (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8+=实际拨出之和
*/ */
@Excel(name = "首购拨出金额(¥)", scale = 2) @Excel(name = "首购拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainBonus = BigDecimal.ZERO; private BigDecimal mainBonus = BigDecimal.ZERO;
/** /**
@ -236,7 +249,7 @@ public class CuBonusStatisVO implements Serializable {
* 复购直推收益+复购级差收益+复购拓展收益*80% +海粉直推 * 复购直推收益+复购级差收益+复购拓展收益*80% +海粉直推
* (复购级差+复购拓展 ) *0.8 +海粉直推 * (复购级差+复购拓展 ) *0.8 +海粉直推
*/ */
@Excel(name = "复购拨出金额(¥)", scale = 2) @Excel(name = "复购拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurBonus = BigDecimal.ZERO; private BigDecimal repurBonus = BigDecimal.ZERO;
@ -251,7 +264,7 @@ public class CuBonusStatisVO implements Serializable {
/** /**
* (直推收益+拓展收益+辅导收益+分红收益+报单服务费服务补贴+复购直推收益+复购级差收益+复购拓展收益)*0.8+海粉直推 * (直推收益+拓展收益+辅导收益+分红收益+报单服务费服务补贴+复购直推收益+复购级差收益+复购拓展收益)*0.8+海粉直推
*/ */
@Excel(name = "总拨出金额(¥)", scale = 2) @Excel(name = "总拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonus = BigDecimal.ZERO; private BigDecimal totalBonus = BigDecimal.ZERO;
@ -265,7 +278,7 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal totalBonusRate = BigDecimal.ZERO; private BigDecimal totalBonusRate = BigDecimal.ZERO;
/** /**
* 三方订单业绩(礼包订单) * 三方订单业绩(礼包订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal thirdOrder = BigDecimal.ZERO; private BigDecimal thirdOrder = BigDecimal.ZERO;
@ -294,55 +307,55 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal realIncomeTotal = BigDecimal.ZERO; private BigDecimal realIncomeTotal = BigDecimal.ZERO;
/** /**
* 注册新增金额小计 * 注册新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRegAmountSum = BigDecimal.ZERO; private BigDecimal mainRegAmountSum = BigDecimal.ZERO;
/** /**
* 升级新增金额小计 * 升级新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainUpAmountSum = BigDecimal.ZERO; private BigDecimal mainUpAmountSum = BigDecimal.ZERO;
/** /**
* 首购总金额小计 注册金额+升级金额+礼包订单1万礼包 * 首购总金额小计 注册金额+升级金额+礼包订单1万礼包
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal firstPurchaseAllSum = BigDecimal.ZERO; private BigDecimal firstPurchaseAllSum = BigDecimal.ZERO;
/** /**
* 直推收益小计 * 直推收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonusSum = BigDecimal.ZERO; private BigDecimal introduceBonusSum = BigDecimal.ZERO;
/** /**
* 拓展收益小计 * 拓展收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonusSum = BigDecimal.ZERO; private BigDecimal orgBonusSum = BigDecimal.ZERO;
/** /**
* 辅导收益小计 * 辅导收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonusSum = BigDecimal.ZERO; private BigDecimal leaderBonusSum = BigDecimal.ZERO;
/** /**
* 分红收益小计 * 分红收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal shareBonusSum = BigDecimal.ZERO; private BigDecimal shareBonusSum = BigDecimal.ZERO;
/** /**
* 服务补贴小计 * 服务补贴小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal serviceBonusSum = BigDecimal.ZERO; private BigDecimal serviceBonusSum = BigDecimal.ZERO;
/** /**
* 复购新增金额小计(复购专区) * 复购新增金额小计(复购专区)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRepurAmountSum = BigDecimal.ZERO; private BigDecimal mainRepurAmountSum = BigDecimal.ZERO;
/** /**
* 嗨粉注册金额小计 * 嗨粉注册金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal hifansRegAmountSum = BigDecimal.ZERO; private BigDecimal hifansRegAmountSum = BigDecimal.ZERO;
@ -352,12 +365,12 @@ public class CuBonusStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurchaseAllAmountSum = BigDecimal.ZERO; private BigDecimal repurchaseAllAmountSum = BigDecimal.ZERO;
/** /**
* 复购级差收益小计 * 复购级差收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonusSum = BigDecimal.ZERO; private BigDecimal repurRangeBonusSum = BigDecimal.ZERO;
/** /**
* 复购拓展收益小计 * 复购拓展收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonusSum = BigDecimal.ZERO; private BigDecimal repurOrgBonusSum = BigDecimal.ZERO;
@ -366,6 +379,16 @@ public class CuBonusStatisVO implements Serializable {
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonusSum = BigDecimal.ZERO; private BigDecimal repurLeaderBonusSum = BigDecimal.ZERO;
/**
* 复购见点收益
*/
@BigDecimalFormat
private BigDecimal globalPointsBonusSum = BigDecimal.ZERO;
/**
* 复购区域收益
*/
@BigDecimalFormat
private BigDecimal storeIncomeBonusSum = BigDecimal.ZERO;
/** /**
* 首购拨出金额合计 * 首购拨出金额合计
@ -414,7 +437,7 @@ public class CuBonusStatisVO implements Serializable {
/** /**
* 小计 * 小计
* 总拨出金额()/(复购订单+海粉订单+海粉复购订单+注册+升级+1万礼包(礼包订单)=总金额) * 总拨出金额/(复购订单+海粉订单+海粉复购订单+注册+升级+1万礼包(礼包订单)=总金额)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonusRateSum = BigDecimal.ZERO; private BigDecimal totalBonusRateSum = BigDecimal.ZERO;
@ -490,13 +513,13 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal agentIntroduceBonusRate = BigDecimal.ZERO; private BigDecimal agentIntroduceBonusRate = BigDecimal.ZERO;
/** /**
* 礼包金额(礼包订单) * 礼包金额(礼包订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal giftOrder = BigDecimal.ZERO; private BigDecimal giftOrder = BigDecimal.ZERO;
/** /**
* 实际综合实发金额 * 实际综合实发金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonusReal = BigDecimal.ZERO; private BigDecimal totalBonusReal = BigDecimal.ZERO;
@ -631,7 +654,7 @@ public class CuBonusStatisVO implements Serializable {
private BigDecimal orderAmount = BigDecimal.ZERO; private BigDecimal orderAmount = BigDecimal.ZERO;
private List<BigDecimal> orderAchieveList; private List<BigDecimal> orderAchieveList;
/** /**
* 国外奖金 * 实发收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal realIncome = BigDecimal.ZERO; private BigDecimal realIncome = BigDecimal.ZERO;
@ -646,11 +669,6 @@ public class CuBonusStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal dividendRatio = BigDecimal.ZERO; private BigDecimal dividendRatio = BigDecimal.ZERO;
/**
* 按照体系中国和国家分组合并订单
*/
List<CuBonusStatisVO> mergeList;
List<Integer> orderTypeList; List<Integer> orderTypeList;
/** /**
@ -662,5 +680,4 @@ public class CuBonusStatisVO implements Serializable {
*/ */
private BigDecimal calRepAchieve; private BigDecimal calRepAchieve;
} }

View File

@ -38,9 +38,9 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
private String memberName; private String memberName;
/** /**
* 首购总金额 注册金额+升级金额+礼包订单1万礼包 * 首购总金额 注册金额+升级金额+礼包订单1万礼包
*/ */
@Excel(name = "首购金额(¥)", scale = 2) @Excel(name = "首购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal firstPurchaseAll = BigDecimal.ZERO; private BigDecimal firstPurchaseAll = BigDecimal.ZERO;
@ -56,7 +56,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
/** /**
* (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8=实际拨出之和 * (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8=实际拨出之和
*/ */
@Excel(name = "首购奖金(¥)", scale = 2) @Excel(name = "首购奖金", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainBonus = BigDecimal.ZERO; private BigDecimal mainBonus = BigDecimal.ZERO;
/** /**
@ -81,7 +81,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonusRate = BigDecimal.ZERO; private BigDecimal introduceBonusRate = BigDecimal.ZERO;
/** /**
* 直推收益 * 直推收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonus = BigDecimal.ZERO; private BigDecimal introduceBonus = BigDecimal.ZERO;
@ -92,7 +92,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonusRate = BigDecimal.ZERO; private BigDecimal orgBonusRate = BigDecimal.ZERO;
/** /**
* 拓展收益 * 拓展收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonus = BigDecimal.ZERO; private BigDecimal orgBonus = BigDecimal.ZERO;
@ -103,7 +103,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonusRate = BigDecimal.ZERO; private BigDecimal leaderBonusRate = BigDecimal.ZERO;
/** /**
* 辅导收益 * 辅导收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonus = BigDecimal.ZERO; private BigDecimal leaderBonus = BigDecimal.ZERO;
@ -115,30 +115,30 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
private BigDecimal serviceBonusRate = BigDecimal.ZERO; private BigDecimal serviceBonusRate = BigDecimal.ZERO;
/** /**
* 服务补贴 * 服务补贴
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal serviceBonus = BigDecimal.ZERO; private BigDecimal serviceBonus = BigDecimal.ZERO;
/** /**
* 复购总金额 复购订单+海粉订单+海粉复购订单 * 复购总金额 复购订单
*/ */
@Excel(name = "复购金额(¥)", scale = 2) @Excel(name = "复购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurchaseAllAmount = BigDecimal.ZERO; private BigDecimal repurchaseAllAmount = BigDecimal.ZERO;
/** /**
* 复购直推收益+复购级差收益+复购拓展收益*80% +海粉直推 * 复购直推收益+复购级差收益+复购拓展收益*80%
* (复购级差+复购拓展 ) *0.8 +海粉直推 * (复购级差+复购拓展 ) *0.8
*/ */
@Excel(name = "复购拨出金额(¥)", scale = 2) @Excel(name = "复购拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurBonus = BigDecimal.ZERO; private BigDecimal repurBonus = BigDecimal.ZERO;
/** /**
* (复购级差+复购拓展 ) *0.8 +海粉直推 * (复购级差+复购拓展 ) *0.8
* 复购拨出比例% = ((复购直推收益+复购级差收益+复购拓展收益*80%)+海粉直推)/复购总奖金(复购订单+海粉订单) * 复购拨出比例% = ((复购直推收益+复购级差收益+复购拓展收益*80%))/复购总奖金(复购订单)
*/ */
@Excel(name = "复购拨出比例(%)", scale = 2) @Excel(name = "复购拨出比例(%)", scale = 2)
@BigDecimalFormat @BigDecimalFormat
@ -158,7 +158,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonusRate = BigDecimal.ZERO; private BigDecimal repurRangeBonusRate = BigDecimal.ZERO;
/** /**
* 复购级差收益 * 复购级差收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonus = BigDecimal.ZERO; private BigDecimal repurRangeBonus = BigDecimal.ZERO;
@ -169,7 +169,7 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonusRate = BigDecimal.ZERO; private BigDecimal repurOrgBonusRate = BigDecimal.ZERO;
/** /**
* 复购拓展收益 * 复购拓展收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonus = BigDecimal.ZERO; private BigDecimal repurOrgBonus = BigDecimal.ZERO;
@ -180,11 +180,35 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonusRate = BigDecimal.ZERO; private BigDecimal repurLeaderBonusRate = BigDecimal.ZERO;
/** /**
* 复购辅导收益 * 复购辅导收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonus = BigDecimal.ZERO; private BigDecimal repurLeaderBonus = BigDecimal.ZERO;
/**
* 复购见点拨比(%)
*/
@Excel(name = "复购见点拨比(%)", scale = 2)
@BigDecimalFormat
private BigDecimal globalPointsBonusRate = BigDecimal.ZERO;
/**
* 复购见点收益
*/
@BigDecimalFormat
private BigDecimal globalPointsBonus = BigDecimal.ZERO;
/**
* 复购区域拨比(%)
*/
@Excel(name = "复购区域拨比(%)", scale = 2)
@BigDecimalFormat
private BigDecimal storeIncomeBonusRate = BigDecimal.ZERO;
/**
* 复购区域收益
*/
@BigDecimalFormat
private BigDecimal storeIncomeBonus = BigDecimal.ZERO;
/** /**
* 拓展平均碰次 * 拓展平均碰次
*/ */
@ -330,9 +354,6 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
*/ */
private Integer bonusType; private Integer bonusType;
private List<BigDecimal> orderAchieveList;
/** /**
* 重复消费% * 重复消费%
*/ */
@ -344,11 +365,6 @@ public class CuBonusVertexStaticTotalVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal dividendRatio = BigDecimal.ZERO; private BigDecimal dividendRatio = BigDecimal.ZERO;
/**
* 按照体系中国和国家分组合并订单
*/
List<CuBonusVertexStaticTotalVO> mergeList;
List<Integer> orderTypeList; List<Integer> orderTypeList;
/** /**

View File

@ -64,17 +64,17 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal repurBonusPvRate = BigDecimal.ZERO; private BigDecimal repurBonusPvRate = BigDecimal.ZERO;
/** /**
* 注册新增金额 * 注册新增金额
*/ */
@BigDecimalFormat @BigDecimalFormat
@Excel(name = "注册专区(¥)", scale = 2) @Excel(name = "注册专区", scale = 2)
private BigDecimal mainRegAmount = BigDecimal.ZERO; private BigDecimal mainRegAmount = BigDecimal.ZERO;
/** /**
* 升级新增金额 * 升级新增金额
*/ */
@BigDecimalFormat @BigDecimalFormat
@Excel(name = "升级专区(¥)", scale = 2) @Excel(name = "升级专区", scale = 2)
private BigDecimal mainUpAmount = BigDecimal.ZERO; private BigDecimal mainUpAmount = BigDecimal.ZERO;
/** /**
@ -94,7 +94,7 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO; private BigDecimal specialRepurchaseAmount = BigDecimal.ZERO;
/** /**
* 虚拟订单金额 * 虚拟订单金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal fictitiousAmount = BigDecimal.ZERO; private BigDecimal fictitiousAmount = BigDecimal.ZERO;
@ -112,47 +112,47 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal agentUpAmount = BigDecimal.ZERO; private BigDecimal agentUpAmount = BigDecimal.ZERO;
/** /**
* 首购总金额 注册金额+升级金额+礼包订单1万礼包 * 首购总金额 注册金额+升级金额+礼包订单1万礼包
*/ */
@Excel(name = "首购金额(¥)", scale = 2) @Excel(name = "首购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal firstPurchaseAll = BigDecimal.ZERO; private BigDecimal firstPurchaseAll = BigDecimal.ZERO;
/** /**
* 直推收益 * 直推收益
*/ */
@Excel(name = "直推收益(¥)", scale = 2) @Excel(name = "直推收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonus = BigDecimal.ZERO; private BigDecimal introduceBonus = BigDecimal.ZERO;
/** /**
* 拓展收益 * 拓展收益
*/ */
@Excel(name = "拓展收益(¥)", scale = 2) @Excel(name = "拓展收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonus = BigDecimal.ZERO; private BigDecimal orgBonus = BigDecimal.ZERO;
/** /**
* 辅导收益 * 辅导收益
*/ */
@Excel(name = "辅导收益(¥)", scale = 2) @Excel(name = "辅导收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonus = BigDecimal.ZERO; private BigDecimal leaderBonus = BigDecimal.ZERO;
/** /**
* 分红收益 * 分红收益
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal shareBonus = BigDecimal.ZERO; private BigDecimal shareBonus = BigDecimal.ZERO;
/** /**
* 服务补贴 * 服务补贴
*/ */
@Excel(name = "服务补贴(¥)", scale = 2) @Excel(name = "服务补贴", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal serviceBonus = BigDecimal.ZERO; private BigDecimal serviceBonus = BigDecimal.ZERO;
/** /**
* 复购新增金额(复购专区) * 复购新增金额(复购专区)
*/ */
@Excel(name = "复购专区(¥)", scale = 2) @Excel(name = "复购专区", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRepurAmount = BigDecimal.ZERO; private BigDecimal mainRepurAmount = BigDecimal.ZERO;
/** /**
@ -180,40 +180,53 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal welfareOrder = BigDecimal.ZERO; private BigDecimal welfareOrder = BigDecimal.ZERO;
/** /**
* 海粉注册金额 * 海粉注册金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal hifansRegAmount = BigDecimal.ZERO; private BigDecimal hifansRegAmount = BigDecimal.ZERO;
/** /**
* 海粉升级(海粉升级订单) * 海粉升级(海粉升级订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal haiFunUpgradeAmount = BigDecimal.ZERO; private BigDecimal haiFunUpgradeAmount = BigDecimal.ZERO;
/** /**
* 复购总金额 复购订单+海粉订单+海粉复购订单 * 复购总金额 复购订单+海粉订单+海粉复购订单
*/ */
@Excel(name = "复购金额(¥)", scale = 2) @Excel(name = "复购金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurchaseAllAmount = BigDecimal.ZERO; private BigDecimal repurchaseAllAmount = BigDecimal.ZERO;
/** /**
* 复购级差收益 * 复购级差收益
*/ */
@Excel(name = "复购级差收益(¥)", scale = 2) @Excel(name = "复购级差收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonus = BigDecimal.ZERO; private BigDecimal repurRangeBonus = BigDecimal.ZERO;
/** /**
* 复购拓展收益 * 复购拓展收益
*/ */
@Excel(name = "复购拓展收益(¥)", scale = 2) @Excel(name = "复购拓展收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonus = BigDecimal.ZERO; private BigDecimal repurOrgBonus = BigDecimal.ZERO;
/** /**
* 复购辅导收益 * 复购辅导收益
*/ */
@Excel(name = "复购辅导收益(¥)", scale = 2) @Excel(name = "复购辅导收益", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonus = BigDecimal.ZERO; private BigDecimal repurLeaderBonus = BigDecimal.ZERO;
/**
* 复购见点收益
*/
@Excel(name = "复购见点收益", scale = 2)
@BigDecimalFormat
private BigDecimal globalPointsBonus = BigDecimal.ZERO;
/**
* 复购区域收益
*/
@Excel(name = "复购区域收益", scale = 2)
@BigDecimalFormat
private BigDecimal storeIncomeBonus = BigDecimal.ZERO;
/** /**
* 海粉直推收益海粉推荐收益% * 海粉直推收益海粉推荐收益%
*/ */
@ -223,7 +236,7 @@ public class CuBonusVertexStatisVO implements Serializable {
/** /**
* (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8=实际拨出之和 * (直推收益+拓展收益+辅导收益+分红收益+报单收益服务补贴)*0.8=实际拨出之和
*/ */
@Excel(name = "首购拨出金额(¥)", scale = 2) @Excel(name = "首购拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainBonus = BigDecimal.ZERO; private BigDecimal mainBonus = BigDecimal.ZERO;
/** /**
@ -238,7 +251,7 @@ public class CuBonusVertexStatisVO implements Serializable {
* 复购直推收益+复购级差收益+复购拓展收益*80% +海粉直推 * 复购直推收益+复购级差收益+复购拓展收益*80% +海粉直推
* (复购级差+复购拓展 ) *0.8 +海粉直推 * (复购级差+复购拓展 ) *0.8 +海粉直推
*/ */
@Excel(name = "复购拨出金额(¥)", scale = 2) @Excel(name = "复购拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurBonus = BigDecimal.ZERO; private BigDecimal repurBonus = BigDecimal.ZERO;
@ -253,7 +266,7 @@ public class CuBonusVertexStatisVO implements Serializable {
/** /**
* (直推收益+拓展收益+辅导收益+分红收益+报单服务费服务补贴+复购直推收益+复购级差收益+复购拓展收益)*0.8+海粉直推 * (直推收益+拓展收益+辅导收益+分红收益+报单服务费服务补贴+复购直推收益+复购级差收益+复购拓展收益)*0.8+海粉直推
*/ */
@Excel(name = "总拨出金额(¥)", scale = 2) @Excel(name = "总拨出金额", scale = 2)
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonus = BigDecimal.ZERO; private BigDecimal totalBonus = BigDecimal.ZERO;
@ -267,7 +280,7 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal totalBonusRate = BigDecimal.ZERO; private BigDecimal totalBonusRate = BigDecimal.ZERO;
/** /**
* 三方订单业绩(礼包订单) * 三方订单业绩(礼包订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal thirdOrder = BigDecimal.ZERO; private BigDecimal thirdOrder = BigDecimal.ZERO;
@ -296,23 +309,23 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal realIncomeTotal = BigDecimal.ZERO; private BigDecimal realIncomeTotal = BigDecimal.ZERO;
/** /**
* 注册新增金额小计 * 注册新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRegAmountSum = BigDecimal.ZERO; private BigDecimal mainRegAmountSum = BigDecimal.ZERO;
/** /**
* 升级新增金额小计 * 升级新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainUpAmountSum = BigDecimal.ZERO; private BigDecimal mainUpAmountSum = BigDecimal.ZERO;
/** /**
* 特殊注册新增金额小计 * 特殊注册新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialRegisterAmountSum = BigDecimal.ZERO; private BigDecimal specialRegisterAmountSum = BigDecimal.ZERO;
/** /**
* 特殊升级新增金额小计 * 特殊升级新增金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialUpgradeAmountSum = BigDecimal.ZERO; private BigDecimal specialUpgradeAmountSum = BigDecimal.ZERO;
@ -330,49 +343,49 @@ public class CuBonusVertexStatisVO implements Serializable {
private BigDecimal agentUpAmountSum = BigDecimal.ZERO; private BigDecimal agentUpAmountSum = BigDecimal.ZERO;
/** /**
* 首购总金额小计 注册金额+升级金额+礼包订单1万礼包 * 首购总金额小计 注册金额+升级金额+礼包订单1万礼包
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal firstPurchaseAllSum = BigDecimal.ZERO; private BigDecimal firstPurchaseAllSum = BigDecimal.ZERO;
/** /**
* 直推收益小计 * 直推收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal introduceBonusSum = BigDecimal.ZERO; private BigDecimal introduceBonusSum = BigDecimal.ZERO;
/** /**
* 拓展收益小计 * 拓展收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal orgBonusSum = BigDecimal.ZERO; private BigDecimal orgBonusSum = BigDecimal.ZERO;
/** /**
* 辅导收益小计 * 辅导收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal leaderBonusSum = BigDecimal.ZERO; private BigDecimal leaderBonusSum = BigDecimal.ZERO;
/** /**
* 分红收益小计 * 分红收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal shareBonusSum = BigDecimal.ZERO; private BigDecimal shareBonusSum = BigDecimal.ZERO;
/** /**
* 服务补贴小计 * 服务补贴小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal serviceBonusSum = BigDecimal.ZERO; private BigDecimal serviceBonusSum = BigDecimal.ZERO;
/** /**
* 复购新增金额小计(复购专区) * 复购新增金额小计(复购专区)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal mainRepurAmountSum = BigDecimal.ZERO; private BigDecimal mainRepurAmountSum = BigDecimal.ZERO;
/** /**
* 特殊复购新增金额小计(复购专区) * 特殊复购新增金额小计(复购专区)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal specialRepurchaseAmountSum = BigDecimal.ZERO; private BigDecimal specialRepurchaseAmountSum = BigDecimal.ZERO;
/** /**
* 嗨粉注册金额小计 * 嗨粉注册金额小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal hifansRegAmountSum = BigDecimal.ZERO; private BigDecimal hifansRegAmountSum = BigDecimal.ZERO;
@ -382,20 +395,30 @@ public class CuBonusVertexStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurchaseAllAmountSum = BigDecimal.ZERO; private BigDecimal repurchaseAllAmountSum = BigDecimal.ZERO;
/** /**
* 复购级差收益小计 * 复购级差收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurRangeBonusSum = BigDecimal.ZERO; private BigDecimal repurRangeBonusSum = BigDecimal.ZERO;
/** /**
* 复购拓展收益小计 * 复购拓展收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurOrgBonusSum = BigDecimal.ZERO; private BigDecimal repurOrgBonusSum = BigDecimal.ZERO;
/** /**
* 复购辅导收益小计 * 复购辅导收益小计
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal repurLeaderBonusSum = BigDecimal.ZERO; private BigDecimal repurLeaderBonusSum = BigDecimal.ZERO;
/**
* 复购见点收益
*/
@BigDecimalFormat
private BigDecimal globalPointsBonusSum = BigDecimal.ZERO;
/**
* 复购区域收益
*/
@BigDecimalFormat
private BigDecimal storeIncomeBonusSum = BigDecimal.ZERO;
/** /**
* 首购拨出金额合计 * 首购拨出金额合计
@ -443,19 +466,19 @@ public class CuBonusVertexStatisVO implements Serializable {
/** /**
* 小计 * 小计
* 总拨出金额()/(复购订单+海粉订单+海粉复购订单+注册+升级+1万礼包(礼包订单)=总金额) * 总拨出金额/(复购订单+海粉订单+海粉复购订单+注册+升级+1万礼包(礼包订单)=总金额)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonusRateSum = BigDecimal.ZERO; private BigDecimal totalBonusRateSum = BigDecimal.ZERO;
/** /**
* 礼包金额(礼包订单) * 礼包金额(礼包订单)
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal giftOrder = BigDecimal.ZERO; private BigDecimal giftOrder = BigDecimal.ZERO;
/** /**
* 实际综合实发金额 * 实际综合实发金额
*/ */
@BigDecimalFormat @BigDecimalFormat
private BigDecimal totalBonusReal = BigDecimal.ZERO; private BigDecimal totalBonusReal = BigDecimal.ZERO;
@ -605,13 +628,6 @@ public class CuBonusVertexStatisVO implements Serializable {
@BigDecimalFormat @BigDecimalFormat
private BigDecimal dividendRatio = BigDecimal.ZERO; private BigDecimal dividendRatio = BigDecimal.ZERO;
/**
* 按照体系中国和国家分组合并订单
*/
List<CuBonusVertexStatisVO> mergeList;
List<Integer> orderTypeList;
/** /**
* 本月会员网体表 * 本月会员网体表
*/ */

View File

@ -47,26 +47,26 @@
ELSE ROUND((#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS)) ELSE ROUND((#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS))
/ #{rate} / (cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4) / #{rate} / (cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4)
end AS mainBonusPvRate, end AS mainBonusPvRate,
<!-- 复购拨出金额 = 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 --> <!-- 复购拨出金额 = 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 + 复购见点收益 + 复购区域收益 -->
(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS repurBonus, AS repurBonus,
<!-- 复购拨出比例 = 复购金额为0复购拨出比例 = 0否则复购拨出比例 = 100 * 复购拨出金额 / 复购金额 --> <!-- 复购拨出比例 = 复购金额为0复购拨出比例 = 0否则复购拨出比例 = 100 * 复购拨出金额 / 复购金额 -->
case case
WHEN (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRate, end AS repurBonusRate,
<!-- 复购PV拨出比例 = 复购PV为0复购PV拨出比例 = 0否则复购PV拨出比例 = 100 * 首购拨出金额 / 汇率 / 首购PV --> <!-- 复购PV拨出比例 = 复购PV为0复购PV拨出比例 = 0否则复购PV拨出比例 = 100 * 首购拨出金额 / 汇率 / 首购PV -->
case case
WHEN (cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN (cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / (cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / (cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRate, end AS repurBonusPvRate,
<!-- 总拨出金额 = 直推收益 + 拓展收益 + 辅导收益 + 服务补贴 + 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 --> <!-- 总拨出金额 = 直推收益 + 拓展收益 + 辅导收益 + 服务补贴 + 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 + 复购见点收益 + 复购区域收益 -->
(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS totalBonus, AS totalBonus,
<!-- 总拨出比例 = 首购 + 复购金额为0总拨出比例 = 0否则总拨出比例 = 100 * 首购 + 复购拨出金额 / 首购 + 复购金额 --> <!-- 总拨出比例 = 首购 + 复购金额为0总拨出比例 = 0否则总拨出比例 = 100 * 首购 + 复购拨出金额 / 首购 + 复购金额 -->
CASE CASE
@ -74,7 +74,7 @@
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0 + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND (#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS ELSE ROUND (#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT / (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS totalBonusRate end AS totalBonusRate
@ -142,7 +142,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_STATIS cbs FROM CU_BONUS_STATIS cbs
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
LEFT JOIN cu_member_team ct ON ct.pk_id = cbs.pk_team_code LEFT JOIN cu_member_team ct ON ct.pk_id = cbs.pk_team_code
@ -223,6 +225,8 @@
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum, sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum,
sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum, sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum,
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum, sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum,
sum (cbs.global_points_bonus) globalPointsBonusSum,
sum (cbs.store_income_bonus) storeIncomeBonusSum,
sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT) sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
AS firstPurchaseAllSum, AS firstPurchaseAllSum,
sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
@ -241,28 +245,28 @@
ELSE ROUND(#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS) ELSE ROUND(#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS)
/ #{rate} / sum(cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4) / #{rate} / sum(cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4)
end AS mainBonusPvRateSum, end AS mainBonusPvRateSum,
sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) AS repurBonusSum, sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus) AS repurBonusSum,
case case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRateSum, end AS repurBonusRateSum,
case case
WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRateSum, end AS repurBonusPvRateSum,
sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS totalBonusSum, AS totalBonusSum,
CASE CASE
WHEN sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT WHEN sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0 + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND (#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS ELSE ROUND (#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT / sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS totalBonusRateSum end AS totalBonusRateSum
@ -329,7 +333,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_STATIS cbs FROM CU_BONUS_STATIS cbs
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
WHERE 1 = 1 WHERE 1 = 1
@ -676,7 +682,7 @@
so.MODIFIED_TIME modifiedTime so.MODIFIED_TIME modifiedTime
from sa_order so from sa_order so
inner JOIN CU_MEMBER cm on so.PK_MEMBER = cm.pk_id inner JOIN CU_MEMBER cm on so.PK_MEMBER = cm.pk_id
where so.ORDER_TYPE in (1, 2, 3, 13, 20, 24, 25, 26) and cm.DEL_FLAG = 0 where so.ORDER_TYPE in (1, 2, 3, 20, 24, 25, 26) and cm.DEL_FLAG = 0
<if test="pkCountry != null"> <if test="pkCountry != null">
and so.pk_country = #{pkCountry} and so.pk_country = #{pkCountry}
</if> </if>
@ -1222,7 +1228,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbp.DEL_FLAG = 0 where mbp.DEL_FLAG = 0
and mbp.INCOME_STATUS = 0 and mbp.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1251,7 +1257,7 @@
where mbe.DEL_FLAG = 0 where mbe.DEL_FLAG = 0
and mbe.INCOME_STATUS in (0, 4) and mbe.INCOME_STATUS in (0, 4)
and mbe.pk_order != 0 and mbe.pk_order != 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1280,7 +1286,7 @@
where mbc.DEL_FLAG = 0 where mbc.DEL_FLAG = 0
and mbc.INCOME_STATUS in (0, 4) and mbc.INCOME_STATUS in (0, 4)
and mbc.pk_order != 0 and mbc.pk_order != 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1308,7 +1314,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbr.DEL_FLAG = 0 where mbr.DEL_FLAG = 0
and mbr.INCOME_STATUS = 0 and mbr.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1336,7 +1342,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbd.DEL_FLAG = 0 where mbd.DEL_FLAG = 0
and mbd.INCOME_STATUS = 0 and mbd.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>

View File

@ -29,26 +29,26 @@
ELSE ROUND((#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS)) ELSE ROUND((#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS))
/ #{rate} / (cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4) / #{rate} / (cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4)
end AS mainBonusPvRate, end AS mainBonusPvRate,
<!-- 复购拨出金额 = 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 --> <!-- 复购拨出金额 = 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 + 复购见点收益 + 复购区域收益 -->
(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS repurBonus, AS repurBonus,
<!-- 复购拨出比例 = 复购金额为0复购拨出比例 = 0否则复购拨出比例 = 100 * 复购拨出金额 / 复购金额 --> <!-- 复购拨出比例 = 复购金额为0复购拨出比例 = 0否则复购拨出比例 = 100 * 复购拨出金额 / 复购金额 -->
case case
WHEN (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRate, end AS repurBonusRate,
<!-- 复购PV拨出比例 = 复购PV为0复购PV拨出比例 = 0否则复购PV拨出比例 = 100 * 首购拨出金额 / 汇率 / 首购PV --> <!-- 复购PV拨出比例 = 复购PV为0复购PV拨出比例 = 0否则复购PV拨出比例 = 100 * 首购拨出金额 / 汇率 / 首购PV -->
case case
WHEN (cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN (cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * (cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / (cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / (cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRate, end AS repurBonusPvRate,
<!-- 总拨出金额 = 直推收益 + 拓展收益 + 辅导收益 + 服务补贴 + 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 --> <!-- 总拨出金额 = 直推收益 + 拓展收益 + 辅导收益 + 服务补贴 + 复购级差收益 + 复购拓展收益 + 复购推荐收益 + 复购辅导收益 + 复购见点收益 + 复购区域收益 -->
(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS totalBonus, AS totalBonus,
<!-- 总拨出比例 = 首购 + 复购金额为0总拨出比例 = 0否则总拨出比例 = 100 * 首购 + 复购拨出金额 / 首购 + 复购金额 --> <!-- 总拨出比例 = 首购 + 复购金额为0总拨出比例 = 0否则总拨出比例 = 100 * 首购 + 复购拨出金额 / 首购 + 复购金额 -->
CASE CASE
@ -56,7 +56,7 @@
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0 + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND (#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS ELSE ROUND (#{perCent} * (cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT / (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS totalBonusRate end AS totalBonusRate
@ -124,7 +124,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_VERTEX_STATIS cbs FROM CU_BONUS_VERTEX_STATIS cbs
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0 LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
WHERE 1 = 1 WHERE 1 = 1
@ -144,8 +146,7 @@
) cbs ) cbs
</select> </select>
<!-- 查询顶点拓展封顶人数-->
<!-- 查询顶点拓展封顶人数-->
<select id="queryOrgTopNumber" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO" <select id="queryOrgTopNumber" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO">
SELECT COUNT(cb.pk_id) orgTopNumber, SELECT COUNT(cb.pk_id) orgTopNumber,
@ -229,6 +230,8 @@
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum, sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum,
sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum, sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum,
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum, sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum,
sum (cbs.global_points_bonus) globalPointsBonusSum,
sum (cbs.store_income_bonus) storeIncomeBonusSum,
sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT) sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
AS firstPurchaseAllSum, AS firstPurchaseAllSum,
sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
@ -247,28 +250,28 @@
ELSE ROUND(#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS) ELSE ROUND(#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS)
/ #{rate} / sum(cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4) / #{rate} / sum(cbs.MAIN_REG_PV + cbs.MAIN_UP_PV + cbs.SPECIAL_REGISTER_PV + cbs.SPECIAL_UPGRADE_PV + cbs.FICTITIOUS_PV), 4)
end AS mainBonusPvRateSum, end AS mainBonusPvRateSum,
sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) AS repurBonusSum, sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus) AS repurBonusSum,
case case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRateSum, end AS repurBonusRateSum,
case case
WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV +cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRateSum, end AS repurBonusPvRateSum,
sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS totalBonusSum, AS totalBonusSum,
CASE CASE
WHEN sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT WHEN sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0 + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT +cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND (#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS ELSE ROUND (#{perCent} * sum(cbs.INTRODUCE_BONUS + cbs.ORG_BONUS + cbs.LEADER_BONUS + cbs.SERVICE_BONUS
+ cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) + cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT / sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) + cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS totalBonusRateSum end AS totalBonusRateSum
@ -336,7 +339,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_VERTEX_STATIS cbs FROM CU_BONUS_VERTEX_STATIS cbs
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0 LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
WHERE 1 = 1 WHERE 1 = 1
@ -370,6 +375,8 @@
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonus, sum (cbs.REPUR_RANGE_BONUS) repurRangeBonus,
sum (cbs.REPUR_ORG_BONUS) repurOrgBonus, sum (cbs.REPUR_ORG_BONUS) repurOrgBonus,
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonus, sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonus,
sum (cbs.global_points_bonus) globalPointsBonus,
sum (cbs.store_income_bonus) storeIncomeBonus,
<!-- 首购相关 --> <!-- 首购相关 -->
sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT) sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
AS firstPurchaseAll, AS firstPurchaseAll,
@ -390,18 +397,18 @@
<!-- 复购相关 --> <!-- 复购相关 -->
sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
AS repurchaseAllAmount, AS repurchaseAllAmount,
sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS repurBonus, AS repurBonus,
case case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRate, end AS repurBonusRate,
case case
WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRate end AS repurBonusPvRate
FROM FROM
@ -467,7 +474,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_VERTEX_STATIS cbs FROM CU_BONUS_VERTEX_STATIS cbs
WHERE 1 = 1 WHERE 1 = 1
<if test="pkCountry != null"> <if test="pkCountry != null">
@ -490,7 +499,7 @@
ORDER BY firstPurchaseAll desc, repurchaseAllAmount desc ORDER BY firstPurchaseAll desc, repurchaseAllAmount desc
</select> </select>
<!-- 顶点奖金拨比汇总查询总和--> <!-- 顶点奖金拨比汇总查询总和-->
<select id="queryCuBonusStatisSum" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO" <select id="queryCuBonusStatisSum" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO">
SELECT SELECT
@ -501,6 +510,8 @@
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonus, sum (cbs.REPUR_RANGE_BONUS) repurRangeBonus,
sum (cbs.REPUR_ORG_BONUS) repurOrgBonus, sum (cbs.REPUR_ORG_BONUS) repurOrgBonus,
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonus, sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonus,
sum (cbs.global_points_bonus) globalPointsBonusSum,
sum (cbs.store_income_bonus) storeIncomeBonusSum,
<!-- 首购相关 --> <!-- 首购相关 -->
sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT) sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
AS firstPurchaseAll, AS firstPurchaseAll,
@ -521,18 +532,18 @@
<!-- 复购相关 --> <!-- 复购相关 -->
sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
AS repurchaseAllAmount, AS repurchaseAllAmount,
sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
AS repurBonus, AS repurBonus,
case case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0 WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurBonusRate, end AS repurBonusRate,
case case
WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0 WHEN sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV) = 0
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS + cbs.global_points_bonus + cbs.store_income_bonus)
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4) / #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
end AS repurBonusPvRate, end AS repurBonusPvRate,
<!-- 首购奖金占比 --> <!-- 首购奖金占比 -->
@ -578,7 +589,19 @@
THEN 0 THEN 0
ELSE ROUND(#{perCent} * sum(cbs.REPUR_LEADER_BONUS) ELSE ROUND(#{perCent} * sum(cbs.REPUR_LEADER_BONUS)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4) / sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS repurLeaderBonusRate end AS repurLeaderBonusRate,
case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0
ELSE ROUND(#{perCent} * sum(cbs.global_points_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS globalPointsBonusRate,
case
WHEN sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER) = 0
THEN 0
ELSE ROUND(#{perCent} * sum(cbs.store_income_bonus)
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
end AS storeIncomeBonusRate
FROM ( FROM (
SELECT SELECT
cbs.PK_BD_VERTEX , cbs.PK_BD_VERTEX ,
@ -643,7 +666,9 @@
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) * cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
leader_bonus leader_bonus
end repur_leader_bonus, end repur_leader_bonus,
cbs.repur_push_income cbs.repur_push_income,
cbs.global_points_bonus,
cbs.store_income_bonus
FROM CU_BONUS_VERTEX_STATIS cbs FROM CU_BONUS_VERTEX_STATIS cbs
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0 LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
WHERE 1 = 1 WHERE 1 = 1
@ -663,16 +688,17 @@
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0 LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0
</select> </select>
<!-- 查询时间内奖金拨比顶点会员--> <!-- 查询时间内奖金拨比顶点会员-->
<select id="queryCuBonusVertex" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO" <select id="queryCuBonusVertex" parameterType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStaticTotalVO">
select cbs.PK_BD_VERTEX pkVertex select cbs.PK_BD_VERTEX pkVertex
from CU_BONUS_VERTEX_STATIS cbs where 1=1 from CU_BONUS_VERTEX_STATIS cbs
where 1=1
<if test="pkCountry != null"> <if test="pkCountry != null">
and cbs.PK_COUNTRY=#{pkCountry} and cbs.PK_COUNTRY = #{pkCountry}
</if> </if>
<if test="pkVertex != null"> <if test="pkVertex != null">
and cbs.PK_BD_VERTEX=#{pkVertex} and cbs.PK_BD_VERTEX = #{pkVertex}
</if> </if>
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and cbs.CREATION_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and cbs.CREATION_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
@ -683,7 +709,7 @@
GROUP BY cbs.PK_BD_VERTEX GROUP BY cbs.PK_BD_VERTEX
</select> </select>
<!-- 查询小于当天全部已支付或撤单订单信息--> <!-- 查询小于当天全部已支付或撤单订单信息-->
<select id="querySaOrderByLessDay" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO" <select id="querySaOrderByLessDay" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
select * from ( select * from (
@ -748,7 +774,7 @@
connect by pk_place_parent = prior pk_member connect by pk_place_parent = prior pk_member
) cm ) cm
INNER JOIN SA_ORDER so on so.pk_member = cm.pk_member INNER JOIN SA_ORDER so on so.pk_member = cm.pk_member
where so.ORDER_TYPE in (1, 2, 3, 13, 20, 24, 25, 26) where so.ORDER_TYPE in (1, 2, 3, 20, 24, 25, 26)
<if test="pkCountry != null"> <if test="pkCountry != null">
and so.pk_country = #{pkCountry} and so.pk_country = #{pkCountry}
</if> </if>
@ -788,33 +814,6 @@
</if> </if>
</delete> </delete>
<!-- 查询奖金扣项配置参数-->
<select id="bonusDeductlist" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
select a.PK_ID,
b.PK_ID as pkId,
(a.BACK_RATIO+a.PLATFORM_RATIO)/100 backRatio
from BD_BONUS_ITEMS b
left JOIN BD_BONUS_DEDUCT a on a.PK_BONUS_ITEMS=b.PK_ID
where
b.DEL_FLAG =0
and a.BACK_RATIO>0
and a.PLATFORM_RATIO>0
<if test="pkCountry != null ">
AND b.PK_COUNTRY = #{pkCountry}
</if>
ORDER BY a.BACK_RATIO,a.PLATFORM_RATIO DESC
</select>
<!-- 查询生效国外国家-->
<select id="countrylist" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
select pk_id as pkCountry
from BD_COUNTRY
where pk_id!=1 and del_flag = 0 and EFFECTIVE_DATE &lt;= sysdate
</select>
<!-- 查询有效顶点 --> <!-- 查询有效顶点 -->
<select id="vertexList" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO" <select id="vertexList" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
@ -836,140 +835,6 @@
ORDER BY m.pk_id ASC ORDER BY m.pk_id ASC
</select> </select>
<!-- 查询中国奖金-->
<select id="queryChinaCountryBonus" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
select
#{pkCountry} pkCountry,sum(mbp.REAL_INCOME) realIncome,
mbp.PK_COUNTRY con,
bbi.BONUS_VALUE bonusType,
#{pkVertex} pkVertex,
to_date(to_char(so.PAY_TIME, 'yyyy-mm-dd'),'yyyy-mm-dd') AS creationTime
from cu_member_bonus_push mbp
INNER JOIN CU_MEMBER_BONUS cmb on mbp.PK_BONUS=cmb.pk_id
INNER join ( SELECT cm.pk_id FROM cu_member cm WHERE del_flag = 0 AND category = 0 START WITH pk_place_parent
=#{pkVertex} CONNECT BY pk_place_parent = PRIOR pk_id ) cm
on cm.pk_id = cmb.pk_member
inner join BD_BONUS_ITEMS bbi on bbi.pk_id=mbp.PK_BONUS_ITEMS
INNER JOIN sa_order so on so.pk_id=mbp.pk_order and so.PK_COUNTRY=#{pkCountry} and so.del_flag=0
where mbp.DEL_FLAG=0
and mbp.INCOME_STATUS=0
and bbi.BONUS_VALUE in (3,4,5,7,8,9,12,24,20,21,14,15,16,1)
<if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if>
<if test="endDate!=null and endDate!='' ">
and so.PAY_TIME &lt;= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
</if>
GROUP BY mbp.PK_COUNTRY,
bbi.BONUS_VALUE,
to_char(so.PAY_TIME, 'yyyy-mm-dd')
UNION ALL
select
#{pkCountry} pkCountry,sum(mbe.REAL_INCOME) realIncome,
mbe.PK_COUNTRY con,
bbi.BONUS_VALUE bonusType,
#{pkVertex} pkVertex,
to_date(to_char(so.PAY_TIME, 'yyyy-mm-dd'),'yyyy-mm-dd') AS creationTime
from CU_MEMBER_BONUS_EXPAND mbe
INNER JOIN CU_MEMBER_BONUS cmb on mbe.PK_BONUS=cmb.pk_id
INNER join ( SELECT cm.pk_id FROM cu_member cm WHERE del_flag = 0 AND category = 0 START WITH pk_place_parent
=#{pkVertex} CONNECT BY pk_place_parent = PRIOR pk_id ) cm
on cm.pk_id = cmb.pk_member
inner join BD_BONUS_ITEMS bbi on bbi.pk_id=mbe.PK_BONUS_ITEMS
INNER JOIN sa_order so on so.pk_id=mbe.pk_order and so.PK_COUNTRY=#{pkCountry} and so.del_flag=0
where mbe.DEL_FLAG=0
and mbe.INCOME_STATUS=0
and bbi.BONUS_VALUE in (3,4,5,7,8,9,12,24,20,21,14,15,16,1)
<if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if>
<if test="endDate!=null and endDate!='' ">
and so.PAY_TIME &lt;= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
</if>
GROUP BY mbe.PK_COUNTRY,
bbi.BONUS_VALUE,
to_char(so.PAY_TIME, 'yyyy-mm-dd')
UNION ALL
select
#{pkCountry} pkCountry,sum(mbc.REAL_INCOME) realIncome,
mbc.PK_COUNTRY con,
bbi.BONUS_VALUE bonusType,
#{pkVertex} pkVertex,
to_date(to_char(so.PAY_TIME, 'yyyy-mm-dd'),'yyyy-mm-dd') AS creationTime
from CU_MEMBER_BONUS_COACH mbc
INNER JOIN CU_MEMBER_BONUS cmb on mbc.PK_BONUS=cmb.pk_id
INNER join ( SELECT cm.pk_id FROM cu_member cm WHERE del_flag = 0 AND category = 0 START WITH pk_place_parent
=#{pkVertex} CONNECT BY pk_place_parent = PRIOR pk_id ) cm
on cm.pk_id = cmb.pk_member
inner join BD_BONUS_ITEMS bbi on bbi.pk_id=mbc.PK_BONUS_ITEMS
INNER JOIN sa_order so on so.pk_id=mbc.pk_order and so.PK_COUNTRY=#{pkCountry} and so.del_flag=0
where mbc.DEL_FLAG=0
and mbc.INCOME_STATUS=0
and bbi.BONUS_VALUE in (3,4,5,7,8,9,12,24,20,21,14,15,16,1)
<if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if>
<if test="endDate!=null and endDate!='' ">
and so.PAY_TIME &lt;= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
</if>
GROUP BY mbc.PK_COUNTRY,
bbi.BONUS_VALUE,
to_char(so.PAY_TIME, 'yyyy-mm-dd')
UNION ALL
select
#{pkCountry} pkCountry,sum(mbr.REAL_INCOME) realIncome,
mbr.PK_COUNTRY con,
bbi.BONUS_VALUE bonusType,
#{pkVertex} pkVertex,
to_date(to_char(so.PAY_TIME, 'yyyy-mm-dd'),'yyyy-mm-dd') AS creationTime
from cu_member_bonus_range mbr
INNER JOIN CU_MEMBER_BONUS cmb on mbr.PK_BONUS=cmb.pk_id
INNER join ( SELECT cm.pk_id FROM cu_member cm WHERE del_flag = 0 AND category = 0 START WITH pk_place_parent
=#{pkVertex} CONNECT BY pk_place_parent = PRIOR pk_id ) cm
on cm.pk_id = cmb.pk_member
inner join BD_BONUS_ITEMS bbi on bbi.pk_id=mbr.PK_BONUS_ITEMS
INNER JOIN sa_order so on so.pk_id=mbr.pk_order and so.PK_COUNTRY=#{pkCountry} and so.del_flag=0
where mbr.DEL_FLAG=0
and mbr.INCOME_STATUS=0
and bbi.BONUS_VALUE in (3,4,5,7,8,9,12,24,20,21,14,15,16,1)
<if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if>
<if test="endDate!=null and endDate!='' ">
and so.PAY_TIME &lt;= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
</if>
GROUP BY bbi.BONUS_VALUE,
mbr.PK_COUNTRY,
to_char(so.PAY_TIME, 'yyyy-mm-dd')
UNION ALL
select
#{pkCountry} pkCountry,sum(mbd.REAL_INCOME) realIncome,
mbd.PK_COUNTRY con,
bbi.BONUS_VALUE bonusType,
#{pkVertex} pkVertex,
to_date(to_char(so.PAY_TIME, 'yyyy-mm-dd'),'yyyy-mm-dd') AS creationTime
from cu_member_bonus_detail mbd
INNER JOIN CU_MEMBER_BONUS cmb on mbd.PK_BONUS=cmb.pk_id
INNER join ( SELECT cm.pk_id FROM cu_member cm WHERE del_flag = 0 AND category = 0 START WITH pk_place_parent
=#{pkVertex} CONNECT BY pk_place_parent = PRIOR pk_id ) cm
on cm.pk_id = cmb.pk_member
inner join BD_BONUS_ITEMS bbi on bbi.pk_id=mbd.PK_BONUS_ITEMS
INNER JOIN sa_order so on so.pk_id=mbd.pk_order and so.PK_COUNTRY=#{pkCountry} and so.del_flag=0
where mbd.DEL_FLAG=0
and mbd.INCOME_STATUS=0
and bbi.BONUS_VALUE in (3,4,5,7,8,9,12,24,20,21,14,15,16,1)
<if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if>
<if test="endDate!=null and endDate!='' ">
and so.PAY_TIME &lt;= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
</if>
GROUP BY bbi.BONUS_VALUE,
mbd.PK_COUNTRY,
to_char(so.PAY_TIME, 'yyyy-mm-dd')
</select>
<!-- 查询7天重算奖金查询--> <!-- 查询7天重算奖金查询-->
<select id="queryVertexChinaCountryBonus" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO" <select id="queryVertexChinaCountryBonus" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"> resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
@ -995,7 +860,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbp.DEL_FLAG = 0 where mbp.DEL_FLAG = 0
and mbp.INCOME_STATUS = 0 and mbp.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1028,7 +893,7 @@
where mbe.DEL_FLAG = 0 where mbe.DEL_FLAG = 0
and mbe.INCOME_STATUS in (0, 4) and mbe.INCOME_STATUS in (0, 4)
and mbe.pk_order != 0 and mbe.pk_order != 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1061,7 +926,7 @@
where mbc.DEL_FLAG = 0 where mbc.DEL_FLAG = 0
and mbc.INCOME_STATUS in (0, 4) and mbc.INCOME_STATUS in (0, 4)
and mbc.pk_order != 0 and mbc.pk_order != 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1093,7 +958,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbr.DEL_FLAG = 0 where mbr.DEL_FLAG = 0
and mbr.INCOME_STATUS = 0 and mbr.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>
@ -1125,7 +990,7 @@
and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0 and so.PK_COUNTRY = #{pkCountry} and so.del_flag = 0
where mbd.DEL_FLAG = 0 where mbd.DEL_FLAG = 0
and mbd.INCOME_STATUS = 0 and mbd.INCOME_STATUS = 0
and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25) and bbi.BONUS_VALUE in (1, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 20, 21, 24, 25, 26, 27)
<if test="startDate!=null and startDate!='' "> <if test="startDate!=null and startDate!='' ">
and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd') and so.PAY_TIME >= to_date(#{startDate}, 'yyyy-mm-dd')
</if> </if>

View File

@ -55,7 +55,6 @@ public class ApiOthSaOrderController extends ParentOrderController {
convertShoppingCarToSku(orderParam); convertShoppingCarToSku(orderParam);
if (EOrderType.UPGRADE_ORDER.getValue() == orderParam.getSpecialArea() if (EOrderType.UPGRADE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea() || EOrderType.REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.WELFARE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.SPECIAL_UPGRADE_ORDER.getValue() == orderParam.getSpecialArea() || EOrderType.SPECIAL_UPGRADE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.SPECIAL_REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()) { || EOrderType.SPECIAL_REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()) {
if (StringUtils.isEmpty(orderParam.getUpgradeMemberCode())) { if (StringUtils.isEmpty(orderParam.getUpgradeMemberCode())) {

View File

@ -632,8 +632,6 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
confirmPay = ESystemConfig.PICK_ORDER_CONFIRM_PAY.getValue(); confirmPay = ESystemConfig.PICK_ORDER_CONFIRM_PAY.getValue();
} else if (EOrderType.CONSUME_ORDER.getValue() == specialArea) { } else if (EOrderType.CONSUME_ORDER.getValue() == specialArea) {
confirmPay = querySystemConfigByKey(pkCountry, ESystemConfig.CONSUME_ORDER_CONFIRM_PAY.getKey()); confirmPay = querySystemConfigByKey(pkCountry, ESystemConfig.CONSUME_ORDER_CONFIRM_PAY.getKey());
} else if (EOrderType.WELFARE_ORDER.getValue() == specialArea) {
confirmPay = querySystemConfigByKey(pkCountry, ESystemConfig.WELFARE_ORDER_CONFIRM_PAY.getKey());
} else { } else {
confirmPay = querySystemConfigByKey(pkCountry, ESystemConfig.REPURCHASE_ORDER_CONFIRM_PAY.getKey()); confirmPay = querySystemConfigByKey(pkCountry, ESystemConfig.REPURCHASE_ORDER_CONFIRM_PAY.getKey());
} }
@ -661,8 +659,6 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
timeType = querySystemConfigByKey(pkCountry, ESystemConfig.PICK_ORDER_TIME.getKey()); timeType = querySystemConfigByKey(pkCountry, ESystemConfig.PICK_ORDER_TIME.getKey());
} else if (EOrderType.CONSUME_ORDER.getValue() == specialArea) { } else if (EOrderType.CONSUME_ORDER.getValue() == specialArea) {
timeType = querySystemConfigByKey(pkCountry, ESystemConfig.CONSUME_ORDER_TIME.getKey()); timeType = querySystemConfigByKey(pkCountry, ESystemConfig.CONSUME_ORDER_TIME.getKey());
} else if (EOrderType.WELFARE_ORDER.getValue() == specialArea) {
timeType = querySystemConfigByKey(pkCountry, ESystemConfig.WELFARE_ORDER_TIME.getKey());
} else { } else {
timeType = querySystemConfigByKey(pkCountry, ESystemConfig.REGISTER_ORDER_TIME.getKey()); timeType = querySystemConfigByKey(pkCountry, ESystemConfig.REGISTER_ORDER_TIME.getKey());
} }
@ -894,7 +890,6 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
CuMember cuMember; CuMember cuMember;
if (EOrderType.UPGRADE_ORDER.getValue() == orderParam.getSpecialArea() if (EOrderType.UPGRADE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea() || EOrderType.REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.WELFARE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.SPECIAL_UPGRADE_ORDER.getValue() == orderParam.getSpecialArea() || EOrderType.SPECIAL_UPGRADE_ORDER.getValue() == orderParam.getSpecialArea()
|| EOrderType.SPECIAL_REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()) { || EOrderType.SPECIAL_REPURCHASE_ORDER.getValue() == orderParam.getSpecialArea()) {
cuMember = getCuMemberByCode(orderParam.getUpgradeMemberCode()); cuMember = getCuMemberByCode(orderParam.getUpgradeMemberCode());
@ -2015,9 +2010,6 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
} else if (ESystemConfig.getPayMentTimeList().get(i).getKey().equals(ESystemConfig.PICK_ORDER_TIME.getKey())) { } else if (ESystemConfig.getPayMentTimeList().get(i).getKey().equals(ESystemConfig.PICK_ORDER_TIME.getKey())) {
// 提货专区 // 提货专区
orderType = EOrderType.PICK_ORDER.getValue(); orderType = EOrderType.PICK_ORDER.getValue();
} else if (ESystemConfig.getPayMentTimeList().get(i).getKey().equals(ESystemConfig.WELFARE_ORDER_TIME.getKey())) {
// 福利订单
orderType = EOrderType.WELFARE_ORDER.getValue();
} }
ESpecialAreaTime specialAreaTime = ESpecialAreaTime.getSpecialAreaTime(date); ESpecialAreaTime specialAreaTime = ESpecialAreaTime.getSpecialAreaTime(date);
if (orderType != null && specialAreaTime != null) { if (orderType != null && specialAreaTime != null) {

View File

@ -39,11 +39,6 @@ public enum EOrderType {
*/ */
CONSUME_ORDER(10, "重消订单", 0, EnumsPrefixConstants.ORDER_TYPE + 10), CONSUME_ORDER(10, "重消订单", 0, EnumsPrefixConstants.ORDER_TYPE + 10),
/**
* 福利订单-福利专区 bv
*/
WELFARE_ORDER(13, "福利订单", 0, EnumsPrefixConstants.ORDER_TYPE + 13),
/** /**
* 虚拟订单空单使用 * 虚拟订单空单使用
*/ */

View File

@ -36,11 +36,6 @@ public enum ESpecialArea {
*/ */
RESCISSION_AREA(10, "重消专区", 0, EnumsPrefixConstants.SPECIAL_AREA + "10", 8, EMenuDetail.REPEATED_CONSUMPTION.getValue()), RESCISSION_AREA(10, "重消专区", 0, EnumsPrefixConstants.SPECIAL_AREA + "10", 8, EMenuDetail.REPEATED_CONSUMPTION.getValue()),
/**
* 福利专区
*/
WELFARE_AREA(13, "福利专区", 0, EnumsPrefixConstants.SPECIAL_AREA + 13, 9, EMenuDetail.WELFARE_AREA.getValue()),
/** /**
* 注册专区 * 注册专区
*/ */

View File

@ -102,8 +102,6 @@ public enum ESystemConfig {
CONSUME_ORDER_TIME("0", "重消专区时间", 0, "PAYMENT_10"), CONSUME_ORDER_TIME("0", "重消专区时间", 0, "PAYMENT_10"),
PICK_ORDER_CONFIRM_PAY("1", "提货专区", 0, "PAYMENT_13"), PICK_ORDER_CONFIRM_PAY("1", "提货专区", 0, "PAYMENT_13"),
PICK_ORDER_TIME("0", "提货专区时间", 0, "PAYMENT_14"), PICK_ORDER_TIME("0", "提货专区时间", 0, "PAYMENT_14"),
WELFARE_ORDER_CONFIRM_PAY("0", "福利专区", 0, "PAYMENT_17"),
WELFARE_ORDER_TIME("0", "福利专区时间", 0, "PAYMENT_18"),
/** /**
* 直推方式 1=三单循环 2=四单循环 * 直推方式 1=三单循环 2=四单循环
@ -154,7 +152,6 @@ public enum ESystemConfig {
list.add(REPURCHASE_ORDER_TIME); list.add(REPURCHASE_ORDER_TIME);
list.add(CONSUME_ORDER_TIME); list.add(CONSUME_ORDER_TIME);
list.add(PICK_ORDER_TIME); list.add(PICK_ORDER_TIME);
list.add(WELFARE_ORDER_TIME);
return list; return list;
} }
} }

View File

@ -468,5 +468,17 @@ public class CuBonusStatis extends BaseEntity {
@TableField("CAL_REP_ACHIEVE") @TableField("CAL_REP_ACHIEVE")
private BigDecimal calRepAchieve; private BigDecimal calRepAchieve;
/**
* 复购见点收益
*/
@TableField("GLOBAL_POINTS_BONUS")
private BigDecimal globalPointsBonus;
/**
* 复购区域收益
*/
@TableField("STORE_INCOME_BONUS")
private BigDecimal storeIncomeBonus;
} }

View File

@ -388,4 +388,16 @@ public class CuBonusVertexStatis extends BaseEntity {
@TableField("CAL_REP_ACHIEVE") @TableField("CAL_REP_ACHIEVE")
private BigDecimal calRepAchieve; private BigDecimal calRepAchieve;
/**
* 复购见点收益
*/
@TableField("GLOBAL_POINTS_BONUS")
private BigDecimal globalPointsBonus;
/**
* 复购区域收益
*/
@TableField("STORE_INCOME_BONUS")
private BigDecimal storeIncomeBonus;
} }