Commit eaf54eed authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

Feature licancan

See merge request !255
parents 75f59018 121e1611
......@@ -277,6 +277,10 @@ public class InsurancesConstants {
* 购买标准不存在
*/
public static final String BUY_STANDARD_NOT_EXIST = "购买标准不存在";
/**
* 购买标准格式错误
*/
public static final String BUY_STANDARD_PARSE_ERROR = "购买标准格式错误";
/**
* 商险购买地省名称不能为空
*/
......
......@@ -70,4 +70,28 @@ public class TInsuranceCompany extends BaseEntity {
@Schema(description = "是否删除 0否/1是")
private Integer deleteFlag;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
private String insuranceHandleProvinceName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
private Integer insuranceHandleCity;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
private String insuranceHandleCityName;
}
\ No newline at end of file
......@@ -50,6 +50,12 @@ public class InsuranceRegisterParam implements Serializable {
@Schema(description = "保单结束时间")
private String policyEnd;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 保单编号
*/
......
......@@ -234,9 +234,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceList = baseMapper.getInsuranceList(param);
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList)){
if(insuranceList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
/*if(insuranceList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
}*/
insuranceList.stream().forEach(e ->{
e.setBuyMonth(LocalDateUtil.betweenMonth(e.getPolicyStart().toString(),e.getPolicyEnd().toString()));
});
......@@ -782,6 +782,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//购买周期
String buyCycle = month + "个月/" + day + "天";
insuranceDetailVO.setBuyCycle(buyCycle);
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == insuranceDetailVO.getBuyType()){
if (Objects.isNull(insuranceDetailVO.getPolicyEffect())){
insuranceDetailVO.setBuyCycle(null);
}else {
day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyEffect().toString(),insuranceDetailVO.getPolicyEnd().toString());
month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyEffect().toString(),insuranceDetailVO.getPolicyEnd().toString());
buyCycle = month + "个月/" + day + "天";
insuranceDetailVO.setBuyCycle(buyCycle);
}
}
//派单类型
insuranceDetailVO.setDistributeType(insuranceDetailVO.getReduceHandleStatus() == null?insuranceDetailVO.getBuyType():CommonConstants.FIVE_INT);
//派单状态
......@@ -888,9 +899,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceExportList = baseMapper.getInsuranceExportList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
if(insuranceExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
/*if(insuranceExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
}*/
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
......@@ -1309,12 +1320,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//按天
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
day = LocalDateUtil.betweenDay(detail.getPolicyEffect().toString(), detail.getPolicyEnd().toString());
}
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
detail.setSignFlag(CommonConstants.ONE_INT);
......@@ -2869,6 +2881,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EXIST);
listResult.add(param);
continue;
}else {
if (!ValidityUtil.validateMoney(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_PARSE_ERROR);
listResult.add(param);
continue;
}
if (!ValidityUtil.validateMoneyMax(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
listResult.add(param);
continue;
}
}
if (StringUtils.isNotBlank(param.getPolicyNo())){
if (!ValidityUtil.validate50(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_MORE_THAN_50);
......@@ -2890,7 +2918,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
......@@ -2898,6 +2926,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getBuyStandard,param.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
......@@ -3311,9 +3340,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuredListVo> insuredList;
insuredList = this.baseMapper.getInsuredList(param);
if (CollectionUtils.isNotEmpty(insuredList)){
if(insuredList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
/*if(insuredList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}*/
//根据项目编码获取项目名称
List<String> collect = insuredList.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList());
try{
......@@ -3391,9 +3420,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
if(insuranceRefundList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
/*if(insuranceRefundList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
}*/
//根据项目编码获取项目名称
List<String> collect = insuranceRefundList.stream().map(InsuranceRefundListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
......@@ -3478,9 +3507,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
refundExportList = baseMapper.getRefundExportList(param);
}
if (CollectionUtils.isNotEmpty(refundExportList)){
if(refundExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
/*if(refundExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
}*/
List<TInsuranceDetail> detailList = new ArrayList<>();
List<TInsuranceRefund> refundList = new ArrayList<>();
//根据项目编码获取项目名称
......
......@@ -15,12 +15,17 @@
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
<result property="insuranceHandleProvince" column="INSURANCE_HANDLE_PROVINCE" jdbcType="TINYINT"/>
<result property="insuranceHandleProvinceName" column="INSURANCE_HANDLE_PROVINCE_NAME" jdbcType="VARCHAR"/>
<result property="insuranceHandleCity" column="INSURANCE_HANDLE_CITY" jdbcType="TINYINT"/>
<result property="insuranceHandleCityName" column="INSURANCE_HANDLE_CITY_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,COMPANY_NAME,COMPANY_ADDRESS,
COMPANY_DOCKING,CREATE_BY,CREATE_NAME,
CREATE_TIME,UPDATE_BY,UPDATE_TIME,
DELETE_FLAG
DELETE_FLAG,
INSURANCE_HANDLE_PROVINCE,INSURANCE_HANDLE_PROVINCE_NAME,INSURANCE_HANDLE_CITY,INSURANCE_HANDLE_CITY_NAME
</sql>
</mapper>
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