Commit 391dd7ae authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:修改减员的校验逻辑"

See merge request fangxinjiang/yifu!86
parents 183a80ba 03985faf
...@@ -569,9 +569,9 @@ public class InsurancesConstants { ...@@ -569,9 +569,9 @@ public class InsurancesConstants {
*/ */
public static final String REFUND_EXPORT_FAILED = "减员办理失败"; 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 = "员工投保记录不存在";
/** /**
* 存在多条在保记录 * 存在多条在保记录
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
...@@ -442,9 +443,8 @@ public class TInsuranceDetailController { ...@@ -442,9 +443,8 @@ public class TInsuranceDetailController {
* @return * @return
*/ */
@Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表") @Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表")
@PostMapping("/getInsuranceListByIdCard") @GetMapping("/getInsuranceListByIdCard")
public R<IPage<TInsuranceDetail>> getInsuranceListByIdCard(Page<TInsuranceDetail> page, public R<IPage<TInsuranceDetail>> getInsuranceListByIdCard(Page page, String idCard) {
@RequestParam String idCard) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard)); return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard));
} }
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; 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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -2491,7 +2490,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2491,7 +2490,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>(); List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList); List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>(); List<TInsuranceRefund> refundList = new ArrayList<>();
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) { for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund(); TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo(); RefundErrorVo refundErrorVo = new RefundErrorVo();
...@@ -2898,7 +2896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2898,7 +2896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .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 :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据 //排除已减员的数据
...@@ -2910,6 +2908,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2910,6 +2908,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
TInsuranceDetail one = getOne(queryWrapper); TInsuranceDetail one = getOne(queryWrapper);
//员工投保记录不存在
if (Common.isEmpty(one)){ if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
...@@ -2917,11 +2916,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2917,11 +2916,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//当前保单信息的不是已投保状态不能导入 //当前保单信息的不是已投保状态不能导入
Integer buyHandleStatus = one.getBuyHandleStatus(); Integer buyHandleStatus = one.getBuyHandleStatus();
//商险待投保,无法减员
if (CommonConstants.ONE_INT == buyHandleStatus){ if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//商险投保中,无法减员
if (CommonConstants.TWO_INT == buyHandleStatus){ if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR);
errorList.add(param); errorList.add(param);
...@@ -3150,7 +3151,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3150,7 +3151,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .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); queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper); List<TInsuranceDetail> list = list(queryWrapper);
...@@ -3367,7 +3369,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3367,7 +3369,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo) .eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .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); queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper); List<TInsuranceDetail> list = list(queryWrapper);
...@@ -3514,7 +3517,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3514,7 +3517,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* EKP紧急出险 * EKP紧急出险
* *
* @author zhaji * @author zhaji
* @param userName
* @param empIdcardNo * @param empIdcardNo
* @return {@link R} * @return {@link R}
*/ */
......
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