|
|
@@ -260,24 +260,30 @@ public class PartnerRuleServiceImpl extends ServiceImpl<PartnerRuleMapper, Partn
|
|
|
}
|
|
|
|
|
|
private VerifyData downgradeUpgradeConditions(String userId, String grade) {
|
|
|
- PartnerRuleEntity partnerRuleEntity = validateGradeAndFetchRuleEntity(grade);
|
|
|
- if (partnerRuleEntity == null) {
|
|
|
- throw new SystemException("合作伙伴规则实体不能为空");
|
|
|
- }
|
|
|
- partnerRuleEntity.getStrategyArray();
|
|
|
- CommissionValidityPeriod period = partnerUserMapper.selectUpgradeCycleStartTime(userId, Integer.valueOf(grade));
|
|
|
- period.setEndDate(SpringUtil.getBean(ExpiredCommissionUtils.class).generateDowngradeTime(grade,period.getStartDate()));
|
|
|
- BigDecimal p = getInviteData(userId, grade, period);
|
|
|
- BigDecimal bf = partnerUserMapper.subordinateMembersInsurancePremiums(userId, grade, period);
|
|
|
- // 查询当前用户出单的保费
|
|
|
- BigDecimal ownBf = partnerUserMapper.selectOwnSumPremium(userId, period);
|
|
|
- if (bf == null){
|
|
|
- bf = BigDecimal.ZERO;
|
|
|
- }
|
|
|
- if (ownBf == null){
|
|
|
- ownBf = BigDecimal.ZERO;
|
|
|
+ try {
|
|
|
+ PartnerRuleEntity partnerRuleEntity = validateGradeAndFetchRuleEntity(grade);
|
|
|
+ if (partnerRuleEntity == null) {
|
|
|
+ throw new SystemException("合作伙伴规则实体不能为空");
|
|
|
+ }
|
|
|
+ partnerRuleEntity.getStrategyArray();
|
|
|
+ CommissionValidityPeriod period = partnerUserMapper.selectUpgradeCycleStartTime(userId, Integer.valueOf(grade));
|
|
|
+ period.setEndDate(SpringUtil.getBean(ExpiredCommissionUtils.class).generateDowngradeTime(grade,period.getStartDate()));
|
|
|
+ BigDecimal p = getInviteData(userId, grade, period);
|
|
|
+ BigDecimal bf = partnerUserMapper.subordinateMembersInsurancePremiums(userId, grade, period);
|
|
|
+ // 查询当前用户出单的保费
|
|
|
+ BigDecimal ownBf = partnerUserMapper.selectOwnSumPremium(userId, period);
|
|
|
+ if (bf == null){
|
|
|
+ bf = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ if (ownBf == null){
|
|
|
+ ownBf = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ return new VerifyData(partnerRuleEntity, p, bf,ownBf);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error("用户ID:{}" + userId + "报错信息:{}" + e.getMessage());
|
|
|
+ throw new SystemException(e.getMessage());
|
|
|
}
|
|
|
- return new VerifyData(partnerRuleEntity, p, bf,ownBf);
|
|
|
}
|
|
|
|
|
|
private static class VerifyData {
|