## 迁移会员三单补单业绩为0的,第三单也按0进行处理;
This commit is contained in:
parent
5d33769e3e
commit
2c6db5649d
|
@ -324,16 +324,40 @@ public class BonusSettleFirstPurchaseHandle extends BonusSettleHandle {
|
|||
cuMemberBonusPush.setCalAchieve(orderAchieve);
|
||||
cuMemberBonusPush.setPretaxIncome(ComputeUtil.computeBonusMultiply(orderAchieve, cuMemberBonusPush.getCalValue()));
|
||||
}
|
||||
|
||||
// 判断是否最后一次
|
||||
boolean roundEnd = Objects.equals(ERecommendType.THREE_LOOP.getValue(), recommendType) && targetMemberSettleExt.getSecond() == 3;
|
||||
if (!roundEnd) {
|
||||
roundEnd = Objects.equals(ERecommendType.FOUR_LOOP.getValue(), recommendType) && targetMemberSettleExt.getSecond() == 4;
|
||||
}
|
||||
// 记录最小值,前面的值 > 后面的值
|
||||
if (ComputeUtil.compareValue(targetMemberSettleExt.getMinAchieve(), cuMemberBonusPush.getCalAchieve()) ||
|
||||
ComputeUtil.compareEqual(targetMemberSettleExt.getMinAchieve(), BigDecimal.ZERO)) {
|
||||
targetMemberSettleExt.setMinAchieve(cuMemberBonusPush.getCalAchieve());
|
||||
|
||||
// TODO 第1次为0,从第2次开始,第3单按0为最小单计算
|
||||
// TODO 第1、2次为0,从第3次开始,第3单按0为最小单计算
|
||||
if ((targetMemberSettleExt.getSecond() == 2 || targetMemberSettleExt.getSecond() == 3)
|
||||
&& ComputeUtil.compareEqual(targetMemberSettleExt.getMinAchieve(), BigDecimal.ZERO)) {
|
||||
// 当前第 2、3 次,并且最小业绩为0,不进行任何处理
|
||||
} else {
|
||||
// 记录最小值,前面的值 > 后面的值
|
||||
// 订单业绩 小于 最小业绩,并且最小业绩为0,则订单业绩为最小业绩
|
||||
if (ComputeUtil.compareValue(targetMemberSettleExt.getMinAchieve(), cuMemberBonusPush.getCalAchieve())
|
||||
|| ComputeUtil.compareEqual(targetMemberSettleExt.getMinAchieve(), BigDecimal.ZERO)
|
||||
) {
|
||||
targetMemberSettleExt.setMinAchieve(cuMemberBonusPush.getCalAchieve());
|
||||
}
|
||||
}
|
||||
|
||||
// // TODO 第1次为0,从第2次开始,第3单按非0为最小单计算
|
||||
// // TODO 第1、2次为0,从第3次开始,第3单按非0为最小单计算
|
||||
// // 记录最小值,前面的值 > 后面的值
|
||||
// // 订单业绩 小于 最小业绩,并且最小业绩为0,则订单业绩为最小业绩
|
||||
// if (ComputeUtil.compareValue(targetMemberSettleExt.getMinAchieve(), cuMemberBonusPush.getCalAchieve())
|
||||
// || ComputeUtil.compareEqual(targetMemberSettleExt.getMinAchieve(), BigDecimal.ZERO)
|
||||
// ) {
|
||||
// targetMemberSettleExt.setMinAchieve(cuMemberBonusPush.getCalAchieve());
|
||||
// }
|
||||
|
||||
if (roundEnd) {
|
||||
// 是最后一次,直接用最小业绩处理
|
||||
cuMemberBonusPush.setCalAchieve(targetMemberSettleExt.getMinAchieve());
|
||||
cuMemberBonusPush.setPretaxIncome(ComputeUtil.computeBonusMultiply(targetMemberSettleExt.getMinAchieve(), cuMemberBonusPush.getCalValue()));
|
||||
reductionMemberSettle(targetMemberSettleExt);
|
||||
|
|
|
@ -1016,7 +1016,7 @@ public class BonusSettlePurchaseHandle extends BonusSettleHandle {
|
|||
BigDecimal maxIncome = ComputeUtil.computeBonusMultiply(cuMemberBonusExpand.getCalAchieve(), gradeExpandRatio);
|
||||
// actualIncome = 业绩 * 等级扩展比例
|
||||
BigDecimal actualIncome = ComputeUtil.computeBonusMultiply(cuMemberBonusExpand.getCalAchieve(), countryExpandRatio);
|
||||
log.info("复购. maxIncome: {}, gradeExpandRatio: {}; actualIncome: {}, countryExpandRatio: {}", maxIncome, gradeExpandRatio, actualIncome, countryExpandRatio);
|
||||
// log.info("复购. maxIncome: {}, gradeExpandRatio: {}; actualIncome: {}, countryExpandRatio: {}", maxIncome, gradeExpandRatio, actualIncome, countryExpandRatio);
|
||||
|
||||
// 获取等级对应的封顶值(累计复购扩展 + 当前等级对应订单的最大收益)
|
||||
BigDecimal expandIncome = ComputeUtil.computeAdd(ComputeUtil.computeAdd(cuMemberBonus.getRepurExpandIncome(), actualIncome), weekRepExpandIncome);
|
||||
|
|
|
@ -683,26 +683,12 @@
|
|||
from sa_order_items soi
|
||||
where soi.pk_order = so.pk_id
|
||||
and soi.del_flag = 0
|
||||
and soi.pk_product != 0
|
||||
and soi.order_status in
|
||||
<foreach collection="statusList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
union all
|
||||
select count(sto.pk_id) pk_id
|
||||
from sa_t_order sto
|
||||
where sto.del_flag = 0
|
||||
and sto.pk_country = #{pkCountry}
|
||||
and (sto.pk_member = #{memberId} or sto.pk_creator = #{memberId})
|
||||
and exists (select 1
|
||||
from sa_t_order_items stoi
|
||||
where stoi.pk_th_order = sto.pk_id
|
||||
and stoi.del_flag = 0
|
||||
and stoi.order_status in
|
||||
<foreach collection="statusList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue