Commit db7d8dba authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!147
parents 42fa4c4a 52e1553d
...@@ -365,7 +365,7 @@ public class TInsuranceDetailController { ...@@ -365,7 +365,7 @@ public class TInsuranceDetailController {
@Operation(summary = "导出减员列表", description = "导出减员列表") @Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList") @PostMapping("/getInsuranceRefundHandlingList")
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) { public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param)); return tInsuranceDetailService.getInsuranceRefundHandlingList(param);
} }
/** /**
......
...@@ -189,4 +189,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -189,4 +189,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard); IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo); List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
TInsuranceDetail selectByregionSQL(@Param("regionSql") String regionSQL,@Param("id") String id);
} }
...@@ -231,7 +231,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -231,7 +231,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param param 查询参数 * @param param 查询参数
* @return {@link List< RefundExportListVo >} * @return {@link List< RefundExportListVo >}
*/ */
List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param); R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param);
/** /**
* 减员办理 * 减员办理
......
...@@ -2402,17 +2402,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2402,17 +2402,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 //查数据是否存在权限范围内
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL, detail.getId());
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.last(regionSQL+CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){ if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION); param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION);
listResult.add(param); listResult.add(param);
...@@ -2833,7 +2824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2833,7 +2824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param){ public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList; List<RefundExportListVo> refundExportList;
...@@ -2843,6 +2834,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2843,6 +2834,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集 //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){ if (CollectionUtils.isNotEmpty(param.getIdList())){
refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList()); refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList());
for (RefundExportListVo refundExportListVo : refundExportList) {
if(null != refundExportListVo.getReduceHandleStatus() && CommonConstants.ONE_INT != refundExportListVo.getReduceHandleStatus()){
return R.failed(InsurancesConstants.CHANGE_ERROR);
}
}
}else { }else {
refundExportList = baseMapper.getRefundExportList(param); refundExportList = baseMapper.getRefundExportList(param);
} }
...@@ -2880,7 +2876,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2880,7 +2876,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//批量更新 //批量更新
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail s : detailList) {
updateWrapper.eq(TInsuranceDetail :: getId,s.getId())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
} }
//批量更新 //批量更新
if (CollectionUtils.isNotEmpty(refundList)){ if (CollectionUtils.isNotEmpty(refundList)){
...@@ -2891,7 +2894,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2891,7 +2894,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//操作记录 //操作记录
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT); addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT);
} }
return refundExportList; return R.ok(refundExportList);
} }
/** /**
...@@ -2910,6 +2913,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2910,6 +2913,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> insuranceDetailList = insuranceDetail.getInsuranceDetailList(); List<String> insuranceDetailList = insuranceDetail.getInsuranceDetailList();
if (CollectionUtils.isEmpty(insuranceDetailList)){
return R.failed("减员办理列表为空");
}
List<RefundErrorVo> errorList = new ArrayList<>(); List<RefundErrorVo> errorList = new ArrayList<>();
List<TInsuranceDetail> successList = new ArrayList<>(); List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList); List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
...@@ -2934,6 +2940,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2934,6 +2940,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setReduceHandleStatus(refundType); tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){ if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setIsOverdue(null); tInsuranceDetail.setIsOverdue(null);
tInsuranceDetail.setIsEffect(null);
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
}else { }else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
......
...@@ -803,6 +803,7 @@ ...@@ -803,6 +803,7 @@
detail.SETTLE_MONTH as settleMonth, detail.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType, detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName, detail.CREATE_NAME as createName,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus,
detail.REMARK as remark detail.REMARK as remark
from from
t_insurance_detail detail t_insurance_detail detail
...@@ -903,4 +904,17 @@ ...@@ -903,4 +904,17 @@
</where> </where>
ORDER BY CREATE_TIME desc ORDER BY CREATE_TIME desc
</select> </select>
<select id="selectByregionSQL" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
t_insurance_detail detail
<where>
detail.ID = #{id}
<if test="regionSql != null and regionSql.trim() != ''">
and ${regionSql}
</if>
</where>
ORDER BY CREATE_TIME desc
</select>
</mapper> </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