Commit 211481e8 authored by zhaji's avatar zhaji

"feature-zhaJi:优化登记保单保费权限校验"

parent 3a83e50f
......@@ -365,7 +365,7 @@ public class TInsuranceDetailController {
@Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList")
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> {
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
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> {
* @param param 查询参数
* @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
listResult.add(param);
continue;
}else {
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.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)
);
//查数据是否存在权限范围内
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL, detail.getId());
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION);
listResult.add(param);
......@@ -2833,7 +2824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(rollbackFor = Exception.class)
public List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param){
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList;
......@@ -2843,6 +2834,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
if (CollectionUtils.isNotEmpty(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 {
refundExportList = baseMapper.getRefundExportList(param);
}
......@@ -2891,7 +2887,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//操作记录
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT);
}
return refundExportList;
return R.ok(refundExportList);
}
/**
......
......@@ -803,6 +803,7 @@
detail.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus,
detail.REMARK as remark
from
t_insurance_detail detail
......@@ -903,4 +904,17 @@
</where>
ORDER BY CREATE_TIME desc
</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>
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