Commit 3b468ce0 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!80
parents 5cf7bde6 17c7e1a9
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
......@@ -7,6 +10,8 @@ import java.util.Date;
* 结算信息作废记录表(用于记录项目变更导致推信息送至EKP)
* @TableName t_insurance_settle_cancel
*/
@Data
@Tag(name = "结算信息作废记录")
public class TInsuranceSettleCancel implements Serializable {
/**
*
......@@ -55,129 +60,4 @@ public class TInsuranceSettleCancel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
public String getId() {
return id;
}
/**
*
*/
public void setId(String id) {
this.id = id;
}
/**
* 结算明细id
*/
public String getInsDetailId() {
return insDetailId;
}
/**
* 结算明细id
*/
public void setInsDetailId(String insDetailId) {
this.insDetailId = insDetailId;
}
/**
* 结算信息表id
*/
public String getSettleId() {
return settleId;
}
/**
* 结算信息表id
*/
public void setSettleId(String settleId) {
this.settleId = settleId;
}
/**
* 项目编码
*/
public String getDeptNo() {
return deptNo;
}
/**
* 项目编码
*/
public void setDeptNo(String deptNo) {
this.deptNo = deptNo;
}
/**
* 项目名称
*/
public String getDeptName() {
return deptName;
}
/**
* 项目名称
*/
public void setDeptName(String deptName) {
this.deptName = deptName;
}
/**
* 订单编号
*/
public String getOrderNo() {
return orderNo;
}
/**
* 订单编号
*/
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
/**
* 推送标识 1成功 0失败
*/
public Integer getIsCancelPush() {
return isCancelPush;
}
/**
* 推送标识 1成功 0失败
*/
public void setIsCancelPush(Integer isCancelPush) {
this.isCancelPush = isCancelPush;
}
/**
* 创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 操作人
*/
public String getCreateUesr() {
return createUesr;
}
/**
* 操作人
*/
public void setCreateUesr(String createUesr) {
this.createUesr = createUesr;
}
}
\ No newline at end of file
......@@ -2570,6 +2570,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle.setEstimatePremium(new BigDecimal("0"));
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
//生成一条作废数据并推送至EKP
TInsuranceSettleCancel tInsuranceSettleCancel = new TInsuranceSettleCancel();
tInsuranceSettleCancel.setInsDetailId(success.getId());
tInsuranceSettleCancel.setSettleId(success.getDefaultSettleId());
}else{
//更新预估保费
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0"));
......@@ -2887,7 +2892,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param.setId(one.getId());
param.setReduceHandleStatus(one.getReduceHandleStatus());
boolean b = successList.stream().anyMatch(
u -> u.getEmpName().equals(param.getEmpName())
&& u.getEmpIdcardNo().equals(param.getEmpIdcardNo())
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())
&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())
&& u.getPolicyEnd().equals(param.getPolicyEnd())
);
if(b){
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param);
continue;
}
successList.add(param);
}
map.put("successList",successList);
map.put("errorList",errorList);
......@@ -3200,7 +3219,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
......@@ -3328,40 +3346,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//预估
if (param.getNewSettleType() == CommonConstants.ZERO_INT){
//根据险种获取费率,没费率返回错误
TInsuranceType insuranceType = tInsuranceTypeService.getById(insuranceDetail.getInsuranceTypeId());
//险种存不存在
if (!Optional.ofNullable(insuranceType).isPresent()){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EXIST);
errorList.add(param);
continue;
}else {
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getById(insuranceType.getInsuranceCompanyId());
//保险公司存不存在
if (!Optional.ofNullable(insuranceCompany).isPresent()){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EXIST);
errorList.add(param);
continue;
}else {
if (CommonConstants.ONE_STRING.equals(insuranceCompany.getBillingType())){
//按月查费率
//计算起止时间的月数
long month = LocalDateUtil.betweenMonth(insuranceDetail.getPolicyStart().toString(), insuranceDetail.getPolicyEnd().toString());
TInsuranceTypeRate typeRate = tInsuranceTypeRateService.getOne(Wrappers.<TInsuranceTypeRate>query().lambda()
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceDetail.getInsuranceTypeId())
.eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeRate).isPresent()){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_RATE_NOT_EXIST);
errorList.add(param);
continue;
}else {
//按月
if (CommonConstants.ONE_INT == insuranceDetail.getBillingType()){
// 预估保费 = 费率 * 购买标准
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).multiply(new BigDecimal(typeRate.getRate())).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).multiply(insuranceDetail.getRate()).setScale(2,BigDecimal.ROUND_HALF_UP);
param.setEstimatePremium(estimatePremium);
}
}else {
//按天
//计算起止时间的天数
......@@ -3371,11 +3360,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setEstimatePremium(estimatePremium);
}
}
}
}
param.setOldSettleType(insuranceDetail.getSettleType());
param.setDefaultSettleId(insuranceDetail.getDefaultSettleId());
param.setId(insuranceDetail.getId());
boolean b = successList.stream().anyMatch(
u -> u.getEmpName().equals(param.getEmpName())
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())
&& u.getOldDeptNo().equals(param.getOldDeptNo())
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())
&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())
&& u.getPolicyEnd().equals(param.getPolicyEnd())
&& u.getBuyStandard().equals(param.getBuyStandard())
);
if(b){
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param);
continue;
}
successList.add(param);
}
map.put("errorList",errorList);
......
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