Commit a76a8fa6 by jianan

出账检核-设置本期出账金额、完成检核

parent b7a3bb32
......@@ -84,8 +84,14 @@ public class FortuneUpdateRequest implements Serializable {
/**
* 本期出账金额
*/
@Schema(description = "本期出账金额")
private BigDecimal currentPaymentAmount;
// @Schema(description = "本期出账金额")
// private BigDecimal currentPaymentAmount;
/**
* 本期出账港币金额
*/
@Schema(description = "本期出账港币金额")
private BigDecimal currentPaymentHkdAmount;
/**
* 出账币种
......
......@@ -181,13 +181,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (expectedFortune == null) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "预计出账数据不存在");
}
BigDecimal currentPaymentAmount = fortuneUpdateRequest.getCurrentPaymentAmount();
if (currentPaymentAmount != null) {
if (currentPaymentAmount.compareTo(BigDecimal.ZERO) < 0) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账金额不能小于0");
BigDecimal currentPaymentHkdAmount = fortuneUpdateRequest.getCurrentPaymentHkdAmount();
if (currentPaymentHkdAmount != null) {
if (currentPaymentHkdAmount.compareTo(BigDecimal.ZERO) < 0) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账港币金额不能小于0");
}
if (currentPaymentAmount.compareTo(expectedFortune.getHkdAmount()) > 0) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账金额不能大于应付款金额");
if (currentPaymentHkdAmount.compareTo(expectedFortune.getHkdAmount()) > 0) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账港币金额不能大于应付款港币金额");
}
if (StringUtils.isBlank(fortuneUpdateRequest.getCurrency())) {
throw new BusinessException(ResultCode.PARAM_CHECK_ERROR.getCode(), "出账币种不能为空");
......@@ -211,8 +211,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortune.setReconciliationOperator(currentLoginUser.getUsername());
// 如果传入了金额
if (currentPaymentAmount != null) {
splitFortune(fortune, currentPaymentAmount, expectedFortune, loginUserId, fortuneUpdateRequest);
if (currentPaymentHkdAmount != null && currentPaymentHkdAmount.compareTo(BigDecimal.ZERO) != 0) {
splitFortune(fortune, currentPaymentHkdAmount, expectedFortune, loginUserId, fortuneUpdateRequest);
} else {
// 如果未传入金额,仅更新预计出账状态为已出帐
expectedFortuneService.lambdaUpdate()
......@@ -360,9 +360,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 校验发佣记录状态
StringBuilder validateMsg = new StringBuilder();
for (Fortune fortune : fortuneList) {
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.CAN_SEND.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("当前未检核,请检核后再生成出账记录; ");
}
// if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.CAN_SEND.getItemValue())) {
// validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("当前未检核,请检核后再生成出账记录; ");
// }
if (StringUtils.equals(fortune.getStatus(), FortuneStatusEnum.SENT.getItemValue())) {
validateMsg.append(fortune.getPolicyNo()).append("-").append(fortune.getBroker()).append("已完成出账,不能生成出账记录; ");
}
......
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