Commit 516a30a0 authored by fangxinjiang's avatar fangxinjiang

商险 提醒

parent 6a6abfb5
......@@ -342,6 +342,8 @@ public interface CommonConstants {
int BATCH_COUNT = 100;
int BATCH_COUNT1 = 2000;
String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(1.日期格式:yyyy-MM-dd,2.比例为整数且不含%)";
String IMPORT_DATA_ANALYSIS_ERROR_TWO = "数据导入解析异常,请检查表数据格式";
String CREATE_TIME = "CREATE_TIME";
String ID = "ID";
String PARAM_IS_NOT_ERROR = "传参异常,请检查参数";
......
......@@ -1297,5 +1297,22 @@ public class InsurancesConstants {
public static final String AGAIN_UPDATE_STATUS = "再次同步状态成功";
public static final String UPLOAD_PARAM_CHECK_FAIL="上传必要参数不能为空";
/**
* 商险忽略备注
*/
public static final String[] INSURANCE_IGNORE_REMARK = {"已续保", "不续保-员工已离职", "不续保-客户停止合作", "不续保-客户要求不续保", "不续保-客户要求转社保", "未续保"};
/**
* 项目名称不可为空
*/
public static final String PROJECT_NAME_IS_NOT_EMPTY = "项目名称不可为空";
/**
* 项目编码不可为空
*/
public static final String PROJECT_NO_IS_NOT_EMPTY = "项目编码不可为空";
/**
* 商险到期提醒批量导出
*/
public static final String INSURANCE_ALERT_EXPORT = "商险到期提醒批量导出";
}
......@@ -207,7 +207,7 @@ public class TInsuranceDetail extends BaseEntity {
/**
* 结算类型 (0、与薪资合并结算 1、单独结算)
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
@Schema(description = "结算类型 (0、与薪资合并结算 1、单独结算)")
private Integer settleType;
/**
......@@ -385,5 +385,17 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "退回原因")
private String backRemark;
/**
* 忽略提醒 0:忽略 1:不忽略
*/
@Schema(description = "有忽略提醒 0:忽略 1:不忽略")
private String expireIgnoreFlag;
/**
* 消息提醒备注
*/
@Schema(description = "消息提醒备注")
private String expireRemark;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @Author fxj
* @Date 2023/2/21
* @Description
* @Version 1.0
*/
@Data
public class InsuranceSearchVo extends TBusinessInsuranceVo{
private List<String> idList;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
/**
* @Author fxj
* 导出字段
**/
List<String> exportFields;
/**
* @Author fxj
* 导出选择的ID
**/
private String idStr;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author fxj
* @Date 2023/2/22
* @Description
* @Version 1.0
*/
@ColumnWidth(10)
@Data
public class InsuranceWarnExportVo implements Serializable {
/**
* 员工姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工姓名")
@Schema(name = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工身份证号码")
@Schema(name = "员工身份证号码")
private String empIdcardNo;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "客户")
@Schema(name = "客户")
private String customerName;
/**
* 结算部门名称中文(内部组织架构)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目名称")
@Schema(name = "项目名称")
private String deptName;
/**
* 结算部门编码(内部组织架构)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目编码")
@Schema(name = "项目编码")
private String deptNo;
/**
* 保险公司(配置项)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保险公司")
@Schema(name = "保险公司(配置项)")
private String insuranceCompanyName;
/**
* 险种名称中文(配置项) 用于导入
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种名称")
@Schema(name = "险种名称")
private String insuranceTypeName;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单开始时间")
@Schema(name = "保单开始时间")
private String policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单结束时间")
@Schema(name = "保单结束时间")
private String policyEnd;
/**
* 购买标准
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "购买标准")
@Schema(name = "购买标准")
private String buyStandard;
/**
* 实际保费
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保费")
@Schema(name = "保费")
private BigDecimal actualPremium;
/**
* 创建人
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "创建人")
@Schema(name = "创建人")
private String createName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "创建时间")
@Schema(name = "创建时间")
private String createTime;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "办理状态")
@Schema(name = "办理状态")
private String buyHandleStatus;
/**
* 出险状态(0未出险;1已出险)
*/
/*@Schema(name = "出险状态(0未出险;1已出险)")
private Integer useStatus;*/
/**
* 保单号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单号")
@Schema(name = "保单号")
private String policyNo;
/**
* 医保
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "医保")
@Schema(name = "医保")
private BigDecimal medicalQuota;
/**
* 身故或残疾
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "身故或残疾")
@Schema(name = "身故或残疾")
private BigDecimal dieDisableQuota;
/**
* 结算月份
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "结算月份")
@Schema(name = "结算月份")
private String settleMonth;
/**
* 发票号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "发票号")
@Schema(name = "发票号")
private String invoiceNo;
/**
* 被替换时间
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "被替换时间")
@Schema(name = "被替换时间")
private String replaceTime;
/**
* 保单生效时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单生效时间")
@Schema(name = "保单生效时间")
private String policyEffect;
/**
* 备注
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "备注")
@Schema(name = "备注")
private String remark;
/**
* 商险购买地省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地省")
@Schema(name = "商险购买地省")
private String insuranceProvince;
/**
* 商险购买地
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地市")
@Schema(name = "商险购买地市")
private String insuranceCityName;
/**
* 是否有效 0有效 1无效
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "是否有效")
@Schema(name = "是否有效 0有效 1无效")
private String isEffect;
/**
* 岗位
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "岗位")
@Schema(name = "岗位")
private String post;
//替换人名称,用户展示
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "被替换人姓名")
@Schema(name = "被替换人姓名")
private String fromEmpName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人姓名")
@Schema(name = "替换人姓名")
//被替换名称,用户展示
private String toEmpName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换时间")
@Schema(name = "替换时间")
private String toReplaceTime;
/**
* 是否过期状态 0 未过期 1已过期。主要用于页面查询展示
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "是否过期")
@Schema(name = "是否过期")
private String isOverdue;
/**
* 预估保费
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "预估保费")
@Schema(name = "预估保费")
private BigDecimal estimatePremium;
/**
* 结算类型 (0、与薪资合并结算 1、单独结算)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "结算类型")
@Schema(description = "结算类型 (0、与薪资合并结算 1、单独结算)")
private String settleType;
/**
* 退费金额
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费金额")
@Schema(name = "退费金额")
private BigDecimal refundMoney;
/**
* 退费时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费时间")
@Schema(name = "退费时间")
private String refundCreateTime;
/**
* 退费人
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费人")
@Schema(name = "退费人")
private String refundCreateUser;
/**
* 派单人所属部门
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "派单人所属部门")
@Schema(name = "派单人所属部门")
private String createUserDeptName;
/**
* 消息提醒备注
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "消息提醒备注")
private String expireRemark;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2023/2/21
* @Description
* @Version 1.0
*/
@Schema(description = "商险备注批量操作")
@Data
public class InsurancesWarnUpdateVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", errorInfo = "员工姓名不能为空", maxLength = 32, needExport = true)
private String empName;
/**
* 员工身份证号
*/
@ExcelAttribute(name = "员工身份证号码", errorInfo = "员工身份证号不能为空", maxLength = 32, needExport = true)
private String empIdcardNo;
/**
* 结算部门名称中文(内部组织架构)
*/
@Schema(name = "项目名称")
@ExcelAttribute(name = "项目名称")
private String deptName;
/**
* 结算部门编码(内部组织架构)
*/
@Schema(name = "项目编码")
@ExcelAttribute(name = "项目编码")
private String deptNo;
/**
* 保险公司(配置项)
*/
@ExcelAttribute(name = "保险公司名称", errorInfo = "保险公司(配置项)不能为空", maxLength = 32, needExport = true)
private String insuranceCompanyName;
/**
* 险种名称中文(配置项) 用于导入
*/
@ExcelAttribute(name = "险种名称", errorInfo = "险种名称不能为空", maxLength = 32, needExport = true)
private String insuranceTypeName;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@ExcelAttribute(name = "保单开始时间", errorInfo = "保单开始时间不能为空", needExport = true)
private String policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@ExcelAttribute(name = "保单结束时间", needExport = true)
private String policyEnd;
/**
* 购买标准
*/
@Schema(name = "购买标准")
private String buyStandard;
/**
* 到期消息提醒批量导入是否续保
*/
@ExcelAttribute(name = "是否续保", maxLength = 32)
private String renewal;
/**
* 备注(未续保原因)
*/
@ExcelAttribute(name = "备注(未续保原因)")
private String expireRemark;
}
......@@ -56,7 +56,22 @@ public class InsuredListVo implements Serializable {
@ExcelProperty(value = "投保类型")
@ExcelAttribute(name = "投保类型", readConverterExp = "1=新增,3=批增,4=替换")
private String buyType;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@Schema(description ="客户")
@ExcelProperty(value = "客户")
private String unitName;
/**
* 客户编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@Schema(description ="客户编码")
@ExcelProperty(value = "客户编码")
@ExcelIgnore
private String unitNo;
/**
* 项目名称
*/
......@@ -182,22 +197,7 @@ public class InsuredListVo implements Serializable {
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
@ExcelIgnore
private Integer reduceHandleStatus;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@Schema(description ="客户名称")
@ExcelProperty(value = "客户名称")
private String unitName;
/**
* 客户编码
*/
@HeadFontStyle(fontHeightInPoints = 11)
@Schema(description ="客户编码")
@ExcelProperty(value = "客户编码")
@ExcelIgnore
private String unitNo;
/**
* 项目编码
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
......@@ -17,6 +19,7 @@ import java.util.List;
* @Description 商险派单信息表
* @Date 16:59 2023/2/20
**/
@ColumnWidth(10)
@Data
@Schema(name = "商险派单信息表")
public class TBusinessInsuranceVo implements Serializable {
......@@ -30,69 +33,99 @@ public class TBusinessInsuranceVo implements Serializable {
/**
* 员工姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工姓名")
@Schema(name = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工身份证号码")
@Schema(name = "员工身份证号码")
private String empIdcardNo;
/**
* 结算部门名称中文(内部组织架构)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目名称")
@Schema(name = "项目名称")
private String deptName;
/**
* 结算部门编码(内部组织架构)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目编码")
@Schema(name = "项目编码")
private String deptNo;
/**
* 保险公司(配置项)
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保险公司")
@Schema(name = "保险公司(配置项)")
private String insuranceCompanyName;
/**
* 险种名称中文(配置项) 用于导入
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种名称")
@Schema(name = "险种名称")
private String insuranceTypeName;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单开始时间")
@Schema(name = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单结束时间")
@Schema(name = "保单结束时间")
private LocalDate policyEnd;
/**
* 购买标准
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "购买标准")
@Schema(name = "购买标准")
private String buyStandard;
/**
* 实际保费
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保费")
@Schema(name = "保费")
private BigDecimal actualPremium;
/**
* 创建人
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "创建人")
@Schema(name = "创建人")
private String createName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "创建时间")
@Schema(name = "创建时间")
private LocalDateTime createTime;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "办理状态")
@Schema(name = "办理状态")
private String buyHandleStatus;
/**
......@@ -103,51 +136,70 @@ public class TBusinessInsuranceVo implements Serializable {
/**
* 保单号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单号")
@Schema(name = "保单号")
private String policyNo;
/**
* 医保
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "医保")
@Schema(name = "医保")
private BigDecimal medicalQuota;
/**
* 身故或残疾
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "身故或残疾")
@Schema(name = "身故或残疾")
private BigDecimal dieDisableQuota;
/**
* 结算月份
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "结算月份")
@Schema(name = "结算月份")
private String settleMonth;
/**
* 发票号
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "发票号")
@Schema(name = "发票号")
private String invoiceNo;
/**
* 被替换时间
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "被替换时间")
@Schema(name = "被替换时间")
private String replaceTime;
/**
* 保单生效时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单生效时间")
@Schema(name = "保单生效时间")
private String policyEffect;
/**
* 客户名称
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "客户名称")
@Schema(name = "客户名称")
private String customerName;
/**
* 备注
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "备注")
@Schema(name = "备注")
private String remark;
......@@ -155,54 +207,79 @@ public class TBusinessInsuranceVo implements Serializable {
/**
* 商险购买地省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地省")
@Schema(name = "商险购买地省")
private String insuranceProvince;
/**
* 商险购买地
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地市")
@Schema(name = "商险购买地市")
private String insuranceCityName;
/**
* 是否有效 0有效 1无效
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "是否有效")
@Schema(name = "是否有效 0有效 1无效")
private String isEffect;
/**
* 岗位
*/
@Length(max = 32, message = "岗位不能超过32个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "岗位")
@Schema(name = "岗位")
private String post;
//替换人名称,用户展示
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "被替换人姓名")
@Schema(name = "被替换人姓名")
private String fromEmpName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换人姓名")
@Schema(name = "替换人姓名")
//被替换名称,用户展示
private String toEmpName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "替换时间")
@Schema(name = "替换时间")
private String toReplaceTime;
/**
* 是否过期状态 0 未过期 1已过期。主要用于页面查询展示
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "是否过期")
@Schema(name = "是否过期")
private String isOverdue;
/**
* 预估保费
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "预估保费")
@Schema(name = "预估保费")
private BigDecimal estimatePremium;
/**
* 保费结算类型:1取实际保费 2.取预估保费
* 结算类型 (0、与薪资合并结算 1、单独结算)
*/
@Schema(name = "保费结算类型:1取实际保费 2.取预估保费")
private String settleType;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "结算类型")
@Schema(description = "结算类型 (0、与薪资合并结算 1、单独结算)")
private Integer settleType;
/**
* 退费金额
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费金额")
@Schema(name = "退费金额")
private BigDecimal refundMoney;
......@@ -210,12 +287,17 @@ public class TBusinessInsuranceVo implements Serializable {
/**
* 退费时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费时间")
@Schema(name = "退费时间")
private LocalDateTime refundCreateTime;
/**
* 退费人
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "退费人")
@Schema(name = "退费人")
private String refundCreateUser;
/*
......@@ -240,12 +322,16 @@ public class TBusinessInsuranceVo implements Serializable {
/**
* 派单人所属部门
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "派单人所属部门")
@Schema(name = "派单人所属部门")
private String createUserDeptName;
/**
* 消息提醒备注
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "消息提醒备注")
private String expireRemark;
/**
......@@ -258,4 +344,17 @@ public class TBusinessInsuranceVo implements Serializable {
*/
@Schema(name = "商险购买地市")
private List<String> insuranceCitys;
/**
* 创建人ID
*/
@Schema(name = "创建人ID")
private String createBy;
/**
* 忽略提醒 0:忽略 1:不忽略
*/
@Schema(description = "有忽略提醒 0:忽略 1:不忽略")
private String expireIgnoreFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import cn.hutool.core.util.CharsetUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.WorkBanchWarnVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -51,7 +41,7 @@ public class TInsurancesWarnController {
**/
@Operation(description = "商险到期提醒分页查询")
@GetMapping("/getExpireWarn/Vopage")
public R<IPage<TBusinessInsuranceVo>> getTBusinessInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance) {
public R<IPage<TBusinessInsuranceVo>> getTBusinessInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, InsuranceSearchVo tBusinessInsurance) {
return R.ok(insuranceDetailService.getInsuranceExpireWarnVoPage(page, tBusinessInsurance));
}
......@@ -60,36 +50,26 @@ public class TInsurancesWarnController {
* @Description 备注批量导入
* @Date 16:57 2023/2/16
**/
@Operation(description = "备注批量导入(wxhr:insurance_remark_add)")
@SneakyThrows
@Operation(description = "备注批量导入(wxhr:insurance_Warn_batch_update)")
@SysLog("备注批量导入")
@PostMapping("/remark/batchAdd")
public R<Object> remarkBatchAdd(@RequestBody String jsonString) {
/*ExcelUtil<TBusinessInsuranceVo> util1 = new ExcelUtil<>(TBusinessInsuranceVo.class);
util1.parseJsonStringToList(jsonString, BasicServiceUtil.initMapForExport(remoteSysDictService, preRemoteBasicArchivesService));
List<TBusinessInsuranceVo> businessInsuranceVoList = util1.getEntityList();
if (businessInsuranceVoList.isEmpty()) {
return Result.fail("无数据");
}
if (null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) {
return Result.fail(InsuranceConstant.DATA_CHECK_FAIL, util1.getErrorInfo());
}*/
return null;//insuranceDetailService.remarkBatchAdd(businessInsuranceVoList);
//@PreAuthorize("@pms.hasPermission('insurance_Warn_batch_update')")
public R<List<ErrorMessage>> remarkBatchAdd(@RequestBody MultipartFile file) {
return insuranceDetailService.remarkBatchAdd(file.getInputStream());
}
/**
* @Author fxj
* @Description 商险到期提醒分页查询导出
* @Date 16:57 2023/2/16
**/
@GetMapping("/getExpireWarn/export")
@PostMapping("/getExpireWarn/export")
@Operation(description = "商险到期提醒分页查询导出 hasPermission('wxhr:insurance_expirewarnexport')")
@SysLog("商险到期提醒分页查询导出")
@PreAuthorize("@pms.hasPermission('wxhr:insurance_expirewarnexport')")
public void getExpireWarnExport(HttpServletResponse response, HttpServletRequest request,
@RequestParam(name = "idStr", required = false) String[] idstr,
@RequestParam(name = "exportFields", required = true) String[] exportFields, TBusinessInsuranceVo vo) {
List<TBusinessInsuranceVo> list = null;
//@PreAuthorize("@pms.hasPermission('wxhr:insurance_expirewarnexport')")
public void getExpireWarnExport(HttpServletResponse response, HttpServletRequest request, @RequestBody InsuranceSearchVo vo) {
insuranceDetailService.exportInsurancesWarn(vo, response,vo.getExportFields(),vo.getIdStr());
}
/**
......@@ -101,19 +81,7 @@ public class TInsurancesWarnController {
@SysLog("到期提醒备注")
@PutMapping("/expireRemark")
public R<Object> expireRemark(@RequestBody TBusinessInsuranceVo vo) {
if (Common.isEmpty(vo.getId()) || Common.isEmpty(vo.getExpireRemark())) {
return R.failed(InsurancesConstants.UPLOAD_PARAM_CHECK_FAIL);
}
TInsuranceDetail entity = insuranceDetailService.getById(vo.getId());
if (entity == null) {
return R.failed("未查询到相关商险订单");
}
/* entity.setExpireRemark(vo.getExpireRemark());
entity.setLastUpdateUser(SecurityUtils.getUser().getNickName());
entity.setLastUpdateUserId(SecurityUtils.getUser().getId());
entity.setLastUpdateTime(LocalDateTime.now());*/
insuranceDetailService.updateById(entity);
return R.ok("操作成功");
return insuranceDetailService.expireRemark(vo);
}
/**
......@@ -126,13 +94,9 @@ public class TInsurancesWarnController {
@PutMapping("/expireIgnore")
@PreAuthorize("@pms.hasPermission('wxhr:insurance_expireignore')")
public R<Object> expireIgnore(@RequestBody TBusinessInsuranceVo vo) {
if (Common.isEmpty(vo.getId())) {
return R.failed(InsurancesConstants.UPLOAD_PARAM_CHECK_FAIL);
}
return insuranceDetailService.expireIgnore(vo);
}
/**
* @Author fxj
* @Description 到期提醒批量忽略
......@@ -146,62 +110,14 @@ public class TInsurancesWarnController {
return insuranceDetailService.batchexpireIgnore(ids);
}
/**
* @Author: wangan
* @Date: 2020/5/18
* @Description: 到期提醒忽略
* @return: com.yifu.cloud.v1.common.core.util.R
**/
/*@Operation(description = "到期提醒忽略(wxhr:insurance_expireignore)")
@SysLog("到期提醒忽略")
@PutMapping("/batchExpireIgnore")
@PreAuthorize("@pms.hasPermission('wxhr:insurance_expireignore')")
public Result<Object> batchExpireIgnoreList(@RequestBody List<TBusinessInsurance> voList) {
if (voList.isEmpty()) {
return Result.fail("无数据");
}
ArrayList<ErrorMessage> errorMessages = Lists.newArrayList();
for (int i = 0; i < voList.size(); i++) {
TBusinessInsurance vo = voList.get(i);
if (Common.isEmpty(vo.getId())) {
errorMessages.add(new ErrorMessage(i + 1, "提醒商险ID不能为空"));
continue;
}
TBusinessInsurance entity = tBusinessInsuranceService.getById(vo.getId());
if (entity == null) {
errorMessages.add(new ErrorMessage(i + 1, "未查询到相关商险订单"));
continue;
}
try {
entity.setExpireIgnoreFlag(CommonConstants.dingleDigitStrArray[0]);
entity.setLastUpdateUser(SecurityUtils.getUser().getNickName());
entity.setLastUpdateUserId(SecurityUtils.getUser().getId());
entity.setLastUpdateTime(LocalDateTime.now());
tBusinessInsuranceService.updateById(entity);
} catch (Exception e) {
log.error("执行异常", e);
errorMessages.add(new ErrorMessage(i + 1, "执行忽略失败"));
continue;
}
}
if (!errorMessages.isEmpty()) {
return Result.fail("数据条数" + voList.size(), voList, errorMessages);
}
return Result.success("数据条数" + voList.size(), voList, errorMessages);
}*/
/**
* @Author fxj
* @Description 工作台消息提醒:商险到期总数通知提醒/商险未购买总数通知提醒
* @Description 工作台消息提醒:商险到期总数通知提醒
* @Date 17:03 2023/2/16
**/
@Operation(description = "商险到期总数通知提醒/商险未购买总数通知提醒")
@PostMapping("/inner/workBranch/getWorkBanchInsuranceMessageWarn")
public R<List<WorkBanchWarnVo>> getExpireInsuranceWarn(@RequestBody
Integer expireInsuranceWarnNameUrlFlag,
Integer noBuyInsuranceWarnNameUrlFlag,
Integer noSettleInsuranceWarnNameUrlFlag, Boolean haveAllOrg, Integer userId) {
return insuranceDetailService.getExpireInsuranceWarn(expireInsuranceWarnNameUrlFlag, noBuyInsuranceWarnNameUrlFlag, noSettleInsuranceWarnNameUrlFlag, haveAllOrg, userId);
@Operation(description = "商险到期总数通知提醒")
@PostMapping("/workBranch/getWorkBanchInsuranceMessageWarn")
public R<Integer> getExpireInsuranceWarn() {
return insuranceDetailService.getExpireInsuranceWarn();
}
}
......@@ -283,6 +283,12 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @Date 16:33 2023/2/20
**/
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page,
@Param("param")TBusinessInsuranceVo param,
@Param("param")InsuranceSearchVo param,
@Param("domains")List<TSettleDomainSelectVo> domains);
List<InsuranceWarnExportVo> noPageDiy(@Param("param")InsuranceSearchVo searchVo, @Param("domains")List<TSettleDomainSelectVo> listSelectVO);
int noPageCountDiy(@Param("param")InsuranceSearchVo searchVo, @Param("domains")List<TSettleDomainSelectVo> listSelectVO);
void batchexpireIgnore(@Param("idList")List<String> idList);
}
......@@ -4,6 +4,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
......@@ -12,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
......@@ -510,11 +512,17 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
**/
void updateSettleStatus();
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo tBusinessInsurance);
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, InsuranceSearchVo tBusinessInsurance);
R<List<WorkBanchWarnVo>> getExpireInsuranceWarn(Integer expireInsuranceWarnNameUrlFlag, Integer noBuyInsuranceWarnNameUrlFlag, Integer noSettleInsuranceWarnNameUrlFlag, Boolean haveAllOrg, Integer userId);
R<Integer> getExpireInsuranceWarn();
R<Object> batchexpireIgnore(String ids);
R<Object> expireIgnore(TBusinessInsuranceVo vo);
R<List<ErrorMessage>> remarkBatchAdd(InputStream inputStream);
void exportInsurancesWarn(InsuranceSearchVo vo, HttpServletResponse response, List<String> exportFields, String idstr);
R<Object> expireRemark(TBusinessInsuranceVo vo);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -54,6 +59,7 @@ import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -7401,46 +7407,346 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @Date 16:51 2023/2/16
**/
@Override
public IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, TBusinessInsuranceVo condition) {
public IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page, InsuranceSearchVo condition) {
YifuUser user = SecurityUtils.getUser();
if (!SecurityUtils.isHaveAllOrg(null, user)) {
R<TSettleDomainListVo > sdRes = archivesDaprUtil.getPermissionByUserId(user.getId());
List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getUserId,user.getId()).eq(TInsuranceAreaRes::getStatus,CommonConstants.ZERO_STRING));
if (Common.isNotNull(areaRes)) {
List<String> provinces = new ArrayList<>();
List<String> citys = new ArrayList<>();
for (TInsuranceAreaRes res:areaRes){
if (Common.isEmpty(res.getCity())){
provinces.add(res.getProvince());
}else {
citys.add(res.getCity());
}
condition.setCreateBy(SecurityUtils.getUser().getId());
R<TSettleDomainListVo> sdRes = archivesDaprUtil.getPermissionByUserId(user.getId());
List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getUserId, user.getId()).eq(TInsuranceAreaRes::getStatus, CommonConstants.ZERO_STRING));
if (Common.isNotNull(areaRes)) {
List<String> provinces = new ArrayList<>();
List<String> citys = new ArrayList<>();
for (TInsuranceAreaRes res : areaRes) {
if (Common.isEmpty(res.getCity())) {
provinces.add(res.getProvince());
} else {
citys.add(res.getCity());
}
condition.setInsuranceProvinces(provinces);
condition.setInsuranceCitys(citys);
}
condition.setCreateName(SecurityUtils.getUser().getId());
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())){
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, sdRes.getData().getListSelectVO());
}
condition.setInsuranceProvinces(provinces);
condition.setInsuranceCitys(citys);
}
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())) {
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, sdRes.getData().getListSelectVO());
}else {
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, null);
}
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, null);
}
@Override
public R<List<WorkBanchWarnVo>> getExpireInsuranceWarn(Integer expireInsuranceWarnNameUrlFlag, Integer noBuyInsuranceWarnNameUrlFlag, Integer noSettleInsuranceWarnNameUrlFlag, Boolean haveAllOrg, Integer userId) {
return null;
public R<Object> batchexpireIgnore(String ids) {
if (Common.isEmpty(ids)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
List<String> idList = Common.getList(ids);
baseMapper.batchexpireIgnore(idList);
return R.ok();
}
/**
* @Author fxj
* @Description 商险到期提醒 批量备注更新
* @Date 16:26 2023/2/21
**/
@Override
public R<Object> batchexpireIgnore(String ids) {
return null;
}
public R<List<ErrorMessage>> remarkBatchAdd(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<InsurancesWarnUpdateVo> util1 = new ExcelUtil<>(InsurancesWarnUpdateVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcelFactory.read(inputStream, InsurancesWarnUpdateVo.class, new ReadListener<InsurancesWarnUpdateVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<InsurancesWarnUpdateVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(InsurancesWarnUpdateVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
if (!cachedDataList.isEmpty()) {
remarkBatchAdd(cachedDataList, errorMessageList);
}
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR_TWO, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR_TWO);
}
boolean isTrue = true;
for (ErrorMessage message : errorMessageList) {
if (!CommonConstants.SAVE_SUCCESS.equals(message.getMessage())) {
isTrue = false;
break;
}
}
if (isTrue) {
return R.ok();
} else {
return R.ok(errorMessageList);
}
}
@Override
public R<Object> expireIgnore(TBusinessInsuranceVo vo) {
return null;
if (Common.isEmpty(vo.getId())) {
return R.failed(InsurancesConstants.UPLOAD_PARAM_CHECK_FAIL);
}
TInsuranceDetail entity = baseMapper.selectById(vo.getId());
if (entity == null) {
return R.failed("未查询到相关商险订单");
}
entity.setExpireIgnoreFlag(vo.getExpireIgnoreFlag());
baseMapper.updateById(entity);
return R.ok();
}
private void remarkBatchAdd(List<InsurancesWarnUpdateVo> businessInsuranceVoList,List<ErrorMessage> errorMessages) {
InsurancesWarnUpdateVo vo;
TInsuranceDetail detail;
for (int i = 0; i < businessInsuranceVoList.size(); i++) {
try {
int line = i;
vo = businessInsuranceVoList.get(i);
if (Common.isEmpty(vo.getEmpName())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.EMP_NAME_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getEmpIdcardNo())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY));
continue;
}
if (vo.getPolicyStart() == null) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.POLICY_START_NOT_EMPTY));
continue;
}
if (vo.getPolicyEnd() == null) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.POLICY_END_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getBuyStandard())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.BUY_STANDARD_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getInsuranceCompanyName())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getInsuranceTypeName())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getDeptNo())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.PROJECT_NO_IS_NOT_EMPTY));
continue;
}
if (Common.isEmpty(vo.getDeptName())) {
errorMessages.add(new ErrorMessage(i + 2, InsurancesConstants.PROJECT_NAME_IS_NOT_EMPTY));
continue;
}
// 必填校验
ErrorMessage errorMessage = null;
boolean matchRemark = false;
String expireIgnoreFlag = null;
for (String remark : InsurancesConstants.INSURANCE_IGNORE_REMARK) {
if (StringUtils.equals(remark, vo.getRenewal())) { //是否续保
matchRemark = true;
if (StringUtils.equals(remark, InsurancesConstants.INSURANCE_IGNORE_REMARK[5])) {
expireIgnoreFlag = CommonConstants.ONE_STRING; //不忽略
if (StringUtils.isEmpty(vo.getExpireRemark())) {
errorMessage = new ErrorMessage(line + 2, "备注不能为空");
continue;
}
} else {
expireIgnoreFlag = CommonConstants.ZERO_STRING; //忽略
if (StringUtils.isEmpty(vo.getExpireRemark())) {
vo.setExpireRemark(remark);
}
}
}
}
if (errorMessage != null) {
errorMessages.add(errorMessage);
continue;
}
if (!matchRemark) {
errorMessages.add(new ErrorMessage(line + 2, "是否续保未定义"));
continue;
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, vo.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, vo.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, vo.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, vo.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, vo.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, vo.getPolicyEnd())
.eq(TInsuranceDetail::getBuyStandard,vo.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(detail).isPresent()) {
errorMessages.add(new ErrorMessage(line + 2, InsurancesConstants.NOT_FOUND_INSURANCE_RECORD));
continue;
}
detail.setExpireIgnoreFlag(expireIgnoreFlag);
detail.setExpireRemark(vo.getExpireRemark());
this.updateById(detail);
errorMessages.add(new ErrorMessage(line + 2, CommonConstants.UPDATE_SUCCESS));
} catch (Exception e) {
log.error("商险批量备注执行异常", e);
errorMessages.add(new ErrorMessage(i + 2, CommonConstants.UPDATE_DATA_FAIL));
continue;
}
}
}
/**
* @Author fxj
* @Description 商险到期提醒导出
* @Date 16:25 2023/2/21
**/
@Override
public void exportInsurancesWarn(InsuranceSearchVo searchVo, HttpServletResponse response, List<String> exportFields, String idstr) {
String fileName = InsurancesConstants.INSURANCE_ALERT_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<InsuranceWarnExportVo> list = new ArrayList<>();
if (Common.isNotNull(idstr)){
searchVo.setIdList(Common.getList(idstr));
}
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
ExcelUtil<InsuranceWarnExportVo> util = new ExcelUtil<>(InsuranceWarnExportVo.class);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, InsuranceWarnExportVo.class)
.includeColumnFieldNames(exportFields).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet(InsurancesConstants.INSURANCE_ALERT_EXPORT+index).build();
excelWriter.write(list,writeSheet);
index++;
}
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(InsurancesConstants.INSURANCE_ALERT_EXPORT+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
excelWriter.finish();
}catch (Exception e){
log.error(InsurancesConstants.INSURANCE_ALERT_EXPORT+"执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error(InsurancesConstants.INSURANCE_ALERT_EXPORT+"执行异常", e);
}
}
}
@Override
public R<Object> expireRemark(TBusinessInsuranceVo vo) {
if (Common.isEmpty(vo.getId()) || Common.isEmpty(vo.getExpireRemark())) {
return R.failed(InsurancesConstants.UPLOAD_PARAM_CHECK_FAIL);
}
TInsuranceDetail entity = baseMapper.selectById(vo.getId());
if (entity == null) {
return R.failed("未查询到相关商险订单");
}
entity.setExpireRemark(vo.getExpireRemark());
baseMapper.updateById(entity);
return R.ok();
}
private List<InsuranceWarnExportVo> noPageDiy(InsuranceSearchVo searchVo) {
List<TSettleDomainSelectVo> listSelectVO =null;
listSelectVO = getExportCondition(searchVo, listSelectVO);
return baseMapper.noPageDiy(searchVo,listSelectVO);
}
private int noPageCountDiy(InsuranceSearchVo searchVo) {
List<TSettleDomainSelectVo> listSelectVO =null;
listSelectVO = getExportCondition(searchVo, listSelectVO);
return baseMapper.noPageCountDiy(searchVo,listSelectVO);
}
private List<TSettleDomainSelectVo> getExportCondition(InsuranceSearchVo searchVo, List<TSettleDomainSelectVo> listSelectVO) {
YifuUser user = SecurityUtils.getUser();
R<TSettleDomainListVo > sdRes = archivesDaprUtil.getPermissionByUserId(user.getId());
List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getUserId,user.getId()).eq(TInsuranceAreaRes::getStatus,CommonConstants.ZERO_STRING));
if (Common.isNotNull(areaRes)) {
List<String> provinces = new ArrayList<>();
List<String> citys = new ArrayList<>();
for (TInsuranceAreaRes res:areaRes){
if (Common.isEmpty(res.getCity())){
provinces.add(res.getProvince());
}else {
citys.add(res.getCity());
}
}
searchVo.setInsuranceProvinces(provinces);
searchVo.setInsuranceCitys(citys);
}
searchVo.setCreateBy(SecurityUtils.getUser().getId());
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())){
listSelectVO = sdRes.getData().getListSelectVO();
}
return listSelectVO;
}
@Override
public R<Integer> getExpireInsuranceWarn() {
InsuranceSearchVo searchVo = new InsuranceSearchVo();
List<TSettleDomainSelectVo> listSelectVO =null;
listSelectVO = getExportCondition(searchVo, listSelectVO);
return R.ok(baseMapper.noPageCountDiy(searchVo,listSelectVO));
}
}
......@@ -1551,7 +1551,7 @@
a.INVOICE_NO,
r2.REPLACE_TIME,
a.POLICY_EFFECT,
a.UNIT_NAME,
a.UNIT_NAME as "customerName",
a.UNIT_NO,
a.REMARK,
a.INSURANCE_PROVINCE_NAME,
......@@ -1566,54 +1566,171 @@
rf.REFUND_MONEY,
rf.CREATE_TIME as "refundCreateTime",
rf.CREATE_NAME as "refundCreateUser",
a.CREATE_USER_DEPT_NAME
from t_insurance_detail a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
a.CREATE_USER_DEPT_NAME,
a.EXPIRE_REMARK
</sql>
<sql id="expire_export_sql_param">
select
a.id,
a.EMP_NAME,
a.EMP_IDCARD_NO,
a.DEPT_NAME,
a.DEPT_NO,
a.INSURANCE_COMPANY_NAME,
a.INSURANCE_TYPE_NAME,
a.POLICY_START,
a.POLICY_END,
a.BUY_STANDARD,
a.ACTUAL_PREMIUM,
a.CREATE_NAME,
a.CREATE_TIME,
"已办理" as "BUY_HANDLE_STATUS",
a.POLICY_NO,
a.MEDICAL_QUOTA,
a.DIE_DISABLE_QUOTA,
a.SETTLE_TYPE,
a.SETTLE_MONTH,
a.INVOICE_NO,
r2.REPLACE_TIME,
a.POLICY_EFFECT,
a.UNIT_NAME as "customerName",
a.UNIT_NO,
a.REMARK,
a.INSURANCE_PROVINCE_NAME,
a.INSURANCE_CITY_NAME,
case when a.IS_EFFECT = 0 then "有效"
when a.IS_EFFECT = 1 then "无效"
else null end as "IS_EFFECT" ,
a.POST,
r.fromEmpName,
r.toEmpName,
r.REPLACE_TIME as "toReplaceTime",
case when a.IS_OVERDUE = 0 then "未过期"
when a.IS_OVERDUE = 1 then "已过期"
else null end as "IS_OVERDUE" ,
a.ESTIMATE_PREMIUM,
rf.REFUND_MONEY,
rf.CREATE_TIME as "refundCreateTime",
rf.CREATE_NAME as "refundCreateUser",
a.CREATE_USER_DEPT_NAME,
a.EXPIRE_REMARK
</sql>
<sql id="expire_sql_where">
<where>
<!-- info.AUDIT_STATUS='0' and t.STATUS = 5 状态 0.待提交 1.待办理 2.已提交保险公司 3.已办理 4.办理失败 5:待结算(已输入保单号)-->
AND t.INVALID_FLAG='0' <!--未作废-->
<!--一个月内的,没有再续买商险的数据-->
and t.STATUS in('3','5','6','7','8','9')
and EXPIRE_IGNORE_FLAG='1'
a.BUY_HANDLE_STATUS ='3'
and a.EXPIRE_IGNORE_FLAG='1'
and (
date_add(curdate() - day(curdate()) + 1, interval 3 month) >
t.POLICY_END
a.POLICY_END
)
and t.VALID_FLAG='0'
<if test="param != null">
<if test="param.empName != null and param.empName.trim() != ''">
AND a.EMP_NAME like CONCAT('%' , #{param.empName},'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
AND a.EMP_IDCARD_NO like CONCAT('%' ,#{param.empIdcardNo},'%')
</if>
<if test="param.idList != null and param.idList.size() > 0">
and a.id in
<foreach collection="param.idList" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
<if test="param.empName != null and param.empName.trim() != ''">
AND t.EMP_NAME like CONCAT('%' , #{param.empName},'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
AND t.EMP_IDCARD_NO like CONCAT('%' ,#{param.empIdcardNo},'%')
</if>
<if test="param.insuranceProvinces != null and param.insuranceProvinces != null">
<if test="param.insuranceProvinces.size() > 0">
and a.INSURANCE_PROVINCE in
<foreach collection="param.insuranceProvinces" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
</if>
</if>
<if test="param.insuranceCitys != null and param.insuranceCitys != null">
<if test="param.insuranceCitys.size() > 0">
and a.INSURANCE_CITY in
<foreach collection="param.insuranceCitys" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
</if>
<if test="param.insuranceCitys != null and param.insuranceProvinces != null">
<if test="param.insuranceCitys.size() > 0 and param.insuranceProvinces.size() > 0">
and (
a.INSURANCE_PROVINCE in
<foreach collection="param.insuranceProvinces" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
or a.INSURANCE_CITY in
<foreach collection="param.insuranceCitys" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
)
</if>
</if>
</if>
<!--数据权限判断-->
AND (t.CREATE_USER_ID = #{param.createUserId}
AND (a.CREATE_BY = #{param.createBy}
<if test="domains != null">
<if test="domains.size() > 0">
or t.SETTLEMENT_ORGAN in
or a.SETTLEMENT_ORGAN in
<foreach collection="domains" item="param" index="index" open="(" close=")" separator=",">
#{param.id}
#{param}
</foreach>
</if>
</if>
<if test="domains == null">
or 1=1
</if>
)
</where>
order by t.CREATE_TIME desc
</sql>
<select id="getInsuranceExpireWarnVoPage"
resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<select id="getInsuranceExpireWarnVoPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<include refid="expire_sql_param"/>
from t_insurance_detail a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
</select>
<select id="noPageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceWarnExportVo">
<include refid="expire_export_sql_param"/>
from t_insurance_detail a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
<if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
select
count(1)
from t_insurance_detail a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
</select>
<update id="batchexpireIgnore">
update t_insurance_detail a
set a.EXPIRE_IGNORE_FLAG = '0'
where
<if test="idList != null and idList.size() > 0">
a.id in
<foreach collection="idList" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="idList == null or idList.size() = 0">
1=2
</if>
</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