Commit f8d3e5c9 authored by 张云's avatar 张云 🎱

Merge branch 'f-zy' into 'feature/insurance-1.1.0'

feat:商险退保费用相关

See merge request !282
parents d481515e c4320208
......@@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
......@@ -66,6 +67,7 @@ public class BaseEntity implements Serializable {
@Schema(description = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
@ExcelIgnore
@JsonIgnore
private LocalDateTime updateTime;
/**
......@@ -73,6 +75,7 @@ public class BaseEntity implements Serializable {
*/
@TableField(exist = false)
@ExcelIgnore
@JsonIgnore
private String mId;
/**
......@@ -80,6 +83,7 @@ public class BaseEntity implements Serializable {
*/
@TableField(exist = false)
@ExcelIgnore
@JsonIgnore
private String menuInfo;
/**
......@@ -87,6 +91,7 @@ public class BaseEntity implements Serializable {
*/
@TableField(exist = false)
@ExcelIgnore
@JsonIgnore
private String authSql;
}
......@@ -657,6 +657,31 @@ public class InsurancesConstants {
public static final String DEPT_NO_CHANGE_OLD_IS_NOT_EXIST = "被替换的项目不存在";
/**
* 保险公司不能为空
*/
public static final String REFUND_INSURANCE_COMPANY_NOT_EMPTY = "保险公司不能为空";
/**
* 险种不能为空
*/
public static final String REFUND_INSURANCE_TYPE_NOT_EMPTY = "险种不能为空";
/**
* 保单开始日期不能为空
*/
public static final String REFUND_INSURANCE_START_DATE_NOT_EMPTY = "保单开始日期不能为空";
/**
* 保单结束日期不能为空
*/
public static final String REFUND_INSURANCE_END_DATE_NOT_EMPTY = "保单结束日期不能为空";
/**
* 购买标准不能为空
*/
public static final String REFUND_BUY_STANDARD_NOT_EMPTY = "购买标准不能为空";
/**
* 退费金额不能为空
*/
......@@ -670,7 +695,7 @@ public class InsurancesConstants {
/**
* 员工减员记录不存在
*/
public static final String REFUND_IS_NULL = "员工减员记录不存在";
public static final String REFUND_IS_NULL = "未找到“减员成功”的参保信息";
/**
* 已更新保单减员退费,不能再次更新
......
......@@ -365,10 +365,16 @@ public class InsuranceDetailVO implements Serializable {
private String replaceInvoiceTitle;
/**
* 退保金额 todo 数据库暂时没有
* 减员id
*/
@Schema(description = "退保金额 :预留字段,暂时都是空(减员类型专用)")
private String surrender;
@Schema(description = "减员id")
private String refundId;
/**
* 退保金额
*/
@Schema(description = "退保金额(减员类型专用)")
private BigDecimal surrender;
/**
* 退保结算状态 todo 数据库暂时没有
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author zhangyun
* @description 退保成功列表
* @date 2022-12-09 09:00:00
*/
@Data
@Tag(name ="退保成功列表")
public class RefundListVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 保险公司名称(冗余字段)
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 退款金额(元)
*/
@Schema(description = "退款金额(元)")
private String refundMoney;
/**
* 退至项目名称
*/
@Schema(description = "退至项目名称")
private String returnProjectName;
/**
* 退至员工姓名
*/
@Schema(description = "退至员工姓名")
private String returnEmpName;
/**
* 退至员工身份证号
*/
@Schema(description = "退至员工身份证号")
private String returnEmpIdcardNo;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author 张云
* @description 减员退费导入表
* @date 2022-12-09 10:06:31
*/
@Data
@Tag(name = "减员退费导入表")
public class RefundMoneyUpdateParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
@JsonIgnore
private String id;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
private String policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
private String policyEnd;
/**
* 保险公司名称(冗余字段)
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 退款金额(元)
*/
@Schema(description = "退款金额(元)")
private String refundMoney;
/**
* 错误原因
*/
@Schema(description = "错误原因")
private String errorMessage;
}
......@@ -416,7 +416,7 @@ public class TInsuranceDetailController {
*
* @author zhaji
* @param param 查询条件
* @return {@link R<IPage< InsuranceRefundListVo >>}
* @return {@link R<IPage<InsuranceRefundListVo>>}
*/
@Operation(summary = "已减员列表分页查询", description = "已减员列表分页查询")
@PostMapping("/getInsuranceRefundPageList")
......@@ -430,7 +430,7 @@ public class TInsuranceDetailController {
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List< InsuranceRefundListVo >>}
* @return {@link R<List<InsuranceRefundListVo>>}
*/
@Operation(summary = "已减员列表导出", description = "已减员列表导出")
@PostMapping("/getInsuranceRefundList")
......@@ -445,7 +445,7 @@ public class TInsuranceDetailController {
*
* @author zhaji
* @param param 查询条件
* @return {@link R<IPage< RefundExportListVo >>}
* @return {@link R<IPage<RefundExportListVo>>}
*/
@Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询")
@GetMapping("/getInsuranceRefundHandlingPageList")
......@@ -536,19 +536,6 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.updateIsUse(id);
}
/**
* 更新减员退费
*
* @author zhaji
* @param paramList 退费列表
* @return {@link R<List< RefundMoneyParam >>}
*/
@Operation(summary = "更新减员退费", description = "更新减员退费")
@PostMapping("/updateRefundMoney")
public R updateRefundMoney(@RequestBody @Valid @Size(min = 1,message = "更新减员退费不能为空") List<RefundMoneyParam> paramList) {
return R.failed("该功能暂未开放");
//return tInsuranceDetailService.updateRefundMoney(paramList);
}
/**
* 查询项目列表
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
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.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.jmx.export.annotation.ManagedOperationParameter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @author zhangyun
* @description 减员退费控制器
* @date 2022-12-09 09:55:28
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/insuranceRefund")
@Tag(name = "商险减员退费相关")
@Validated
public class TInsuranceRefundController {
@Resource
private TInsuranceDetailService tInsuranceDetailService;
/**
* 减员退费分页列表
*
* @author zhangyun
* @param page 分页信息
* @param param 筛选条件
* @param mId 菜单Id
* @return {@link R}
*/
@Operation(summary = "减员退费分页列表", description = "减员退费分页列表")
@GetMapping("/getInsuranceRefundMoneyPageList")
public R getInsuranceRefundPageList(Page<RefundListVo> page,
InsuranceRefundHandlingParam param,
@RequestParam(required = false) String mId) {
return tInsuranceDetailService.getInsuranceRefundMoneyPageList(page,param,mId);
}
/**
* 减员退费不分页列表
*
* @author zhangyun
* @param param 筛选条件
* @return {@link R}
*/
@Operation(summary = "已减员列表导出", description = "已减员列表导出")
@GetMapping("/getInsuranceRefundMoneyList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_reduction_export')")
public R getInsuranceRefundList(InsuranceRefundHandlingParam param) {
return tInsuranceDetailService.getInsuranceRefundMoneyList(param);
}
/**
* 更新减员退费
*
* @author zhangyun
* @param paramList 退费列表
* @return {@link R<List<RefundMoneyUpdateParam>>}
*/
@Operation(summary = "更新减员退费", description = "更新减员退费")
@PostMapping("/updateRefundMoney")
public R updateRefundMoney(@RequestBody @Valid @Size(min = 1,message = "更新减员退费不能为空") List<RefundMoneyUpdateParam> paramList) {
return tInsuranceDetailService.updateRefundMoney(paramList);
}
}
......@@ -130,7 +130,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuranceRefundListVo>}
* @return {@link IPage<InsuranceRefundListVo>}
*/
IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @Param("param")InsuranceRefundParam param);
......@@ -139,10 +139,30 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo>}
* @return {@link List<InsuranceRefundListVo>}
*/
List<InsuranceRefundListVo> getInsuranceRefundList( @Param("param") InsuranceRefundParam param);
/**
* 查询退费分页列表
*
* @author zhangyun
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage<RefundListVo>}
*/
IPage<RefundListVo> getInsuranceRefundMoneyPageList(Page<RefundListVo> page, @Param("param")InsuranceRefundHandlingParam param);
/**
* 查询退费不分页列表
*
* @author zhangyun
* @param param 查询参数
* @return {@link List<RefundListVo>}
*/
List<RefundListVo> getInsuranceRefundMoneyList(@Param("param") InsuranceRefundHandlingParam param);
/**
* 减员办理列表分页查询
*
......@@ -174,11 +194,11 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
/**
* 查询保单减员退费信息
*
* @author zhaji
* @param refundDetail
* @return {@link TInsuranceRefundDetail}
* @author zhangyun
* @param param 查询参数
* @return {@link String}
*/
TInsuranceRefundDetail selectRefundDetail(@Param("param") TInsuranceRefundDetail refundDetail);
String selectRefundDetailId(@Param("param") RefundMoneyUpdateParam param);
/**
* 根据ID导出减员办理列表
......
......@@ -25,5 +25,12 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
void updateByInsDetailId(@Param("param") TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
/**
* 更新退款信息
*
* @author zhangyun
* @param insuranceRefund 退款信息
* @return {@link int}
*/
int updateRefundMoney(@Param("param") TInsuranceRefund insuranceRefund);
}
......@@ -253,17 +253,38 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
* @return {@link List<InsuranceRefundListVo>}
*/
R getInsuranceRefundList(InsuranceRefundParam param);
/**
* 减员退费分页列表
*
* @author zhangyun
* @param page 分页信息
* @param param 筛选条件
* @param mId 菜单Id
* @return {@link R}
*/
R getInsuranceRefundMoneyPageList(Page<RefundListVo> page, InsuranceRefundHandlingParam param, String mId);
/**
* 减员退费不分页列表
*
* @author zhangyun
* @param param 筛选条件
* @return {@link R}
*/
R getInsuranceRefundMoneyList(InsuranceRefundHandlingParam param);
/**
* 减员办理列表分页查询
*
* @author zhaji
* @param page 分页数据
* @param param 查询参数
* @return {@link IPage< RefundExportListVo >}
* @param mId 菜单id
* @return {@link IPage<RefundExportListVo>}
*/
IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param,
String mId);
......@@ -344,11 +365,11 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
/**
* 更新减员退费
*
* @author zhaji
* @param paramList
* @author zhangyun
* @param paramList 减员退费参数
* @return {@link R}
*/
R updateRefundMoney(List<RefundMoneyParam> paramList);
R updateRefundMoney(List<RefundMoneyUpdateParam> paramList);
/**
* 查询项目列表
......
......@@ -14,6 +14,13 @@ public interface TInsuranceRefundService extends IService<TInsuranceRefund> {
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
/**
* 更新退款信息
*
* @author zhangyun
* @param insuranceRefund 退款参数
* @return {@link int}
*/
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
......@@ -918,11 +918,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//减员类型 处理创建人、创建时间、备注
if(CommonConstants.FIVE_INT == insuranceDetailVO.getDistributeType()){
TInsuranceRefund refund = tInsuranceRefundService.getOne(Wrappers.<TInsuranceRefund>query().lambda()
.eq(TInsuranceRefund::getInsDetailId, insuranceDetailVO.getId())
.eq(TInsuranceRefund::getId, insuranceDetailVO.getRefundId())
.orderByDesc(TInsuranceRefund::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(refund).isPresent()){
insuranceDetailVO.setSurrender(refund.getRefundMoney());
insuranceDetailVO.setCreateName(refund.getCreateName());
insuranceDetailVO.setCreateTime(refund.getCreateTime());
insuranceDetailVO.setRemark(refund.getRemark());
......@@ -4017,7 +4018,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
* @return {@link List<InsuranceRefundListVo>}
*/
@Override
public R getInsuranceRefundList(InsuranceRefundParam param) {
......@@ -4029,9 +4030,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
/*if(insuranceRefundList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}*/
//根据项目编码获取项目名称
List<String> collect = insuranceRefundList.stream().map(InsuranceRefundListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
......@@ -4052,6 +4051,51 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.ok(insuranceRefundList);
}
/**
* 减员退费分页列表
*
* @param page 分页信息
* @param param 筛选条件
* @param mId 菜单Id
* @return {@link R}
* @author zhangyun
*/
@Override
public R getInsuranceRefundMoneyPageList(Page<RefundListVo> page, InsuranceRefundHandlingParam param, String mId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isNotNull(mId)) {
param.setMId(mId);
}
param.setCreateBy(user.getId());
menuUtil.setAuthSql(user, param);
if (Common.isNotNull(param.getAuthSql()) && param.getAuthSql().contains("1=2 CONCAT")) {
param.setAuthSql(param.getAuthSql().replace("1=2 CONCAT", "CONCAT"));
}
IPage<RefundListVo> insuranceRefundMoneyPageList = this.baseMapper.getInsuranceRefundMoneyPageList(page, param);
return R.ok(insuranceRefundMoneyPageList);
}
/**
* 减员退费不分页列表
*
* @param param 筛选条件
* @return {@link R}
* @author zhangyun
*/
@Override
public R getInsuranceRefundMoneyList(InsuranceRefundHandlingParam param) {
YifuUser user = SecurityUtils.getUser();
param.setCreateBy(user.getId());
menuUtil.setAuthSql(user, param);
if (Common.isNotNull(param.getAuthSql()) && param.getAuthSql().contains("1=2 CONCAT")) {
param.setAuthSql(param.getAuthSql().replace("1=2 CONCAT", "CONCAT"));
}
List<RefundListVo> insuranceRefundMoneyList = this.baseMapper.getInsuranceRefundMoneyList(param);
return R.ok(insuranceRefundMoneyList);
}
/**
* 减员办理列表分页查询
*
......@@ -5263,24 +5307,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/**
* 更新减员退费
*
* @author zhaji
* @param paramList
* @author zhangyun
* @param paramList 导入参数
* @return {@link R}
*/
@Override
public R updateRefundMoney(List<RefundMoneyParam> paramList) {
public R updateRefundMoney(List<RefundMoneyUpdateParam> paramList) {
YifuUser user = SecurityUtils.getUser();
Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyParam> successList = map.get(InsurancesConstants.SUCCESS_LIST);
Map<String, List<RefundMoneyUpdateParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyUpdateParam> successList = map.get(InsurancesConstants.SUCCESS_LIST);
if (CollectionUtils.isNotEmpty(successList)){
for (RefundMoneyParam param : successList) {
for (RefundMoneyUpdateParam param : successList) {
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(param.getId());
insuranceRefund.setId(param.getId());
insuranceRefund.setRefundMoney(new BigDecimal(param.getRefundMoney()));
insuranceRefund.setReduceHandleStatus(CommonConstants.FOUR_INT);
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setUpdateBy(user.getId());
insuranceRefund.setUpdateTime(LocalDateTime.now());
tInsuranceRefundService.updateRefundMoney(insuranceRefund);
}
}
......@@ -5485,57 +5529,83 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param paramList 变更列表
* @return {@link R}
*/
public Map<String,List<RefundMoneyParam>> refundMoneyCheck(List<RefundMoneyParam> paramList){
Map<String,List<RefundMoneyParam>> map = new HashMap<>(16);
List<RefundMoneyParam> errorList = new ArrayList<>();
List<RefundMoneyParam> successList = new ArrayList<>();
for (RefundMoneyParam param : paramList) {
String refundMoney = param.getRefundMoney();
String policyNo = param.getPolicyNo();
String empName = param.getEmpName();
String empIdcardNo = param.getEmpIdcardNo();
//退费金额
if(StringUtils.isBlank(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_NOT_EMPTY);
public Map<String,List<RefundMoneyUpdateParam>> refundMoneyCheck(List<RefundMoneyUpdateParam> paramList){
Map<String,List<RefundMoneyUpdateParam>> map = new HashMap<>(16);
List<RefundMoneyUpdateParam> errorList = new ArrayList<>();
List<RefundMoneyUpdateParam> successList = new ArrayList<>();
for (RefundMoneyUpdateParam param : paramList) {
//姓名
if(StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单
if(StringUtils.isBlank(policyNo)){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY);
//身份证
if(StringUtils.isBlank(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//姓名
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
//保险公司
if(StringUtils.isBlank(param.getInsuranceCompanyName())){
param.setErrorMessage(InsurancesConstants.REFUND_INSURANCE_COMPANY_NOT_EMPTY);
errorList.add(param);
continue;
}
//身份证号
if(StringUtils.isBlank(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
//险种名称
if(StringUtils.isBlank(param.getInsuranceTypeName())){
param.setErrorMessage(InsurancesConstants.REFUND_INSURANCE_TYPE_NOT_EMPTY);
errorList.add(param);
continue;
}
if(!ValidityUtil.validateMoney(refundMoney)){
//保单开始时间
if(StringUtils.isBlank(param.getPolicyStart())){
param.setErrorMessage(InsurancesConstants.REFUND_INSURANCE_START_DATE_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单结束时间
if(StringUtils.isBlank(param.getPolicyEnd())){
param.setErrorMessage(InsurancesConstants.REFUND_INSURANCE_END_DATE_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单借宿时间
if(StringUtils.isBlank(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.REFUND_BUY_STANDARD_NOT_EMPTY);
errorList.add(param);
continue;
}
//退费金额
if(StringUtils.isBlank(param.getRefundMoney())){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_NOT_EMPTY);
errorList.add(param);
continue;
}
if(!ValidityUtil.validateMoney(param.getRefundMoney())){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息
TInsuranceRefundDetail refundDetail = new TInsuranceRefundDetail();
refundDetail.setEmpName(empName);
refundDetail.setEmpIdcardNo(empIdcardNo);
refundDetail.setPolicyNo(policyNo);
TInsuranceRefundDetail tInsuranceRefundDetail = this.baseMapper.selectRefundDetail(refundDetail);
if(Common.isEmpty(tInsuranceRefundDetail)){
String tInsuranceRefundDetailId = this.baseMapper.selectRefundDetailId(param);
if(Common.isEmpty(tInsuranceRefundDetailId)){
param.setErrorMessage(InsurancesConstants.REFUND_IS_NULL);
errorList.add(param);
continue;
}
param.setId(tInsuranceRefundDetail.getInsDetailId());
param.setId(tInsuranceRefundDetailId);
successList.add(param);
}
map.put(InsurancesConstants.ERROR_LIST,errorList);
......
......@@ -324,7 +324,8 @@
a.REMARK as remark,
a.BILLING_TYPE as billingType,
a.DEFAULT_SETTLE_ID as defaultSettleId,
a.RATE as rate
a.RATE as rate,
a.REFUND_ID as refundId
from t_insurance_detail a
left join t_insurance_settle tis on a.DEFAULT_SETTLE_ID = tis.ID
where a.ID = #{id}
......@@ -916,35 +917,29 @@
#{item}
</foreach>
</select>
<!-- 查询保单减员退费信息-->
<select id="selectRefundDetail" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceRefundDetail">
<select id="selectRefundDetailId" resultType="String">
select
a.DEPT_NO as deptNo,
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
refund.ID as id,
refund.INS_DETAIL_ID as insDetailId,
refund.REFUND_MONEY as refundMoney
refund.ID as refundId
from
t_insurance_detail a,
t_insurance_refund refund
where
a.DELETE_FLAG = 0
and
a.REFUND_ID = refund.ID
and
a.BUY_HANDLE_STATUS = 5
and
a.REDUCE_HANDLE_STATUS = 4
<if test="param.empName != null and param.empName.trim() != ''">
and a.REFUND_ID = refund.ID
and a.BUY_HANDLE_STATUS = 5
and a.REDUCE_HANDLE_STATUS = 4
and a.EMP_NAME = #{param.empName}
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO = #{param.empIdcardNo}
</if>
<if test="param.policyNo!= null and param.policyNo.trim() != ''">
and a.POLICY_NO = #{param.policyNo}
</if>
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
and a.INSURANCE_TYPE_NAME = #{param.insuranceTypeName}
and a.POLICY_START = #{param.policyStart}
and a.POLICY_END = #{param.policyEnd}
and a.BUY_STANDARD = #{param.buyStandard}
order by
refund.CREATE_TIME DESC
limit 1;
</select>
<!-- 根据ID导出减员办理列表-->
<select id="getRefundExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
......@@ -1240,4 +1235,155 @@
</foreach>
</select>
<!-- 退保退费分页查询-->
<select id="getInsuranceRefundMoneyPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundListVo">
SELECT
a.ID AS id,
a.DEPT_NAME AS projectName,
a.EMP_NAME AS empName,
a.EMP_IDCARD_NO AS empIdcardNo,
a.BUY_TYPE AS buyType,
a.POLICY_START AS policyStart,
a.POLICY_END AS policyEnd,
a.INSURANCE_COMPANY_NAME AS insuranceCompanyName,
a.INSURANCE_TYPE_NAME AS insuranceTypeName,
a.BUY_STANDARD AS buyStandard,
refund.REFUND_MONEY AS refundMoney,
IF
( a.BUY_TYPE = 4, `replace`.empName, a.EMP_NAME ) AS returnEmpName,
IF
( a.BUY_TYPE = 4, `replace`.empIdcardNo, a.EMP_IDCARD_NO ) AS returnEmpIdcardNo,
IF
( a.BUY_TYPE = 4, `replace`.projectName, a.DEPT_NAME ) AS returnProjectName
FROM
t_insurance_detail a
LEFT JOIN t_insurance_refund refund ON a.REFUND_ID = refund.ID
LEFT JOIN (
SELECT
`replace`.FROM_INSURANCE_DETAIL_ID AS fromDetailId,
`replace`.TO_INSURANCE_DETAIL_ID AS toDetailId,
`replace`.ORIGIN_INSURANCE_DETAIL_ID AS originDetailId,
detail.DEPT_NAME AS projectName,
detail.EMP_NAME AS empName,
detail.EMP_IDCARD_NO AS empIdcardNo
FROM
t_insurance_replace `replace`
LEFT JOIN t_insurance_detail detail ON `replace`.ORIGIN_INSURANCE_DETAIL_ID = detail.ID
) `replace` ON a.ID = `replace`.toDetailId
AND a.BUY_TYPE = 4
WHERE
a.DELETE_FLAG = 0
AND a.REDUCE_HANDLE_STATUS = 4
and refund.REFUND_MONEY IS NOT NULL
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo}
</if>
<if test="param.reduceHandleStatus != null">
and a.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and a.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
and refund.UPDATE_BY = #{param.updateBy}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
ORDER BY refund.CREATE_TIME DESC,a.ID ASC
</select>
<select id="getInsuranceRefundMoneyList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundListVo">
SELECT
a.ID AS id,
a.DEPT_NAME AS projectName,
a.EMP_NAME AS empName,
a.EMP_IDCARD_NO AS empIdcardNo,
a.BUY_TYPE AS buyType,
a.POLICY_START AS policyStart,
a.POLICY_END AS policyEnd,
a.INSURANCE_COMPANY_NAME AS insuranceCompanyName,
a.INSURANCE_TYPE_NAME AS insuranceTypeName,
a.BUY_STANDARD AS buyStandard,
refund.REFUND_MONEY AS refundMoney,
IF
( a.BUY_TYPE = 4, `replace`.empName, a.EMP_NAME ) AS returnEmpName,
IF
( a.BUY_TYPE = 4, `replace`.empIdcardNo, a.EMP_IDCARD_NO ) AS returnEmpIdcardNo,
IF
( a.BUY_TYPE = 4, `replace`.projectName, a.DEPT_NAME ) AS returnProjectName
FROM
t_insurance_detail a
LEFT JOIN t_insurance_refund refund ON a.REFUND_ID = refund.ID
LEFT JOIN (
SELECT
`replace`.FROM_INSURANCE_DETAIL_ID AS fromDetailId,
`replace`.TO_INSURANCE_DETAIL_ID AS toDetailId,
`replace`.ORIGIN_INSURANCE_DETAIL_ID AS originDetailId,
detail.DEPT_NAME AS projectName,
detail.EMP_NAME AS empName,
detail.EMP_IDCARD_NO AS empIdcardNo
FROM
t_insurance_replace `replace`
LEFT JOIN t_insurance_detail detail ON `replace`.ORIGIN_INSURANCE_DETAIL_ID = detail.ID
) `replace` ON a.ID = `replace`.toDetailId
AND a.BUY_TYPE = 4
WHERE
a.DELETE_FLAG = 0
AND a.REDUCE_HANDLE_STATUS = 4
and refund.REFUND_MONEY IS NOT NULL
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo}
</if>
<if test="param.reduceHandleStatus != null">
and a.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and a.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
and refund.UPDATE_BY = #{param.updateBy}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
ORDER BY refund.CREATE_TIME DESC,a.ID ASC
</select>
</mapper>
......@@ -63,11 +63,11 @@
update
t_insurance_refund
set
REFUND_MONEY = #{refundMoney},
UPDATE_BY = #{updateBy},
UPDATE_TIME = #{updateTime}
REFUND_MONEY = #{param.refundMoney},
UPDATE_BY = #{param.updateBy},
UPDATE_TIME = #{param.updateTime}
where
INS_DETAIL_ID = #{insDetailId}
ID = #{param.id}
</update>
<select id="getByInsDetailId" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund">
......
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