Commit d8b9a136 by jianan

前端对接问题修复46

parent 5837446d
......@@ -22,6 +22,8 @@ public interface CommissionMapper extends BaseMapper<Commission> {
List<CommissionBindPolicyBrokerDto> queryCommissionBindPolicyBrokerList(@Param("dto") CommissionDto dto);
CommissionStatisticsVO getCommissionStatistics(@Param("commissionIdList") List<Long> commissionIdList);
int updateStatusBatchById(@Param("existingCommissions") List<Commission> existingCommissions);
}
......
......@@ -11,9 +11,9 @@ import java.util.Date;
@Data
public class CommissionUpdateRequest implements Serializable {
/**
* 保单来佣业务id
* 保单入账业务id
*/
@Schema(description = "保单来佣业务id", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "保单入账业务id", requiredMode = Schema.RequiredMode.REQUIRED)
private String commissionBizId;
/**
......@@ -29,12 +29,6 @@ public class CommissionUpdateRequest implements Serializable {
private String policyNo;
/**
* 保费
*/
@Schema(description = "保费")
private String premium;
/**
* 对账公司
*/
@Schema(description = "对账公司")
......@@ -47,9 +41,9 @@ public class CommissionUpdateRequest implements Serializable {
private String reconciliationCompanyBizId;
/**
* 来佣比对状态
* 入账比对状态
*/
// @Schema(description = "来佣比对状态 1=比对成功 2=比对失败")
// @Schema(description = "入账比对状态 1=比对成功 2=比对失败")
// private String status;
/**
......@@ -59,33 +53,33 @@ public class CommissionUpdateRequest implements Serializable {
private Integer commissionPeriod;
/**
* 总来佣期数
* 总入账期数
*/
@Schema(description = "总来佣期数")
@Schema(description = "总入账期数")
private Integer totalPeriod;
/**
* 来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
* 入账项目名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
*/
@Schema(description = "来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)")
@Schema(description = "入账项目名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)")
private String commissionName;
/**
* 来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
* 入账项目类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
*/
@Schema(description = "来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)")
@Schema(description = "入账项目类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)")
private String commissionType;
/**
* 来佣金额
* 入账金额
*/
@Schema(description = "来佣金额")
@Schema(description = "入账金额")
private BigDecimal amount;
/**
* 来佣币种
* 入账币种
*/
@Schema(description = "来佣币种")
@Schema(description = "入账币种")
private String currency;
/**
......@@ -95,9 +89,9 @@ public class CommissionUpdateRequest implements Serializable {
private String exchangeRate;
/**
* 来佣日期
* 入账日期
*/
@Schema(description = "来佣日期")
@Schema(description = "入账日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date commissionDate;
......
......@@ -51,4 +51,6 @@ public interface CommissionService extends IService<Commission> {
List<Commission> addCommissionBatch(List<CommissionAddRequest> customerAddRequestList);
Boolean addToExpected(AddToExpectedCommissionRequest addToExpectedCommissionRequest);
int updateStatusBatchById(List<Commission> existingCommissions);
}
......@@ -210,11 +210,11 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
BigDecimal amount = commission.getAmount();
BigDecimal requestAmount = commissionUpdateRequest.getAmount();
// 1. 执行主更新事务(这个方法将在当前事务中执行)
// 计算当前来佣比例
BigDecimal currentCommissionRatio = this.calculateCurrentCommissionRatio(
commissionUpdateRequest.getAmount(),
commissionUpdateRequest.getPremium(),
commission.getPremium(),
requestAmount,
commissionUpdateRequest.getCurrency(),
commissionUpdateRequest.getExchangeRate());
// 获取当前登录用户
......@@ -261,18 +261,14 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
log.error("来佣业务id不能为空:{}", commissionUpdateRequest.getCommissionBizId());
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "来佣业务id不能为空");
}
if (ObjectUtils.isEmpty(commissionUpdateRequest.getPremium())) {
log.error("保费不能为空:{}", commissionUpdateRequest.getPremium());
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "保费不能为空");
}
if (ObjectUtils.isEmpty(commissionUpdateRequest.getAmount())) {
log.error("当前入账金额不能为空,来佣业务id:{}", commissionUpdateRequest.getCommissionBizId());
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "当前入账金额不能为空");
}
if (ObjectUtils.isEmpty(commissionUpdateRequest.getExchangeRate())) {
log.error("当前结算汇率不能为空,来佣业务id:{}", commissionUpdateRequest.getCommissionBizId());
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "当前结算汇率不能为空");
}
// if (ObjectUtils.isEmpty(commissionUpdateRequest.getAmount())) {
// log.error("当前入账金额不能为空,来佣业务id:{}", commissionUpdateRequest.getCommissionBizId());
// throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "当前入账金额不能为空");
// }
// if (ObjectUtils.isEmpty(commissionUpdateRequest.getExchangeRate())) {
// log.error("当前结算汇率不能为空,来佣业务id:{}", commissionUpdateRequest.getCommissionBizId());
// throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "当前结算汇率不能为空");
// }
}
......@@ -570,9 +566,9 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
return this.getOne(new QueryWrapper<Commission>().eq("commission_biz_id", commissionBizId));
}
public BigDecimal calculateCurrentCommissionRatio(BigDecimal amount, String premium, String exchangeRate) {
public BigDecimal calculateCurrentCommissionRatio(String premium, BigDecimal amount, String exchangeRate, String currency) {
if (ObjectUtils.isEmpty(premium)) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "保费不能为空");
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "保单保费不能为空");
}
if (ObjectUtils.isEmpty(amount)) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), "当前入账金额不能为空");
......@@ -750,6 +746,11 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
return commissionExpectedService.save(expected);
}
@Override
public int updateStatusBatchById(List<Commission> existingCommissions) {
return this.baseMapper.updateStatusBatchById(existingCommissions);
}
/**
* 查询列表
*
......
......@@ -48,6 +48,19 @@
updater_id,create_time,update_time
</sql>
<update id="updateStatusBatchById">
update commission
set
status = #{item.status},
update_time = now()
where id in
<foreach collection="existingCommissions" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<select id="queryCommissionBindPolicyBrokerList"
resultType="com.yd.csf.service.dto.CommissionBindPolicyBrokerDto">
select c.*,p.*,pb.*
......
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