Commit c5ab6c47 by zhangxingmin

Merge remote-tracking branch 'origin/test' into test

parents d53aac5d 8f319c81
...@@ -1049,6 +1049,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1049,6 +1049,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune.setUpdaterId(authUserDto.getUserBizId()); expectedFortune.setUpdaterId(authUserDto.getUserBizId());
expectedFortune.setCreateTime(now); expectedFortune.setCreateTime(now);
expectedFortune.setUpdateTime(now); expectedFortune.setUpdateTime(now);
// 是否拆分
expectedFortune.setIsPart(0);
if ("R".equals(expectedFortuneDto.getFortuneBizType())) { if ("R".equals(expectedFortuneDto.getFortuneBizType())) {
Policy policy = policyMap.get(expectedFortuneDto.getPolicyNo()); Policy policy = policyMap.get(expectedFortuneDto.getPolicyNo());
......
...@@ -42,12 +42,6 @@ public class ApiExpectedFortunePageResponse { ...@@ -42,12 +42,6 @@ public class ApiExpectedFortunePageResponse {
private String payableNo; private String payableNo;
/** /**
* 关联业务编号
*/
@Schema(description = "关联业务编号")
private String associatedPayableNo;
/**
* 保单号 * 保单号
*/ */
@Schema(description = "policy no") @Schema(description = "policy no")
......
...@@ -93,7 +93,7 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe ...@@ -93,7 +93,7 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
return expectedFortuneVOPage; return expectedFortuneVOPage;
} }
// 调整数据顺序 // 调整数据顺序、格式
processData(expectedFortuneList); processData(expectedFortuneList);
// 1. 转介人职级信息 // 1. 转介人职级信息
...@@ -158,8 +158,12 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe ...@@ -158,8 +158,12 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
// 查找对应的实际发佣 // 查找对应的实际发佣
List<ApiExpectedFortunePageResponse> matchedList = actualMap.get(expected.getExpectedFortuneBizId()); List<ApiExpectedFortunePageResponse> matchedList = actualMap.get(expected.getExpectedFortuneBizId());
if (CollUtil.isNotEmpty(matchedList)) { if (CollUtil.isNotEmpty(matchedList)) {
// 设置实际发佣的关联业务编号 // 设置实际出账记录的字段:待出账金额(估)、已出账比例、未出账比例
matchedList.forEach(actual -> actual.setAssociatedPayableNo(expected.getPayableNo())); matchedList.forEach(actual -> {
actual.setUnpaidAmount(expected.getHkdAmount());
actual.setPaidRatio(expected.getPaidRatio());
actual.setUnpaidRatio(expected.getUnpaidRatio());
});
sortedList.addAll(matchedList); sortedList.addAll(matchedList);
matchedActualPayableNos.add(expected.getExpectedFortuneBizId()); matchedActualPayableNos.add(expected.getExpectedFortuneBizId());
...@@ -173,7 +177,13 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe ...@@ -173,7 +177,13 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
} }
} }
// 6. 将排序后的结果写回原列表 // 6.设置实际出账记录的字段:待出账金额(估)
for (ApiExpectedFortunePageResponse item : sortedList) {
if (item.getType() == 2) {
item.setCurrentPaymentHkdAmount(item.getHkdAmount());
}
}
// 7. 将排序后的结果写回原列表
expectedFortuneList.clear(); expectedFortuneList.clear();
expectedFortuneList.addAll(sortedList); expectedFortuneList.addAll(sortedList);
......
...@@ -385,22 +385,34 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -385,22 +385,34 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
StringBuilder validateMsg = new StringBuilder(); StringBuilder validateMsg = new StringBuilder();
for (Fortune fortune : fortuneList) { for (Fortune fortune : fortuneList) {
if (StringUtils.isNotBlank(fortune.getFortuneAccountBizId())) { if (StringUtils.isNotBlank(fortune.getFortuneAccountBizId())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("已发薪资,不能重复生成薪资记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":已发薪资,不能重复生成");
break;
} }
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.WAIT.getItemValue())) { if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.WAIT.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("待出账状态不能直接改为'可出账, 检核完成',不能生成出账记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":待出账状态不能直接改为'可出账, 检核完成'");
break;
} }
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.SENT.getItemValue())) { if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.SENT.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("已完成出账,不能生成出账记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":已完成出账");
break;
} }
if (fortune.getActualPayoutDate() == null) { if (fortune.getActualPayoutDate() == null) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("未设置出账年月(实),不能生成出账记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":未设置出账年月(实)");
break;
} }
if (ObjectUtils.isEmpty(fortune.getPayoutCurrency())) { if (ObjectUtils.isEmpty(fortune.getPayoutCurrency())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("未设置发放币种,不能生成出账记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":未设置发放币种");
break;
} }
if (ObjectUtils.isEmpty(fortune.getPayoutAmount())) { if (ObjectUtils.isEmpty(fortune.getPayoutAmount())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("未设置发放币种金额,不能生成出账记录; "); validateMsg.append("保单").append(fortune.getPolicyNo()).append("-").append(fortune.getBroker())
.append(":未设置发放币种金额");
break;
} }
} }
if (StringUtils.isNotBlank(validateMsg.toString())) { if (StringUtils.isNotBlank(validateMsg.toString())) {
...@@ -809,12 +821,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -809,12 +821,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
.set(ExpectedFortune::getPayableNo, payableNo) .set(ExpectedFortune::getPayableNo, payableNo)
.eq(ExpectedFortune::getId, expectedFortune.getId()) .eq(ExpectedFortune::getId, expectedFortune.getId())
.update(); .update();
// 关联应付款编号
fortune.setPayableNo(payableNo);
} else { } else {
// 如果有预计出账记录,提示去应付款管理页面修改金额,而不是在出账页面新增 // 如果有预计出账记录,提示去应付款管理页面修改金额,而不是在出账页面新增
throw new BusinessException(ResultCode.FAIL.getCode(), fortuneAddRequest.getFortuneName() + " 已存在应付记录,请在应付款管理页面修改金额"); throw new BusinessException(ResultCode.FAIL.getCode(), fortuneAddRequest.getFortuneName() + " 已存在应付记录,请在应付款管理页面修改金额");
} }
fortune.setPayableNo(expectedFortune.getPayableNo());
fortune.setExpectedFortuneBizId(expectedFortune.getExpectedFortuneBizId()); fortune.setExpectedFortuneBizId(expectedFortune.getExpectedFortuneBizId());
fortune.setPolicyCurrency(expectedFortune.getPolicyCurrency()); fortune.setPolicyCurrency(expectedFortune.getPolicyCurrency());
fortune.setCurrentPaymentRatio(BigDecimal.valueOf(100)); fortune.setCurrentPaymentRatio(BigDecimal.valueOf(100));
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
ef.status_desc, ef.status_desc,
ef.payout_date, ef.payout_date,
ef.actual_payout_date, ef.actual_payout_date,
ef.default_exchange_rate, ef.default_exchange_rate as exchangeRate,
ef.original_currency, ef.original_currency,
ef.original_amount, ef.original_amount,
ef.original_to_hkd_rate, ef.original_to_hkd_rate,
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
ef.hkd_to_payout_rate, ef.hkd_to_payout_rate,
ef.hkd_amount, ef.hkd_amount,
NULL as current_payment_hkd_amount, NULL as current_payment_hkd_amount,
NULL as exchange_rate, ef.default_exchange_rate as exchange_rate,
ef.paid_amount, ef.paid_amount,
ef.unpaid_amount, ef.unpaid_amount,
ef.paid_ratio, ef.paid_ratio,
...@@ -241,8 +241,8 @@ ...@@ -241,8 +241,8 @@
f.hkd_amount, f.hkd_amount,
f.current_payment_amount, f.current_payment_amount,
f.exchange_rate, f.exchange_rate,
NULL as paid_amount, IF(f.status = 2, f.hkd_amount, 0) as paid_amount,
NULL as unpaid_amount, IF(f.status != 2 and f.status != 5, f.hkd_amount, 0) as unpaid_amount,
NULL as paid_ratio, NULL as paid_ratio,
NULL as unpaid_ratio, NULL as unpaid_ratio,
f.is_tax, f.is_tax,
......
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