member: 佣金不冻结时,直接就是结算状态

This commit is contained in:
owen 2023-09-05 09:27:12 +08:00
parent c7ef8519c8
commit 090058a2ba

View File

@ -30,6 +30,10 @@ public interface MemberBrokerageRecordConvert {
PageResult<MemberBrokerageRecordRespVO> convertPage(PageResult<MemberBrokerageRecordDO> page);
default MemberBrokerageRecordDO convert(MemberUserDO user, String bizId, int brokerageFrozenDays, int brokerage, LocalDateTime unfreezeTime) {
// 不冻结时佣金直接就是结算状态
Integer status = brokerageFrozenDays > 0
? BrokerageRecordStatusEnum.WAIT_SETTLEMENT.getStatus()
: BrokerageRecordStatusEnum.SETTLEMENT.getStatus();
return new MemberBrokerageRecordDO()
.setUserId(user.getId())
.setBizType(BrokerageRecordBizTypeEnum.ORDER.getType())
@ -38,7 +42,7 @@ public interface MemberBrokerageRecordConvert {
.setTotalPrice(user.getBrokeragePrice())
.setTitle(BrokerageRecordBizTypeEnum.ORDER.getTitle())
.setDescription(StrUtil.format(BrokerageRecordBizTypeEnum.ORDER.getDescription(), String.valueOf(brokerage / 100.0)))
.setStatus(BrokerageRecordStatusEnum.WAIT_SETTLEMENT.getStatus())
.setStatus(status)
.setFrozenDays(brokerageFrozenDays)
.setUnfreezeTime(unfreezeTime);
}