Commit da7e1aa6 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents a4abe059 70768517
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -116,6 +117,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -116,6 +117,7 @@ public class TSettleDomain extends BaseEntity {
* 最后审核时间 * 最后审核时间
*/ */
@Schema(description = "最后审核时间") @Schema(description = "最后审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastAuditDate; private LocalDateTime lastAuditDate;
/** /**
...@@ -182,6 +184,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -182,6 +184,7 @@ public class TSettleDomain extends BaseEntity {
* 首次审核通过时间 * 首次审核通过时间
*/ */
@Schema(description = "首次审核通过时间") @Schema(description = "首次审核通过时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime firstPassTime; private LocalDateTime firstPassTime;
/** /**
...@@ -218,6 +221,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -218,6 +221,7 @@ public class TSettleDomain extends BaseEntity {
* 停止时间 * 停止时间
*/ */
@Schema(description = "停止时间") @Schema(description = "停止时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime stopDate; private LocalDateTime stopDate;
/** /**
...@@ -284,12 +288,14 @@ public class TSettleDomain extends BaseEntity { ...@@ -284,12 +288,14 @@ public class TSettleDomain extends BaseEntity {
* 审核人审核的时间 * 审核人审核的时间
*/ */
@Schema(description = "审核人审核的时间") @Schema(description = "审核人审核的时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime auditTime; private LocalDateTime auditTime;
/** /**
* 经理审核时间 * 经理审核时间
*/ */
@Schema(description = "经理审核时间") @Schema(description = "经理审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime managerAuditTime; private LocalDateTime managerAuditTime;
/** /**
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class TSettleDomainListVo { public class TSettleDomainListVo {
...@@ -12,4 +13,6 @@ public class TSettleDomainListVo { ...@@ -12,4 +13,6 @@ public class TSettleDomainListVo {
*/ */
private List<TSettleDomainSelectVo> listSelectVO; private List<TSettleDomainSelectVo> listSelectVO;
private Map<String,TSettleDomainSelectVo> mapSlectVo;
} }
...@@ -35,7 +35,6 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -35,7 +35,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -149,8 +148,8 @@ public class TSettleDomainController { ...@@ -149,8 +148,8 @@ public class TSettleDomainController {
**/ **/
@Inner @Inner
@PostMapping("/getSettleDomainSelectVoById") @PostMapping("/getSettleDomainSelectVoById")
public TSettleDomainSelectVo getInnerSettleDomainSelectVoByUserId(@RequestParam String id) { public TSettleDomainSelectVo getInnerSettleDomainSelectVoByUserId(@RequestBody TSettleDomainSelectVo settleDomainSelectVo) {
return tSettleDomainService.selectSettleDomainSelectVosById(id); return tSettleDomainService.selectSettleDomainSelectVosById(settleDomainSelectVo);
} }
/** /**
......
...@@ -55,7 +55,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -55,7 +55,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
* @Author fxj * @Author fxj
* @Date 2019-12-24 * @Date 2019-12-24
**/ **/
TSettleDomainSelectVo selectSettleDomainSelectVosById(String id); TSettleDomainSelectVo selectSettleDomainSelectVosById(TSettleDomainSelectVo settleDomainSelectVo);
/** /**
* 获取所有客户单位的结算主体信息 * 获取所有客户单位的结算主体信息
......
...@@ -1196,7 +1196,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1196,7 +1196,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
list = gettEmpProInfoExportVos(idstr, projectDTO); list = gettEmpProInfoExportVos(idstr, projectDTO);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list != null && !list.isEmpty()) { if (list == null || list.isEmpty()) {
list = new ArrayList<>(); list = new ArrayList<>();
} }
try { try {
......
...@@ -87,15 +87,15 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -87,15 +87,15 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
/** /**
* @param id * @param settleDomainSelectVo
* @Author: wangan * @Author: wangan
* @Date: 2019/10/18 * @Date: 2019/10/18
* @Description: dataCheckDepart * @Description: dataCheckDepart
* @return: com.yifu.cloud.v1.hrms.api.vo.TSettleDomainSelectVo * @return: com.yifu.cloud.v1.hrms.api.vo.TSettleDomainSelectVo
**/ **/
@Override @Override
public TSettleDomainSelectVo selectSettleDomainSelectVosById(String id) { public TSettleDomainSelectVo selectSettleDomainSelectVosById(TSettleDomainSelectVo settleDomainSelectVo) {
return baseMapper.selectSettleDomainSelectVosById(id); return baseMapper.selectSettleDomainSelectVosById(settleDomainSelectVo.getId());
} }
@Override @Override
......
...@@ -670,7 +670,7 @@ ...@@ -670,7 +670,7 @@
a.ID_TOWN,a.EMP_REGIS_TYPE,a.FILE_PROVINCE,a.FILE_CITY,a.FILE_TOWN,a.HIGN_EDUCATION,a.FILE_STATUS, a.ID_TOWN,a.EMP_REGIS_TYPE,a.FILE_PROVINCE,a.FILE_CITY,a.FILE_TOWN,a.HIGN_EDUCATION,a.FILE_STATUS,
b.CONTRACT_NAME,b.CONTRACT_TYPE, b.CONTRACT_NAME,b.CONTRACT_TYPE,
b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,b.CONTRACT_ID b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,b.CONTRACT_ID,
c.UNIT_NAME, c.UNIT_NAME,
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST
......
...@@ -61,4 +61,6 @@ public class ValidityConstants { ...@@ -61,4 +61,6 @@ public class ValidityConstants {
public static final String PATTERN_32 = "^.{1,32}$"; public static final String PATTERN_32 = "^.{1,32}$";
/** 最多50位 规则 */ /** 最多50位 规则 */
public static final String PATTERN_50 = "^.{1,50}$"; public static final String PATTERN_50 = "^.{1,50}$";
/** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$";
} }
...@@ -420,4 +420,8 @@ public interface ErrorCodes { ...@@ -420,4 +420,8 @@ public interface ErrorCodes {
* 当前社保导入队列不足或者数据量过大,请稍后重试! * 当前社保导入队列不足或者数据量过大,请稍后重试!
*/ */
String SOCIALINFO_LIST_NUM_LARGE = "socialinfo.list.num.large"; String SOCIALINFO_LIST_NUM_LARGE = "socialinfo.list.num.large";
/**
* 派增异常: 自定义缴纳养老基数不可为空
*/
String EMP_DISPATCH_SOCIAL_DIY_NOT_EMPTY = "emp.dispatch.social.diy.not.empty";
} }
...@@ -111,9 +111,9 @@ project.person.delete.exit=\u8BE5\u4EBA\u5458\u9879\u76EE\u6863\u6848\u5DF2\u51C ...@@ -111,9 +111,9 @@ project.person.delete.exit=\u8BE5\u4EBA\u5458\u9879\u76EE\u6863\u6848\u5DF2\u51C
emp.dispatch.contract.not.empty=\u6D3E\u5355\u5458\u5DE5\u5408\u540C\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A emp.dispatch.contract.not.empty=\u6D3E\u5355\u5458\u5DE5\u5408\u540C\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.not.empty=\u6D3E\u5355\u5458\u5DE5\u793E\u4FDD\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A emp.dispatch.social.not.empty=\u6D3E\u5355\u5458\u5DE5\u793E\u4FDD\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A(\u5907\u6848\u57FA\u6570|\u7F34\u7EB3\u7C7B\u578B|\u517B\u8001\u8D77\u7F34\u65F6\u95F4)
emp.dispatch.fund.not.empty=\u6D3E\u5355\u5458\u5DE5\u516C\u79EF\u91D1\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A emp.dispatch.fund.not.empty=\u6D3E\u5355\u5458\u5DE5\u516C\u79EF\u91D1\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A(\u8D77\u7F34\u65E5\u671F|\u57FA\u6570|\u6BD4\u4F8B)
emp.dispatch.social.existing=\u65B0\u589E\u5F02\u5E38\uFF1A\u5DF2\u5B58\u5728\u793E\u4FDD\u6570\u636E emp.dispatch.social.existing=\u65B0\u589E\u5F02\u5E38\uFF1A\u5DF2\u5B58\u5728\u793E\u4FDD\u6570\u636E
......
...@@ -11,7 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -11,7 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
...@@ -82,7 +81,9 @@ public class ArchivesDaprUtil { ...@@ -82,7 +81,9 @@ public class ArchivesDaprUtil {
* @return * @return
**/ **/
public R<TSettleDomainSelectVo> getSettleDomainSelectVoById(String departId){ public R<TSettleDomainSelectVo> getSettleDomainSelectVoById(String departId){
R<TSettleDomainSelectVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById",departId, Map.class, SecurityConstants.FROM_IN); TSettleDomainSelectVo settleDomainSelectVo = new TSettleDomainSelectVo();
settleDomainSelectVo.setId(departId);
R<TSettleDomainSelectVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById",settleDomainSelectVo, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取派单校验需要的档案信息失败!"); return R.failed("获取派单校验需要的档案信息失败!");
} }
...@@ -97,7 +98,7 @@ public class ArchivesDaprUtil { ...@@ -97,7 +98,7 @@ public class ArchivesDaprUtil {
* @return * @return
**/ **/
public R<TSettleDomainListVo> selectAllSettleDomainSelectVos(){ public R<TSettleDomainListVo> selectAllSettleDomainSelectVos(){
R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVos","", Map.class, SecurityConstants.FROM_IN); R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVos","", TSettleDomainListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取所有客户单位的结算主体信息失败!"); return R.failed("获取所有客户单位的结算主体信息失败!");
} }
......
...@@ -77,9 +77,9 @@ public class InsurancesConstants { ...@@ -77,9 +77,9 @@ public class InsurancesConstants {
*/ */
public static final String DATA_IS_NOT_EXIST = "投保信息不存在"; public static final String DATA_IS_NOT_EXIST = "投保信息不存在";
/** /**
* 被替换信息不存在 * 被替换员工投保记录不存在
*/ */
public static final String REPLACE_IS_NOT_EXIST = "被替换信息不存在"; public static final String REPLACE_IS_NOT_EXIST = "被替换员工投保记录不存在";
/** /**
* 项目编码不存在 * 项目编码不存在
*/ */
...@@ -89,13 +89,37 @@ public class InsurancesConstants { ...@@ -89,13 +89,37 @@ public class InsurancesConstants {
*/ */
public static final String PROJECT_NOT_FIND_SETTLE_TYPE = "未找到结算主体的结算方式"; public static final String PROJECT_NOT_FIND_SETTLE_TYPE = "未找到结算主体的结算方式";
/** /**
* 替换者信息已存在 * 替换员工投保记录已存在
*/ */
public static final String REPLACE_IS_EXIST = "替换者信息已存在"; public static final String REPLACE_IS_EXIST = "替换员工投保记录已存在";
/** /**
* 无效、已过期、已出险、已减员的 不能替换 * 当前记录是待投保,无法替换
*/ */
public static final String REPLACE_IS_NOT_ALLOW = "无效、已过期、已出险、已减员的 不能替换"; public static final String ONE_REPLACE_IS_NOT_ALLOW = "当前记录是待投保,无法替换";
/**
* 当前记录是投保中,无法替换
*/
public static final String TWO_REPLACE_IS_NOT_ALLOW = "当前记录是投保中,无法替换";
/**
* 当前记录已出险,无法替换
*/
public static final String USE_REPLACE_IS_NOT_ALLOW = "当前记录已出险,无法替换";
/**
* 当前记录已失效,无法替换
*/
public static final String EFFECT_REPLACE_IS_NOT_ALLOW = "当前记录已失效,无法替换";
/**
* 当前记录已过期,无法替换
*/
public static final String OVERDUE_REPLACE_IS_NOT_ALLOW = "当前记录已过期,无法替换";
/**
* 当前记录已减员,无法替换
*/
public static final String FIVE_REPLACE_IS_NOT_ALLOW = "当前记录已减员,无法替换";
/**
* 当前记录在减员流程中,无法替换
*/
public static final String REDUCE_REPLACE_IS_NOT_ALLOW = "当前记录在减员流程中,无法替换";
/** /**
* 员工姓名不能为空 * 员工姓名不能为空
*/ */
...@@ -108,6 +132,10 @@ public class InsurancesConstants { ...@@ -108,6 +132,10 @@ public class InsurancesConstants {
* 替换员工姓名不能为空 * 替换员工姓名不能为空
*/ */
public static final String REPLACE_EMP_NAME_NOT_EMPTY = "替换员工姓名不能为空"; public static final String REPLACE_EMP_NAME_NOT_EMPTY = "替换员工姓名不能为空";
/**
* 替换员工姓名超过20字符长度限制
*/
public static final String REPLACE_EMP_NAME_MORE_THAN_20 = "替换员工姓名超过20字符长度限制";
/** /**
* 员工身份证号不能为空 * 员工身份证号不能为空
*/ */
...@@ -125,9 +153,9 @@ public class InsurancesConstants { ...@@ -125,9 +153,9 @@ public class InsurancesConstants {
*/ */
public static final String EMP_ID_CARD_NO_NOT_FIT = "员工未通过实名认证"; public static final String EMP_ID_CARD_NO_NOT_FIT = "员工未通过实名认证";
/** /**
* 替换员工姓名、身份证号不一致 * 替换员工未通过实名认证
*/ */
public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工姓名、身份证号不一致"; public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工未通过实名认证";
/** /**
* 替换员工身份证号格式有误 * 替换员工身份证号格式有误
*/ */
...@@ -137,9 +165,9 @@ public class InsurancesConstants { ...@@ -137,9 +165,9 @@ public class InsurancesConstants {
*/ */
public static final String DEPT_NO_NOT_EMPTY = "项目编码不能为空"; public static final String DEPT_NO_NOT_EMPTY = "项目编码不能为空";
/** /**
* 替换项目编码不能为空 * 替换员工项目编码不能为空
*/ */
public static final String REPLACE_DEPT_NO_NOT_EMPTY = "替换项目编码不能为空"; public static final String REPLACE_DEPT_NO_NOT_EMPTY = "替换员工项目编码不能为空";
/** /**
* 保险公司名称不能为空 * 保险公司名称不能为空
*/ */
...@@ -253,9 +281,17 @@ public class InsurancesConstants { ...@@ -253,9 +281,17 @@ public class InsurancesConstants {
*/ */
public static final String ACTUAL_PREMIUM_NO_EMPTY = "保费不能为空"; public static final String ACTUAL_PREMIUM_NO_EMPTY = "保费不能为空";
/** /**
* 保单号不存在 * 保单号不存在或已过期
*/
public static final String POLICY_NO_EXIST = "保单号不存在或已过期";
/**
* 保险公司错误
*/ */
public static final String POLICY_NO_EXIST= "保单号不存在"; public static final String POLICY_NO_COMPANY_NAME_NOT_SAME = "保险公司错误";
/**
* 险种名称错误
*/
public static final String POLICY_NO_TYPE_NAME_NOT_SAME = "险种名称错误";
/***********************减员办理错误码********************************/ /***********************减员办理错误码********************************/
...@@ -359,5 +395,10 @@ public class InsurancesConstants { ...@@ -359,5 +395,10 @@ public class InsurancesConstants {
*/ */
public static final String REFUND_MONEY_IS_NOT_NULL = "已更新保单减员退费,不能再次更新"; public static final String REFUND_MONEY_IS_NOT_NULL = "已更新保单减员退费,不能再次更新";
/**
* 减员导出办理
*/
public static final String REFUND_EXPORT = "减员导出办理";
} }
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
...@@ -15,7 +16,7 @@ import java.util.Date; ...@@ -15,7 +16,7 @@ import java.util.Date;
*/ */
@Data @Data
@Tag(name = "减员信息表") @Tag(name = "减员信息表")
public class TInsuranceRefund implements Serializable { public class TInsuranceRefund extends BaseEntity {
/** /**
* 主键id * 主键id
*/ */
...@@ -31,24 +32,6 @@ public class TInsuranceRefund implements Serializable { ...@@ -31,24 +32,6 @@ public class TInsuranceRefund implements Serializable {
*/ */
private Integer reduceHandleStatus; private Integer reduceHandleStatus;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 保单编号
*/
@Schema(description = "保单编号")
private String policyNo;
/** /**
* 退费金额 * 退费金额
*/ */
...@@ -59,21 +42,6 @@ public class TInsuranceRefund implements Serializable { ...@@ -59,21 +42,6 @@ public class TInsuranceRefund implements Serializable {
*/ */
private String remark; private String remark;
/**
* 减员创建时间
*/
private LocalDateTime createTime;
/**
* 减员创建人
*/
private String createBy;
/**
* 减员创建人姓名
*/
private String createName;
/** /**
* 是否删除 0未删除/1删除 * 是否删除 0未删除/1删除
*/ */
...@@ -81,6 +49,8 @@ public class TInsuranceRefund implements Serializable { ...@@ -81,6 +49,8 @@ public class TInsuranceRefund implements Serializable {
private Integer deleteFlag; private Integer deleteFlag;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -258,6 +258,20 @@ public class ValidityUtil { ...@@ -258,6 +258,20 @@ public class ValidityUtil {
return str.matches(ValidityConstants.PATTERN_50) ; return str.matches(ValidityConstants.PATTERN_50) ;
} }
/**
* 验证字符串 最多50位
*
* @author licancan
* @param str
* @return {@link boolean}
*/
public static boolean validate60(final String str){
if(Common.isEmpty(str)){
return Boolean.FALSE;
}
return str.matches(ValidityConstants.PATTERN_60) ;
}
/** /**
* 校验用户姓名是否是初始化的值 * 校验用户姓名是否是初始化的值
* *
......
...@@ -44,4 +44,10 @@ public class InsuranceListParam implements Serializable { ...@@ -44,4 +44,10 @@ public class InsuranceListParam implements Serializable {
*/ */
@Schema(description = "保险公司名称") @Schema(description = "保险公司名称")
private String insuranceCompanyName; private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
} }
...@@ -61,6 +61,12 @@ public class InsuranceRefundCheck implements Serializable { ...@@ -61,6 +61,12 @@ public class InsuranceRefundCheck implements Serializable {
@Schema(description = "保单结束日期") @Schema(description = "保单结束日期")
private String policyEnd; private String policyEnd;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/** /**
* 备注 * 备注
*/ */
......
...@@ -165,5 +165,11 @@ public class InsuranceRefundListVo implements Serializable { ...@@ -165,5 +165,11 @@ public class InsuranceRefundListVo implements Serializable {
@Schema(description = "减员派单日期") @Schema(description = "减员派单日期")
private LocalDate refundCreateTime; private LocalDate refundCreateTime;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
} }
...@@ -23,7 +23,7 @@ public class InsuranceRefundOperationParam implements Serializable { ...@@ -23,7 +23,7 @@ public class InsuranceRefundOperationParam implements Serializable {
private Integer operationType; private Integer operationType;
@Schema(name = "减员办理列表") @Schema(name = "减员办理列表")
private List<InsuranceRefundHandlingListVo> insuranceRefundHandlingList; private List<RefundExportListVo> insuranceRefundHandlingList;
@Schema(name = "办理参数") @Schema(name = "办理参数")
private InsuranceRefundHandlingParam param; private InsuranceRefundHandlingParam param;
......
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-27 10:29:55
*/
@Data
@Tag(name = "减员办理错误返回类")
public class RefundErrorVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
private String id;
/**
* 项目名称
*/
@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;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/**
* 投保岗位
*/
@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;
/**
* 错误原因
*/
@Schema(description = "错误原因")
private String errorMessage;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaji
* @description 导出减员办理请求参数
* @date 2022-07-26 15:53:56
*/
@Data
@Schema(description = "导出减员办理请求参数")
public class RefundExportListParam implements Serializable {
private static final long serialVersionUID = 3623027153213352936L;
/**
* 员工姓名
*/
@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;
/**
* 商险id集合
*/
@Schema(description = "商险id集合")
private List<String> idList;
}
...@@ -15,7 +15,7 @@ import java.time.LocalDate; ...@@ -15,7 +15,7 @@ import java.time.LocalDate;
*/ */
@Data @Data
@Tag(name ="减员办理返回类") @Tag(name ="减员办理返回类")
public class InsuranceRefundHandlingListVo implements Serializable { public class RefundExportListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
...@@ -54,6 +54,12 @@ public class InsuranceRefundHandlingListVo implements Serializable { ...@@ -54,6 +54,12 @@ public class InsuranceRefundHandlingListVo implements Serializable {
@Schema(description = " 投保类型, 1新增、3批增、4替换") @Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType; private Integer buyType;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/** /**
* 投保岗位 * 投保岗位
*/ */
...@@ -169,7 +175,7 @@ public class InsuranceRefundHandlingListVo implements Serializable { ...@@ -169,7 +175,7 @@ public class InsuranceRefundHandlingListVo implements Serializable {
* 创建人姓名 * 创建人姓名
*/ */
@Schema(description = "创建人(派单人)") @Schema(description = "创建人(派单人)")
private String refundCreateName; private String createName;
/** /**
* 备注 * 备注
......
...@@ -291,11 +291,11 @@ public class TInsuranceDetailController { ...@@ -291,11 +291,11 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param param 查询条件 * @param param 查询条件
* @return {@link R<IPage< InsuranceRefundHandlingListVo >>} * @return {@link R<IPage< RefundExportListVo >>}
*/ */
@Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询") @Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询")
@PostMapping("/getInsuranceRefundHandlingPageList") @PostMapping("/getInsuranceRefundHandlingPageList")
public R<IPage<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @RequestBody InsuranceRefundHandlingParam param) { public R<IPage<RefundExportListVo>> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @RequestBody InsuranceRefundHandlingParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingPageList(page,param)); return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingPageList(page,param));
} }
...@@ -304,11 +304,11 @@ public class TInsuranceDetailController { ...@@ -304,11 +304,11 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param param 查询条件 * @param param 查询条件
* @return {@link R<List< InsuranceRefundHandlingListVo >>} * @return {@link R<List< RefundExportListVo >>}
*/ */
@Operation(summary = "导出减员列表", description = "导出减员列表") @Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList") @PostMapping("/getInsuranceRefundHandlingList")
public R<List<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingList(@RequestBody InsuranceRefundOperationParam param) { public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param)); return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param));
} }
...@@ -317,7 +317,7 @@ public class TInsuranceDetailController { ...@@ -317,7 +317,7 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param insuranceDetail 减员信息 * @param insuranceDetail 减员信息
* @return {@link R<List< InsuranceRefundHandlingListVo >>} * @return {@link R<List< RefundExportListVo >>}
*/ */
@Operation(summary = "减员办理", description = "减员办理") @Operation(summary = "减员办理", description = "减员办理")
@PostMapping("/updateInsuranceRefund") @PostMapping("/updateInsuranceRefund")
...@@ -330,7 +330,7 @@ public class TInsuranceDetailController { ...@@ -330,7 +330,7 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param CompanyName 保险公司id * @param CompanyName 保险公司id
* @return {@link R<List< InsuranceRefundHandlingListVo >>} * @return {@link R<List< RefundExportListVo >>}
*/ */
@Operation(summary = "根据保险公司名称查询保单明细", description = "根据保险公司名称查询保单明细") @Operation(summary = "根据保险公司名称查询保单明细", description = "根据保险公司名称查询保单明细")
@GetMapping("/selectByCompanyName") @GetMapping("/selectByCompanyName")
...@@ -343,7 +343,7 @@ public class TInsuranceDetailController { ...@@ -343,7 +343,7 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param id 险种id * @param id 险种id
* @return {@link R<List< InsuranceRefundHandlingListVo >>} * @return {@link R<List< RefundExportListVo >>}
*/ */
@Operation(summary = "根据险种名称查询保单明细", description = "根据险种名称查询保单明细") @Operation(summary = "根据险种名称查询保单明细", description = "根据险种名称查询保单明细")
@GetMapping("/selectByTypeId") @GetMapping("/selectByTypeId")
...@@ -356,7 +356,7 @@ public class TInsuranceDetailController { ...@@ -356,7 +356,7 @@ public class TInsuranceDetailController {
* *
* @author zhaji * @author zhaji
* @param id 险种id * @param id 险种id
* @return {@link R<List< InsuranceRefundHandlingListVo >>} * @return {@link R<List< RefundExportListVo >>}
*/ */
@Operation(summary = "出险", description = "出险") @Operation(summary = "出险", description = "出险")
@GetMapping("/updateIsUse") @GetMapping("/updateIsUse")
......
...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; ...@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
...@@ -40,8 +41,8 @@ public class TInsuranceTypeController { ...@@ -40,8 +41,8 @@ public class TInsuranceTypeController {
* @return * @return
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @PostMapping("/page" )
public R<IPage<InsuranceTypeVo>> getInsuranceTypePage(Page page,TInsuranceType insuranceType) { public R<IPage<InsuranceTypeVo>> getInsuranceTypePage(Page<TInsuranceType> page, @RequestBody TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.pageDiy(page, insuranceType)); return R.ok(insuranceTypeService.pageDiy(page, insuranceType));
} }
...@@ -53,7 +54,6 @@ public class TInsuranceTypeController { ...@@ -53,7 +54,6 @@ public class TInsuranceTypeController {
@Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "新增险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("新增险种") @SysLog("新增险种")
@PostMapping("/save") @PostMapping("/save")
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R save(@RequestBody TInsuranceType insuranceType) { public R save(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.saveInsuranceType(insuranceType); return insuranceTypeService.saveInsuranceType(insuranceType);
} }
...@@ -65,7 +65,6 @@ public class TInsuranceTypeController { ...@@ -65,7 +65,6 @@ public class TInsuranceTypeController {
*/ */
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')") @Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" )
public R getInsuranceTypeDetail(@PathVariable("id" ) String id) { public R getInsuranceTypeDetail(@PathVariable("id" ) String id) {
return insuranceTypeService.getInsuranceTypeDetail(id); return insuranceTypeService.getInsuranceTypeDetail(id);
} }
...@@ -79,7 +78,6 @@ public class TInsuranceTypeController { ...@@ -79,7 +78,6 @@ public class TInsuranceTypeController {
@Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')") @Operation(summary = "修改险种", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("修改险种") @SysLog("修改险种")
@PostMapping("/update") @PostMapping("/update")
//@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R update(@RequestBody TInsuranceType insuranceType) { public R update(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.updateInsuranceType(insuranceType); return insuranceTypeService.updateInsuranceType(insuranceType);
} }
...@@ -90,8 +88,8 @@ public class TInsuranceTypeController { ...@@ -90,8 +88,8 @@ public class TInsuranceTypeController {
* @return * @return
*/ */
@Operation(summary = "查询险种列表", description = "查询险种列表") @Operation(summary = "查询险种列表", description = "查询险种列表")
@GetMapping("/list" ) @PostMapping("/list" )
public R getInsuranceTypeList(TInsuranceType insuranceType) { public R getInsuranceTypeList(@RequestBody TInsuranceType insuranceType) {
return insuranceTypeService.getInsuranceTypeList(insuranceType); return insuranceTypeService.getInsuranceTypeList(insuranceType);
} }
} }
...@@ -111,18 +111,18 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -111,18 +111,18 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @author zhaji * @author zhaji
* @param page 分页参数 * @param page 分页参数
* @param param 查询参数 * @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>} * @return {@link IPage< RefundExportListVo >}
*/ */
IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @Param("param") InsuranceRefundHandlingParam param); IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @Param("param") InsuranceRefundHandlingParam param);
/** /**
* 减员办理列表不分页查询 * 减员办理列表不分页查询
* *
* @author zhaji * @author zhaji
* @param param 查询参数 * @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>} * @return {@link List< RefundExportListVo >}
*/ */
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(@Param("param")InsuranceRefundHandlingParam param); List<RefundExportListVo> getInsuranceRefundHandlingList(@Param("param")InsuranceRefundHandlingParam param);
/** /**
* 减员办理 * 减员办理
...@@ -150,4 +150,22 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -150,4 +150,22 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @return {@link TInsuranceRefundDetail} * @return {@link TInsuranceRefundDetail}
*/ */
TInsuranceRefundDetail selectRefundDetail(@Param("param") TInsuranceRefundDetail refundDetail); TInsuranceRefundDetail selectRefundDetail(@Param("param") TInsuranceRefundDetail refundDetail);
/**
* TODO
*
* @author zhaji
* @param idList
* @return {@link List< RefundExportListVo>}
*/
List<RefundExportListVo> getRefundExportListBySelect(@Param("idList")List<String> idList);
/**
* TODO
*
* @author zhaji
* @param param
* @return {@link List< RefundExportListVo>}
*/
List<RefundExportListVo> getRefundExportList(@Param("param") RefundExportListParam param);
} }
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;
/** /**
* @author Administrator * @author Administrator
...@@ -14,5 +13,14 @@ import org.springframework.stereotype.Service; ...@@ -14,5 +13,14 @@ import org.springframework.stereotype.Service;
@Mapper @Mapper
public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> { public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
/**
* 根据保单id查询减员信息
*
* @author zhaji
* @param id
* @return {@link TInsuranceRefund}
*/
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
} }
...@@ -181,18 +181,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -181,18 +181,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @author zhaji * @author zhaji
* @param page 分页数据 * @param page 分页数据
* @param param 查询参数 * @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>} * @return {@link IPage< RefundExportListVo >}
*/ */
IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param); IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param);
/** /**
* 减员办理列表不分页查询 * 减员办理列表不分页查询
* *
* @author zhaji * @author zhaji
* @param param 查询参数 * @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>} * @return {@link List< RefundExportListVo >}
*/ */
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundOperationParam param); List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param);
/** /**
* 减员办理 * 减员办理
......
...@@ -11,4 +11,8 @@ import org.springframework.stereotype.Service; ...@@ -11,4 +11,8 @@ import org.springframework.stereotype.Service;
*/ */
public interface TInsuranceRefundService extends IService<TInsuranceRefund> { public interface TInsuranceRefundService extends IService<TInsuranceRefund> {
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
} }
...@@ -25,7 +25,7 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> { ...@@ -25,7 +25,7 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> {
* @param insuranceType 分页查询参数 * @param insuranceType 分页查询参数
* @return {@link IPage< TInsuranceType>} * @return {@link IPage< TInsuranceType>}
*/ */
IPage<InsuranceTypeVo> pageDiy(Page page,TInsuranceType insuranceType); IPage<InsuranceTypeVo> pageDiy(Page<TInsuranceType> page,TInsuranceType insuranceType);
/** /**
* 新增险种信息 * 新增险种信息
......
...@@ -16,6 +16,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; ...@@ -16,6 +16,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -53,8 +54,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM ...@@ -53,8 +54,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){ if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确"); return R.failed("计费方式格式不正确");
} }
String companyName = insuranceCompany.getCompanyName(); if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){
if (companyName.length()>CommonConstants.SIXTY_INT){
return R.failed("保险公司名称过长"); return R.failed("保险公司名称过长");
} }
boolean b = companyIsExists(insuranceCompany.getCompanyName()); boolean b = companyIsExists(insuranceCompany.getCompanyName());
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl; package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -973,6 +971,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -973,6 +971,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (!ValidityUtil.validate20(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MORE_THAN_20);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getEmpIdcardNo())){ if (StringUtils.isBlank(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -983,6 +986,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -983,6 +986,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (!ValidityUtil.validate32(param.getPost())){
param.setErrorMessage(InsurancesConstants.POST_NOT_MORE_THAN_32);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getPolicyNo())){ if (StringUtils.isBlank(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY); param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -1028,6 +1036,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1028,6 +1036,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (StringUtils.isNotBlank(param.getRemark())){
if (!ValidityUtil.validate50(param.getRemark())){
param.setErrorMessage(InsurancesConstants.REMARK_NOT_MORE_THAN_50);
listResult.add(param);
continue;
}
}
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
...@@ -1149,14 +1164,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1149,14 +1164,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 //记录查重校验:姓名 + 身份证号 + 保险公司 + 险种
//待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
setRStatus.add(CommonConstants.FIVE_INT);
TInsuranceDetail insuranceDetail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail insuranceDetail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName()) .eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo()) .eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName()) .eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
//是否需要加状态过滤? .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(insuranceDetail).isPresent()){ if (Optional.ofNullable(insuranceDetail).isPresent()){
param.setErrorMessage(InsurancesConstants.DATA_IS_EXIST); param.setErrorMessage(InsurancesConstants.DATA_IS_EXIST);
...@@ -1167,6 +1202,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1167,6 +1202,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail limitOne = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail limitOne = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo()) .eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.THREE_INT) .eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.THREE_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
...@@ -1175,20 +1212,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1175,20 +1212,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
param.setPolicyStart(limitOne.getPolicyStart()); if(!limitOne.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())){
param.setPolicyEnd(limitOne.getPolicyEnd()); param.setErrorMessage(InsurancesConstants.POLICY_NO_COMPANY_NAME_NOT_SAME);
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
listResult.add(param); listResult.add(param);
continue; continue;
} }else if (!limitOne.getInsuranceTypeName().equals(param.getInsuranceTypeName())){
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){ param.setErrorMessage(InsurancesConstants.POLICY_NO_TYPE_NAME_NOT_SAME);
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
listResult.add(param); listResult.add(param);
continue; continue;
}else {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
} }
listSuccess.add(param); listSuccess.add(param);
} }
...@@ -1250,6 +1285,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1250,6 +1285,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (!ValidityUtil.validate20(param.getReplaceEmpName())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_NAME_MORE_THAN_20);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getReplaceEmpIdcardNo())){ if (StringUtils.isBlank(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -1265,12 +1305,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1265,12 +1305,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validate32(param.getPost())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.POST_NOT_MORE_THAN_32);
listResult.add(param); listResult.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getReplaceEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param); listResult.add(param);
...@@ -1290,6 +1332,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1290,6 +1332,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}
}
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param); listResult.add(param);
...@@ -1317,28 +1377,101 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1317,28 +1377,101 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
// 无效、已过期、已出险、已减员的 不能替换 // 投保状态 待投保 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.ONE_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 投保中 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.TWO_INT){
param.setErrorMessage(InsurancesConstants.TWO_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 已投保 已出险 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
&& detail.getIsUse() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.USE_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 已投保 已失效 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
&& detail.getIsEffect() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.EFFECT_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 已投保 已过期 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
&& detail.getIsOverdue() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.OVERDUE_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 已减员 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){ if (detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){
param.setErrorMessage(InsurancesConstants.REPLACE_IS_NOT_ALLOW); param.setErrorMessage(InsurancesConstants.FIVE_REPLACE_IS_NOT_ALLOW);
listResult.add(param);
continue;
}
// 投保状态 已投保 减员状态 待减员/减员中 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
&& (detail.getReduceHandleStatus() == CommonConstants.ONE_INT
|| detail.getReduceHandleStatus() == CommonConstants.TWO_INT)){
param.setErrorMessage(InsurancesConstants.REDUCE_REPLACE_IS_NOT_ALLOW);
listResult.add(param); listResult.add(param);
continue; continue;
} }
} }
//替换者数据查重校验:替换姓名 + 替换身份证号 + 替换项目编码 + 保险公司 + 险种名称 //替换者数据查重校验:替换姓名 + 替换身份证号 + 替换项目编码? + 保险公司 + 险种名称
//待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
setRStatus.add(CommonConstants.FIVE_INT);
TInsuranceDetail replace = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail replace = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getReplaceEmpName()) .eq(TInsuranceDetail::getEmpName, param.getReplaceEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getReplaceEmpIdcardNo()) .eq(TInsuranceDetail::getEmpIdcardNo, param.getReplaceEmpIdcardNo())
.eq(TInsuranceDetail::getDeptNo, param.getReplaceDeptNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName()) .eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
//加状态?? .eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(replace).isPresent()){ if (Optional.ofNullable(replace).isPresent()){
param.setErrorMessage(InsurancesConstants.REPLACE_IS_EXIST); param.setErrorMessage(InsurancesConstants.REPLACE_IS_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
} }
//时间区间
TInsuranceDetail insuranceDetailBetween = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getReplaceEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getReplaceEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and(
wrapper -> wrapper.between(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.or()
.between(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetailBetween).isPresent()){
param.setErrorMessage("替换员工在["+param.getPolicyStart()+"-"+param.getPolicyEnd()+"]期间内有投保记录");
listResult.add(param);
continue;
}
listSuccess.add(param); listSuccess.add(param);
} }
map.put("listResult",listResult); map.put("listResult",listResult);
...@@ -1389,6 +1522,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1389,6 +1522,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
...@@ -1483,204 +1617,73 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1483,204 +1617,73 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
* 减员导入校验 * 减员导入
* *
* @author zhaji * @author zhaji
* @param insuranceRefundCheckList 减员表 * @param insuranceRefundCheckList 减员表
* @return {@link R} * @return {@link R}
*/ */
public Map<String,List<InsuranceRefundCheck>> checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList){ @Override
List<InsuranceRefundCheck> errorList = new ArrayList<>(128); public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList) {
List<InsuranceRefundCheck> successList = new ArrayList<>(); YifuUser user = SecurityUtils.getUser();
Map<String,List<InsuranceRefundCheck>> map = new HashMap<>(); if(!Common.isNotEmpty(insuranceRefundCheckList)){
for (InsuranceRefundCheck param : insuranceRefundCheckList) { return R.failed("当前导入的减员信息为空");
//员工姓名
String empName = param.getEmpName();
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
} }
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList);
//员工身份证 List<InsuranceRefundCheck> successList = refundMap.get("successList");
String empIdCardNo = param.getEmpIdcardNo(); if (CollectionUtils.isNotEmpty(successList)){
if(StringUtils.isBlank(empIdCardNo)){ LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY); updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId())
errorList.add(param); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now())
continue; .set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
for (InsuranceRefundCheck refund : successList){
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(refund.getId());
insuranceRefund.setReduceHandleStatus(CommonConstants.ONE_INT);
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setRemark(refund.getRemark());
if(null == refund.getReduceHandleStatus() || CommonConstants.THREE_INT == refund.getReduceHandleStatus()){
tInsuranceRefundService.updateByInsDetailId(insuranceRefund);
}else{
tInsuranceRefundService.save(insuranceRefund);
} }
updateWrapper.eq(TInsuranceDetail :: getId,refund.getId());
//保险公司名称 update(updateWrapper);
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;
} }
List<InsuranceRefundCheck> errorList = refundMap.get("errorList");
//保单开始日期 return R.ok(errorList,"校验完成");
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); * @author zhaji
errorList.add(param); * @param page 分页参数
continue; * @param param 查询参数
* @return {@link IPage< InsuredListVo>}
*/
@Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
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<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuredListVo record : insuranceList.getRecords()) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
} }
// 身份证号位数校验(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<>(); return insuranceList;
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;
}
param.setId(one.getId());
successList.add(param);
}
map.put("successList",successList);
map.put("errorList",errorList);
return map;
};
/**
* 减员导入
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
@Override
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
}
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList);
List<InsuranceRefundCheck> successList = refundMap.get("successList");
if (CollectionUtils.isNotEmpty(successList)){
List<TInsuranceRefund> refundList= new ArrayList<>();
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
for (InsuranceRefundCheck refund : successList) {
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(refund.getId());
insuranceRefund.setEmpName(refund.getEmpName());
insuranceRefund.setEmpIdcardNo(refund.getEmpIdcardNo());
insuranceRefund.setEmpName(refund.getEmpName());
insuranceRefund.setPolicyNo(refund.getPolicyNo());
insuranceRefund.setReduceHandleStatus(CommonConstants.ONE_INT);
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setRemark(refund.getRemark());
refundList.add(insuranceRefund);
updateWrapper.eq(TInsuranceDetail :: getId,refund.getId());
update(updateWrapper);
}
tInsuranceRefundService.saveBatch(refundList);
}
List<InsuranceRefundCheck> errorList = refundMap.get("errorList");
return R.ok(errorList,"校验完成,成功:"+successList.size()+"条,失败:"+errorList.size()+"条");
}
/**
* 已投保列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuredListVo>}
*/
@Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
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<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuredListVo record : insuranceList.getRecords()) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
}
}
}
return insuranceList;
} }
/** /**
...@@ -1771,19 +1774,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1771,19 +1774,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @author zhaji * @author zhaji
* @param page 分页数据 * @param page 分页数据
* @param param 查询参数 * @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>} * @return {@link IPage< RefundExportListVo >}
*/ */
@Override @Override
public IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) { public IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) {
IPage<InsuranceRefundHandlingListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param); IPage<RefundExportListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){ if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuranceRefundHandlingPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = insuranceRefundHandlingPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceRefundHandlingListVo record : insuranceRefundHandlingPageList.getRecords()) { for (RefundExportListVo record : insuranceRefundHandlingPageList.getRecords()) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
...@@ -1800,44 +1803,65 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1800,44 +1803,65 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* *
* @author zhaji * @author zhaji
* @param param 查询参数 * @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>} * @return {@link List< RefundExportListVo >}
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundOperationParam param) { public List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param){
Integer operationType = param.getOperationType();
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<InsuranceRefundHandlingListVo> insuranceRefundHandlingList = new ArrayList<>(); List<RefundExportListVo> refundExportList;
//如果是导出类型的则查询列表并返回 //todo 根据登录人获取数据权限
if(CommonConstants.ONE_INT ==operationType){
InsuranceRefundHandlingParam insuranceRefundHandlingParam = param.getParam(); //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
insuranceRefundHandlingList = this.baseMapper.getInsuranceRefundHandlingList(insuranceRefundHandlingParam); if (CollectionUtils.isNotEmpty(param.getIdList())){
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingList)){ refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList());
}else {
refundExportList = baseMapper.getRefundExportList(param);
}
if (CollectionUtils.isNotEmpty(refundExportList)){
List<TInsuranceDetail> detailList = new ArrayList<>();
List<TInsuranceRefund> refundList = new ArrayList<>();
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuranceRefundHandlingList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = refundExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceRefundHandlingListVo record : insuranceRefundHandlingList) { for (RefundExportListVo record : refundExportList) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
} }
TInsuranceDetail detail = new TInsuranceDetail();
TInsuranceRefund refund = new TInsuranceRefund();
detail.setId(record.getId());
//update状态由「待减员」置为「减员中」
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
detailList.add(detail);
refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refundList.add(refund);
} }
} }
//批量更新
if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList);
} }
}else{ //批量更新
insuranceRefundHandlingList = param.getInsuranceRefundHandlingList(); if (CollectionUtils.isNotEmpty(refundList)){
for (TInsuranceRefund refund : refundList) {
tInsuranceRefundService.updateByInsDetailId(refund);
} }
for (InsuranceRefundHandlingListVo insuranceRefund : insuranceRefundHandlingList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); }
updateWrapper.eq(TInsuranceDetail :: getId,insuranceRefund.getId()) //操作记录
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT) addOperate(detailList,user,InsurancesConstants.REFUND_EXPORT);
.set(TInsuranceDetail ::getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail ::getUpdateBy,user.getId());
update(updateWrapper);
} }
return insuranceRefundHandlingList; return refundExportList;
} }
/** /**
...@@ -1850,22 +1874,439 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1850,22 +1874,439 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail) { public R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail) {
InsuranceRefundListParam param = new InsuranceRefundListParam();
Integer refundType = insuranceDetail.getRefundType(); Integer refundType = insuranceDetail.getRefundType();
if(CommonConstants.THREE_INT != refundType && CommonConstants.FOUR_INT != refundType){
return R.failed("当前的操作类型不正确");
}
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<String> insuranceDetailList = insuranceDetail.getInsuranceDetailList(); List<String> insuranceDetailList = insuranceDetail.getInsuranceDetailList();
List<RefundErrorVo> errorList = new ArrayList<>();
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList); List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) { for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
BeanCopyUtils.copyProperties(tInsuranceDetail,refundErrorVo);
Integer deleteFlag = tInsuranceDetail.getDeleteFlag(); Integer deleteFlag = tInsuranceDetail.getDeleteFlag();
if (CommonConstants.ONE_INT == deleteFlag ){ if(refundType.equals(tInsuranceDetail.getReduceHandleStatus())){
if(CommonConstants.THREE_INT == refundType){
refundErrorVo.setErrorMessage("该保单信息已被更新为减员退回");
errorList.add(refundErrorVo);
}else{
refundErrorVo.setErrorMessage("该保单信息已被更新为减员成功");
errorList.add(refundErrorVo);
}
}else{
if (CommonConstants.ZERO_INT == deleteFlag ){
tInsuranceDetail.setUpdateTime(LocalDateTime.now()); tInsuranceDetail.setUpdateTime(LocalDateTime.now());
tInsuranceDetail.setUpdateBy(user.getId()); tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setReduceHandleStatus(refundType); tInsuranceDetail.setReduceHandleStatus(refundType);
successList.add(tInsuranceDetail);
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setReduceHandleStatus(refundType);
refundList.add(refund);
}else{
refundErrorVo.setErrorMessage("该保单信息已被删除");
errorList.add(refundErrorVo);
}
}
}
for (TInsuranceRefund refund : refundList) {
tInsuranceRefundService.updateByInsDetailId(refund);
}
updateBatchById(successList);
return R.ok(errorList,"操作成功");
}
/**
* 变更结算月份
*
* @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(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
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 companyName 保险公司名称
* @return {@link R}
*/
@Override
public R selectByCompanyName(String companyName) {
LambdaQueryWrapper<TInsuranceDetail> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceDetail :: getInsuranceCompanyName ,companyName).eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(list(typeWrapper));
}
/**
* 根据险种id查询保单明细
*
* @author zhaji
* @param id
* @return {@link R}
*/
@Override
public R selectByTypeId(String id) {
LambdaQueryWrapper<TInsuranceDetail> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceDetail :: getInsuranceTypeId ,id).eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(list(typeWrapper));
}
/**
* 出险
*
* @author zhaji
* @param id
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R updateIsUse(String id) {
YifuUser user = SecurityUtils.getUser();
TInsuranceDetail insuranceDetail = getById(id);
if(Common.isEmpty(insuranceDetail) || CommonConstants.ONE_INT == insuranceDetail.getDeleteFlag()){
return R.failed("保单信息不存在或已被删除");
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if(!(CommonConstants.THREE_INT == buyHandleStatus && (null == reduceHandleStatus ||CommonConstants.THREE_INT == reduceHandleStatus))){
return R.failed("当前保单信息非已投保且未减员状态,不能进行出险操作");
}
Integer isEffect = insuranceDetail.getIsEffect();
if(CommonConstants.ZERO_INT != isEffect){
return R.failed("保单信息已被替换,不能进行出险操作");
}
Integer isUse = insuranceDetail.getIsUse();
if(CommonConstants.ZERO_INT != isUse){
return R.failed("保单信息已出险,不能进行出险操作");
}
Integer isOverdue = insuranceDetail.getIsOverdue();
if(CommonConstants.ZERO_INT != isOverdue){
return R.failed("保单信息已过期,不能进行出险操作");
}
insuranceDetail.setIsUse(CommonConstants.ONE_INT);
insuranceDetail.setUpdateBy(user.getId());
insuranceDetail.setUpdateTime(LocalDateTime.now());
return R.ok(updateById(insuranceDetail),"出险成功");
}
/**
* 更新减员退费
*
* @author zhaji
* @param paramList
* @return {@link R}
*/
@Override
public R updateRefundMoney(List<RefundMoneyParam> paramList) {
YifuUser user = SecurityUtils.getUser();
List<TInsuranceRefund> insuranceRefundList = new ArrayList<>();
Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyParam> successList = map.get("successList");
if (CollectionUtils.isNotEmpty(successList)){
for (RefundMoneyParam param : successList) {
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(param.getId());
insuranceRefund.setRefundMoney(new BigDecimal(param.getRefundMoney()));
insuranceRefund.setReduceHandleStatus(CommonConstants.FOUR_INT);
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefundList.add(insuranceRefund);
}
tInsuranceRefundService.saveBatch(insuranceRefundList);
}
return R.ok(map.get("errorList"));
}
/**
* 减员导入校验
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
public Map<String,List<InsuranceRefundCheck>> checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList){
List<InsuranceRefundCheck> errorList = new ArrayList<>(128);
List<InsuranceRefundCheck> successList = new ArrayList<>();
Map<String,List<InsuranceRefundCheck>> map = new HashMap<>();
for (InsuranceRefundCheck param : insuranceRefundCheckList) {
//员工姓名
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;
}
// 身份证号位数校验(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 :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(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;
}
param.setId(one.getId());
param.setReduceHandleStatus(one.getReduceHandleStatus());
successList.add(param);
}
map.put("successList",successList);
map.put("errorList",errorList);
return map;
};
/**
* 校验保单退费
*
* @author zhaji
* @param paramList 变更列表
* @return {@link R}
*/
public Map<String,List<RefundMoneyParam>> refundMoneyCheck(List<RefundMoneyParam> paramList){
Map<String,List<RefundMoneyParam>> map = new HashMap<>(16);
List<RefundMoneyParam> errorList = new ArrayList<>();
List<RefundMoneyParam> successList = new ArrayList<>();
for (RefundMoneyParam param : paramList) {
String refundMoney = param.getRefundMoney();
String policyNo = param.getPolicyNo();
String empName = param.getEmpName();
String empIdcardNo = param.getEmpIdcardNo();
//退费金额
if(StringUtils.isBlank(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单号
if(StringUtils.isBlank(policyNo)){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY);
errorList.add(param);
continue;
}
//姓名
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//身份证号
if(StringUtils.isBlank(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
if(empName.length()>CommonConstants.TWENTY_INT){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MAX_LENGTH_ERROR);
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
if(BigDecimalUtils.isBigDecimal(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param);
continue;
}
boolean max = refundMoney.compareTo(CommonConstants.MONEY_MAX) < 0;
boolean min = refundMoney.compareTo(CommonConstants.MONEY_MIN) > 0;
if (max){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MAX_ERROR);
errorList.add(param);
continue;
}
if (min){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MIN_ERROR);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息
TInsuranceRefundDetail refundDetail = new TInsuranceRefundDetail();
refundDetail.setEmpName(empName);
refundDetail.setEmpIdcardNo(empIdcardNo);
refundDetail.setPolicyNo(policyNo);
TInsuranceRefundDetail tInsuranceRefundDetail = this.baseMapper.selectRefundDetail(refundDetail);
if(Common.isEmpty(tInsuranceRefundDetail)){
param.setErrorMessage(InsurancesConstants.REFUND_IS_NULL);
errorList.add(param);
continue;
}
if ( null != tInsuranceRefundDetail.getRefundMoney()){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_IS_NOT_NULL);
errorList.add(param);
continue;
} }
param.setId(tInsuranceRefundDetail.getInsDetailId());
successList.add(param);
} }
return R.ok(updateBatchById(tInsuranceDetails),"办理成功"); map.put("errorList",errorList);
map.put("successList",successList);
return map;
} }
/** /**
* 结算月份校验 * 结算月份校验
* *
...@@ -1947,7 +2388,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1947,7 +2388,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdCardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param); errorList.add(param);
continue; continue;
...@@ -1982,7 +2423,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1982,7 +2423,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,policyStart ).eq(TInsuranceDetail :: getPolicyEnd,policyEnd); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空 //如果保单信息为空
if (Common.isEmpty(insuranceDetail)){ if (Common.isEmpty(insuranceDetail)){
...@@ -2049,255 +2490,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2049,255 +2490,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
map.put("successList",successList); map.put("successList",successList);
return map; 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(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
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 companyName 保险公司名称
* @return {@link R}
*/
@Override
public R selectByCompanyName(String companyName) {
LambdaQueryWrapper<TInsuranceDetail> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceDetail :: getInsuranceCompanyName ,companyName).eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(list(typeWrapper));
}
/**
* 根据险种id查询保单明细
*
* @author zhaji
* @param id
* @return {@link R}
*/
@Override
public R selectByTypeId(String id) {
LambdaQueryWrapper<TInsuranceDetail> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceDetail :: getInsuranceTypeId ,id).eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT);
return R.ok(list(typeWrapper));
}
@Override
@Transactional(rollbackFor = Exception.class)
public R updateIsUse(String id) {
YifuUser user = SecurityUtils.getUser();
TInsuranceDetail insuranceDetail = getById(id);
if(Common.isEmpty(insuranceDetail) || CommonConstants.ONE_INT == insuranceDetail.getDeleteFlag()){
return R.failed("保单信息不存在或已被删除");
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if(!(CommonConstants.THREE_INT == buyHandleStatus && (null == reduceHandleStatus ||CommonConstants.THREE_INT == reduceHandleStatus))){
return R.failed("当前保单信息非已投保且未减员状态,不能进行出险操作");
}
Integer isEffect = insuranceDetail.getIsEffect();
if(CommonConstants.ZERO_INT != isEffect){
return R.failed("保单信息已被替换,不能进行出险操作");
}
Integer isUse = insuranceDetail.getIsUse();
if(CommonConstants.ZERO_INT != isUse){
return R.failed("保单信息已出险,不能进行出险操作");
}
Integer isOverdue = insuranceDetail.getIsOverdue();
if(CommonConstants.ZERO_INT != isOverdue){
return R.failed("保单信息已过期,不能进行出险操作");
}
insuranceDetail.setIsUse(CommonConstants.ONE_INT);
insuranceDetail.setUpdateBy(user.getId());
insuranceDetail.setUpdateTime(LocalDateTime.now());
return R.ok(updateById(insuranceDetail),"出险成功");
}
/**
* 更新减员退费
*
* @author zhaji
* @param paramList
* @return {@link R}
*/
@Override
public R updateRefundMoney(List<RefundMoneyParam> paramList) {
YifuUser user = SecurityUtils.getUser();
List<TInsuranceRefund> insuranceRefundList = new ArrayList<>();
Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyParam> successList = map.get("successList");
if (CollectionUtils.isNotEmpty(successList)){
for (RefundMoneyParam param : successList) {
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(param.getId());
insuranceRefund.setRefundMoney(new BigDecimal(param.getRefundMoney()));
insuranceRefund.setReduceHandleStatus(CommonConstants.FOUR_INT);
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefundList.add(insuranceRefund);
}
tInsuranceRefundService.saveBatch(insuranceRefundList);
}
return R.ok(map.get("errorList"));
}
/**
* 校验保单退费
*
* @author zhaji
* @param paramList 变更列表
* @return {@link R}
*/
public Map<String,List<RefundMoneyParam>> refundMoneyCheck(List<RefundMoneyParam> paramList){
Map<String,List<RefundMoneyParam>> map = new HashMap<>(16);
List<RefundMoneyParam> errorList = new ArrayList<>();
List<RefundMoneyParam> successList = new ArrayList<>();
for (RefundMoneyParam param : paramList) {
String refundMoney = param.getRefundMoney();
String policyNo = param.getPolicyNo();
String empName = param.getEmpName();
String empIdcardNo = param.getEmpIdcardNo();
//退费金额
if(StringUtils.isBlank(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_NOT_EMPTY);
errorList.add(param);
continue;
}
//保单号
if(StringUtils.isBlank(policyNo)){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY);
errorList.add(param);
continue;
}
//姓名
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
errorList.add(param);
continue;
}
//身份证号
if(StringUtils.isBlank(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
if(empName.length()>CommonConstants.TWENTY_INT){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MAX_LENGTH_ERROR);
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
if(BigDecimalUtils.isBigDecimal(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param);
continue;
}
boolean max = refundMoney.compareTo(CommonConstants.MONEY_MAX) < 0;
boolean min = refundMoney.compareTo(CommonConstants.MONEY_MIN) > 0;
if (max){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MAX_ERROR);
errorList.add(param);
continue;
}
if (min){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MIN_ERROR);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息
TInsuranceRefundDetail refundDetail = new TInsuranceRefundDetail();
refundDetail.setEmpName(empName);
refundDetail.setEmpIdcardNo(empIdcardNo);
refundDetail.setPolicyNo(policyNo);
TInsuranceRefundDetail tInsuranceRefundDetail = this.baseMapper.selectRefundDetail(refundDetail);
if(Common.isEmpty(tInsuranceRefundDetail)){
param.setErrorMessage(InsurancesConstants.REFUND_IS_NULL);
errorList.add(param);
continue;
}
if ( null != tInsuranceRefundDetail.getRefundMoney()){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_IS_NOT_NULL);
errorList.add(param);
continue;
}
param.setId(tInsuranceRefundDetail.getInsDetailId());
successList.add(param);
}
map.put("errorList",errorList);
map.put("successList",successList);
return map;
}
/** /**
* 校验所属项目 * 校验所属项目
* *
...@@ -2380,7 +2572,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2380,7 +2572,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdCardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param); errorList.add(param);
continue; continue;
...@@ -2430,7 +2622,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2430,7 +2622,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,policyStart ).eq(TInsuranceDetail :: getPolicyEnd,policyEnd); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//替换类型的保单不能变更所属项目 //替换类型的保单不能变更所属项目
Integer buyType = insuranceDetail.getBuyType(); Integer buyType = insuranceDetail.getBuyType();
......
...@@ -15,4 +15,13 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +15,13 @@ import org.springframework.stereotype.Service;
public class TInsuranceRefundServiceImpl extends ServiceImpl<TInsuranceRefundMapper, TInsuranceRefund> public class TInsuranceRefundServiceImpl extends ServiceImpl<TInsuranceRefundMapper, TInsuranceRefund>
implements TInsuranceRefundService { implements TInsuranceRefundService {
@Override
public TInsuranceRefund getByInsDetailId(String id) {
return this.baseMapper.getByInsDetailId(id);
}
@Override
public void updateByInsDetailId(TInsuranceRefund insuranceRefund) {
this.baseMapper.updateByInsDetailId(insuranceRefund);
}
} }
...@@ -50,7 +50,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -50,7 +50,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link IPage< TInsuranceType>} * @return {@link IPage< TInsuranceType>}
*/ */
@Override @Override
public IPage<InsuranceTypeVo> pageDiy(Page page, TInsuranceType insuranceType) { public IPage<InsuranceTypeVo> pageDiy(Page<TInsuranceType> page, TInsuranceType insuranceType) {
return this.baseMapper.selectInsuranceTypePage(page,insuranceType); return this.baseMapper.selectInsuranceTypePage(page,insuranceType);
} }
...@@ -75,6 +75,9 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -75,6 +75,9 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
if(Common.isEmpty(insuranceCompany)){ if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除"); return R.failed("所属保险公司不存在或已被删除");
} }
if (!ValidityUtil.validate50(insuranceType.getName())){
return R.failed("险种名称过长");
}
LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceType :: getInsuranceCompanyId ,companyId).eq(TInsuranceType::getName,insuranceType.getName()).eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT); typeWrapper.eq(TInsuranceType :: getInsuranceCompanyId ,companyId).eq(TInsuranceType::getName,insuranceType.getName()).eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceType type = getOne(typeWrapper); TInsuranceType type = getOne(typeWrapper);
......
...@@ -97,6 +97,9 @@ ...@@ -97,6 +97,9 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
...@@ -133,6 +136,9 @@ ...@@ -133,6 +136,9 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
...@@ -251,6 +257,7 @@ ...@@ -251,6 +257,7 @@
</select> </select>
<!-- ***********************减员办理******************************** --> <!-- ***********************减员办理******************************** -->
<!-- 已投保列表分页查询-->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo"> <select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select select
detail.id as id, detail.id as id,
...@@ -316,7 +323,7 @@ ...@@ -316,7 +323,7 @@
</if> </if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!-- 已投保列表不分页查询-->
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo"> <select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select select
detail.id as id, detail.id as id,
...@@ -394,6 +401,7 @@ ...@@ -394,6 +401,7 @@
</if> </if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!-- 已减员列表分页查询-->
<select id="getInsuranceRefundPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo"> <select id="getInsuranceRefundPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select select
detail.id as id, detail.id as id,
...@@ -445,6 +453,7 @@ ...@@ -445,6 +453,7 @@
</if> </if>
ORDER BY refund.CREATE_TIME DESC ORDER BY refund.CREATE_TIME DESC
</select> </select>
<!-- 已减员列表不分页查询-->
<select id="getInsuranceRefundList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo"> <select id="getInsuranceRefundList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
select select
detail.id as id, detail.id as id,
...@@ -504,8 +513,10 @@ ...@@ -504,8 +513,10 @@
</if> </if>
ORDER BY refund.CREATE_TIME DESC ORDER BY refund.CREATE_TIME DESC
</select> </select>
<select id="getInsuranceRefundHandlingPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo"> <!-- 减员办理列表分页查询-->
<select id="getInsuranceRefundHandlingPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select select
DISTINCT
detail.id as id, detail.id as id,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo, detail.EMP_IDCARD_NO as empIdcardNo,
...@@ -523,7 +534,7 @@ ...@@ -523,7 +534,7 @@
detail.BUY_STANDARD as buyStandard, detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota, detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota, detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName, refund.CREATE_NAME as createName,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from from
t_insurance_detail detail, t_insurance_detail detail,
...@@ -541,8 +552,8 @@ ...@@ -541,8 +552,8 @@
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%') and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.reduceHandleStatus != null and param.reduceHandleStatus.trim() != ''"> <if test="param.reduceHandleStatus != null">
and detail.REDUCE_HANDLE_STATUS like concat('%',replace(replace(#{param.reduceHandleStatus},'_','\_'),'%','\%'),'%') and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if> </if>
<if test="param.isOverdue != null"> <if test="param.isOverdue != null">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%') and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
...@@ -552,8 +563,10 @@ ...@@ -552,8 +563,10 @@
</if> </if>
ORDER BY refund.CREATE_TIME DESC ORDER BY refund.CREATE_TIME DESC
</select> </select>
<select id="getInsuranceRefundHandlingList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingListVo"> <!-- 减员办理列表不分页查询-->
<select id="getInsuranceRefundHandlingList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select select
DISTINCT
detail.id as id, detail.id as id,
detail.DEPT_NO as deptNo, detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
...@@ -573,13 +586,17 @@ ...@@ -573,13 +586,17 @@
detail.DIE_DISABLE_QUOTA as dieDisableQuota, detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.SETTLE_TYPE as settleType, detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth, detail.SETTLE_MONTH as settleMonth,
detail.CREATE_NAME as createName, refund.CREATE_NAME as createName,
detail.REMARK as remark detail.REMARK as remark,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from from
t_insurance_detail detail t_insurance_detail detail,
t_insurance_refund refund
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
detail.ID = refund.INS_DETAIL_ID
and
detail.REDUCE_HANDLE_STATUS = 1 detail.REDUCE_HANDLE_STATUS = 1
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%') and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
...@@ -590,8 +607,8 @@ ...@@ -590,8 +607,8 @@
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%') and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.reduceHandleStatus != null and param.reduceHandleStatus.trim() != ''"> <if test="param.reduceHandleStatus != null ">
and detail.REDUCE_HANDLE_STATUS like concat('%',replace(replace(#{param.reduceHandleStatus},'_','\_'),'%','\%'),'%') and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if> </if>
<if test="param.isOverdue != null "> <if test="param.isOverdue != null ">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%') and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
...@@ -601,6 +618,7 @@ ...@@ -601,6 +618,7 @@
</if> </if>
ORDER BY detail.REFUND_CREATE_TIME DESC ORDER BY detail.REFUND_CREATE_TIME DESC
</select> </select>
<!-- 查询保单列表-->
<select id="selectDetailListByIds" <select id="selectDetailListByIds"
resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail"> resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
select select
...@@ -613,6 +631,7 @@ ...@@ -613,6 +631,7 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<!-- 查询保单减员退费信息-->
<select id="selectRefundDetail" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefundDetail"> <select id="selectRefundDetail" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefundDetail">
select select
detail.DEPT_NO as deptNo, detail.DEPT_NO as deptNo,
...@@ -642,6 +661,82 @@ ...@@ -642,6 +661,82 @@
and detail.POLICY_NO = #{param.policyNo} and detail.POLICY_NO = #{param.policyNo}
</if> </if>
</select> </select>
<!-- 已投保列表分页查询-->
<select id="getRefundExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select
detail.id as id,
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.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName,
detail.REMARK as remark
from
t_insurance_detail detail
where
detail.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
ORDER BY detail.CREATE_TIME DESC
</select>
<!-- 已投保列表分页查询-->
<select id="getRefundExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo">
select
detail.id as id,
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.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
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.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>
ORDER BY detail.CREATE_TIME DESC
</select>
<!-- 已投保列表分页查询-->
<update id="updateInsuranceRefund"> <update id="updateInsuranceRefund">
update update
t_insurance_detail detail t_insurance_detail detail
...@@ -655,6 +750,4 @@ ...@@ -655,6 +750,4 @@
#{item} #{item}
</foreach> </foreach>
</update> </update>
</mapper> </mapper>
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
<id property="id" column="ID" jdbcType="BIGINT"/> <id property="id" column="ID" jdbcType="BIGINT"/>
<result property="insDetailId" column="INS_DETAIL_ID" jdbcType="BIGINT"/> <result property="insDetailId" column="INS_DETAIL_ID" jdbcType="BIGINT"/>
<result property="reduceHandleStatus" column="REDUCE_HANDLE_STATUS" jdbcType="TINYINT"/> <result property="reduceHandleStatus" column="REDUCE_HANDLE_STATUS" jdbcType="TINYINT"/>
<result property="empName" column="EMP_NAME" jdbcType="VARCHAR"/>
<result property="empIdcardNo" column="EMP_IDCARD_NO" jdbcType="VARCHAR"/>
<result property="policyNo" column="POLICY_NO" jdbcType="VARCHAR"/>
<result property="refundMoney" column="REFUND_MONEY" jdbcType="DECIMAL"/> <result property="refundMoney" column="REFUND_MONEY" jdbcType="DECIMAL"/>
<result property="remark" column="REMARK" jdbcType="VARCHAR"/> <result property="remark" column="REMARK" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/> <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
...@@ -21,6 +18,19 @@ ...@@ -21,6 +18,19 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
ID,INS_DETAIL_ID,REDUCE_HANDLE_STATUS, ID,INS_DETAIL_ID,REDUCE_HANDLE_STATUS,
REFUND_MONEY,REMARK,CREATE_TIME, REFUND_MONEY,REMARK,CREATE_TIME,
CREATE_BY,CREATE_NAME,EMP_NAME,EMP_IDCARD_NO,POLICY_NO CREATE_BY,CREATE_NAME
</sql> </sql>
<update id="updateByInsDetailId">
update
t_insurance_refund
set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime}
where
INS_DETAIL_ID = #{insDetailId}
</update>
<select id="getByInsDetailId" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund">
</select>
</mapper> </mapper>
...@@ -26,10 +26,12 @@ public class DispatchConstants { ...@@ -26,10 +26,12 @@ public class DispatchConstants {
public static final String DISPATCH_ADD = "派增"; public static final String DISPATCH_ADD = "派增";
public static final String DISPATCH_REDUCE = "派减"; public static final String DISPATCH_REDUCE = "派减";
public static final String DISPATCH_SOCIAL_ADD = "社保派增"; public static final String DISPATCH_SOCIAL_ADD = "社保派增";
public static final String DISPATCH_SOCIAL_HANDLE_SUCCESS = "办理成功:"; public static final String DISPATCH_HANDLE_SUCCESS = "办理成功:";
public static final String DISPATCH_SOCIAL_HANDLE_FAIL = "办理失败:"; public static final String DISPATCH_HANDLE_FAIL = "办理失败:";
public static final String DISPATCH_FUND_ADD_SUCCESS = "公积金派增办理成功:"; public static final String DISPATCH_FUND_ADD_SUCCESS = "公积金派增办理成功:";
public static final String DISPATCH_FUND_ADD_FAIL = "公积金派增办理失败:"; public static final String DISPATCH_FUND_ADD_FAIL = "公积金派增办理失败:";
public static final String DISPATCH_FUND_REDUCE = "公积金派减";
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
/** /**
......
...@@ -56,13 +56,13 @@ public class TAuditInfo implements Serializable { ...@@ -56,13 +56,13 @@ public class TAuditInfo implements Serializable {
@ExcelProperty("社保ID" ) @ExcelProperty("社保ID" )
private String socialId; private String socialId;
/** /**
* 审核状态(0wait/1success/2fail * 审核状态(0 待审核 1 审核通过 2 审核不通过 3 办理成功 4 办理失败 5 部分办理失败 6派减
*/ */
@NotBlank(message = "审核状态(0wait/1success/2fail)不能为空" ) @NotBlank(message = "审核状态不能为空" )
@Length(max = 1, message = "审核状态(0wait/1success/2fail) 不能超过1个字符" ) @Length(max = 1, message = "审核状态 不能超过1个字符" )
@ExcelAttribute(name = "审核状态(0wait/1success/2fail)", isNotEmpty = true, errorInfo = "审核状态(0wait/1success/2fail)不能为空", maxLength = 1) @ExcelAttribute(name = "审核状态", isNotEmpty = true, errorInfo = "审核状态不能为空", maxLength = 1)
@Schema(description = "审核状态(0wait/1success/2fail)" ) @Schema(description = "审核状态(0 待审核 1 审核通过 2 审核不通过 3 办理成功 4 办理失败 5 部分办理失败 6派减)" )
@ExcelProperty("审核状态(0wait/1success/2fail)" ) @ExcelProperty("审核状态" )
private String auditStatus; private String auditStatus;
/** /**
* 审核意见 * 审核意见
......
...@@ -17,6 +17,9 @@ import java.time.LocalDateTime; ...@@ -17,6 +17,9 @@ import java.time.LocalDateTime;
@Data @Data
public class TPreDispatchExportVo implements Serializable { public class TPreDispatchExportVo implements Serializable {
@ExcelAttribute(name = "主键", needExport = true)
private String id;
/** /**
* 0 派增 1 派减 * 0 派增 1 派减
*/ */
......
...@@ -26,7 +26,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -26,7 +26,6 @@ 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.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo; import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
......
...@@ -57,12 +57,10 @@ import org.springframework.stereotype.Service; ...@@ -57,12 +57,10 @@ import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.sql.CommonDataSource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1117,7 +1115,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1117,7 +1115,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
List<SysBaseSetInfo> socialBases = baseSetMapper.selectList(Wrappers.<SysBaseSetInfo>query().lambda() List<SysBaseSetInfo> socialBases = baseSetMapper.selectList(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, CommonConstants.ZERO_STRING) .eq(SysBaseSetInfo::getBaseType, CommonConstants.ZERO_STRING)
.le(SysBaseSetInfo::getApplyStartDate, now) .le(SysBaseSetInfo::getApplyStartDate, now)
.ge(SysBaseSetInfo::getApplyEndDate, now)
.in(SysBaseSetInfo::getDepartName,socialholds) .in(SysBaseSetInfo::getDepartName,socialholds)
.eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING) .eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.groupBy(SysBaseSetInfo::getDepartName)); .groupBy(SysBaseSetInfo::getDepartName));
...@@ -1346,11 +1343,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1346,11 +1343,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Common.isEmpty(excel.getRecordBase()) Common.isEmpty(excel.getRecordBase())
|| Common.isEmpty(excel.getPensionStart()) || Common.isEmpty(excel.getPensionStart())
|| Common.isEmpty(excel.getPaymentType()) || Common.isEmpty(excel.getPaymentType())
|| Common.isEmpty(excel.getPensionCardinal())
)) { )) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY)));
return true; return true;
} }
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType()) && Common.isEmpty(excel.getPensionCardinal())
){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DIY_NOT_EMPTY)));
return true;
}
if (Common.isNotNull(excel.getProvidentHousehold()) && ( if (Common.isNotNull(excel.getProvidentHousehold()) && (
Common.isEmpty(excel.getProvidentCardinal()) Common.isEmpty(excel.getProvidentCardinal())
|| Common.isEmpty(excel.getProvidentStart()) || Common.isEmpty(excel.getProvidentStart())
...@@ -2020,13 +2021,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2020,13 +2021,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.setLength(CommonConstants.ZERO_INT); temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD); temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(socialTypeRemark.toString()); temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_SOCIAL_HANDLE_SUCCESS); temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString()); initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString());
} else { } else {
temp.setLength(CommonConstants.ZERO_INT); temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD); temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(socialTypeRemark.toString()); temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_SOCIAL_HANDLE_FAIL); temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString()); initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString());
} }
dis.setSocialHandleStatus(socialInfo.getHandleStatus()); dis.setSocialHandleStatus(socialInfo.getHandleStatus());
...@@ -2046,9 +2047,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2046,9 +2047,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ZERO_INT == flag) { if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ZERO_INT == flag) {
//派增办理通过 改成可派减状态 //派增办理通过 改成可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]); providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);
sf.setFundAddStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.THREE_STRING);
} else if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ONE_INT == flag) { } else if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派增办理不通过 改成不可派减状态 //派增办理不通过 改成不可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]); providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]);
sf.setFundAddStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.FOUR_STRING);
// 同步预估库数据 TODO // 同步预估库数据 TODO
} }
fundMapper.updateById(providentFund); fundMapper.updateById(providentFund);
...@@ -2068,11 +2073,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2068,11 +2073,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) { } else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
//社保派减办理 //社保派减办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) { if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (null != socialInfo && Common.isNotNull(socialInfo.getId())) { if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
// 社保办理状态补充判断: // 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf); this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
//社保派减办理成功才变更社保的办理状态 //社保派减办理成功才变更社保的办理状态
if (CommonConstants.ZERO_INT == flag) { if (CommonConstants.ZERO_INT == flag) {
socialInfo.setHandleStatus(CommonConstants.THREE_STRING); socialInfo.setHandleStatus(CommonConstants.THREE_STRING);
...@@ -2080,23 +2083,38 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2080,23 +2083,38 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialInfo.setReduceHandleTime(now); socialInfo.setReduceHandleTime(now);
if (Common.isNotNull(dis.getSocialReduceDate())) { if (Common.isNotNull(dis.getSocialReduceDate())) {
socialInfo.setSocialReduceDate(dis.getSocialReduceDate()); socialInfo.setSocialReduceDate(dis.getSocialReduceDate());
sf.setSocialReduceDate(dis.getSocialReduceDate());
} }
sf.setSocialReduceStatus(CommonConstants.TWO_STRING);
sf.setSocialStatus(CommonConstants.EIGHT_STRING);
// 同步预估库数据 TODO
} }
socialInfo.setHandleTime(now); socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId().toString()); socialInfo.setHandleUser(user.getId());
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType()) && CommonConstants.ONE_INT == flag) { if (CommonConstants.ONE_INT == flag) {
//派减办理不通过 //派减办理不通过
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态 socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
// 同步预估库数据 sf.setSocialReduceStatus(CommonConstants.THREE_STRING);
sf.setSocialStatus(CommonConstants.NINE_STRING);
} }
socialMapper.updateById(socialInfo); socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(null == handleRemark ? "" : handleRemark); dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditInfo = new TAuditInfo(); auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING); auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) { if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, ("社保派减" + socialTypeRemark.toString() + "办理成功:" + handleRemark), handleStatus, user, ""); temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(handleRemark);
initAuditInfo(auditInfo,temp.toString(), handleStatus, user, temp.toString());
} else { } else {
initAuditInfo(auditInfo, ("社保派减" + socialTypeRemark.toString() + "办理失败:" + handleRemark), handleStatus, user, ""); temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(handleRemark);
initAuditInfo(auditInfo,temp.toString(), handleStatus, user, temp.toString());
} }
dis.setSocialHandleStatus(handleStatus); dis.setSocialHandleStatus(handleStatus);
auditInfo.setSocialId(dis.getId()); auditInfo.setSocialId(dis.getId());
...@@ -2106,7 +2124,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2106,7 +2124,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
//公积金派减办理 //公积金派减办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) { } else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (null != providentFund && Common.isNotNull(providentFund.getId())) { if (Common.isNotNull(providentFund) && Common.isNotNull(providentFund.getId())) {
//公积金派减办理成功才变更公积金的办理状态 //公积金派减办理成功才变更公积金的办理状态
if (CommonConstants.ZERO_INT == flag) { if (CommonConstants.ZERO_INT == flag) {
providentFund.setHandleStatus(CommonConstants.THREE_STRING); providentFund.setHandleStatus(CommonConstants.THREE_STRING);
...@@ -2114,14 +2132,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2114,14 +2132,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
providentFund.setReduceHandleUser(user.getId().toString()); providentFund.setReduceHandleUser(user.getId().toString());
if (Common.isNotNull(dis.getFundReduceDate())) { if (Common.isNotNull(dis.getFundReduceDate())) {
providentFund.setFundReduceDate(dis.getFundReduceDate()); providentFund.setFundReduceDate(dis.getFundReduceDate());
sf.setFundReduceDate(dis.getFundReduceDate());
} }
// 派减办理成功后,同步预估库数据清理 sf.setFundReduceStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.SEVEN_STRING);
// 派减办理成功后,同步预估库数据清理 TODO
} }
providentFund.setHandleTime(now); providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId().toString()); providentFund.setHandleUser(user.getId().toString());
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType()) && CommonConstants.ONE_INT == flag) { if (CommonConstants.ONE_INT == flag) {
//派减办理不通过 //派减办理不通过
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态 providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setSocialReduceStatus(CommonConstants.THREE_STRING);
sf.setSocialStatus(CommonConstants.NINE_STRING);
// 同步预估库数据 // 同步预估库数据
} }
fundMapper.updateById(providentFund); fundMapper.updateById(providentFund);
......
...@@ -772,7 +772,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -772,7 +772,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
list = baseMapper.getListForExport(tPreDispatchInfo); list = baseMapper.getListForExport(tPreDispatchInfo);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list != null && !list.isEmpty()) { if (list == null || list.isEmpty()) {
list = new ArrayList<>(); list = new ArrayList<>();
} }
try { try {
......
...@@ -356,7 +356,6 @@ ...@@ -356,7 +356,6 @@
<where> <where>
1=1 1=1
and a.APPLY_START_DATE <![CDATA[ <= ]]> now() and a.APPLY_START_DATE <![CDATA[ <= ]]> now()
and a.APPLY_END_DATE >= now()
<if test="fundHolds != null and fundHolds.size > 0"> <if test="fundHolds != null and fundHolds.size > 0">
and a.DEPART_NAME in and a.DEPART_NAME in
<foreach collection="fundHolds" item="item" open="(" close=")" separator="," > <foreach collection="fundHolds" item="item" open="(" close=")" separator="," >
......
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