Commit 7a323d93 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 91a5325f f83f038b
......@@ -569,9 +569,9 @@ public class InsurancesConstants {
*/
public static final String REFUND_EXPORT_FAILED = "减员办理失败";
/**
* 员工投保信息不存在
* 员工投保记录不存在
*/
public static final String USER_DATA_IS_NOT_EXIST = "员工投保信息不存在";
public static final String USER_DATA_IS_NOT_EXIST = "员工投保记录不存在";
/**
* 存在多条在保记录
......@@ -619,6 +619,20 @@ public class InsurancesConstants {
*/
public static final String DELETE_INSURANCE_TYPE_STANDARD = "删除购买标准";
/**
* 购买标准不能超过9999999.99
*/
public static final String INSURANCE_TYPE_STANDARD_MAX_ERROR = "购买标准不能超过9999999.99";
/**
* 医疗额度不能超过9999999.99
*/
public static final String MEDICAL_QUOTA_MAX_ERROR = "医疗额度不能超过9999999.99";
/**
* 身故和残疾不能超过9999999.99
*/
public static final String DIE_DISABLE_QUOTA_MAX_ERROR = "身故和残疾不能超过9999999.99";
/**
* 导入减员数据
......
......@@ -168,6 +168,15 @@ public class ValidityUtil {
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ;
}
return Boolean.TRUE;
}
/**
* 判断金额是否大于9999999.99
* @param money 金额
* @return boolean
*/
public static boolean validateMoneyMax(final String money) {
BigDecimal bigDecimalMoney= new BigDecimal(money);
boolean max = bigDecimalMoney.compareTo(CommonConstants.MONEY_MAX) >0;
if(max){
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author zhaji
* @description TODO
* @date 2022-08-01 18:11:59
*/
@Data
public class InsuranceListByIdCardVo extends TInsuranceDetail {
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
}
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
......@@ -442,9 +443,8 @@ public class TInsuranceDetailController {
* @return
*/
@Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表")
@PostMapping("/getInsuranceListByIdCard")
public R<IPage<TInsuranceDetail>> getInsuranceListByIdCard(Page<TInsuranceDetail> page,
@RequestParam String idCard) {
@GetMapping("/getInsuranceListByIdCard")
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard));
}
}
......@@ -176,5 +176,5 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @date 2022-08-01
* @return
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
}
......@@ -301,6 +301,6 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param
* @return {@link R}
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -2491,7 +2490,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
......@@ -2898,7 +2896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName).eq(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
......@@ -2910,6 +2908,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
TInsuranceDetail one = getOne(queryWrapper);
//员工投保记录不存在
if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
......@@ -2917,11 +2916,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//当前保单信息的不是已投保状态不能导入
Integer buyHandleStatus = one.getBuyHandleStatus();
//商险待投保,无法减员
if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
//商险投保中,无法减员
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
......@@ -3150,7 +3151,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
......@@ -3367,7 +3369,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
......@@ -3514,7 +3517,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
......@@ -3553,8 +3555,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
@Override
public IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
return baseMapper.getInsuranceListByIdCard(page, idCard);
public IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
IPage<InsuranceListByIdCardVo> insuranceListByIdCard = baseMapper.getInsuranceListByIdCard(page, idCard);
List<InsuranceListByIdCardVo> records = insuranceListByIdCard.getRecords();
if (CollectionUtils.isNotEmpty(records)){
for (InsuranceListByIdCardVo record : records) {
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
}
insuranceListByIdCard.setRecords(records);
}
return insuranceListByIdCard;
}
}
......@@ -125,12 +125,21 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (!ValidityUtil.validateMoney(buyStandard)){
return R.failed("购买标准格式不正确");
}
if (!ValidityUtil.validateMoneyMax(buyStandard)){
return R.failed(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("医疗额度格式不正确");
}
if (!ValidityUtil.validateMoneyMax(medicalQuota)){
return R.failed(InsurancesConstants.MEDICAL_QUOTA_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(dieDisableQuota)){
return R.failed("身故或残疾额度格式不正确");
}
if (!ValidityUtil.validateMoneyMax(dieDisableQuota)){
return R.failed(InsurancesConstants.DIE_DISABLE_QUOTA_MAX_ERROR);
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getInsuranceTypeId,insuranceTypeStandard.getInsuranceTypeId())
.eq(TInsuranceTypeStandard::getBuyStandard,insuranceTypeStandard.getBuyStandard())
......
......@@ -763,7 +763,7 @@
</update>
<!--getInsuranceListByIdCard-->
<select id="getInsuranceListByIdCard" resultMap="BaseResultMap">
<select id="getInsuranceListByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_detail
......
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