Commit 6ba8e474 by zhangxingmin

Merge remote-tracking branch 'origin/dev' into prod

parents 5c1af100 1eb2c6da
......@@ -955,14 +955,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune.setPayableNo(this.createPayableNo(expectedFortune.getFortuneBizType(), ++currentSeq));
// 默认结算汇率
expectedFortune.setDefaultExchangeRate(
queryExchangeRateByFeign(expectedFortune.getPolicyCurrency(), expectedFortune.getCurrency()));
queryExchangeRateByFeign(expectedFortuneDto.getCurrency(), "HKD"));
// 计算港币金额
expectedFortune.setHkdAmount(expectedFortune.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
expectedFortune.setHkdAmount(expectedFortuneDto.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune.setPaidAmount(BigDecimal.ZERO);
// 转介人比例默认100%
expectedFortune.setBrokerRatio("100");
expectedFortune.setUnpaidAmount(expectedFortune.getAmount());
expectedFortune.setUnpaidAmount(expectedFortune.getHkdAmount());
expectedFortune.setPaidRatio(BigDecimal.ZERO);
expectedFortune.setUnpaidRatio(BigDecimal.valueOf(100));
fortuneList.add(expectedFortune);
......@@ -1278,11 +1278,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
updateExpectedFortune.setDefaultExchangeRate(
queryExchangeRateByFeign(
updateExpectedFortune.getCurrency(),
expectedFortune.getCurrency()
"HKD"
));
// 计算港币金额
updateExpectedFortune.setHkdAmount(updateExpectedFortune.getAmount().multiply(updateExpectedFortune.getDefaultExchangeRate()));
// 更新待出账金额
updateExpectedFortune.setUnpaidAmount(updateExpectedFortune.getHkdAmount());
// 获取当前登录用户
AuthUserDto currentLoginUser = SecurityUtil.getCurrentLoginUser();
String loginUserId = currentLoginUser.getId().toString();
......
......@@ -349,6 +349,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 校验发佣记录状态
StringBuilder validateMsg = new StringBuilder();
for (Fortune fortune : fortuneList) {
if (StringUtils.isNotBlank(fortune.getFortuneAccountBizId())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("已发薪资,不能重复生成薪资记录; ");
}
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.WAIT.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("待出账状态不能直接改为'可出账, 检核完成',不能生成出账记录; ");
}
......
......@@ -533,7 +533,7 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 更新保单状态为生效
policy.setStatus(PolicyStatusEnum.INFORCE.getItemValue());
// 手动映射不同名的字段
policy.setPaymentPremium(policyFollow.getInitialPremium());
policy.setPaymentPremium(policyFollow.getEachIssuePremium());
policy.setCurrency(policyFollow.getPolicyCurrency());
policy.setPaymentTerm(policyFollow.getIssueNumber());
policy.setTotalPaymentPremium(calculateTotalPaymentPremium(policy));
......
......@@ -329,14 +329,16 @@ public class FortuneVO implements Serializable {
}
FortuneVO fortuneVO = new FortuneVO();
BeanUtils.copyProperties(fortune, fortuneVO);
// 计算已出账金额和待出账金额
fortuneVO.setFortunePaidAmount(fortune.getCurrentPaymentHkdAmount());
fortuneVO.setFortuneUnpaidAmount(NumberUtil.sub(fortune.getHkdAmount(), fortune.getCurrentPaymentHkdAmount()));
// 计算待出账比例
BigDecimal currentPaymentRatio = ObjectUtil.defaultIfNull(fortuneVO.getCurrentPaymentRatio(), BigDecimal.ZERO);
BigDecimal currentPaymentRatio = NumberUtil
.div(fortune.getCurrentPaymentHkdAmount(), fortune.getHkdAmount(), 4)
.multiply(BigDecimal.valueOf(100));
fortuneVO.setCurrentPaymentRatio(currentPaymentRatio);
fortuneVO.setFortuneUnpaidRatio(BigDecimal.valueOf(100).subtract(currentPaymentRatio));
fortuneVO.setFortunePaidAmount(fortune.getCurrentPaymentHkdAmount());
fortuneVO.setFortuneUnpaidAmount(NumberUtil.sub(fortune.getHkdAmount(), fortune.getCurrentPaymentHkdAmount()));
fortuneVO.setCurrency(CurrencyEnum.toLabel(fortune.getCurrency()));
fortuneVO.setPolicyCurrency((CurrencyEnum.toLabel(fortune.getPolicyCurrency())));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment