Commit 6a095335 authored by zhaji's avatar zhaji

"feature-zhaJi:优化商险登记保单退费的保单开始时间结束时间校验"

parent 40a2611b
......@@ -1201,6 +1201,13 @@ public class InsurancesConstants {
*/
public static final String SETTLE_ID_ATYPISM = "结算id不一致";
/**
* 登记退保费用
*/
public static final String REGISTERED_SURRENDER_EXPENSE = "登记退保费用";
/**
* 获取项目信息失败
*/
......
......@@ -21,6 +21,12 @@ public class RefundMoneyUpdateParam implements Serializable {
@JsonIgnore
private String id;
/**
* 商险id
*/
@JsonIgnore
private String insDetailId;
/**
* 员工姓名
*/
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -198,7 +199,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @param param 查询参数
* @return {@link String}
*/
String selectRefundDetailId(@Param("param") RefundMoneyUpdateParam param);
TInsuranceRefund selectRefundDetailId(@Param("param") RefundMoneyUpdateParam param);
/**
* 根据ID导出减员办理列表
......
......@@ -5422,6 +5422,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<RefundMoneyUpdateParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyUpdateParam> successList = map.get(InsurancesConstants.SUCCESS_LIST);
List<TInsuranceOperate> insuranceOperateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)){
for (RefundMoneyUpdateParam param : successList) {
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
......@@ -5431,8 +5432,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setUpdateBy(user.getId());
insuranceRefund.setUpdateTime(LocalDateTime.now());
tInsuranceRefundService.updateRefundMoney(insuranceRefund);
//新增操作记录
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(param.getInsDetailId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setDisplayFlag(CommonConstants.ZERO_INT);
insuranceOperate.setOperateDesc(InsurancesConstants.REGISTERED_SURRENDER_EXPENSE);
insuranceOperateList.add(insuranceOperate);
}
}
tInsuranceOperateService.saveBatch(insuranceOperateList);
return R.ok(map.get(InsurancesConstants.ERROR_LIST));
}
......@@ -5674,15 +5685,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
errorList.add(param);
continue;
}
//保单结束时间
if(StringUtils.isBlank(param.getPolicyEnd())){
param.setErrorMessage(InsurancesConstants.REFUND_INSURANCE_END_DATE_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单借宿时间
if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR);
errorList.add(param);
continue;
}
//购买标准
if(StringUtils.isBlank(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.REFUND_BUY_STANDARD_NOT_EMPTY);
errorList.add(param);
......@@ -5696,7 +5715,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
if(!ValidityUtil.validateMoney(param.getRefundMoney())){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param);
......@@ -5704,13 +5722,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//必填格式校通过后查询对应的保单信息
String tInsuranceRefundDetailId = this.baseMapper.selectRefundDetailId(param);
if(Common.isEmpty(tInsuranceRefundDetailId)){
TInsuranceRefund insuranceRefund = this.baseMapper.selectRefundDetailId(param);
if(Common.isEmpty(insuranceRefund)){
param.setErrorMessage(InsurancesConstants.REFUND_IS_NULL);
errorList.add(param);
continue;
}
param.setId(tInsuranceRefundDetailId);
param.setId(insuranceRefund.getId());
param.setInsDetailId(insuranceRefund.getInsDetailId());
successList.add(param);
}
map.put(InsurancesConstants.ERROR_LIST,errorList);
......@@ -6212,6 +6231,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
errorList.add(param);
param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY);
continue;
}
......@@ -6238,6 +6258,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
errorList.add(param);
continue;
}
// 保单结束日期格式校验
......
......@@ -933,9 +933,10 @@
</select>
<!-- 查询保单减员退费信息-->
<select id="selectRefundDetailId" resultType="String">
<select id="selectRefundDetailId" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund">
select
refund.ID as refundId
refund.ID as id,
refund.INS_DETAIL_ID as insDetailId
from
t_insurance_detail a,
t_insurance_refund refund
......
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