Commit ef78da01 by jianan

出账检核-增加币种44

parent 1a474817
...@@ -1022,14 +1022,10 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1022,14 +1022,10 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 查询保单信息 // 查询保单信息
Set<String> policyNoSet = fortuneAddRequestList.stream() Set<String> policyNoSet = fortuneAddRequestList.stream()
.map(ExpectedFortuneAddRequest::getPolicyNo) .map(ExpectedFortuneAddRequest::getPolicyNo)
.filter(StringUtils::isNotBlank).collect(Collectors.toSet()); .filter(StringUtils::isNotBlank)
.collect(Collectors.toSet());
Map<String, Policy> policyMap = new HashMap<>(); Map<String, Policy> policyMap = policyService.queryPolicyMap(policyNoSet);
if (CollUtil.isNotEmpty(policyNoSet)) {
List<Policy> policyList = policyService.lambdaQuery().in(Policy::getPolicyNo, policyNoSet).list();
// 保单映射
policyMap = policyList.stream().collect(Collectors.toMap(Policy::getPolicyNo, Function.identity()));
}
// 查询最新一条有 payableNo 记录 // 查询最新一条有 payableNo 记录
// int currentSeq = iExpectedFortuneService.getPayableNoCurrentSeq(); // int currentSeq = iExpectedFortuneService.getPayableNoCurrentSeq();
...@@ -1085,13 +1081,6 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1085,13 +1081,6 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
} }
private String queryByDict(String fortuneType) { private String queryByDict(String fortuneType) {
//查询redis缓存的字典列表信息
List<GetDictItemListByDictTypeResponse> dictTypeResponses = redisUtil.getCacheObject(RedisConstants.DICT_LIST);
String fortuneName = GetDictItemListByDictTypeResponse.getItemLabel(dictTypeResponses,
"csf_fortune_type", fortuneType);
if (ObjectUtils.isNotEmpty(fortuneName)) {
return fortuneName;
}
Result<List<GetDictItemListByDictTypeResponse>> result = apiSysDictFeignClient.getDictItemListByDictType("csf_fortune_type"); Result<List<GetDictItemListByDictTypeResponse>> result = apiSysDictFeignClient.getDictItemListByDictType("csf_fortune_type");
if (ObjectUtils.isNotEmpty(result.getData())) { if (ObjectUtils.isNotEmpty(result.getData())) {
for (GetDictItemListByDictTypeResponse dictItem : result.getData()) { for (GetDictItemListByDictTypeResponse dictItem : result.getData()) {
...@@ -1127,15 +1116,29 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1127,15 +1116,29 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
private void validateAdd(List<ExpectedFortuneAddRequest> fortuneAddRequestList) { private void validateAdd(List<ExpectedFortuneAddRequest> fortuneAddRequestList) {
for (ExpectedFortuneAddRequest expectedFortuneDto : fortuneAddRequestList) { for (ExpectedFortuneAddRequest expectedFortuneDto : fortuneAddRequestList) {
if (Objects.isNull(expectedFortuneDto.getHkdAmount())) { if (Objects.isNull(expectedFortuneDto.getOriginalAmount())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "预计出账金额不能为空"); throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "原币种金额不能为空");
}
if (Objects.isNull(expectedFortuneDto.getOriginalCurrency())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "原币种不能为空");
} }
if (Objects.isNull(expectedFortuneDto.getCurrency())) { if (Objects.isNull(expectedFortuneDto.getOriginalToHkdRate())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "预计出账币种不能为空"); throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "原币种→港币汇率不能为空");
} }
if (Objects.isNull(expectedFortuneDto.getExchangeRate())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "结算汇率不能为空"); if (Objects.isNull(expectedFortuneDto.getRuleAmount())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "保单币种金额不能为空");
}
if (Objects.isNull(expectedFortuneDto.getRuleCurrency())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "保单币种不能为空");
} }
if (Objects.isNull(expectedFortuneDto.getDefaultExchangeRate())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "预计出账汇率不能为空");
}
if (Objects.isNull(expectedFortuneDto.getHkdAmount())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "预计出账金额不能为空");
}
} }
} }
......
...@@ -5,118 +5,84 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -5,118 +5,84 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
@Data @Data
public class ExpectedFortuneAddRequest { public class ExpectedFortuneAddRequest {
/**
* 应付款类型 R-关联保单应付款 U-非关联保单应付款 @Schema(description = "应付款类型 R-关联保单应付款 U-非关联保单应付款", requiredMode = Schema.RequiredMode.REQUIRED)
*/
@Schema(description = "应付款类型 R-关联保单应付款 U-非关联保单应付款")
private String fortuneBizType; private String fortuneBizType;
/** @Schema(description = "出账年月 (估)", requiredMode = Schema.RequiredMode.REQUIRED)
* 关联保单号 @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
*/ private String payoutDate;
@Schema(description = "出账年月 (实)", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private String actualPayoutDate;
@Schema(description = "关联保单号") @Schema(description = "关联保单号")
private String policyNo; private String policyNo;
/** @Schema(description = "出账状态 0=待出账 1=可出帐,待检核 2=完成出账 3=部分出账 4=保留 5=已失效 6=可出帐,检核完成 7=未找到当前预计发佣对应的来佣, 字典值: csf_expected_fortune_status")
* 产品计划 ID private String status;
*/
@Schema(description = "产品计划 ID") @Schema(description = "出账状态-修改理由")
private String productLaunchBizId; private String statusDesc;
/** @Schema(description = "出账项目", requiredMode = Schema.RequiredMode.REQUIRED)
* 佣金期数 private String fortuneName;
*/
@Schema(description = "佣金期数") @Schema(description = "出账项目类型 字典值:csf_fortune_type", requiredMode = Schema.RequiredMode.REQUIRED)
private String fortuneType;
@Schema(description = "出账期数", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer fortunePeriod; private Integer fortunePeriod;
/** @Schema(description = "出账总期数", requiredMode = Schema.RequiredMode.REQUIRED)
* 总期数
*/
@Schema(description = "总期数")
private Integer fortuneTotalPeriod; private Integer fortuneTotalPeriod;
/** @Schema(description = "转介人名称", requiredMode = Schema.RequiredMode.REQUIRED)
* 转介人名称
*/
@Schema(description = "转介人名称")
private String broker; private String broker;
/** @Schema(description = "broker biz id", requiredMode = Schema.RequiredMode.REQUIRED)
* 转介人业务ID
*/
@Schema(description = "broker biz id")
private String brokerBizId; private String brokerBizId;
/** @Schema(description = "所属团队")
* 团队名称
*/
@Schema(description = "团队名称")
private String team; private String team;
/** @Schema(description = "所属团队业务ID")
* 所属团队业务ID
*/
@Schema(description = "所属团队 biz id")
private String teamBizId; private String teamBizId;
/** @Schema(description = "保单币种金额", requiredMode = Schema.RequiredMode.REQUIRED)
* 出账项目 private BigDecimal ruleAmount;
*/
@Schema(description = "出账项目")
private String fortuneName;
/** @Schema(description = "保单币种", requiredMode = Schema.RequiredMode.REQUIRED)
* 出账项目类型 private String ruleCurrency;
*/
@Schema(description = "出账项目类型 字典值:csf_fortune_type")
private String fortuneType;
/** @Schema(description = "保单币种→港币汇率(默认保单币种汇率)", requiredMode = Schema.RequiredMode.REQUIRED)
* 结算汇率 private BigDecimal defaultExchangeRate;
*/
@Schema(description = "结算汇率")
private BigDecimal exchangeRate;
/** @Schema(description = "原币种", requiredMode = Schema.RequiredMode.REQUIRED)
* 出账金额 单位:港币 private String originalCurrency;
*/
@Schema(description = "出账金额 单位:港币")
private BigDecimal hkdAmount;
/** @Schema(description = "原币种金额", requiredMode = Schema.RequiredMode.REQUIRED)
* 出账币种 private BigDecimal originalAmount;
*/
@Schema(description = "出账币种") @Schema(description = "原币种→港币汇率", requiredMode = Schema.RequiredMode.REQUIRED)
private String currency; private BigDecimal originalToHkdRate;
/** @Schema(description = "发放币种", requiredMode = Schema.RequiredMode.REQUIRED)
* 出账日 (估) private String payoutCurrency;
*/
@Schema(description = "出账日 (估)") @Schema(description = "发放币种金额", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private BigDecimal payoutAmount;
private LocalDate payoutDate;
@Schema(description = "港币→发放币种汇率", requiredMode = Schema.RequiredMode.REQUIRED)
/** private BigDecimal hkdToPayoutRate;
* 出账日 (实)
*/ @Schema(description = "港币金额", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "出账日 (实)") private BigDecimal hkdAmount;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date actualPayoutDate;
/**
* 出账状态
*/
@Schema(description = "出账状态 0=待出账 1=可出帐,待检核 2=完成出账 3=部分出账 4=保留 5=已失效 6=可出帐,检核完成 7=未找到当前预计发佣对应的来佣, 字典值: csf_expected_fortune_status")
private String status;
/**
* 备注
*/
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
} }
...@@ -10,6 +10,7 @@ import com.yd.csf.service.vo.PolicyVO; ...@@ -10,6 +10,7 @@ import com.yd.csf.service.vo.PolicyVO;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* @author Zhang Jianan * @author Zhang Jianan
...@@ -33,4 +34,6 @@ public interface PolicyService extends IService<Policy> { ...@@ -33,4 +34,6 @@ public interface PolicyService extends IService<Policy> {
List<PolicyProductInfo> getPolicyProductInfo(List<String> productLaunchBizIdList); List<PolicyProductInfo> getPolicyProductInfo(List<String> productLaunchBizIdList);
Map<String, PolicyProductInfo> getPolicyProductInfoMap(Collection<String> productLaunchBizIdList); Map<String, PolicyProductInfo> getPolicyProductInfoMap(Collection<String> productLaunchBizIdList);
Map<String, Policy> queryPolicyMap(Collection<String> policyNoList);
} }
...@@ -388,6 +388,17 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy> ...@@ -388,6 +388,17 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
.collect(Collectors.toMap(PolicyProductInfo::getProductLaunchBizId, Function.identity(), (oldValue, newValue) -> newValue)); .collect(Collectors.toMap(PolicyProductInfo::getProductLaunchBizId, Function.identity(), (oldValue, newValue) -> newValue));
} }
@Override
public Map<String, Policy> queryPolicyMap(Collection<String> policyNoList) {
// 校验参数
if (CollectionUtils.isEmpty(policyNoList)) {
return Collections.emptyMap();
}
return this.lambdaQuery().in(Policy::getPolicyNo, policyNoList).list()
.stream().collect(Collectors.toMap(Policy::getPolicyNo, Function.identity()));
}
/** /**
* 从JSON数组中解析自定义属性 * 从JSON数组中解析自定义属性
*/ */
......
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