## 二三阶段添加阶段顺序;

This commit is contained in:
cabbage 2025-10-23 14:58:36 +08:00
parent b14c0961bf
commit 4c549c7a4e
7 changed files with 67 additions and 19 deletions

View File

@ -55,7 +55,6 @@ public class CuMemberTreeServiceImpl extends ServiceImpl<CuMemberTreeMapper, CuM
}
// 创建结算明细表
String retailRangeTableDetailName = TableNameConstants.CU_MEMBER_RETAIL_RANGE_DETAIL + period;
;
number = baseMapper.queryExistOracleTable(retailRangeTableDetailName);
if (number == null || number <= 0) {
baseMapper.createCuMemberRetailDetail(retailRangeTableDetailName);

View File

@ -732,6 +732,7 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
CuMemberRetailDetail newRetailDetail = CuMemberRetailDetail.builder()
.pkMember(sourceMember.getPkMember())
.childNode(pointCount + i)
.stageSort(pointCount + i)
.pkParent(sourceMember.getPkParent())
.stage(EBonusStage.ONE.getValue())
.stageStatus(EBonusStageStatus.NO.getValue())
@ -763,6 +764,7 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
CuMemberRetailDetail newRetailDetail = CuMemberRetailDetail.builder()
.pkMember(sourceMember.getPkMember())
.childNode(pointCount + i)
.stageSort(pointCount + i)
.pkParent(sourceMember.getPkParent())
.stage(EBonusStage.ONE.getValue())
.stageStatus(EBonusStageStatus.NO.getValue())
@ -983,12 +985,20 @@ public class BonusSettleRangeHandle extends BonusSettleHandle {
if (EBonusStage.ONE.getValue() == bonusStageData.getStage()) {
// 一阶段需要处理升阶段
CuMemberRetailDetail twoRetailDetail = bonusStageData.getTwoRetailDetail();
Integer pointCount2 = targetMember.getPointCount2() + 1;
targetMember.setPointCount2(pointCount2);
twoRetailDetail.setStageSort(pointCount2);
targetMember.getTwoDetailMap().put(twoRetailDetail.getChildNode(), twoRetailDetail);
returnRetailDetailList.add(twoRetailDetail);
} else if (EBonusStage.TWO.getValue() == bonusStageData.getStage()) {
// 二阶段需要处理升阶段
CuMemberRetailDetail threeRetailDetail = bonusStageData.getThreeRetailDetail();
Integer pointCount3 = targetMember.getPointCount3() + 1;
targetMember.setPointCount3(pointCount3);
threeRetailDetail.setStageSort(pointCount3);
targetMember.getThreeDetailMap().put(threeRetailDetail.getChildNode(), threeRetailDetail);
returnRetailDetailList.add(threeRetailDetail);
} else if (EBonusStage.THREE.getValue() == bonusStageData.getStage()) {
// 三阶段填充满判断是否需要赠送点位

View File

@ -10,13 +10,11 @@
<foreach collection="tmpIdList" item="items" open="(" close=")" separator=",">
#{items}
</foreach>
<if test="stage != null">
and cmrd.stage = #{stage}
</if>
and cmrd.stage = #{stage}
<if test="stageStatus != null">
and cmrd.stage_status = #{stageStatus}
</if>
order by cmrd.pk_member, cmrd.child_node, cmrd.stage
order by cmrd.pk_member, cmrd.stage_sort
</select>
</mapper>

View File

@ -51,6 +51,8 @@
<result column="rep_team_new_amount" property="repTeamNewAmount"/>
<result column="rep_team_new_pv" property="repTeamNewPv"/>
<result column="point_count" property="pointCount"/>
<result column="point_count_2" property="pointCount2"/>
<result column="point_count_3" property="pointCount3"/>
<result column="wait_point_count" property="waitPointCount"/>
<result column="rep_pv_balance" property="repPvBalance"/>
<result column="gift_point" property="giftPoint"/>
@ -92,6 +94,8 @@
rep_team_new_amount = 0,
rep_team_new_pv = 0,
point_count = 0,
point_count_2 = 0,
point_count_3 = 0,
wait_point_count = 0,
rep_pv_balance = 0,
gift_point = 0,
@ -107,7 +111,8 @@
team_consume_pv, team_month_pv,
team_consume_amount, team_month_amount,
recommend_num, team_num, big_team_pv, small_team_pv,
point_count, wait_point_count, rep_pv_balance,
point_count, point_count_2, point_count_3,
wait_point_count, rep_pv_balance,
gift_point, gift_pay_time
from ${yesterdayRangeTableName}
) b
@ -121,8 +126,8 @@
a.team_consume_amount = b.team_consume_amount,
a.recommend_num = b.recommend_num, a.team_num = b.team_num,
a.big_team_pv = b.big_team_pv, a.small_team_pv = b.small_team_pv,
a.point_count = b.point_count, a.wait_point_count = b.wait_point_count,
a.rep_pv_balance = b.rep_pv_balance,
a.point_count = b.point_count, a.point_count_2 = b.point_count_2, a.point_count_3 = b.point_count_3,
a.wait_point_count = b.wait_point_count, a.rep_pv_balance = b.rep_pv_balance,
a.gift_point = b.gift_point, a.gift_pay_time = b.gift_pay_time
<if test="isSameMonth == 0">
,a.month_consume_pv = b.month_consume_pv
@ -181,7 +186,8 @@
x.point_member_third,
x.third_bonus_1,
x.third_bonus_2,
x.third_bonus_3
x.third_bonus_3,
x.stage_sort
from ${yesterdayDetailTableName} x
left join cu_member cm
on cm.pk_id = x.pk_member
@ -233,7 +239,8 @@
point_member_third,
third_bonus_1,
third_bonus_2,
third_bonus_3)
third_bonus_3,
stage_sort)
values (b.pk_member,
b.child_node,
b.pk_parent,
@ -279,7 +286,8 @@
b.point_member_third,
b.third_bonus_1,
b.third_bonus_2,
b.third_bonus_3)
b.third_bonus_3,
b.stage_sort)
when matched then
update set
a.pk_parent = b.pk_parent,
@ -324,7 +332,8 @@
a.point_member_third = b.point_member_third,
a.third_bonus_1 = b.third_bonus_1,
a.third_bonus_2 = b.third_bonus_2,
a.third_bonus_3 = b.third_bonus_3
a.third_bonus_3 = b.third_bonus_3,
a.stage_sort = b.stage_sort
</update>
<!-- 更新会员日结数据 -->
@ -342,7 +351,8 @@
#{item.regTeamNewAmount} reg_team_new_amount, #{item.regTeamNewPv} reg_team_new_pv,
#{item.repConsumeNewAmount} rep_consume_new_amount, #{item.repConsumeNewPv} rep_consume_new_pv,
#{item.repTeamNewAmount} rep_team_new_amount, #{item.repTeamNewPv} rep_team_new_pv,
#{item.pointCount} point_count, #{item.waitPointCount} wait_point_count, #{item.repPvBalance} rep_pv_balance,
#{item.pointCount} point_count, #{item.pointCount2} point_count_2, #{item.pointCount3} point_count_3,
#{item.waitPointCount} wait_point_count, #{item.repPvBalance} rep_pv_balance,
#{item.giftPoint} gift_point, #{item.giftPayTime, jdbcType=TIMESTAMP} gift_pay_time
from dual
</foreach>
@ -359,7 +369,8 @@
a.reg_team_new_amount = b.reg_team_new_amount, a.reg_team_new_pv = b.reg_team_new_pv,
a.rep_consume_new_amount = b.rep_consume_new_amount, a.rep_consume_new_pv = b.rep_consume_new_pv,
a.rep_team_new_amount = b.rep_team_new_amount, a.rep_team_new_pv = b.rep_team_new_pv,
a.point_count = b.point_count, a.wait_point_count = b.wait_point_count, a.rep_pv_balance = b.rep_pv_balance,
a.point_count = b.point_count, a.point_count_2 = b.point_count_2, a.point_count_3 = b.point_count_3,
a.wait_point_count = b.wait_point_count, a.rep_pv_balance = b.rep_pv_balance,
a.gift_point = b.gift_point, a.gift_pay_time = b.gift_pay_time
</update>
@ -392,7 +403,8 @@
#{item.pointThird, jdbcType=NUMERIC} point_third, #{item.pointMemberThird, jdbcType=NUMERIC} point_member_third,
#{item.thirdBonus1, jdbcType=NUMERIC} third_bonus_1,
#{item.thirdBonus2, jdbcType=NUMERIC} third_bonus_2,
#{item.thirdBonus3, jdbcType=NUMERIC} third_bonus_3
#{item.thirdBonus3, jdbcType=NUMERIC} third_bonus_3,
#{item.stageSort, jdbcType=NUMERIC} stage_sort
from dual
</foreach>
) b
@ -441,7 +453,8 @@
b.point_first, b.point_member_first,
b.point_second, b.point_member_second,
b.point_third, b.point_member_third,
b.third_bonus_1, b.third_bonus_2, b.third_bonus_3)
b.third_bonus_1, b.third_bonus_2, b.third_bonus_3,
b.stage_sort)
when matched then
update set
a.stage_status = b.stage_status, a.stage_date = b.stage_date,
@ -464,7 +477,8 @@
a.point_first = b.point_first, a.point_member_first = b.point_member_first,
a.point_second = b.point_second, a.point_member_second = b.point_member_second,
a.point_third = b.point_third, a.point_member_third = b.point_member_third,
a.third_bonus_1 = b.third_bonus_1, a.third_bonus_2 = b.third_bonus_2, a.third_bonus_3 = b.third_bonus_3
a.third_bonus_1 = b.third_bonus_1, a.third_bonus_2 = b.third_bonus_2, a.third_bonus_3 = b.third_bonus_3,
a.stage_sort = b.stage_sort
</update>
<!-- 当前网体更新极差秒接表 -->
@ -676,6 +690,8 @@
rep_team_new_amount,
rep_team_new_pv,
point_count,
point_count_2,
point_count_3,
wait_point_count,
rep_pv_balance,
gift_point,
@ -735,6 +751,8 @@
rep_team_new_amount,
rep_team_new_pv,
point_count,
point_count_2,
point_count_3,
wait_point_count,
rep_pv_balance,
gift_point,
@ -923,6 +941,8 @@
rep_team_new_amount,
rep_team_new_pv,
point_count,
point_count_2,
point_count_3,
wait_point_count,
rep_pv_balance,
gift_point,

View File

@ -326,7 +326,8 @@
point_third NUMBER(8),
third_bonus_1 NUMBER(8) default 0 not null,
third_bonus_2 NUMBER(8) default 0 not null,
third_bonus_3 NUMBER(8) default 0 not null
third_bonus_3 NUMBER(8) default 0 not null,
stage_sort NUMBER(8) default 0
)
</update>
@ -546,6 +547,8 @@
rep_team_new_amount number(17,6) default 0 not null,
rep_team_new_pv number(17,6) default 0 not null,
point_count number(8) default 0 not null,
point_count_2 number(8) default 0 not null,
point_count_3 number(8) default 0 not null,
wait_point_count number(8) default 0 not null,
rep_pv_balance number(17,6) default 0 not null,
gift_point number(2) default 1 not null,

View File

@ -282,6 +282,12 @@ public class CuMemberRetailDetail {
@TableField("THIRD_BONUS_3")
private Integer thirdBonus3;
/**
* 阶段节点顺序
*/
@TableField("STAGE_SORT")
private Integer stageSort;
/**
* 更新标记不为null则需要入库
*/

View File

@ -192,7 +192,7 @@ public class CuMemberRetailRange extends BaseEntity {
/**
* 子点位总数
*/
@TableField("point_count")
@TableField("POINT_COUNT")
private Integer pointCount;
/**
* 待激活子点位数
@ -218,4 +218,16 @@ public class CuMemberRetailRange extends BaseEntity {
@TableField("GIFT_PAY_TIME")
private Date giftPayTime;
/**
* 二阶段子点位总数
*/
@TableField("POINT_COUNT_2")
private Integer pointCount2;
/**
* 三阶段子点位总数
*/
@TableField("POINT_COUNT_3")
private Integer pointCount3;
}