|
@@ -2,6 +2,7 @@ package cn.newfeifan.mall.module.distri.service.ptprofitlog;
|
|
|
|
|
|
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
import cn.newfeifan.mall.module.distri.enums.CaclEnum;
|
|
|
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -33,6 +34,8 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
|
|
|
|
|
|
@Resource
|
|
|
private PtProfitLogMapper ptProfitLogMapper;
|
|
|
+ @Resource
|
|
|
+ private MemberUserService memberUserService;
|
|
|
|
|
|
|
|
|
|
|
@@ -79,6 +82,13 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
|
|
|
PageResult<PtProfitLogRespVO> result = BeanUtils.toBean(ptProfitLogMapper.selectPage(pageReqVO), PtProfitLogRespVO.class);
|
|
|
for (PtProfitLogRespVO ptProfitLogRespVO : result.getList()) {
|
|
|
ptProfitLogRespVO.setProfitStatusName(Objects.requireNonNull(CaclEnum.getCaclEnumByValue(ptProfitLogRespVO.getProfitStatus())).getName());
|
|
|
+
|
|
|
+ if (ptProfitLogRespVO.getProfitStatus().equals(RECOMMENDED_PERSON_QUOTA.getType()) ||
|
|
|
+ ptProfitLogRespVO.getProfitStatus().equals(CaclEnum.ORDER_PAY_INTEGRAL_ANCESTER.getType()) ||
|
|
|
+ ptProfitLogRespVO.getProfitStatus().equals(CaclEnum.ORDER_REFUND_INTEGRAL_ANCESTER.getType()) ||
|
|
|
+ ptProfitLogRespVO.getProfitStatus().equals(SMALL_QUOTA_CRASH.getType())) {
|
|
|
+ ptProfitLogRespVO.setUsername(memberUserService.getUser(ptProfitLogRespVO.getGenerateUserId()).getUsername());
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -110,7 +120,7 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
|
|
|
|
|
|
}
|
|
|
@Override
|
|
|
- public Long addMessageFreeze(Long userId, CaclEnum caclEnum, Long amount, Long afterAmount, String percentTemplate,Long accumulatedQuotAmount, Long maxAvailablePointsAmount ,Long afterMaxAvailablePointsAmount) {
|
|
|
+ public Long addMessageFreeze(Long userId,Long ancestorId, CaclEnum caclEnum, Long amount, Long afterAmount, String percentTemplate,Long accumulatedQuotAmount, Long maxAvailablePointsAmount ,Long afterMaxAvailablePointsAmount) {
|
|
|
PtProfitLogSaveReqVO ptProfitLog = PtProfitLogSaveReqVO.builder()
|
|
|
.afterFreezeAmount(afterAmount)
|
|
|
.freezeAmount(amount)
|
|
@@ -119,13 +129,11 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
|
|
|
.accumulatedQuotaAmount(accumulatedQuotAmount)
|
|
|
.maxAvailablePointsAmount(maxAvailablePointsAmount)
|
|
|
.afterMaxAvailablePointsAmount(afterMaxAvailablePointsAmount)
|
|
|
- .generateUserId(userId)
|
|
|
+ .generateUserId(ancestorId)
|
|
|
+ .userId(userId)
|
|
|
.build();
|
|
|
- if(caclEnum.getType().equals(SMALL_QUOTA_CRASH.getType())){
|
|
|
- ptProfitLog.setUserId(userId);
|
|
|
- }
|
|
|
PtProfitLogDO bean = BeanUtils.toBean(ptProfitLog, PtProfitLogDO.class);
|
|
|
- ptProfitLogMapper.insert(bean);
|
|
|
+ ptProfitLogMapper.insert(bean);
|
|
|
return bean.getId();
|
|
|
// todo 发送通知
|
|
|
// todo 发短信
|