Commit 0170e2ac authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:新增商险减员办理,查询列表,导出列表接口"

See merge request fangxinjiang/yifu!27
parents 2b1fb524 21734172
......@@ -27,6 +27,7 @@ public class InsurancesConstants {
* 非投保退回状态,无法删除
*/
public static final String DELETE_ERROR = "非投保退回状态,无法删除";
/**
* 不允许编辑
*/
......@@ -184,4 +185,51 @@ public class InsurancesConstants {
*/
public static final String POLICY_NO_EXIST= "保单号不存在";
/***********************减员办理错误码********************************/
/**
* 已被替换,不允许减员
*/
public static final String IS_EFFECT_ERROR = "已被替换,不允许减员";
/**
* 已超出保单截止日期,不允许减员
*/
public static final String IS_OVERDUE_ERROR = "已超出保单截止日期,不允许减员";
/**
* 已出险的,不允许减员
*/
public static final String IS_USE_ERROR = "已出险的,不允许减员";
/**
* 非已投保状态,无法减员
*/
public static final String REFUND_ERROR = "非已投保状态,无法减员";
/**
* 替换结算月份和原有结算月份相同
*/
public static final String SETTLE_MONTH_IDENTICAL = "替换结算月份和原有结算月份相同";
/**
* 当前保单已处于减员流程,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR = "当前保单已处于减员流程,无法变更结算月";
/**
* 当前保单已结算,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "前保单已结算,无法变更结算月";
/**
* 替换项目ID和原有项目ID相同
*/
public static final String DEPT_NO_IDENTICAL = "替换项目ID和原有项目ID相同";
/**
* 重复数据
*/
public static final String DUPLICATE_DATA_ERROR = "重复数据";
}
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -257,6 +258,13 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "备注")
private String remark;
/**
* 减员派单日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "减员派单日期")
private LocalDate refundCreateTime;
/**
* 是否删除 0未删除/1删除
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description 变更所属项目
* @date 2022-07-21 15:35:49
*/
@Data
@Tag(name = "变更所属项目")
public class DeptChangeCheckParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
//姓名+身份证号+原项目编码+保险公司+险种+保单开始时间+保单结束时间+保单结束时间+标准+有效+未减员 是否存在校验
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号码
*/
@Schema(description = "员工身份证号码")
private String empIdCardNo;
/**
* 原项目编码
*/
@Schema(description = "原项目编码")
private String oldDeptNo;
/**
* 新项目编码
*/
@Schema(description = "新项目编码")
private String newDeptNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 保单开始日期
*/
@Schema(description = "保单开始日期")
private String policyStart;
/**
* 保单结束日期
*/
@Schema(description = "保单结束日期")
private String policyEnd;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 错误信息
*/
@Schema(description = "错误信息")
private String errorMessage;
/**
* 结算方式
*/
@Schema(description = "结算方式")
private Integer settleType;
}
......@@ -156,4 +156,5 @@ public class InsuranceExportListVO implements Serializable {
@Schema(description = "备注")
private String remark;
}
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 zhaji
* @description 减员办理返回类
* @date 2022-07-21 11:47:16
*/
@Data
@Tag(name ="减员办理返回类")
public class InsuranceRefundHandlingListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
private Integer insuranceProvince;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
private Integer insuranceCity;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
private String insuranceHandleProvinceName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
private Integer insuranceHandleCity;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
private String insuranceHandleCityName;
/**
* 保单开始时间
*/
@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 medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 结算类型 (0、与薪资合并结算 1、单独结算)
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
private Integer settleType;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}
......@@ -17,6 +17,18 @@ public class InsuranceRefundHandlingParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 减员状态 1待减员 2减员中 3减员退回 4减员成功
*/
@Schema(description = "减员状态 1待减员 2减员中 3减员退回 4减员成功")
private Integer reduceHandleStatus;
/**
* 员工姓名
*/
......@@ -30,14 +42,40 @@ public class InsuranceRefundHandlingParam implements Serializable {
private String empIdcardNo;
/**
* 项目编码
* 保险公司id
*/
@Schema(description = "项目编码")
private String deptNo;
@Schema(description = "保险公司id")
private String insuranceCompanyId;
/**
* 减员状态 1待减员 2减员中3减员退回
* 保险公司名称
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 是否出险 0未出险 1已出险
*/
@Schema(description = "是否出险 0未出险 1已出险")
private Integer isUse;
/**
* 是否有效 0有效 1无效
*/
@Schema(description = "是否有效 0有效 1无效")
private Integer isEffect;
/**
* 是否过期 0未过期 1已过期
*/
@Schema(description = "是否过期 0未过期 1已过期")
private Integer isOverdue;
}
......@@ -7,6 +7,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -25,7 +26,16 @@ public class InsuranceRefundListParam implements Serializable {
@Schema(name = "办理列表")
@NotBlank(message = "办理列表不能为空")
private List<TInsuranceDetail> insuranceRefundList;
private String [] idList;
@Schema(name = "办理人")
@NotBlank(message = "办理类型不能为空")
private String updateBy;
@Schema(name = "办理时间")
@NotBlank(message = "办理类型不能为空")
private LocalDateTime refundCreateTime;
}
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 zhaji
......@@ -15,5 +18,152 @@ import java.io.Serializable;
public class InsuranceRefundListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
private Integer insuranceProvince;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
private Integer insuranceCity;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
private String insuranceHandleProvinceName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
private Integer insuranceHandleCity;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
private String insuranceHandleCityName;
/**
* 保单开始时间
*/
@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 medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 减员派单日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "减员派单日期")
private LocalDate refundCreateTime;
}
......@@ -34,17 +34,6 @@ public class InsuranceRefundParam implements Serializable {
@Schema(description = "项目编码")
private String deptNo;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 保险公司ID
*/
@Schema(description = "保险公司ID")
private String insuranceCompanyId;
/**
* 保险公司名称
......@@ -52,6 +41,13 @@ public class InsuranceRefundParam implements Serializable {
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 保单开始时间
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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;
......@@ -7,7 +10,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @author zhaji
......@@ -58,7 +63,7 @@ public class InsuredListVo implements Serializable {
/**
* 项目编码
*/
@JsonIgnore
@Schema(description = "项目编码")
private String deptNo;
/**
......@@ -100,30 +105,126 @@ public class InsuredListVo implements Serializable {
private String buyStandard;
/**
* 创建人姓名
* 医疗额度
*/
@Schema(description = "创建人(派单人)")
private String createName;
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 预估保费
*/
@Schema(description = "预估保费")
private BigDecimal estimatePremium;
/**
* 实际保费
*/
@Schema(description = "实际保费")
private BigDecimal actualPremium;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 发票号
*/
@Schema(description = "发票号")
private String invoiceNo;
/**
* 保单生效日期
*/
@Schema(description = "保单生效日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private LocalDate policyEffect;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
private Integer insuranceProvince;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
private Integer insuranceCity;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
private String insuranceHandleProvinceName;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
* 商险办理城市code
*/
@Schema(description = "投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
@Schema(description = "商险办理城市code")
private Integer insuranceHandleCity;
/**
* 结算类型 (0、预估 1、实缴)
* 商险办理城市
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
private Integer settleType;
@Schema(description = "商险办理城市")
private String insuranceHandleCityName;
/**
* 结算月
* 是否出险 0未出险 1已出险
*/
@Schema(description = "结算月")
private String settleMonth;
@Schema(description = "是否出险 0未出险 1已出险")
private Integer isUse;
/**
* 是否有效 0有效 1无效
*/
@Schema(description = "是否有效 0有效 1无效")
private Integer isEffect;
/**
* 是否过期 0未过期 1已过期
*/
@Schema(description = "是否过期 0未过期 1已过期")
private Integer isOverdue;
/**
* 派单日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "派单日期")
private LocalDate createTime;
/**
* 派单人
*/
@Schema(description = "创建人(派单人)")
private String createName;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description 结算月变更
* @date 2022-07-21 15:38:13
*/
@Data
@Tag(name = "结算月变更")
public class SettleMonthChangeCheckParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
//姓名+身份证号+原项目编码+保险公司+险种+保单开始时间+保单结束时间+保单结束时间+标准+有效+未减员 是否存在校验
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号码
*/
@Schema(description = "员工身份证号码")
private String empIdCardNo;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 保单开始日期
*/
@Schema(description = "保单开始日期")
private String policyStart;
/**
* 保单结束日期
*/
@Schema(description = "保单结束日期")
private String policyEnd;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 错误信息
*/
@Schema(description = "错误信息")
private String errorMessage;
}
......@@ -34,12 +34,12 @@ public class TInsuranceCompanyController {
private TInsuranceCompanyService insuranceCompanyService;
/**
* 分页查询
* 保险公司分页查询
* @param page 分页对象
* @param insuranceCompany 保险公司
* @return
*/
//@Operation(summary = "分页查询", description = "分页查询")
@Operation(summary = "保险公司分页查询", description = "保险公司分页查询")
@GetMapping("/page" )
public R<IPage<TInsuranceCompany>> getInsuranceCompanyPage(Page page, TInsuranceCompany insuranceCompany) {
return R.ok(insuranceCompanyService.pageDiy(page, insuranceCompany));
......@@ -51,6 +51,7 @@ public class TInsuranceCompanyController {
* @return R
*/
@GetMapping("/{id}" )
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询保险公司详情")
public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceCompanyService.getById(id));
}
......@@ -61,7 +62,7 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 保险公司明细
* @return R
*/
//@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')")
@Operation(summary = "新增保险公司", description = "新增保险公司:hasPermission('demo_insuranceCompany_add')")
@SysLog("新增保险公司" )
@PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" )
......@@ -74,7 +75,7 @@ public class TInsuranceCompanyController {
* @param insuranceCompany 修改实体类
* @return R
*/
//@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')")
@Operation(summary = "修改保险公司", description = "修改保险公司:hasPermission('demo_insuranceCompany_update')")
@SysLog("修改保险公司" )
@PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_update')" )
......@@ -86,7 +87,7 @@ public class TInsuranceCompanyController {
* 查询保险公司列表(不分页)
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)")
@GetMapping("/list" )
public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList());
......
......@@ -200,12 +200,37 @@ public class TInsuranceDetailController {
* @date 2022-07-19
* @since v1.0
*/
@PostMapping("/checkPayRollList")
@PostMapping("/checkInsuranceRefundList")
public R checkInsuranceRefundList(@RequestBody List<InsuranceRefundCheck> insuranceRefundCheckList){
return tInsuranceDetailService.checkInsuranceRefundList(insuranceRefundCheckList);
}
/**
* 变更结算月
* @param settleMonthCheckList 变更结算月
* @author zhaji
* @date 2022-07-21
* @since v1.0
*/
@PostMapping("/settleMonthChange")
@Operation(summary = "变更结算月", description = "变更结算月")
public R settleMonthChange(@RequestBody List<SettleMonthChangeCheckParam> settleMonthCheckList){
return tInsuranceDetailService.settleMonthChange(settleMonthCheckList);
}
/**
* 变更所属项目
* @param deptChangeCheckList 变更所属项目
* @author zhaji
* @date 2022-07-21
* @since v1.0
*/
@PostMapping("/deptChange")
@Operation(summary = "变更所属项目", description = "变更所属项目")
public R deptChange(@RequestBody List<DeptChangeCheckParam> deptChangeCheckList){
return tInsuranceDetailService.deptChange(deptChangeCheckList);
}
/**
* 已投保列表分页查询
*
......
......@@ -84,4 +84,51 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return {@link List<InsuredListVo>}
*/
List<InsuredListVo> getInsuredList(@Param("param") InsuredParam param);
/**
* 已减员列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuranceRefundListVo>}
*/
IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @Param("param")InsuranceRefundParam param);
/**
* 已减员列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo>}
*/
List<InsuranceRefundListVo> getInsuranceRefundList( @Param("param") InsuranceRefundParam param);
/**
* 减员列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>}
*/
IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @Param("param") InsuranceRefundHandlingParam param);
/**
* 减员列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>}
*/
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(@Param("param")InsuranceRefundHandlingParam param);
/**
* 减员办理
*
* @author zhaji
* @param insuranceDetail
* @return {@link boolean}
*/
Integer updateInsuranceRefund(@Param("param") InsuranceRefundListParam insuranceDetail);
}
......@@ -127,6 +127,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
R<List<InsuranceRegisterParam>> registeredPolicyPremium(List<InsuranceRegisterParam> paramList);
/***********************减员办理********************************/
/**
* 减员导入校验
*
......@@ -201,4 +202,23 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return {@link R}
*/
R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail);
/**
* 变更结算月
*
* @author zhaji
* @param settleMonthCheckList 变更列表
* @return {@link R}
*/
R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList);
/**
* 变更所属项目
*
* @author zhaji
* @param deptChangeCheckList 变更列表
* @return {@link R}
*/
R deptChange(List<DeptChangeCheckParam> deptChangeCheckList);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -28,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
......@@ -59,6 +62,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource
private TInsuranceSettleService tInsuranceSettleService;
@Resource
private TInsuranceSettleService insuranceSettleService;
/***********************商险办理********************************/
/**
* 投保办理分页查询
......@@ -1241,41 +1248,141 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
/***********************减员办理********************************/
/**
* 减员导入校验
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
@Override
public R checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
}
List<InsuranceRefundCheck> refundErrorList = new ArrayList(128);
for (InsuranceRefundCheck insuranceRefund : insuranceRefundCheckList) {
boolean b = true;
List<InsuranceRefundCheck> errorList = new ArrayList(128);
List<TInsuranceDetail> successList = new ArrayList<>();
for (InsuranceRefundCheck param : insuranceRefundCheckList) {
//员工姓名
String empName = param.getEmpName();
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
String empName = insuranceRefund.getEmpName();
//员工身份证
String empIdCardNo = param.getEmpIdCardNo();
if(StringUtils.isBlank(empIdCardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
String empIdCardNo = insuranceRefund.getEmpIdCardNo();
//保险公司名称
String insuranceCompanyName = insuranceRefund.getInsuranceCompanyName();
//险种名称
String insuranceTypeName = insuranceRefund.getInsuranceTypeName();
String refundMoney = insuranceRefund.getRefundMoney();
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
String policyStart = insuranceRefund.getPolicyStart();
//险种名称
String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
String policyEnd = insuranceRefund.getPolicyEnd();
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY);
errorList.add(param);
continue;
}
String remark = insuranceRefund.getRemark();
//保单结束日期
String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){
param.setErrorMessage(InsurancesConstants.POLICY_END_NOT_EMPTY);
errorList.add(param);
continue;
}
if (!b){
refundErrorList.add(insuranceRefund);
// 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
// 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
errorList.add(param);
continue;
}
// 保单结束日期格式校验
if(!LocalDateUtil.isDate(policyEnd,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR);
errorList.add(param);
continue;
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName )
.eq(TInsuranceDetail :: getPolicyStart,policyStart ).eq(TInsuranceDetail :: getPolicyEnd,policyEnd);
TInsuranceDetail one = getOne(queryWrapper);
if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
Integer buyHandleStatus = one.getBuyHandleStatus();
if (CommonConstants.THREE_INT != buyHandleStatus){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = one.getReduceHandleStatus();
//当前保单信息的减员状态不为空时不能进行导入
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
errorList.add(param);
continue;
}
//出险状态
if(CommonConstants.ZERO_INT != one.getIsUse()){
param.setErrorMessage(InsurancesConstants.IS_USE_ERROR);
errorList.add(param);
continue;
}
//有效状态
if(CommonConstants.ZERO_INT != one.getIsEffect()){
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR);
errorList.add(param);
continue;
}
//过期状态
if (CommonConstants.ZERO_INT != one.getIsOverdue()){
param.setErrorMessage(InsurancesConstants.IS_OVERDUE_ERROR);
errorList.add(param);
continue;
}
one.setReduceHandleStatus(CommonConstants.ONE_INT);
one.setUpdateTime(LocalDateTime.now());
one.setUpdateBy(user.getId());
successList.add(one);
}
if (Common.isNotEmpty(refundErrorList)){
return null;
//批量更新减员状态
if (CollectionUtils.isNotEmpty(successList)){
this.updateBatchById(successList);
}
return null;
return R.ok(errorList);
}
/**
* 已投保列表分页查询
*
......@@ -1286,8 +1393,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
return null;
IPage<InsuredListVo> insuranceList = this.baseMapper.getInsuredListPage(page, param);
if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuredListVo record : insuranceList.getRecords()) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
return insuranceList;
}
/**
......@@ -1299,8 +1420,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public List<InsuredListVo> getInsuredList(InsuredParam param) {
return null;
List<InsuredListVo> insuredList = this.baseMapper.getInsuredList(param);
if (CollectionUtils.isNotEmpty(insuredList)){
//根据项目编码获取项目名称
List<String> collect = insuredList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuredListVo record : insuredList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
return insuredList;
}
/**
......@@ -1313,7 +1448,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) {
return null;
IPage<InsuranceRefundListVo> insuranceRefundPageList = this.baseMapper.getInsuranceRefundPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundPageList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuranceRefundListVo record : insuranceRefundPageList.getRecords()) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
return insuranceRefundPageList;
}
/**
......@@ -1323,10 +1473,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
*/
@Override
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) {
return null;
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuranceRefundListVo record : insuranceRefundList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
return insuranceRefundList;
}
/**
......@@ -1339,7 +1503,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) {
return null;
IPage<InsuranceRefundHandlingListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundHandlingPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuranceRefundHandlingListVo record : insuranceRefundHandlingPageList.getRecords()) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
return insuranceRefundHandlingPageList;
}
/**
......@@ -1350,8 +1531,33 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link List< InsuranceRefundHandlingListVo>}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundHandlingParam param) {
return null;
YifuUser user = SecurityUtils.getUser();
List<InsuranceRefundHandlingListVo> insuranceRefundHandlingList = this.baseMapper.getInsuranceRefundHandlingList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingList)){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundHandlingList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuranceRefundHandlingListVo record : insuranceRefundHandlingList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
}
}
}
for (InsuranceRefundHandlingListVo insuranceRefund : insuranceRefundHandlingList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getId,insuranceRefund.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.set(TInsuranceDetail ::getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail ::getUpdateBy,user.getId());
update(updateWrapper);
}
return insuranceRefundHandlingList;
}
/**
......@@ -1362,7 +1568,405 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail) {
return null;
YifuUser user = SecurityUtils.getUser();
insuranceDetail.setUpdateBy(user.getId());
insuranceDetail.setRefundCreateTime(LocalDateTime.now());
String refundType = insuranceDetail.getRefundType();
return R.ok(this.baseMapper.updateInsuranceRefund(insuranceDetail));
}
/**
* 结算月份校验
*
* @author zhaji
* @param settleMonthCheckList 变更列表
* @return {@link R}
*/
private Map<String,List<SettleMonthChangeCheckParam>> settleMonthChangeCheck(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>();
List<SettleMonthChangeCheckParam> errorList = new ArrayList();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
for (SettleMonthChangeCheckParam param : settleMonthCheckList) {
//结算月
String settleMonth = param.getSettleMonth();
if(StringUtils.isBlank(settleMonth)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_NOT_EMPTY);
errorList.add(param);
continue;
}
//员工姓名
String empName = param.getEmpName();
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//员工身份证
String empIdCardNo = param.getEmpIdCardNo();
if(StringUtils.isBlank(empIdCardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//险种名称
String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单结束日期
String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){
param.setErrorMessage(InsurancesConstants.POLICY_END_NOT_EMPTY);
errorList.add(param);
continue;
}
//所属项目
String deptNo = param.getDeptNo();
if(StringUtils.isBlank(deptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//购买标准
String buyStandard = param.getBuyStandard();
if(StringUtils.isBlank(buyStandard)){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY);
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
// 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
errorList.add(param);
continue;
}
// 保单结束日期格式校验
if(!LocalDateUtil.isDate(policyEnd,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR);
errorList.add(param);
continue;
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
errorList.add(param);
continue;
}
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,policyStart ).eq(TInsuranceDetail :: getPolicyEnd,policyEnd);
TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空
if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
//如果结算月份相同
if (settleMonth.equals(insuranceDetail.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_IDENTICAL);
errorList.add(param);
continue;
}
//非已办理状态
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if (CommonConstants.THREE_INT != buyHandleStatus){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
errorList.add(param);
continue;
}
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = insuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的减员状态不为空时不能进行导入
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR);
errorList.add(param);
continue;
}
//有效状态
if(CommonConstants.ZERO_INT != insuranceDetail.getIsEffect()){
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR);
errorList.add(param);
continue;
}
//判断当前数据中是否存在重复数据
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName())
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())&& u.getDeptNo().equals(param.getDeptNo())
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())&& u.getPolicyEnd().equals(param.getPolicyEnd())
&& u.getSettleMonth().equals(param.getSettleMonth())&& u.getBuyStandard().equals(param.getBuyStandard()));
if(!b){
successList.add(param);
}else{
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param);
}
}
map.put("errorList",errorList);
map.put("successList",successList);
return map;
}
/**
* 变更结算月份
*
* @author zhaji
* @param
* @return void
*/
@Transactional(rollbackFor = Exception.class)
@Override
public R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(settleMonthCheckList)){
return R.failed("当前变更结算月列表为空");
}
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList);
//todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList");
for (SettleMonthChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName())
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() )
.eq(TInsuranceDetail :: getDeptNo,success.getDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd())
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
return R.ok(errorList);
}
/**
* 变更所属项目
*
* @author zhaji
* @param deptChangeCheckList 变更列表
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R deptChange(List<DeptChangeCheckParam> deptChangeCheckList) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(deptChangeCheckList)){
return R.failed("当前变更所属项目列表为空");
}
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList);
//todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
for (DeptChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName())
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() )
.eq(TInsuranceDetail :: getDeptNo,success.getOldDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
return R.ok(errorList);
}
/**
* 校验所属项目
*
* @author zhaji
* @param deptChangeCheckList 变更列表
* @return {@link R}
*/
public Map<String,List<DeptChangeCheckParam>> deptChangeCheck(List<DeptChangeCheckParam> deptChangeCheckList) {
Map<String,List<DeptChangeCheckParam>> map = new HashMap<>();
List<DeptChangeCheckParam> errorList = new ArrayList();
List<DeptChangeCheckParam> successList = new ArrayList<>();
for (DeptChangeCheckParam param : deptChangeCheckList) {
String newDeptNo = param.getNewDeptNo();
if(StringUtils.isBlank(newDeptNo)){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//员工姓名
String empName = param.getEmpName();
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//员工身份证
String empIdCardNo = param.getEmpIdCardNo();
if(StringUtils.isBlank(empIdCardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//险种名称
String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单结束日期
String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){
param.setErrorMessage(InsurancesConstants.POLICY_END_NOT_EMPTY);
errorList.add(param);
continue;
}
//所属项目
String oldDeptNo = param.getOldDeptNo();
if(StringUtils.isBlank(oldDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//新老项目id相同
if (oldDeptNo.equals(newDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IDENTICAL);
errorList.add(param);
continue;
}
//购买标准
String buyStandard = param.getBuyStandard();
if(StringUtils.isBlank(buyStandard)){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY);
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
// 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
errorList.add(param);
continue;
}
// 保单结束日期格式校验
if(!LocalDateUtil.isDate(policyEnd,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR);
errorList.add(param);
continue;
}
//根据项目编码查询项目是否存在
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(newDeptNo));
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) {
Map data = setInfoByCodes.getData();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
errorList.add(param);
continue;
}else {
JSONObject jsonObject = (JSONObject) data.get(newDeptNo);
if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
errorList.add(param);
continue;
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getString("insuranceSettleType");
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
errorList.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
}
}
}
}
//判断当前数据中是否存在重复数据
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName())
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())&& u.getOldDeptNo().equals(param.getOldDeptNo())
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())&& u.getPolicyEnd().equals(param.getPolicyEnd())
&& u.getNewDeptNo().equals(param.getNewDeptNo())&& u.getBuyStandard().equals(param.getBuyStandard()));
if(!b){
successList.add(param);
}else{
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param);
}
}
map.put("errorList",errorList);
map.put("successList",successList);
return map;
}
}
......@@ -86,7 +86,7 @@
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
......@@ -123,7 +123,7 @@
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
......@@ -246,7 +246,7 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
......@@ -256,78 +256,335 @@
<!-- ***********************减员办理******************************** -->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.DEPT_NO as deptNo,
detail.POST as post,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.POLICY_EFFECT as policyEffect,
detail.IS_USE as isUse,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard
where
detail.DELETE_FLAG = 0
and
detail.BUY_HANDLE_STATUS = 3
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != ''">
AND detail.POLICY_START >= concat(#{param.policyStart}, ' 00:00:00')
</if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
and detail.INVOICE_NO like concat('%',replace(replace(#{param.invoiceNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isUse != null">
and detail.IS_USE = #{param.isUse}
</if>
<if test="param.isOverdue != null and param.isOverdue.trim() != ''">
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
<if test="param.createTime != null and param.createTime.trim() != ''">
AND detail.CREATE_TIME = concat(#{param.createTime}, ' 00:00:00')
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.DEPT_NO as deptNo,
detail.POST as post,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.ESTIMATE_PREMIUM as estimatePremium,
detail.ACTUAL_PREMIUM as actualPremium,
detail.POLICY_NO as policyNo,
detail.INVOICE_NO as invoiceNo,
detail.POLICY_EFFECT as policyEffect,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.IS_USE as isUse,
detail.IS_EFFECT as isEffect,
detail.IS_OVERDUE as isOverdue,
detail.CREATE_TIME as createTime,
detail.CREATE_NAME as createName
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.BUY_HANDLE_STATUS = 3
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != ''">
AND detail.POLICY_START >= concat(#{param.policyStart}, ' 00:00:00')
</if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
and detail.INVOICE_NO like concat('%',replace(replace(#{param.invoiceNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isUse != null">
and detail.IS_USE = #{param.isUse}
</if>
<if test="param.isOverdue != null and param.isOverdue.trim() != ''">
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
<if test="param.createTime != null and param.createTime.trim() != ''">
AND detail.CREATE_TIME = concat(#{param.createTime}, ' 00:00:00')
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<select id="getInsuranceRefundPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.POST as post,
detail.DEPT_NO as deptNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.POLICY_NO as policyNo,
detail.REFUND_CREATE_TIME as refundCreateTime
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.REDUCE_HANDLE_STATUS = 4
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != ''">
AND detail.POLICY_START >= concat(#{param.policyStart}, ' 00:00:00')
</if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
</select>
<select id="getInsuranceRefundList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.REFUND_CREATE_TIME as refundCreateTime
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.REDUCE_HANDLE_STATUS = 4
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != ''">
AND detail.POLICY_START >= concat(#{param.policyStart}, ' 00:00:00')
</if>
<if test="param.policyEnd != null and param.policyEnd.trim() != ''">
AND detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
</select>
<select id="getInsuranceRefundHandlingPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.DEPT_NO as deptNo,
detail.POST as post,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
(detail.REDUCE_HANDLE_STATUS is not null and detail.REDUCE_HANDLE_STATUS != 3)
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC
<if test="param.reduceHandleStatus != null and param.reduceHandleStatus.trim() != ''">
and detail.REDUCE_HANDLE_STATUS like concat('%',replace(replace(#{param.reduceHandleStatus},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isOverdue != null and param.isOverdue.trim() != ''">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isUse != null and param.isUse.trim() != ''">
and detail.IS_USE like concat('%',replace(replace(#{param.isUse},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
</select>
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select detail.id as id,
<select id="getInsuranceRefundHandlingList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.DEPT_NO as deptNo,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
detail.SETTLE_MONTH as settleMonth,
detail.CREATE_NAME as createName,
detail.REMARK as remark
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.REDUCE_HANDLE_STATUS = 1
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC
<if test="param.reduceHandleStatus != null and param.reduceHandleStatus.trim() != ''">
and detail.REDUCE_HANDLE_STATUS like concat('%',replace(replace(#{param.reduceHandleStatus},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isOverdue != null and param.isOverdue.trim() != ''">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isUse != null and param.isUse.trim() != ''">
and detail.IS_USE like concat('%',replace(replace(#{param.isUse},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.REFUND_CREATE_TIME DESC
</select>
<update id="updateInsuranceRefund">
update
t_insurance_detail detail
set
UPDATE_BY = #{param.updateBy},
REDUCE_HANDLE_STATUS = #{param.refundType},
UPDATE_TIME = #{param.refundCreateTime}
where
detail.id in
<foreach collection="param.idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</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