forked from angelo/java-retail-app
Compare commits
3 Commits
3d10722857
...
cfa49da17c
| Author | SHA1 | Date |
|---|---|---|
|
|
cfa49da17c | |
|
|
0bf3304399 | |
|
|
215cdd89aa |
|
|
@ -323,13 +323,21 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
|
|||
// 直推级差收益
|
||||
BigDecimal rangeBonusIncome = BigDecimal.ZERO;
|
||||
|
||||
if (EGrade.HAI_FAN.getValue() == targetGradeValue) {
|
||||
if (EGrade.HAI_FAN.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 会员
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_HAI_FAN).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.YOU_KE.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.YOU_KE.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 VIP
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_YOU_KE).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.MAKER.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.MAKER.getValue() == targetGradeValue && targetGradeValue >= beforeGradeValue) {
|
||||
// 推荐人是 合伙人
|
||||
if (v3Count == 1) {
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_MAKER_1).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
|
|
@ -339,26 +347,46 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
|
|||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_MAKER_3).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
v3Count++;
|
||||
} else if (EGrade.VIP.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.VIP.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 博羚店主
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_VIP).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.S_VIP.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.S_VIP.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 高级店主
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_S_VIP).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.REGION.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.REGION.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 区域代理
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_REGION).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.DIRECTOR.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.DIRECTOR.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 董事代理
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_DIRECTOR).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
} else if (EGrade.COMPANY.getValue() == targetGradeValue) {
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
} else if (EGrade.COMPANY.getValue() == targetGradeValue && targetGradeValue > beforeGradeValue) {
|
||||
// 推荐人是 总公司
|
||||
rangeBonusIncome = orderAmount.multiply(RetailConstants.RECOMMEND_COMPANY).subtract(totalBonus).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
}
|
||||
// 已经算完级差等级的累计奖金
|
||||
totalBonus = totalBonus.add(rangeBonusIncome);
|
||||
// 前一级会员等级
|
||||
beforeGradeValue = targetGradeValue;
|
||||
|
||||
if (rangeBonusIncome.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 处理直推级差收益
|
||||
|
|
@ -524,7 +552,7 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
|
|||
|
||||
// 2025.08.13 添加 代理 级差收益,每1盒(4个产品)区域代理4元,董事代理4元,公司6元,总拨出14元
|
||||
if ((EGrade.REGION.getValue() == targetMemberRangeExt.getGradeValue()
|
||||
&& EGrade.DIRECTOR.getValue() == targetMemberRangeExt.getGradeValue())
|
||||
|| EGrade.DIRECTOR.getValue() == targetMemberRangeExt.getGradeValue())
|
||||
&& branch < 2) {
|
||||
// 等级是分公司 并且 发放次数小于2
|
||||
this.calculateRetailRepurCompanyRangeBonus(sourceMemberRangeExt, targetMemberRangeExt, cuMemberBonusMap, bonusConfigDTO,
|
||||
|
|
@ -617,6 +645,10 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
|
|||
CuMemberRetailRangeExt targetMemberRangeExt = memberRangeExtMap.get(retailRegion.getPkMember());
|
||||
if (ObjectUtil.isEmpty(targetMemberRangeExt)) {
|
||||
targetMemberRangeExt = cuMemberRetailRangeMapper.queryCuMemberRetailRangeByMemberId(rangeTableName, retailRegion.getPkMember());
|
||||
if (null == targetMemberRangeExt) {
|
||||
// 配送区域对应的会员不存在了,直接跳过
|
||||
return memberBonusDetailList;
|
||||
}
|
||||
memberRangeExtMap.put(retailRegion.getPkMember(), targetMemberRangeExt);
|
||||
}
|
||||
// 复购配送区域收益
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ public class ApiOrderController extends BaseController {
|
|||
private ISaDeliverService iSaDeliverService;
|
||||
@Autowired
|
||||
private IOrderBusinessService iOrderBusinessService;
|
||||
@Autowired
|
||||
private ISaDeliverItemsService saDeliverItemsService;
|
||||
|
||||
@DubboReference
|
||||
ICurrencyServiceApi iCurrencyServiceApi;
|
||||
|
|
@ -537,8 +535,6 @@ public class ApiOrderController extends BaseController {
|
|||
if (null != param.getCreationTimeEnd()) {
|
||||
param.setCreationTimeEnd(DateUtils.getEndTime(param.getCreationTimeEnd()));
|
||||
}
|
||||
// 会员ID
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
// 返回的订单数据
|
||||
List<MyOrderVO> myOrderList = new ArrayList<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@
|
|||
<choose>
|
||||
<when test="param.orderStatus == 1">
|
||||
<!-- 前台如果查询待发货,需要包括已合单 -->
|
||||
and soi.order_status in (1, 2)
|
||||
and soi.order_status in (1, 2, 6)
|
||||
</when>
|
||||
<otherwise>
|
||||
and soi.order_status = #{param.orderStatus}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class RetailConstants {
|
|||
public static final BigDecimal RECOMMEND_MAKER_2 = new BigDecimal("0.3");
|
||||
public static final BigDecimal RECOMMEND_MAKER_3 = new BigDecimal("0.325");
|
||||
public static final BigDecimal RECOMMEND_VIP = new BigDecimal("0.5");
|
||||
public static final BigDecimal RECOMMEND_S_VIP = new BigDecimal("0.5");
|
||||
public static final BigDecimal RECOMMEND_S_VIP = new BigDecimal("0.52");
|
||||
public static final BigDecimal RECOMMEND_REGION = new BigDecimal("0.55");
|
||||
public static final BigDecimal RECOMMEND_DIRECTOR = new BigDecimal("0.55");
|
||||
public static final BigDecimal RECOMMEND_COMPANY = new BigDecimal("0.6");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class BonusMsgConstants {
|
|||
/**
|
||||
* 直推级差收益说明
|
||||
*/
|
||||
public static String RANGE = "订单编号%s,%s为%s贡献了直推级差收益,计算金额%f,前一级差等级名称%s,当前级差等级名称%s。";
|
||||
public static String RANGE = "订单编号%s,%s为%s贡献了直推级差收益,计算金额%f,来源等级名称%s,当前级差等级名称%s。";
|
||||
|
||||
/**
|
||||
* 复购级差收益说明
|
||||
|
|
|
|||
Loading…
Reference in New Issue