Commit ef78da01 by jianan

出账检核-增加币种44

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