Commit 0a3cdcf5 authored by huyuchen's avatar huyuchen

fdd 代码修改

parent e8f3456c
...@@ -25,6 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; ...@@ -25,6 +25,8 @@ 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;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.Size;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -53,6 +55,7 @@ public class TPaymentInfo extends BaseEntity { ...@@ -53,6 +55,7 @@ public class TPaymentInfo extends BaseEntity {
@ExcelAttribute(name = "员工姓名" ) @ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名") @Schema(description ="员工姓名")
@ExcelProperty("员工姓名") @ExcelProperty("员工姓名")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName; private String empName;
/** /**
...@@ -61,6 +64,7 @@ public class TPaymentInfo extends BaseEntity { ...@@ -61,6 +64,7 @@ public class TPaymentInfo extends BaseEntity {
@ExcelAttribute(name = "员工编码" ) @ExcelAttribute(name = "员工编码" )
@Schema(description ="员工编码") @Schema(description ="员工编码")
@ExcelProperty("员工编码") @ExcelProperty("员工编码")
@Size(max = 32, message = "员工编码不可超过32位")
private String empNo; private String empNo;
/** /**
...@@ -77,6 +81,7 @@ public class TPaymentInfo extends BaseEntity { ...@@ -77,6 +81,7 @@ public class TPaymentInfo extends BaseEntity {
@ExcelAttribute(name = "身份证号" ) @ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号") @Schema(description ="身份证号")
@ExcelProperty("身份证号") @ExcelProperty("身份证号")
@Size(max = 32, message = "身份证号不可超过32位")
private String empIdcard; private String empIdcard;
/** /**
......
...@@ -31,6 +31,9 @@ import javax.validation.constraints.NotNull; ...@@ -31,6 +31,9 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Set;
/** /**
* 预派单记录 * 预派单记录
...@@ -118,7 +121,7 @@ public class TPreDispatchInfo extends BaseEntity { ...@@ -118,7 +121,7 @@ public class TPreDispatchInfo extends BaseEntity {
* 入职日期 * 入职日期
*/ */
@Schema(description ="入职日期") @Schema(description ="入职日期")
private LocalDateTime entryDate; private Date entryDate;
/** /**
* 正式工资 * 正式工资
...@@ -444,7 +447,7 @@ public class TPreDispatchInfo extends BaseEntity { ...@@ -444,7 +447,7 @@ public class TPreDispatchInfo extends BaseEntity {
* 离职日期 * 离职日期
*/ */
@Schema(description ="离职日期") @Schema(description ="离职日期")
private LocalDateTime leaveDate; private Date leaveDate;
/** /**
* 离职原因 * 离职原因
...@@ -662,4 +665,12 @@ public class TPreDispatchInfo extends BaseEntity { ...@@ -662,4 +665,12 @@ public class TPreDispatchInfo extends BaseEntity {
@ExcelAttribute(name = "创建截止时间") @ExcelAttribute(name = "创建截止时间")
@TableField(exist = false) @TableField(exist = false)
private LocalDateTime createTimeEnd; private LocalDateTime createTimeEnd;
@TableField(exist = false)
@Schema(description = "选中的idList")
private List<String> idList;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
} }
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -19,7 +20,7 @@ public class TPreDispatchExportVo implements Serializable { ...@@ -19,7 +20,7 @@ public class TPreDispatchExportVo implements Serializable {
/** /**
* 0 派增 1 派减 * 0 派增 1 派减
*/ */
@ExcelAttribute(name = "派单类型", maxLength = 2) @ExcelAttribute(name = "派单类型", maxLength = 2, isDataId = true,dataType = "send_order_type")
@Schema(description ="派单类型:0 派增 1 派减") @Schema(description ="派单类型:0 派增 1 派减")
@ExcelProperty("派单类型") @ExcelProperty("派单类型")
private String type; private String type;
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
public class TPreDispatchImportVo extends RowIndex implements Serializable {
/**
* 日期,格式:2020-12-25
*/
@ExcelAttribute(name = "日期" )
@Schema(description ="日期,格式:2020-12-25")
@ExcelProperty("日期,格式:2020-12-25")
private String date;
/**
* 接单分公司
*/
@ExcelAttribute(name = "接单分公司" )
@Schema(description ="接单分公司")
@ExcelProperty("接单分公司")
@Size(max = 50, message = "接单分公司不可超过50位")
private String company;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true,errorInfo = "身份证号不能为空", maxLength = 20, isIdCard = true)
@Schema(description ="身份证号")
@ExcelProperty("身份证号")
@Size(max = 20, message = "客户名称不可超过20位")
private String empIdcard;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", errorInfo = "客户名称不能为空", maxLength = 50)
@Schema(description ="客户名称")
@ExcelProperty("客户名称")
@Size(max = 50, message = "客户名称不可超过50位")
private String customerName;
/**
* 员工姓名
*/
@ExcelProperty(value ="员工姓名")
@ExcelAttribute(name = "员工姓名", needExport = true)
private String empName;
/**
* 联系电话1
*/
@ExcelProperty(value ="联系电话1")
@ExcelAttribute(name = "联系电话1", needExport = true)
private String telOne;
/**
* 联系电话2
*/
@ExcelProperty(value ="联系电话2")
@ExcelAttribute(name = "联系电话2", needExport = true)
private String telTwo;
/**
* 入职日期
*/
@ExcelProperty(value ="入职日期")
@ExcelAttribute(name = "入职日期", needExport = true)
private LocalDate entryDate;
/**
* 正式工资
*/
@ExcelProperty(value ="正式工资")
@ExcelAttribute(name = "正式工资", needExport = true)
private String formalSalary;
/**
* 派遣开始日期
*/
@ExcelProperty(value ="派遣开始日期")
@ExcelAttribute(name = "派遣开始日期", needExport = true)
private String dispatchStart;
/**
* 派遣结束日期
*/
@ExcelProperty(value ="派遣结束日期")
@ExcelAttribute(name = "派遣结束日期", needExport = true)
private String dispatchEnd;
/**
* 合同开始日期
*/
@ExcelProperty(value ="合同开始日期")
@ExcelAttribute(name = "合同开始日期", needExport = true)
private String contractStart;
/**
* 合同终止日期
*/
@ExcelProperty(value ="合同终止日期")
@ExcelAttribute(name = "合同终止日期", needExport = true)
private String contractEnd;
/**
* 试用开始日期
*/
@ExcelProperty(value ="试用开始日期")
@ExcelAttribute(name = "试用开始日期", needExport = true)
private String trialStart;
/**
* 试用结束日期
*/
@ExcelProperty(value ="试用结束日期")
@ExcelAttribute(name = "试用结束日期", needExport = true)
private String trialEnd;
/**
* 试用期工资
*/
@ExcelProperty(value ="试用期工资")
@ExcelAttribute(name = "试用期工资", needExport = true)
private String trialSalary;
/**
* 工作制
*/
@ExcelProperty(value ="工作制")
@ExcelAttribute(name = "工作制", needExport = true)
private String workingSystem;
/**
* 合同版本
*/
@ExcelProperty(value ="合同版本")
@ExcelAttribute(name = "合同版本", needExport = true)
private String contractVersion;
/**
* 是否电话通知
*/
@ExcelProperty(value ="是否电话通知")
@ExcelAttribute(name = "是否电话通知", needExport = true)
private String telNotice;
/**
* 实际工作地
*/
@ExcelProperty(value ="实际工作地")
@ExcelAttribute(name = "实际工作地", needExport = true)
private String workingAddress;
/**
* 备注说明1
*/
@ExcelProperty(value ="备注说明1")
@ExcelAttribute(name = "备注说明1", needExport = true)
private String remarkOne;
/**
* 备注说明2
*/
@ExcelProperty(value ="备注说明2")
@ExcelAttribute(name = "备注说明2", needExport = true)
private String remarkTwo;
/**
* 养老城市
*/
@ExcelProperty(value ="养老城市")
@ExcelAttribute(name = "养老城市", needExport = true)
private String pensionAddress;
/**
* 养老基数
*/
@ExcelProperty(value ="养老基数")
@ExcelAttribute(name = "养老基数", needExport = true)
private BigDecimal pensionBase;
/**
* 养老起缴月
*/
@ExcelProperty(value ="养老起缴月")
@ExcelAttribute(name = "养老起缴月", needExport = true)
private String pensionStart;
/**
* 医疗城市
*/
@ExcelProperty(value ="医疗城市")
@ExcelAttribute(name = "医疗城市", needExport = true)
private String medicalAddress;
/**
* 医疗基数
*/
@ExcelProperty(value ="医疗基数")
@ExcelAttribute(name = "医疗基数", needExport = true)
private BigDecimal medicalBase;
/**
* 医疗起缴月
*/
@ExcelProperty(value ="医疗起缴月")
@ExcelAttribute(name = "医疗起缴月", needExport = true)
private String medicalStart;
/**
* 工伤城市
*/
@ExcelProperty(value ="工伤城市")
@ExcelAttribute(name = "工伤城市", needExport = true)
private String injuryAddress;
/**
* 工伤基数
*/
@ExcelProperty(value ="工伤基数")
@ExcelAttribute(name = "工伤基数", needExport = true)
private BigDecimal injuryBase;
/**
* 工伤起缴月
*/
@ExcelProperty(value ="工伤起缴月")
@ExcelAttribute(name = "工伤起缴月", needExport = true)
private String injuryStart;
/**
* 生育城市
*/
@ExcelProperty(value ="生育城市")
@ExcelAttribute(name = "生育城市", needExport = true)
private String birthAddress;
/**
* 生育基数
*/
@ExcelProperty(value ="生育基数")
@ExcelAttribute(name = "生育基数", needExport = true)
private BigDecimal birthBase;
/**
* 生育起缴月
*/
@ExcelProperty(value ="生育起缴月")
@ExcelAttribute(name = "生育起缴月", needExport = true)
private String birthStart;
/**
* 失业城市
*/
@ExcelProperty(value ="失业城市")
@ExcelAttribute(name = "失业城市", needExport = true)
private String unemploymentAddress;
/**
* 失业基数
*/
@ExcelProperty(value ="失业基数")
@ExcelAttribute(name = "失业基数", needExport = true)
private BigDecimal unemploymentBase;
/**
* 失业起缴月
*/
@ExcelProperty(value ="失业起缴月")
@ExcelAttribute(name = "失业起缴月", needExport = true)
private String unemploymentStart;
/**
* 公积金城市
*/
@ExcelProperty(value ="公积金城市")
@ExcelAttribute(name = "公积金城市", needExport = true)
private String fundAddress;
/**
* 公积金基数
*/
@ExcelProperty(value ="公积金基数")
@ExcelAttribute(name = "公积金基数", needExport = true)
private BigDecimal fundBase;
/**
* 公积金起缴月
*/
@ExcelProperty(value ="公积金起缴月")
@ExcelAttribute(name = "公积金起缴月", needExport = true)
private String fundStart;
/**
* 公积金个人比例
*/
@ExcelProperty(value ="公积金个人比例")
@ExcelAttribute(name = "公积金个人比例", needExport = true)
private BigDecimal fundPersonalPer;
/**
* 公积金企业比例
*/
@ExcelProperty(value ="公积金企业比例")
@ExcelAttribute(name = "公积金企业比例", needExport = true)
private BigDecimal fundCompanyPer;
/**
* 派单分公司
*/
@ExcelProperty(value ="派单分公司")
@ExcelAttribute(name = "派单分公司", needExport = true)
private String dispatchCompany;
/**
* 派单客服
*/
@ExcelProperty(value ="派单客服")
@ExcelAttribute(name = "派单客服", needExport = true)
private String customerService;
/**
* contract
*/
@ExcelProperty(value ="小合同名称")
@ExcelAttribute(name = "小合同名称", needExport = true)
private String contractMinorName;
/**
* 唯一号
*/
@ExcelProperty(value ="唯一号")
@ExcelAttribute(name = "唯一号", needExport = true)
private String uniqueNumber;
/**
* 客户编号
*/
@ExcelProperty(value ="客户编号")
@ExcelAttribute(name = "客户编号", needExport = true)
private String customerNumber;
/**
* 合同类型
*/
@ExcelProperty(value ="合同类型")
@ExcelAttribute(name = "合同类型", needExport = true)
private String contractType;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class TPreDispatchUpdateVo extends TPreDispatchInfo {
/**
*
*/
@ExcelAttribute(name = "主键", maxLength = 32)
private String id;
/**
* 派单类型:0 派增 1 派减
*/
@ExcelAttribute(name = "派单类型", maxLength = 2)
private String type;
/**
* 日期,格式:2020-12-25
*/
@ExcelAttribute(name = "日期")
private String date;
/**
* 接单分公司
*/
@Length(max = 50, message = "接单分公司不能超过50个字符")
@ExcelAttribute(name = "接单分公司", maxLength = 50)
private String company;
/**
* 缴费地
*/
@Length(max = 20, message = "缴费地不能超过20个字符")
@ExcelAttribute(name = "缴费地", isNotEmpty = true,errorInfo = "缴费地不能为空", maxLength = 20)
private String payAddress;
/**
* 客户名称
*/
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelAttribute(name = "客户名称", errorInfo = "客户名称不能为空", maxLength = 50)
private String customerName;
/**
* 身份证号
*/
@Length(max = 20, message = "身份证号不能超过20个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true,errorInfo = "身份证号不能为空", maxLength = 20, isIdCard = true)
private String empIdcard;
/**
* 员工姓名
*/
@Length(max = 15, message = "员工姓名不能超过15个字符")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, maxLength = 15)
private String empName;
/**
* 联系电话1
*/
@Length(max = 20, message = "联系电话1不能超过20个字符")
@ExcelAttribute(name = "联系电话1", maxLength = 20)
private String telOne;
/**
* 联系电话2
*/
@Length(max = 20, message = "联系电话2不能超过20个字符")
@ExcelAttribute(name = "联系电话2", maxLength = 20)
private String telTwo;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期")
private Date entryDate;
/**
* 正式工资
*/
@ExcelAttribute(name = "正式工资")
private String formalSalary;
/**
* 派遣开始日期
*/
@Length(max = 20, message = "派遣开始日期不能超过20个字符")
@ExcelAttribute(name = "派遣开始日期", maxLength = 20)
private String dispatchStart;
/**
* 派遣结束日期
*/
@Length(max = 20, message = "派遣结束日期不能超过20个字符")
@ExcelAttribute(name = "派遣结束日期", maxLength = 20)
private String dispatchEnd;
/**
* 合同开始日期
*/
@Length(max = 20, message = "合同开始日期不能超过20个字符")
@ExcelAttribute(name = "合同开始日期", maxLength = 20)
private String contractStart;
/**
* 合同终止日期
*/
@Length(max = 20, message = "合同终止日期不能超过20个字符")
@ExcelAttribute(name = "合同终止日期", maxLength = 20)
private String contractEnd;
/**
* 试用开始日期
*/
@Length(max = 20, message = "试用开始日期不能超过20个字符")
@ExcelAttribute(name = "试用开始日期", maxLength = 20)
private String trialStart;
/**
* 试用结束日期
*/
@Length(max = 20, message = "试用结束日期不能超过20个字符")
@ExcelAttribute(name = "试用结束日期", maxLength = 20)
private String trialEnd;
/**
* 试用期工资
*/
@ExcelAttribute(name = "试用期工资")
private String trialSalary;
/**
* 工作制
*/
@Length(max = 20, message = "工作制不能超过20个字符")
@ExcelAttribute(name = "工作制", maxLength = 20)
private String workingSystem;
/**
* 合同版本
*/
@Length(max = 20, message = "合同版本不能超过20个字符")
@ExcelAttribute(name = "合同版本", maxLength = 20)
private String contractVersion;
/**
* 是否电话通知
*/
@Length(max = 10, message = "是否电话通知不能超过10个字符")
@ExcelAttribute(name = "是否电话通知", maxLength = 10)
private String telNotice;
/**
* 实际工作地
*/
@Length(max = 100, message = "实际工作地不能超过100个字符")
@ExcelAttribute(name = "实际工作地", maxLength = 100)
private String workingAddress;
/**
* 备注说明1
*/
@Length(max = 255, message = "备注说明1不能超过255个字符")
@ExcelAttribute(name = "备注说明1", maxLength = 255)
private String remarkOne;
/**
* 备注说明2
*/
@Length(max = 255, message = "备注说明2不能超过255个字符")
@ExcelAttribute(name = "备注说明2", maxLength = 255)
private String remarkTwo;
/**
* 养老城市
*/
@Length(max = 15, message = "养老城市不能超过15个字符")
@ExcelAttribute(name = "养老城市", maxLength = 15)
private String pensionAddress;
/**
* 养老基数
*/
@ExcelAttribute(name = "养老基数",isFloat = true)
private BigDecimal pensionBase;
/**
* 养老起缴月
*/
@Length(max = 6, message = "养老起缴月不能超过6个字符")
@ExcelAttribute(name = "养老起缴月", maxLength = 6, isInteger = true)
private String pensionStart;
/**
* 医疗城市
*/
@Length(max = 15, message = "医疗城市不能超过15个字符")
@ExcelAttribute(name = "医疗城市", maxLength = 15)
private String medicalAddress;
/**
* 医疗基数
*/
@ExcelAttribute(name = "医疗基数", isFloat = true)
private BigDecimal medicalBase;
/**
* 医疗起缴月
*/
@Length(max = 6, message = "医疗起缴月不能超过6个字符")
@ExcelAttribute(name = "医疗起缴月", maxLength = 6, isInteger = true)
private String medicalStart;
/**
* 工伤城市
*/
@Length(max = 15, message = "工伤城市不能超过15个字符")
@ExcelAttribute(name = "工伤城市", maxLength = 15)
private String injuryAddress;
/**
* 工伤基数
*/
@ExcelAttribute(name = "工伤基数", isFloat = true)
private BigDecimal injuryBase;
/**
* 工伤起缴月
*/
@Length(max = 6, message = "工伤起缴月不能超过6个字符")
@ExcelAttribute(name = "工伤起缴月", maxLength = 6, isInteger = true)
private String injuryStart;
/**
* 生育城市
*/
@Length(max = 15, message = "生育城市不能超过15个字符")
@ExcelAttribute(name = "生育城市", maxLength = 15)
private String birthAddress;
/**
* 生育基数
*/
@ExcelAttribute(name = "生育基数", isFloat = true)
private BigDecimal birthBase;
/**
* 生育起缴月
*/
@Length(max = 6, message = "生育起缴月不能超过6个字符")
@ExcelAttribute(name = "生育起缴月", maxLength = 6, isInteger = true)
private String birthStart;
/**
* 失业城市
*/
@Length(max = 15, message = "失业城市不能超过15个字符")
@ExcelAttribute(name = "失业城市", maxLength = 15)
private String unemploymentAddress;
/**
* 失业基数
*/
@ExcelAttribute(name = "失业基数", isFloat = true)
private BigDecimal unemploymentBase;
/**
* 失业起缴月
*/
@Length(max = 6, message = "失业起缴月不能超过6个字符")
@ExcelAttribute(name = "失业起缴月", maxLength = 6, isInteger = true)
private String unemploymentStart;
/**
* 公积金城市
*/
@Length(max = 15, message = "公积金城市不能超过15个字符")
@ExcelAttribute(name = "公积金城市", maxLength = 15)
private String fundAddress;
/**
* 公积金基数
*/
@ExcelAttribute(name = "公积金基数", isFloat = true)
private BigDecimal fundBase;
/**
* 公积金起缴月
*/
@Length(max = 6, message = "公积金起缴月不能超过6个字符")
@ExcelAttribute(name = "公积金起缴月", maxLength = 6, isInteger = true)
private String fundStart;
/**
* 公积金个人比例
*/
@ExcelAttribute(name = "公积金个人比例", isFloat = true)
private BigDecimal fundPersonalPer;
/**
* 公积金企业比例
*/
@ExcelAttribute(name = "公积金企业比例", isFloat = true)
private BigDecimal fundCompanyPer;
/**
* 派单分公司
*/
@Length(max = 50, message = "派单分公司不能超过50个字符")
@ExcelAttribute(name = "派单分公司", maxLength = 50)
private String dispatchCompany;
/**
* 派单客服
*/
@Length(max = 10, message = "派单客服不能超过10个字符")
@ExcelAttribute(name = "派单客服", maxLength = 10)
private String customerService;
/**
* 小合同名称
*/
@Length(max = 150, message = "小合同名称不能超过150个字符")
@ExcelAttribute(name = "小合同名称", maxLength = 150)
private String contractMinorName;
/**
* 唯一号
*/
@Length(max = 15, message = "唯一号不能超过15个字符")
@ExcelAttribute(name = "唯一号", maxLength = 15)
private String uniqueNumber;
/**
* 客户编号
*/
@Length(max = 20, message = "客户编号不能超过20个字符")
@ExcelAttribute(name = "客户编号", maxLength = 20)
private String customerNumber;
/**
* 服务类别
*/
@Length(max = 15, message = "服务类别不能超过15个字符")
@ExcelAttribute(name = "服务类别", maxLength = 15)
private String serviceType;
/**
* 养老截止城市
*/
@Length(max = 15, message = "养老截止城市不能超过15个字符")
@ExcelAttribute(name = "养老截止城市", maxLength = 15)
private String pensionAddressReduce;
/**
* 养老截止时间
*/
@Length(max = 6, message = "养老截止时间不能超过6个字符")
@ExcelAttribute(name = "养老截止时间", maxLength = 6, isInteger = true)
private String pensionEndReduce;
/**
* 医疗截止城市
*/
@Length(max = 15, message = "医疗截止城市不能超过15个字符")
@ExcelAttribute(name = "医疗截止城市", maxLength = 15)
private String medicalAddressReduce;
/**
* 医疗截止时间
*/
@Length(max = 6, message = "医疗截止时间不能超过6个字符")
@ExcelAttribute(name = "医疗截止时间", maxLength = 6, isInteger = true)
private String medicalEndReduce;
/**
* 工伤截止城市
*/
@Length(max = 15, message = "工伤截止城市不能超过15个字符")
@ExcelAttribute(name = "工伤截止城市", maxLength = 15)
private String injuryAddressReduce;
/**
* 工伤截止时间
*/
@Length(max = 6, message = "工伤截止时间不能超过6个字符")
@ExcelAttribute(name = "工伤截止时间", maxLength = 6, isInteger = true)
private String injuryEndReduce;
/**
* 生育截止城市
*/
@Length(max = 15, message = "生育截止城市不能超过15个字符")
@ExcelAttribute(name = "生育截止城市", maxLength = 15)
private String birthAddressReduce;
/**
* 生育截止时间
*/
@Length(max = 6, message = "生育截止时间不能超过6个字符")
@ExcelAttribute(name = "生育截止时间", maxLength = 6, isInteger = true)
private String birthEndReduce;
/**
* 失业截止城市
*/
@Length(max = 15, message = "失业截止城市不能超过15个字符")
@ExcelAttribute(name = "失业截止城市", maxLength = 15)
private String unemploymentAddressReduce;
/**
* 失业截止时间
*/
@Length(max = 6, message = "失业截止时间不能超过6个字符")
@ExcelAttribute(name = "失业截止时间", maxLength = 6, isInteger = true)
private String unemploymentEndReduce;
/**
* 公积金截止城市
*/
@Length(max = 15, message = "公积金截止城市不能超过15个字符")
@ExcelAttribute(name = "公积金截止城市", maxLength = 15)
private String fundAddressReduce;
/**
* 公积金截止时间
*/
@Length(max = 6, message = "公积金截止时间不能超过6个字符")
@ExcelAttribute(name = "公积金截止时间", maxLength = 6, isInteger = true)
private String fundEndReduce;
/**
* 离职日期
*/
@ExcelAttribute(name = "离职日期", isDate = true, dateFormatExport = DateUtil.ISO_EXPANDED_DATE_FORMAT)
private Date leaveDate;
/**
* 离职原因
*/
@Length(max = 100, message = "离职原因不能超过100个字符")
@ExcelAttribute(name = "离职原因", maxLength = 100)
private String leaveReason;
/**
* 离职原因ID
*/
@Length(max = 32, message = "离职原因ID不能超过32个字符")
@ExcelAttribute(name = "离职原因ID", maxLength = 32)
private String leaveReasonAdd;
/**
* 合同类型
*/
@Length(max = 50, message = "合同类型不能超过50个字符")
@ExcelAttribute(name = "合同类型", maxLength = 50)
@ExcelProperty(value ="合同类型")
private String contractType;
/**
* 员工类型
*/
@Length(max = 2, message = "员工类型不能超过2个字符")
@ExcelAttribute(name = "员工类型", maxLength = 2)
@ExcelProperty(value ="员工类型")
private String empTypeAdd;
/**
* 所属单位ID
*/
@Length(max = 32, message = "所属单位ID不能超过32个字符")
@ExcelAttribute(name = "所属单位ID", maxLength = 32)
private String unitIdAdd;
/**
* 所属结算主体ID
*/
@Length(max = 32, message = "所属结算主体ID不能超过32个字符")
@ExcelAttribute(name = "所属结算主体ID", maxLength = 32)
private String departIdAdd;
/**
* 所属单位名称
*/
@Length(max = 50, message = "所属单位名称不能超过50个字符")
@ExcelAttribute(name = "所属单位名称", maxLength = 50)
private String unitNameAdd;
/**
* 所属结算主体名称
*/
@Length(max = 50, message = "所属结算主体名称不能超过50个字符")
@ExcelAttribute(name = "所属结算主体名称", maxLength = 50)
private String departNameAdd;
/**
* 社保户
*/
@Length(max = 50, message = "社保户不能超过50个字符")
@ExcelAttribute(name = "社保户", maxLength = 50)
private String socialHouseAdd;
/**
* 公积金户
*/
@Length(max = 50, message = "公积金户不能超过50个字符")
@ExcelAttribute(name = "公积金户", maxLength = 50)
private String fundHouseAdd;
/**
* 岗位
*/
@Length(max = 50, message = "岗位不能超过50个字符")
@ExcelAttribute(name = "岗位", maxLength = 50)
private String positionAdd;
/**
* 备案基数
*/
@ExcelAttribute(name = "备案基数", isFloat = true)
private BigDecimal filingBaseAdd;
/**
* 派单状态:0:正常未派单1:异常未派单2:已派单
*/
@Length(max = 20, message = "0:正常未派单1:异常未派单2:已派单不能超过1个字符")
@ExcelAttribute(name = "派单状态", maxLength = 20)
private String preStatus;
/**
* 预派单状态:0:正常1:作废
*/
@Length(max = 1, message = "预派单状态:0:正常1:作废不能超过1个字符")
@ExcelAttribute(name = "预派单状态", maxLength = 1)
private String status;
/**
* 异常内容
*/
@Length(max = 255, message = "异常内容不能超过255个字符")
@ExcelAttribute(name = "异常内容", maxLength = 255)
private String exceptionContent;
/**
* 社保-省
*/
@Length(max = 5, message = "社保-省不能超过5个字符")
@ExcelAttribute(name = "社保-省", maxLength = 5)
private String socialProvince;
/**
* 社保-市
*/
@Length(max = 5, message = "社保-市不能超过5个字符")
@ExcelAttribute(name = "社保-市", maxLength = 5)
private String socialCity;
/**
* 社保-县
*/
@Length(max = 5, message = "社保-县不能超过5个字符")
@ExcelAttribute(name = "社保-县", maxLength = 5)
private String socialTown;
/**
* 公积金-省
*/
@Length(max = 5, message = "公积金-省不能超过5个字符")
@ExcelAttribute(name = "公积金-省", maxLength = 5)
private String fundProvince;
/**
* 公积金-市
*/
@Length(max = 5, message = "公积金-市不能超过5个字符")
@ExcelAttribute(name = "公积金-市", maxLength = 5)
private String fundCity;
/**
* 公积金-县
*/
@Length(max = 5, message = "公积金-县不能超过5个字符")
@ExcelAttribute(name = "公积金-县", maxLength = 5)
private String fundTown;
/**
* 派单日期限制 如:在15日前包含15日可派单 15日及15后次月派单
*/
@ExcelAttribute(name = "派单日期限制", isInteger = true)
private Integer dayLimit;
/**
* 资料是否提交:0 是 1 否
*/
@Length(max = 5, message = "资料是否提交不能超过2个字符")
@ExcelAttribute(name = "资料是否提交", maxLength = 2)
private String dataSubStatus;
/**
* 派单合同名称
*/
@Length(max = 50, message = "派单合同名称不能超过50个字符")
@ExcelAttribute(name = "派单合同名称", maxLength = 50)
private String contractNameAdd;
/**
* 派单合同类型
*/
@Length(max = 32, message = "派单合同类型不能超过32个字符")
@ExcelAttribute(name = "派单合同类型", maxLength = 32)
private String contractTypeAdd;
/**
* 派单合同开始时间
*/
@Length(max = 20, message = "派单合同开始时间不能超过20个字符")
@ExcelAttribute(name = "派单合同开始时间", maxLength = 20)
private String contractStartAdd;
/**
* 派单合同截止时间
*/
@Length(max = 20, message = "派单合同截止时间不能超过20个字符")
@ExcelAttribute(name = "派单合同截止时间", maxLength = 20)
private String contractEndAdd;
/**
* 派单合同期限
*/
@Length(max = 2, message = "派单合同期限不能超过2个字符")
@ExcelAttribute(name = "派单合同期限", maxLength = 2)
private String contractTermAdd;
/**
* 工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 32, message = "工时制不能超过32个字符")
@ExcelAttribute(name = "工时制", maxLength = 32)
private String workingHoursAdd;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间")
private LocalDateTime createTime;
/**
* 创建人ID
*/
@ExcelAttribute(name = "创建人ID", maxLength = 2)
private String createUserId;
/**
* 创建人姓名
*/
@ExcelAttribute(name = "创建人姓名")
private String createUserName;
/**
* 备注
*/
@ExcelAttribute(name = "备注", maxLength = 255)
private String remark;
/**
* 是否派单:0 是 1 否
*/
@ExcelAttribute(name = "是否派单", maxLength = 2,isDataId = true,dataType = ExcelAttributeConstants.STATUS_FLAG)
private String dispatchFlag;
/**
* 取消原因:不派单时填写
*/
@ExcelAttribute(name = "取消原因", maxLength = 255)
private String cancelRemark;
}
...@@ -20,16 +20,21 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -20,16 +20,21 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
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.PreDispatchConstants; import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.util.ServiceUtil;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
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;
...@@ -38,9 +43,13 @@ import lombok.RequiredArgsConstructor; ...@@ -38,9 +43,13 @@ import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -54,6 +63,7 @@ import java.util.List; ...@@ -54,6 +63,7 @@ import java.util.List;
@RequestMapping("/tpredispatchinfo" ) @RequestMapping("/tpredispatchinfo" )
@Tag(name = "预派单记录管理") @Tag(name = "预派单记录管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
@Slf4j
public class TPreDispatchInfoController { public class TPreDispatchInfoController {
private final TPreDispatchInfoService tPreDispatchInfoService; private final TPreDispatchInfoService tPreDispatchInfoService;
...@@ -194,15 +204,26 @@ public class TPreDispatchInfoController { ...@@ -194,15 +204,26 @@ public class TPreDispatchInfoController {
return tPreDispatchInfoService.dispatchById(id); return tPreDispatchInfoService.dispatchById(id);
} }
/**
* 一键派单
* @Author huyc
* @Date 2022-07-18
* @return R
*/
@Operation(summary = "一键派单:按创建人查找正常未派单的数据", description = "一键派单:按创建人查找正常未派单的数据")
@PostMapping("/oneKeyToDispatch")
public R oneKeyToDispatch(@RequestParam String idStr) {
return tPreDispatchInfoService.oneKeyToDispatch(idStr);
}
/** /**
* 预派单批量新增派增 * 预派单批量新增派增
* * @Author huyc
* @Date 2022-07-18
* @param jsonString * @param jsonString
* @param houseId 社保户ID * @param houseId 社保户ID
* @param departId 结算主体ID * @param departId 结算主体ID
* @return * @return
* @Author fxj
* @Date 2019-09-29
**/ **/
@Operation(summary = "预派单批量新增派增", description = "预派单批量新增派增") @Operation(summary = "预派单批量新增派增", description = "预派单批量新增派增")
@SysLog("预派单批量新增派增") @SysLog("预派单批量新增派增")
...@@ -229,12 +250,131 @@ public class TPreDispatchInfoController { ...@@ -229,12 +250,131 @@ public class TPreDispatchInfoController {
if (null != listInfo && !listInfo.isEmpty()) { if (null != listInfo && !listInfo.isEmpty()) {
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,houseId,departId); errorInfo = tPreDispatchInfoService.batchSavePreDisPatchAdd(listInfo, user,houseId,departId);
} else { } else {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY); errorInfo.add(new ErrorMessage(null, CommonConstants.DATA_CAN_NOT_EMPTY));
}
return R.ok(errorInfo);
}
} catch (Exception e) {
return R.failed(PreDispatchConstants.DATA_IMPORT_ANALYSIS_ERROR);
}
}
/**
* 预派单批量新增派减
* @Author huyc
* @Date 2022-07-18
* @param jsonString
* @return
**/
@Operation(summary = "预派单批量新增派减", description = "预派单批量新增派减")
@SysLog("预派单批量新增派减")
@PostMapping("/analysisJsonStringImportReduce")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_importReduceList')")
public R analysisJsonStringImportReduce(@RequestBody String jsonString) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
}
ExcelUtil<TPreDispatchInfo> util1 = null;
try {
jsonString = URLDecoder.decode(jsonString, CommonConstants.UTF8).replace("=", "");
util1 = new ExcelUtil<>(TPreDispatchInfo.class);
util1.getJsonStringToList(jsonString, null);
List<TPreDispatchInfo> listInfo = util1.getEntityList();
//用于返回错误信息
List<ErrorMessage> errorInfo = new ArrayList<>();
if (null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) {
return R.failed(util1.getErrorInfo());
} else {
if (null != listInfo && !listInfo.isEmpty()) {
errorInfo = tPreDispatchInfoService.batchSavePreDisPatchReduce(listInfo, user);
} else {
errorInfo.add(new ErrorMessage(null, CommonConstants.DATA_CAN_NOT_EMPTY));
}
return R.ok(errorInfo);
}
} catch (Exception e) {
log.error("预派单批量导入派减",e);
return R.failed(PreDispatchConstants.DATA_IMPORT_ANALYSIS_ERROR);
}
}
/**
* 预派单批量更新
* @param jsonString
* @Author huyc
* @Date 2022-07-18
* @return
**/
@Operation(summary = "预派单批量更新", description = "预派单批量更新")
@SysLog("预派单批量更新")
@PostMapping("/analysisJsonStringUpdate")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_updateList')")
public R analysisJsonStringUpdate(@RequestBody String jsonString) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
}
ExcelUtil<TPreDispatchUpdateVo> util1 = null;
R<List<SysDict>> res = null;
Map<String, String> dicMap = new HashMap<>();
try {
jsonString = URLDecoder.decode(jsonString, CommonConstants.UTF8).replace("=", "");
util1 = new ExcelUtil<>(TPreDispatchUpdateVo.class);
Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "status_flag");
if (Common.isNotNull(dicObj)) {
for (String key : dicObj.keySet()) {
dicMap.put("status_flag" + CommonConstants.DOWN_LINE_STRING + dicObj.get(key), key);
}
}
util1.getJsonStringToList(jsonString, dicMap);
List<TPreDispatchUpdateVo> listInfo = util1.getEntityList();
//用于返回错误信息
List<ErrorMessage> errorInfo = new ArrayList<>();
if (null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) {
return R.failed(util1.getErrorInfo(),PreDispatchConstants.DATA_CHECK);
} else {
if (null != listInfo && !listInfo.isEmpty()) {
errorInfo = tPreDispatchInfoService.batchUpdatePreDisPatch(listInfo, user);
} else {
errorInfo.add(new ErrorMessage(null, CommonConstants.DATA_CAN_NOT_EMPTY));
} }
return R.ok(errorInfo,""); return R.ok(errorInfo);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("预派单批量更新",e);
return R.failed(PreDispatchConstants.DATA_IMPORT_ANALYSIS_ERROR); return R.failed(PreDispatchConstants.DATA_IMPORT_ANALYSIS_ERROR);
} }
} }
/**
* 预派单查询导出数据的中文字段
* @Author huyc
* @Date 2022-07-18
* @return
**/
@Operation(summary = "预派单查询导出数据的中文字段", description = "预派单查询导出数据的中文字段")
@GetMapping("/getPreDispatchExportVoFieldName")
public R<List<String>> getPreDispatchExportVoFieldName() {
return ExcelUtil.getExportfieldsName(TPreDispatchExportVo.class);
}
/**
* 导出预派单
* @Author huyc
* @Date 2022-07-18
* @param preDispatchInfo
* @return
**/
@PostMapping("/doexportPreDispatch")
@Operation(summary = "导出预派单", description = "导出预派单")
@SysLog("导出预派单")
@PreAuthorize("@pms.hasPermission('social:tpredispatchinfo_doexportPreDispatch')")
public void doexportPreDispatch(HttpServletResponse response,
@RequestBody(required = false) TPreDispatchInfo preDispatchInfo) {
tPreDispatchInfoService.doexportPreDispatch(response,preDispatchInfo);
}
} }
...@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -46,4 +47,8 @@ public interface TPreDispatchInfoMapper extends BaseMapper<TPreDispatchInfo> { ...@@ -46,4 +47,8 @@ public interface TPreDispatchInfoMapper extends BaseMapper<TPreDispatchInfo> {
void modifyDataSubmitStatus(@Param("idList")List<String> idList, @Param("status")String status); void modifyDataSubmitStatus(@Param("idList")List<String> idList, @Param("status")String status);
int updatePreDispatchInfoById(TPreDispatchInfo tPreDispatchInfo); int updatePreDispatchInfoById(TPreDispatchInfo tPreDispatchInfo);
void updatePreStatusById(TPreDispatchInfo preInfo);
List<TPreDispatchExportVo> getListForExport(@Param("tPreDispatchInfo")TPreDispatchInfo tPreDispatchInfo);
} }
...@@ -24,7 +24,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; ...@@ -24,7 +24,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.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.social.entity.TPreDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -80,6 +82,14 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> { ...@@ -80,6 +82,14 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> {
**/ **/
R<Boolean> dispatchById(String id); R<Boolean> dispatchById(String id);
/**
* 一键派单
* @Author huyc
* @Date 2022-07-18
* @return
**/
R oneKeyToDispatch(String idStr);
/** /**
* 修改预派单记录 * 修改预派单记录
* @Author huyc * @Author huyc
...@@ -99,4 +109,34 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> { ...@@ -99,4 +109,34 @@ public interface TPreDispatchInfoService extends IService<TPreDispatchInfo> {
* @return * @return
**/ **/
List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId); List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId);
/**
* 预派单批量新增派减
* @Author huyc
* @Date 2022-07-18
* @param listInfo
* @param user
* @return
**/
List<ErrorMessage> batchSavePreDisPatchReduce(List<TPreDispatchInfo> listInfo, YifuUser user);
/**
* 预派单批量更新
* @Author huyc
* @Date 2022-07-18
* @param listInfo
* @param user
* @return
**/
List<ErrorMessage> batchUpdatePreDisPatch(List<TPreDispatchUpdateVo> listInfo, YifuUser user);
/**
* 预派单导出
* @Author huyc
* @Date 2022-07-18
* @param response
* @param tPreDispatchInfo
* @return
**/
void doexportPreDispatch(HttpServletResponse response, TPreDispatchInfo tPreDispatchInfo);
} }
...@@ -16,12 +16,14 @@ ...@@ -16,12 +16,14 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.service.impl; package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*; import com.yifu.cloud.plus.v1.yifu.common.core.constant.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
...@@ -31,22 +33,22 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; ...@@ -31,22 +33,22 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
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.insurances.util.ValidityUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants; import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchDayConf; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchDayConfMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPreDispatchInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 预派单记录 * 预派单记录
...@@ -67,6 +69,15 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -67,6 +69,15 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Autowired @Autowired
private ArchivesDaprUtil archivesDaprUtil; private ArchivesDaprUtil archivesDaprUtil;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
@Autowired
private TProvidentFundMapper providentFundMapper;
@Autowired
private TSocialInfoMapper socialInfoMapper;
/** /**
* 预派单记录简单分页查询 * 预派单记录简单分页查询
* *
...@@ -105,7 +116,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -105,7 +116,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 清空预派单默认的派单合同信息 * 清空预派单默认的派单合同信息
*
* @param ids * @param ids
* @return * @return
* @Author huyc * @Author huyc
...@@ -126,7 +136,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -126,7 +136,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 获取社保和公积金基数 * 获取社保和公积金基数
*
* @param baseSocialTimeMap * @param baseSocialTimeMap
* @param baseFundTimeMap * @param baseFundTimeMap
* @param baseSocialSetMap * @param baseSocialSetMap
...@@ -150,7 +159,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -150,7 +159,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 获取社保基数 * 获取社保基数
*
* @param baseFundTimeMap * @param baseFundTimeMap
* @param baseFundSetMap * @param baseFundSetMap
* @param baseSetInfo * @param baseSetInfo
...@@ -187,13 +195,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -187,13 +195,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 获取公积金基数 * 获取公积金基数
*
* @param baseSocialTimeMap * @param baseSocialTimeMap
* @param baseSocialSetMap * @param baseSocialSetMap
* @param baseSetInfo * @param baseSetInfo
* @return
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
* @return
**/ **/
private void handleSocialBase(Map<String, TPreDispatchInfo> baseSocialTimeMap, Map<String, SysBaseSetInfo> baseSocialSetMap, SysBaseSetInfo baseSetInfo) { private void handleSocialBase(Map<String, TPreDispatchInfo> baseSocialTimeMap, Map<String, SysBaseSetInfo> baseSocialSetMap, SysBaseSetInfo baseSetInfo) {
LocalDateTime dateTime; LocalDateTime dateTime;
...@@ -224,11 +231,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -224,11 +231,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 查看公积金起缴时间是否符合政策 * 查看公积金起缴时间是否符合政策
*
* @param newEntity * @param newEntity
* @return
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
* @return
**/ **/
private String checkFundStartDate(TPreDispatchInfo newEntity, SysBaseSetInfo baseSetInfo) { private String checkFundStartDate(TPreDispatchInfo newEntity, SysBaseSetInfo baseSetInfo) {
if (null == baseSetInfo) { if (null == baseSetInfo) {
...@@ -245,12 +251,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -245,12 +251,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 查看公积金起缴时间是否符合政策 * 查看公积金起缴时间是否符合政策
*
* @param newEntity * @param newEntity
* @param oldEntity * @param oldEntity
* @return
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
* @return
**/ **/
private R<Boolean> checkFundStartDate(TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) { private R<Boolean> checkFundStartDate(TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) {
// 公积金确实要派增且时间有变动要判断是否符合派单政策 // 公积金确实要派增且时间有变动要判断是否符合派单政策
...@@ -280,13 +285,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -280,13 +285,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 更新预派单是否派单状态 * 更新预派单是否派单状态
*
* @param id * @param id
* @param dispatchFlag * @param dispatchFlag
* @param cancelRemark * @param cancelRemark
* @return
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
* @return
**/ **/
@Override @Override
public R<Boolean> updateDispatchFlag(String id, String dispatchFlag, String cancelRemark) { public R<Boolean> updateDispatchFlag(String id, String dispatchFlag, String cancelRemark) {
...@@ -303,6 +307,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -303,6 +307,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return R.ok(); return R.ok();
} }
/**
* 单个派单
* @param id
* @Author huyc
* @Date 2022-07-18
* @return
**/
@Override @Override
public R<Boolean> dispatchById(String id) { public R<Boolean> dispatchById(String id) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
...@@ -322,9 +333,151 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -322,9 +333,151 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos(); settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos();
//map数据封装 //map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap); initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
TPreDispatchInfo preInfo = baseMapper.selectById(id);
if (null == preInfo){
return R.failed(CommonConstants.ERROR_NO_DOMAIN);
}
if (!CommonConstants.ZERO_STRING.equals(preInfo.getPreStatus())
||CommonConstants.ONE_STRING.equals(preInfo.getStatus())
|| CommonConstants.ONE_STRING.equals(preInfo.getDispatchFlag())){
return R.failed(PreDispatchConstants.PRESTATUS_ERROR);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
R<Boolean> errorMessage = null;
HashMap<String,SysArea> areaMap = new HashMap<>();
HashMap<String,SysArea> areaIdMap = new HashMap<>();
// 派单派增处理
//todo
if (CommonConstants.ZERO_STRING.equals(preInfo.getType())) {
// EmployeeSocialFundImportVo importVo = new EmployeeSocialFundImportVo();
// // 初始化派增的派单数据
// initDispatchAddVo(preInfo, importVo);
// List<EmployeeSocialFundImportVo> importVoList = new ArrayList<>();
// importVoList.add(importVo);
// importVoList.add(importVo);
// // 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
// if (null == importVo.getFileCity()) {
// initAreaMap(areaMap, areaIdMap);
// // 处理 档案地市
// errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
// }
// // 档案地市没问题 开始派单处理
// if (Common.isEmpty(errorMessageList)) {
// errorMessageList = dispatchInfoService.batchSaveEmployeeContractSocialFund(importVoList,
// settleIdAndCustomerIdMap, settleDomainNameMap, customerNameMap, user);
// }
// // 处理派增结果
// errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
// if (null != errorMessage) {
// return errorMessage;
// }
}
return R.ok(); return R.ok();
} }
/**
* 一键派单
* @param idStr
* @return
* @Author huyc
* @Date 2022-07-18
**/
@Override
public R oneKeyToDispatch(String idStr) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed(CommonConstants.USER_FAIL);
}
R<List<TSettleDomainSelectVo>> settleDomainR = null;
//结算主体名称map key:结算主体id value:结算主体名称
Map<String, String> settleDomainNameMap = new HashMap<>();
//客户名称map key:客户id value:客户名称
Map<String, String> customerNameMap = new HashMap<>();
//结算主体客户关系map key:结算主体id value:客户id
Map<String, String> settleIdAndCustomerIdMap = new HashMap<>();
settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos();
//map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
// 获取当前创建人 截止到当前时间的 正常未派单 未删除的预派单数据
List<TPreDispatchInfo> preList;
if (Common.isEmpty(idStr)) {
preList = baseMapper.selectList(Wrappers.<TPreDispatchInfo>query().lambda()
.eq(TPreDispatchInfo::getCreateBy, user.getId())
.le(TPreDispatchInfo::getCreateTime, LocalDateTime.now())
.eq(TPreDispatchInfo::getStatus, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getDispatchFlag, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ZERO_STRING));
} else {
List<String> idList = Common.initStrToList(idStr, ",");
preList = baseMapper.selectList(Wrappers.<TPreDispatchInfo>query().lambda()
.in(TPreDispatchInfo::getId, idList)
.eq(TPreDispatchInfo::getCreateBy, user.getId())
.le(TPreDispatchInfo::getCreateTime, LocalDateTime.now())
.eq(TPreDispatchInfo::getStatus, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getDispatchFlag, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ZERO_STRING));
}
if (Common.isEmpty(preList)) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
// 找出所有需要派减的社保或公积金数据 主要用于派减是获取结算主体相关数据
HashMap<String, TSocialInfo> socialMap = new HashMap<>();
HashMap<String, TProvidentFund> fundMap = new HashMap<>();
// 封装需要派减的社保或公积金信息
initReduceSocialFundInfo(preList, socialMap, fundMap);
// 开始处理派增
List<ErrorMessage> errorMessageList;
List<ErrorMessage> errorMsgList = new ArrayList<>();
TDispatchInfo dispatchInfo;
R<Boolean> res;
HashMap<String, SysArea> areaMap = new HashMap<>();
HashMap<String, SysArea> areaIdMap = new HashMap<>();
int i = 1;
for (TPreDispatchInfo pre : preList) {
i++;
if (checkLimit(pre)) {
continue;
}
// 派单派增处理
//todo
// batchDispatchAdd(settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap, user, errorMsgList, i, pre,
// areaMap, areaIdMap);
// 派单派减处理
if (CommonConstants.ONE_STRING.equals(pre.getType())) {
dispatchInfo = new TDispatchInfo();
dispatchInfo.setEmpName(pre.getEmpName());
dispatchInfo.setEmpIdcard(pre.getEmpIdcard());
dispatchInfo.setEmpType(pre.getEmpTypeAdd());
dispatchInfo.setType(pre.getType());
dispatchInfo.setReduceReason(pre.getLeaveReasonAdd());
dispatchInfo.setReduceRemark(pre.getLeaveReason());
dispatchInfo.setTrustRemark(pre.getLeaveReason());
dispatchInfo.setBelongUnitName(customerNameMap.get(pre.getUnitIdAdd()));
dispatchInfo.setSettleDomainName(settleIdAndCustomerIdMap.get(pre.getDepartIdAdd()));
dispatchInfo.setFileAddr(pre.getPayAddress());
dispatchInfo.setPost(pre.getPositionAdd());
dispatchInfo.setEmpMobile(pre.getTelTwo());
// 处理派减派单时间
dispatchReduce(dispatchInfo, pre);
// 查看是否可以派减社保或公积金
res = handleBatchSocialFundReduce(pre, dispatchInfo, socialMap.get(pre.getEmpIdcard()), fundMap.get(pre.getEmpIdcard()));
if (res != null) {
errorMsgList.add(new ErrorMessage(i, pre.getEmpIdcard() + CommonConstants.COLON_STRING + res.getMsg()));
} else {
List<TDispatchInfo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchInfo);
//todo
// errorMessageList = dispatchInfoService.batchDispatchReduce(dispatchImportList, settleIdAndCustomerIdMap, user);
// 处理派减结果
// handleDispatchAddRes(pre, errorMessageList);
// 重新组装数据
// resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
}
}
}
return R.ok(errorMsgList);
}
@Override @Override
public R update(TPreDispatchInfo tPreDispatchInfo) { public R update(TPreDispatchInfo tPreDispatchInfo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
...@@ -373,7 +526,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -373,7 +526,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return R.failed(PreDispatchConstants.TEL_NOT_EMPTY); return R.failed(PreDispatchConstants.TEL_NOT_EMPTY);
} }
if (ValidityUtil.checkInvalidEmpPhone(tPreDispatchInfo.getTelOne())){ if (ValidityUtil.checkInvalidEmpPhone(tPreDispatchInfo.getTelOne())) {
return R.failed(PreDispatchConstants.TEL_INVALID); return R.failed(PreDispatchConstants.TEL_INVALID);
} }
} }
...@@ -395,15 +548,15 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -395,15 +548,15 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Override @Override
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId) { public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String houseId, String departId) {
List<ErrorMessage> errorList = new ArrayList<>(); List<ErrorMessage> errorList = new ArrayList<>();
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId); R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId);
TSettleDomainSelectVo selectVo = domainR.getData(); TSettleDomainSelectVo selectVo = domainR.getData();
// 获取区域数据MAP // 获取区域数据MAP
HashMap<String, SysArea> areaHashMap = new HashMap<>(CommonConstants.SIXTEEN_INT); HashMap<String, SysArea> areaHashMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
HashMap<String,SysArea> areaIdMap = new HashMap<>(CommonConstants.SIXTEEN_INT); HashMap<String, SysArea> areaIdMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
if (dataCheck(listInfo, errorList,areaHashMap,areaIdMap)) { if (dataCheck(listInfo, errorList, areaHashMap, areaIdMap)) {
return errorList; return errorList;
} }
if (dataCheckDepart(errorList,domainR)) { if (dataCheckDepart(errorList, domainR)) {
return errorList; return errorList;
} }
// 获取基数配置信息 // 获取基数配置信息
...@@ -413,54 +566,412 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -413,54 +566,412 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
HashMap<String, TPreDispatchInfo> baseFundTimeMap = new HashMap<>(); HashMap<String, TPreDispatchInfo> baseFundTimeMap = new HashMap<>();
initSocialAndFundBaseSet(listInfo, baseSocialSetMap, baseFundSetMap, baseSocialTimeMap, baseFundTimeMap); initSocialAndFundBaseSet(listInfo, baseSocialSetMap, baseFundSetMap, baseSocialTimeMap, baseFundTimeMap);
// 查询当月对应身份证是否已经派增或派减了 后面做判重处理 // 查询当月对应身份证是否已经派增或派减了 后面做判重处理
HashMap<String,TPreDispatchInfo> existsMap = new HashMap<>(); HashMap<String, TPreDispatchInfo> existsMap = new HashMap<>();
initExistsMapByIdCards(listInfo,existsMap,CommonConstants.ZERO_STRING); initExistsMapByIdCards(listInfo, existsMap, CommonConstants.ZERO_STRING);
// 获取所有地市的最迟派单日限制 // 获取所有地市的最迟派单日限制
HashMap<String,Integer> dayConfMap = new HashMap<>(); HashMap<String, Integer> dayConfMap = new HashMap<>();
initDayConfMap(dayConfMap); initDayConfMap(dayConfMap);
int i=1; int i = 1;
for (TPreDispatchInfo info:listInfo){ for (TPreDispatchInfo info : listInfo) {
i++; i++;
// 1.验重 // 1.验重
if (checkAddRepeat(errorList, existsMap, i, info)){ if (checkAddRepeat(errorList, existsMap, i, info)) {
continue; continue;
} }
// 基础封装 其他 // 基础封装 其他
initBaseInfo(houseId,selectVo, info); initBaseInfo(houseId, selectVo, info);
// 2.先校验已有数据 // 2.先校验已有数据
checkBatchSave(info,CommonConstants.ZERO_STRING); checkBatchSave(info, CommonConstants.ZERO_STRING);
// 3.封装 社保缴纳地 公积金缴纳地 // 3.封装 社保缴纳地 公积金缴纳地
initBatchAreaAdd(areaHashMap, areaIdMap, info); initBatchAreaAdd(areaHashMap, areaIdMap, info);
// 4.验证缴纳地和补缴日期是否符合政策 // 4.验证缴纳地和补缴日期是否符合政策
if (Common.isEmpty(info.getExceptionContent())){ if (Common.isEmpty(info.getExceptionContent())) {
checkStartTime(baseSocialSetMap, baseFundSetMap, null, info); checkStartTime(baseSocialSetMap, baseFundSetMap, null, info);
} }
// 5.封装地市派单限制日 // 5.封装地市派单限制日
initDayLimit(dayConfMap, info); initDayLimit(dayConfMap, info);
// 6.保存 有异常也保存 要标识 // 6.保存 有异常也保存 要标识
info.setCreateTime(LocalDateTime.now());
info.setUserDeptName(selectVo.getDepartName()); info.setUserDeptName(selectVo.getDepartName());
info.setPreStatus(CommonConstants.ZERO_STRING); info.setPreStatus(CommonConstants.ZERO_STRING);
// 为验重添加到MAP // 为验重添加到MAP
existsMap.put(info.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+info.getPayAddress(),info); existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())){ if (Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, "保存成功!",CommonConstants.GREEN)); errorList.add(new ErrorMessage(i, "保存成功!", CommonConstants.GREEN));
}else { } else {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, "保存成功!" + errorList.add(new ErrorMessage(i, "保存成功!" +
info.getExceptionContent(),CommonConstants.RED)); info.getExceptionContent(), CommonConstants.RED));
} }
baseMapper.insert(info); baseMapper.insert(info);
} }
return null; return null;
} }
/**
* 预派单批量新增派减
* @param listInfo
* @param user
* @Author huyc
* @Date 2022-07-18
* @return
**/
@Transactional
@Override
public List<ErrorMessage> batchSavePreDisPatchReduce(List<TPreDispatchInfo> listInfo, YifuUser user) {
List<ErrorMessage> errorList = new ArrayList<>();
// 获取区域数据MAP
HashMap<String, SysArea> areaIdMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
HashMap<String, SysArea> areaHashMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
if (dataCheck(listInfo, errorList, areaHashMap, areaIdMap)) {
return errorList;
}
// 查询当月对应身份证是否已经派增或派减了 后面做判重处理
HashMap<String, TPreDispatchInfo> existsMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
initExistsMapByIdCards(listInfo, existsMap, CommonConstants.ONE_STRING);
// 获取所有地市的最迟派单日限制
HashMap<String, Integer> dayConfMap = new HashMap<>();
initDayConfMap(dayConfMap);
// 获取系统中未派单的派增预派单
HashMap<String, String> preAddMap = new HashMap<>();
getPreAddMap(preAddMap);
int i = 1;
for (TPreDispatchInfo info : listInfo) {
i++;
// 1.验重
if (checkAddRepeat(errorList, existsMap, i, info)) {
continue;
}
// 2.基础封装 其他
initReduceBaseInfo(null, info);
// 3.先校验已有数据
checkBatchSave(info, CommonConstants.ONE_STRING);
if (Common.isEmpty(info.getExceptionContent())) {
// 封装社保或公积金的部门数据
initAndCheckArea(areaIdMap, areaHashMap, info);
}
// 4.封装地市派单限制日
initDayLimit(dayConfMap, info);
// 5.保存 有异常也保存 要做标识
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(user.getDeptId().toString());
TSettleDomainSelectVo selectVo = domainR.getData();
info.setUserDeptName(selectVo.getDepartName());
info.setPreStatus(CommonConstants.ZERO_STRING);
// 如果已经存在未派单的派增 这个时候派减 直接标记异常 客服自行判断是否派单
if (null != preAddMap.get(info.getEmpIdcard())) {
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent("当月已存在派增,请确认并处理此人是否取消增减预派单!");
}
// 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
} else {
info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS +
info.getExceptionContent(), CommonConstants.RED));
}
baseMapper.insert(info);
}
return errorList;
}
/**
* 预派单批量更新
* @Author huyc
* @Date 2022-07-18
* @param list
* @param user
* @return
**/
@Override
public List<ErrorMessage> batchUpdatePreDisPatch(List<TPreDispatchUpdateVo> list, YifuUser user) {
List<ErrorMessage> errorList = new ArrayList<>();
// 获取区域数据MAP
HashMap<String, SysArea> areaHashMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
HashMap<String,SysArea> areaIdMap = new HashMap<>(CommonConstants.SIXTEEN_INT);
// 做下转换
List<TPreDispatchInfo> listInfo = changeRes(list);
if (dataCheckSub(listInfo, errorList, areaHashMap, areaIdMap)) {
return errorList;
}
// 获取基数配置信息
HashMap<String, SysBaseSetInfo> baseSocialSetMap = new HashMap<>();
HashMap<String, SysBaseSetInfo> baseFundSetMap = new HashMap<>();
HashMap<String, TPreDispatchInfo> baseSocialTimeMap = new HashMap<>();
HashMap<String, TPreDispatchInfo> baseFundTimeMap = new HashMap<>();
HashMap<String,TPreDispatchInfo> existsMap = new HashMap<>();
HashMap<String,TPreDispatchInfo> repeatMap = new HashMap<>();
initSocialAndFundBaseSet(listInfo, baseSocialSetMap, baseFundSetMap, baseSocialTimeMap, baseFundTimeMap);
initExistsMapByIds(listInfo,existsMap,repeatMap);
// 获取所有地市的最迟派单日限制
HashMap<String,Integer> dayConfMap = new HashMap<>();
initDayConfMap(dayConfMap);
TPreDispatchInfo temp = null;
TPreDispatchInfo repeat = null;
int i=1;
String str = null;
for (TPreDispatchInfo info:listInfo){
i++;
// 重置异常状态
info.setExceptionContent("");
info.setPreStatus(CommonConstants.ZERO_STRING);
temp = existsMap.get(info.getId());
repeat = repeatMap.get(info.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+info.getPayAddress());
// 判重 及身份证不可更新
if (checkRepeatOrIdcard(errorList, temp, i+1, info,repeat)) {
continue;
}
// 验证派单类型
checkDispatchType(info);
// 1.先校验已有数据
str = checkBatchSave(info,info.getType());
if (null != str) {
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(str);
}
// 2.封装 社保缴纳地 公积金缴纳地
initBatchUpdateArea(areaHashMap, areaIdMap, info);
if (Common.isEmpty(info.getExceptionContent())){
// 3.验证补缴时间是否异常 派增验证 派减日期不处理
checkStartTime(baseSocialSetMap, baseFundSetMap, temp, info);
}
// 4.如果派增缴纳地有变更重新变更派单限制日期
initDayLimitForUpdate(dayConfMap, temp, info);
// 5.更新
updateInfoByIdSub(errorList, temp, i, info);
}
return errorList;
}
@Override
public void doexportPreDispatch(HttpServletResponse response, TPreDispatchInfo tPreDispatchInfo) {
String fileName = "导出预派单" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPreDispatchExportVo> list = new ArrayList<>();
//获取记录
list = baseMapper.getListForExport(tPreDispatchInfo);
ServletOutputStream out = null;
if (list != null && !list.isEmpty()) {
list = new ArrayList<>();
}
try {
out = response.getOutputStream();
ExcelUtil<TPreDispatchExportVo> util = new ExcelUtil<>(TPreDispatchExportVo.class);
for (TPreDispatchExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, TPreDispatchExportVo.class).includeColumnFiledNames(tPreDispatchInfo.getExportFields()).sheet("预派单")
.doWrite(list);
out.flush();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
/**
* 派单类型校验
* @Author fxj
* @Date 2020-12-31
* @param info
* @return
**/
private String checkDispatchType(TPreDispatchInfo info) {
if (Common.isEmpty(info.getType()) ||
(!CommonConstants.ZERO_STRING.equals(info.getType()) && !CommonConstants.ONE_STRING.equals(info.getType()))){
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(PreDispatchConstants.DISPATCH_TYPE_ERROR);
return PreDispatchConstants.DISPATCH_TYPE_ERROR;
}
return null;
}
private List<TPreDispatchInfo> changeRes(List<TPreDispatchUpdateVo> list) {
List<TPreDispatchInfo> listInfo = new ArrayList<>();
if (Common.isNotNull(list)){
for (TPreDispatchInfo info:list){
listInfo.add(info);
}
}
return listInfo;
}
private void initBatchUpdateArea(HashMap<String, SysArea> areaHashMap, HashMap<String, SysArea> areaIdMap, TPreDispatchInfo info) {
R<Boolean> x;
if (CommonConstants.ZERO_STRING.equals(info.getType())){
initBatchAreaAdd(areaHashMap, areaIdMap, info);
}else if (CommonConstants.ONE_STRING.equals(info.getType())){
// 初始化离职原因
initLeaveReason(info);
x = handleSocialAreaAdd(areaHashMap,areaIdMap,info,info.getPensionAddressReduce());
if (null != x){
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg());
return;
}
x = handleFundAreaAdd(areaHashMap,areaIdMap,info,info.getFundAddressReduce());
if (null != x){
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg());
}
}
}
/**
* 通过IDS封装已存在的社保数
* @Author fxj
* @Date 2021-01-04
* @param listInfo
* @param existsMap
* @return
**/
private void initExistsMapByIds(List<TPreDispatchInfo> listInfo,
Map<String,TPreDispatchInfo> existsMap,Map<String,TPreDispatchInfo> repeatMap) {
List<String> idList = new ArrayList<>();
List<String> idcarList = new ArrayList<>();
if (Common.isNotNull(listInfo)) {
for (TPreDispatchInfo info:listInfo){
idList.add(info.getId());
idcarList.add(info.getEmpIdcard());
}
}
// 初始化要更新的数据MAP
initExistsMapByIds(existsMap, idList);
// 初始化要验重的数据Map
initRepeatMap(repeatMap, idcarList);
}
/**
* 初始化要更新的数据MAP
* @Author fxj
* @Date 2021-01-04
* @param existsMap
* @param idList
* @return
**/
private void initExistsMapByIds(Map<String, TPreDispatchInfo> existsMap, List<String> idList) {
if (Common.isNotNull(idList)){
List<TPreDispatchInfo> preDispatchInfoList = baseMapper.
selectList(Wrappers.<TPreDispatchInfo>query().lambda().in(TPreDispatchInfo::getId,idList));
if (Common.isNotNull(preDispatchInfoList)){
for (TPreDispatchInfo info:preDispatchInfoList){
existsMap.put(info.getId(),info);
}
}
}
}
private void initRepeatMap(Map<String, TPreDispatchInfo> repeatMap, List<String> idcarList) {
if (Common.isNotNull(idcarList)){
List<TPreDispatchInfo> preDispatchInfoList = baseMapper.
selectList(Wrappers.<TPreDispatchInfo>query().lambda().in(TPreDispatchInfo::getEmpIdcard,idcarList)
.ne(TPreDispatchInfo::getPreStatus, CommonConstants.TWO_STRING));
if (Common.isNotNull(preDispatchInfoList)){
for (TPreDispatchInfo info:preDispatchInfoList){
repeatMap.put(info.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+info.getPayAddress(),info);
}
}
}
}
/**
* 更新代码处理
* @Author fxj
* @Date 2021-01-12
* @param errorList
* @param temp
* @param i
* @param info
* @return
**/
private void updateInfoByIdSub(List<ErrorMessage> errorList, TPreDispatchInfo temp, int i, TPreDispatchInfo info) {
if (Common.isNotNull(info.getPreStatus()) && info.getPreStatus().length() > CommonConstants.ONE_INT){
info.setPreStatus(null);
}
if (CommonConstants.TWO_STRING.equals(temp.getPreStatus())){
info.setPreStatus(CommonConstants.TWO_STRING);
}
if (PreDispatchConstants.YES_CH.equals(info.getDataSubStatus())){
info.setDataSubStatus(CommonConstants.ZERO_STRING);
}
if (PreDispatchConstants.NO_CH.equals(info.getDataSubStatus())){
info.setDataSubStatus(CommonConstants.ONE_STRING);
}
info.setContractNameAdd(temp.getContractNameAdd());
info.setContractTypeAdd(temp.getContractTypeAdd());
info.setContractTermAdd(temp.getContractTermAdd());
info.setContractStartAdd(temp.getContractStart());
info.setContractEndAdd(temp.getContractEnd());
// 合同开始截止时间 同步更新派单的合同时间
info.setContractEndAdd(info.getContractEnd());
info.setContractStartAdd(info.getContractStart());
baseMapper.updatePreDispatchInfoById(info);
if (Common.isNotNull(info.getExceptionContent())){
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS+info.getExceptionContent(),CommonConstants.RED));
}else {
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS,CommonConstants.GREEN));
}
}
private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) { private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
return temp.getYear() == now.getYear() && temp.getMonthValue() < now.getMonthValue(); return temp.getYear() == now.getYear() && temp.getMonthValue() < now.getMonthValue();
} }
private boolean checkRepeatOrIdcard(List<ErrorMessage> errorList, TPreDispatchInfo temp, int i,
TPreDispatchInfo info,TPreDispatchInfo repeat) {
if (null == temp){
errorList.add(new ErrorMessage(i, CommonConstants.DATA_CAN_NOT_EMPTY));
return true;
}
info.setType(temp.getType());
if (null != repeat && !repeat.getId().equals(info.getId())){
errorList.add(new ErrorMessage(i, "已存在身份证对应缴费地的数据!"));
return true;
}
info.setSocialHouseAdd(temp.getSocialHouseAdd());
info.setFundHouseAdd(temp.getFundHouseAdd());
// 身份证不可更新
if (!temp.getEmpIdcard().equals(info.getEmpIdcard())){
errorList.add(new ErrorMessage(i+1, PreDispatchConstants.EMPIDCARD_IS_EMPTY));
return true;
}
return false;
}
/**
* 更新的时候派增缴纳地有变更时重新更新派增限制日期
* @Author fxj
* @Date 2021-01-04
* @param dayConfMap
* @param temp
* @param info
* @return
**/
private void initDayLimitForUpdate(HashMap<String, Integer> dayConfMap, TPreDispatchInfo temp, TPreDispatchInfo info) {
if (CommonConstants.ZERO_STRING.equals(info.getType())){
boolean flag = (Common.isNotNull(info.getPensionAddress()) && !info.getPensionAddress().equals(temp.getPensionAddress())) ||
(Common.isNotNull(info.getFundAddress()) && !info.getFundAddress().equals(temp.getFundAddress()));
if (flag){
initDayLimit(dayConfMap, info);
}
}
}
/** /**
* 预派单更新前校验 * 预派单更新前校验
*
* @param tPreDispatchInfo * @param tPreDispatchInfo
* @param areaHashMap * @param areaHashMap
* @param areaIdMap * @param areaIdMap
...@@ -471,18 +982,18 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -471,18 +982,18 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
**/ **/
private R<Boolean> checkUpdate(TPreDispatchInfo tPreDispatchInfo, Map<String, SysArea> areaHashMap, private R<Boolean> checkUpdate(TPreDispatchInfo tPreDispatchInfo, Map<String, SysArea> areaHashMap,
Map<String, SysArea> areaIdMap, TPreDispatchInfo preDispatchTemp) { Map<String, SysArea> areaIdMap, TPreDispatchInfo preDispatchTemp) {
if (null == tPreDispatchInfo || Common.isEmpty(tPreDispatchInfo.getId())) { // if (null == tPreDispatchInfo || Common.isEmpty(tPreDispatchInfo.getId())) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); // return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
} // }
if (null == preDispatchTemp) { // if (null == preDispatchTemp) {
return R.failed(CommonConstants.ERROR_NO_DOMAIN); // return R.failed(CommonConstants.ERROR_NO_DOMAIN);
} // }
// 先验证必填项 // // 先验证必填项
String errorMessage = checkField(tPreDispatchInfo); // String errorMessage = checkField(tPreDispatchInfo);
if (null != errorMessage) { // if (null != errorMessage) {
return R.failed(errorMessage); // return R.failed(errorMessage);
} // }
R<List<SysArea>> areaListR = UpmsDaprUtils.getAreaListR(); R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) { if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
return R.failed(PreDispatchConstants.GET_AREA_INFO); return R.failed(PreDispatchConstants.GET_AREA_INFO);
} }
...@@ -490,24 +1001,38 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -490,24 +1001,38 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return null; return null;
} }
private void initAreaMap(Map<String, SysArea> areaHashMap, Map<String, SysArea> areaIdMap, R<List<SysArea>> areaListR) { private void initAreaMap(Map<String, SysArea> areaHashMap, Map<String, SysArea> areaIdMap, R<AreaVo> areaListR) {
List<SysArea> areaList = areaListR.getData(); AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.isEmpty()) { if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList) { for (SysArea area : areaList.getSysAreaList()) {
areaHashMap.put(area.getAreaName(), area); areaHashMap.put(area.getAreaName(), area);
areaIdMap.put(Integer.toString(area.getId()), area); areaIdMap.put(Integer.toString(area.getId()), area);
} }
} }
} }
private void initAndCheckArea(HashMap<String, SysArea> areaIdMap, HashMap<String, SysArea> areaHashMap, TPreDispatchInfo info) {
R<Boolean> x = handleSocialAreaAdd(areaHashMap, areaIdMap, info, info.getPensionAddressReduce());
if (null != x) {
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg());
}
x = handleFundAreaAdd(areaHashMap, areaIdMap, info, info.getFundAddressReduce());
if (null != x) {
info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg());
}
}
/** /**
* 初始化基础数据 如 各种状态 合同数据等 * 初始化基础数据 如 各种状态 合同数据等
* @Author fxj *
* @Date 2020-12-31
* @param houseId * @param houseId
* @param selectVo * @param selectVo
* @param info * @param info
* @return * @return
* @Author fxj
* @Date 2020-12-31
**/ **/
private void initBaseInfo(String houseId, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) { private void initBaseInfo(String houseId, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setType(CommonConstants.ZERO_STRING); info.setType(CommonConstants.ZERO_STRING);
...@@ -528,7 +1053,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -528,7 +1053,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
// 默认为开始时间后的两年时间 // 默认为开始时间后的两年时间
info.setContractEndAdd(info.getContractEnd()); info.setContractEndAdd(info.getContractEnd());
// 默认合同期限2年 // 默认合同期限2年
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(),info.getContractEnd()))); info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd())));
// 默认工时制 综合工时制2 // 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING); info.setWorkingHoursAdd(CommonConstants.TWO_STRING);
info.setSocialHouseAdd(houseId); info.setSocialHouseAdd(houseId);
...@@ -595,7 +1120,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -595,7 +1120,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
if (Common.isEmpty(tPreDispatchInfo.getTelOne())) { if (Common.isEmpty(tPreDispatchInfo.getTelOne())) {
return PreDispatchConstants.TEL_NOT_EMPTY; return PreDispatchConstants.TEL_NOT_EMPTY;
} }
if (ValidityUtil.checkInvalidEmpPhone(tPreDispatchInfo.getTelOne())){ if (ValidityUtil.checkInvalidEmpPhone(tPreDispatchInfo.getTelOne())) {
return PreDispatchConstants.TEL_INVALID; return PreDispatchConstants.TEL_INVALID;
} }
if (Common.isEmpty(tPreDispatchInfo.getPensionAddress()) && if (Common.isEmpty(tPreDispatchInfo.getPensionAddress()) &&
...@@ -664,9 +1189,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -664,9 +1189,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* 查看社保起缴日期是否符合补缴政策 * 查看社保起缴日期是否符合补缴政策
* *
* @param newEntity * @param newEntity
* @return
* @Author huyc * @Author huyc
* @Date 2022-07-18 * @Date 2022-07-18
* @return
**/ **/
private String checkSocialStartDate(TPreDispatchInfo newEntity, SysBaseSetInfo baseSetInfo) { private String checkSocialStartDate(TPreDispatchInfo newEntity, SysBaseSetInfo baseSetInfo) {
// 社保确实要派增且时间有变动要判断是否符合派单政策 // 社保确实要派增且时间有变动要判断是否符合派单政策
...@@ -684,31 +1209,32 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -684,31 +1209,32 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 查看社保起缴日期是否符合补缴政策 * 查看社保起缴日期是否符合补缴政策
* @Author huyc *
* @Date 2022-07-18
* @param newEntity * @param newEntity
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private R<Boolean> checkSocialStartDate(TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) { private R<Boolean> checkSocialStartDate(TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) {
// 社保确实要派增且时间有变动要判断是否符合派单政策 // 社保确实要派增且时间有变动要判断是否符合派单政策
if (Common.isNotNull(newEntity.getPensionAddress()) && if (Common.isNotNull(newEntity.getPensionAddress()) &&
Common.isNotNull(newEntity.getPensionStart()) && Common.isNotNull(newEntity.getPensionStart()) &&
!newEntity.getPensionStart().equals(oldEntity.getPensionStart())){ !newEntity.getPensionStart().equals(oldEntity.getPensionStart())) {
SysBaseSetInfo baseSetSocial = null; SysBaseSetInfo baseSetSocial = null;
if (null != newEntity.getSocialProvince()){ if (null != newEntity.getSocialProvince()) {
baseSetSocial = getSysBaseSetInfo(newEntity.getSocialProvince(),newEntity.getSocialCity(), baseSetSocial = getSysBaseSetInfo(newEntity.getSocialProvince(), newEntity.getSocialCity(),
newEntity.getSocialTown(), oldEntity.getSocialHouseAdd(),CommonConstants.ZERO_STRING); newEntity.getSocialTown(), oldEntity.getSocialHouseAdd(), CommonConstants.ZERO_STRING);
}else { } else {
baseSetSocial = getSysBaseSetInfo(oldEntity.getSocialProvince(),oldEntity.getSocialCity(), baseSetSocial = getSysBaseSetInfo(oldEntity.getSocialProvince(), oldEntity.getSocialCity(),
oldEntity.getSocialTown(), oldEntity.getSocialHouseAdd(),CommonConstants.ZERO_STRING); oldEntity.getSocialTown(), oldEntity.getSocialHouseAdd(), CommonConstants.ZERO_STRING);
} }
if (null == baseSetSocial){ if (null == baseSetSocial) {
return R.failed(PreDispatchConstants.NO_SOCIAL_BASE_SET_INFO); return R.failed(PreDispatchConstants.NO_SOCIAL_BASE_SET_INFO);
} }
// 查看是否符合社保补缴政策 // 查看是否符合社保补缴政策
if (checkDispatchDate( if (checkDispatchDate(
LocalDateTimeUtils.dateOfYearAndMonth(newEntity.getPensionStart(), DateUtil.ISO_DATE_FORMAT), LocalDateTimeUtils.dateOfYearAndMonth(newEntity.getPensionStart(), DateUtil.ISO_DATE_FORMAT),
baseSetSocial.getCanOverpay(),baseSetSocial.getOverpayNumber(),baseSetSocial.getHaveThisMonth())){ baseSetSocial.getCanOverpay(), baseSetSocial.getOverpayNumber(), baseSetSocial.getHaveThisMonth())) {
return R.failed(PreDispatchConstants.SOCIAL_START_DATE_ERROR); return R.failed(PreDispatchConstants.SOCIAL_START_DATE_ERROR);
} }
} }
...@@ -717,13 +1243,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -717,13 +1243,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 查看社保公积金起缴日期是否符合补缴逻辑 * 查看社保公积金起缴日期是否符合补缴逻辑
* @Author huyc *
* @Date 2022-07-18
* @param socialStartDate 起缴日期 * @param socialStartDate 起缴日期
* @param canOverpay 是否可补缴 0:是,1:否 * @param canOverpay 是否可补缴 0:是,1:否
* @param overpayNumber 补缴期限 整数 * @param overpayNumber 补缴期限 整数
* @param haveThisMonth 是否含当月 0:是,1:否 如果无符合条件默认不含当月 * @param haveThisMonth 是否含当月 0:是,1:否 如果无符合条件默认不含当月
* @return 符合 false 不符合 true * @return 符合 false 不符合 true
* @Author huyc
* @Date 2022-07-18
**/ **/
public static boolean checkDispatchDate(LocalDateTime socialStartDate, String canOverpay, Integer overpayNumber, String haveThisMonth) { public static boolean checkDispatchDate(LocalDateTime socialStartDate, String canOverpay, Integer overpayNumber, String haveThisMonth) {
if (null == socialStartDate) { if (null == socialStartDate) {
...@@ -741,10 +1268,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -741,10 +1268,11 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 0 个人辞职 = 合同主动解除 1单位辞退 = 合同被动解除 15 死亡 = 死亡 19 其他 * 0 个人辞职 = 合同主动解除 1单位辞退 = 合同被动解除 15 死亡 = 死亡 19 其他
*
* @param tPreDispatchInfo * @param tPreDispatchInfo
* @return
* @Author fxj * @Author fxj
* @Date 2021-01-07 * @Date 2021-01-07
* @return
**/ **/
private void initLeaveReason(TPreDispatchInfo tPreDispatchInfo) { private void initLeaveReason(TPreDispatchInfo tPreDispatchInfo) {
if ("合同主动解除".equals(tPreDispatchInfo.getLeaveReason())) { if ("合同主动解除".equals(tPreDispatchInfo.getLeaveReason())) {
...@@ -758,27 +1286,27 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -758,27 +1286,27 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
} }
private SysBaseSetInfo getSysBaseSetInfo(String province,String city,String town,String houseId,String type) { private SysBaseSetInfo getSysBaseSetInfo(String province, String city, String town, String houseId, String type) {
SysBaseSetInfo queryEntity = new SysBaseSetInfo(); SysBaseSetInfo queryEntity = new SysBaseSetInfo();
queryEntity.setBaseType(type); queryEntity.setBaseType(type);
queryEntity.setStatus(CommonConstants.ZERO_INT); queryEntity.setStatus(CommonConstants.ZERO_INT);
queryEntity.setDepartId(houseId); queryEntity.setDepartId(houseId);
if (Common.isNotNull(province)){ if (Common.isNotNull(province)) {
queryEntity.setProvince(Integer.valueOf(province)); queryEntity.setProvince(Integer.valueOf(province));
} }
if (Common.isNotNull(city)){ if (Common.isNotNull(city)) {
queryEntity.setCity(Integer.valueOf(city)); queryEntity.setCity(Integer.valueOf(city));
} }
if (Common.isNotNull(town)){ if (Common.isNotNull(town)) {
queryEntity.setTown(Integer.valueOf(town)); queryEntity.setTown(Integer.valueOf(town));
} }
queryEntity.setDeleteFlag(CommonConstants.ZERO_STRING); queryEntity.setDeleteFlag(CommonConstants.ZERO_STRING);
QueryWrapper<SysBaseSetInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysBaseSetInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(queryEntity); queryWrapper.setEntity(queryEntity);
if (Common.isEmpty(city)){ if (Common.isEmpty(city)) {
queryWrapper.isNull(PreDispatchConstants.CITY); queryWrapper.isNull(PreDispatchConstants.CITY);
} }
if (Common.isEmpty(town)){ if (Common.isEmpty(town)) {
queryWrapper.isNull(PreDispatchConstants.TOWN); queryWrapper.isNull(PreDispatchConstants.TOWN);
} }
queryWrapper.last(CommonConstants.LAST_ONE_SQL); queryWrapper.last(CommonConstants.LAST_ONE_SQL);
...@@ -787,32 +1315,33 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -787,32 +1315,33 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 重新获取公积金缴纳地数据 * 重新获取公积金缴纳地数据
* @Author huyc *
* @Date 2022-07-18
* @param areaMap * @param areaMap
* @param areaIdMap * @param areaIdMap
* @param newEntity * @param newEntity
* @param oldEntity * @param oldEntity
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private R<Boolean> handleFundArea(Map<String, SysArea> areaMap, private R<Boolean> handleFundArea(Map<String, SysArea> areaMap,
Map<String, SysArea> areaIdMap, TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) { Map<String, SysArea> areaIdMap, TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) {
// 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据 // 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据
if (Common.isNotNull(newEntity.getFundAddress()) && if (Common.isNotNull(newEntity.getFundAddress()) &&
(!newEntity.getFundAddress().equals(oldEntity.getFundAddress()) (!newEntity.getFundAddress().equals(oldEntity.getFundAddress())
|| null == oldEntity.getFundProvince())){ || null == oldEntity.getFundProvince())) {
return initFundArea(areaMap, areaIdMap, newEntity,newEntity.getFundAddress()); return initFundArea(areaMap, areaIdMap, newEntity, newEntity.getFundAddress());
} }
if (Common.isNotNull(newEntity.getFundAddressReduce()) && if (Common.isNotNull(newEntity.getFundAddressReduce()) &&
(!newEntity.getFundAddressReduce().equals(oldEntity.getFundAddressReduce()) (!newEntity.getFundAddressReduce().equals(oldEntity.getFundAddressReduce())
|| null == oldEntity.getFundProvince())){ || null == oldEntity.getFundProvince())) {
return initFundArea(areaMap, areaIdMap, newEntity,newEntity.getFundAddressReduce()); return initFundArea(areaMap, areaIdMap, newEntity, newEntity.getFundAddressReduce());
} }
return null; return null;
} }
private R<Boolean> initFundArea(Map<String, SysArea> areaMap, private R<Boolean> initFundArea(Map<String, SysArea> areaMap,
Map<String, SysArea> areaIdMap, TPreDispatchInfo entity,String address) { Map<String, SysArea> areaIdMap, TPreDispatchInfo entity, String address) {
SysArea area = areaMap.get(address); SysArea area = areaMap.get(address);
SysArea areaTemp; SysArea areaTemp;
if (null != area) { if (null != area) {
...@@ -837,35 +1366,36 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -837,35 +1366,36 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 获取公积金市县 数据 * 获取公积金市县 数据
* @Author huyc *
* @Date 2022-07-18
* @param newEntity * @param newEntity
* @param area * @param area
* @param areaTemp * @param areaTemp
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private boolean handleFundAreaSub(TPreDispatchInfo newEntity, SysArea area, SysArea areaTemp) { private boolean handleFundAreaSub(TPreDispatchInfo newEntity, SysArea area, SysArea areaTemp) {
if (null != areaTemp){ if (null != areaTemp) {
if (null == areaTemp.getParentId() || CommonConstants.ZERO_INT == areaTemp.getParentId().intValue()){ if (null == areaTemp.getParentId() || CommonConstants.ZERO_INT == areaTemp.getParentId().intValue()) {
newEntity.setFundProvince(areaTemp.getId().toString()); newEntity.setFundProvince(areaTemp.getId().toString());
newEntity.setFundCity(area.getId().toString()); newEntity.setFundCity(area.getId().toString());
newEntity.setFundTown(null); newEntity.setFundTown(null);
}else { } else {
newEntity.setFundProvince(areaTemp.getParentId().toString()); newEntity.setFundProvince(areaTemp.getParentId().toString());
newEntity.setFundCity(areaTemp.getId().toString()); newEntity.setFundCity(areaTemp.getId().toString());
newEntity.setFundTown(area.getId().toString()); newEntity.setFundTown(area.getId().toString());
} }
}else { } else {
return true; return true;
} }
return false; return false;
} }
private String getAreaErrorInfo(String type){ private String getAreaErrorInfo(String type) {
if (CommonConstants.ZERO_STRING.equals(type)){ if (CommonConstants.ZERO_STRING.equals(type)) {
return PreDispatchConstants.NO_PENSION_AREA_ADD; return PreDispatchConstants.NO_PENSION_AREA_ADD;
} }
if (CommonConstants.ONE_STRING.equals(type)){ if (CommonConstants.ONE_STRING.equals(type)) {
return PreDispatchConstants.NO_PENSION_AREA_REDUCE; return PreDispatchConstants.NO_PENSION_AREA_REDUCE;
} }
return CommonConstants.EMPTY_STRING; return CommonConstants.EMPTY_STRING;
...@@ -873,37 +1403,38 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -873,37 +1403,38 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 重新获取社保缴纳地 * 重新获取社保缴纳地
* @Author huyc *
* @Date 2022-07-18
* @param areaMap * @param areaMap
* @param newEntity * @param newEntity
* @param oldEntity * @param oldEntity
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private R<Boolean> handleSocialArea(Map<String, SysArea> areaMap, Map<String,SysArea> areaIdMap, private R<Boolean> handleSocialArea(Map<String, SysArea> areaMap, Map<String, SysArea> areaIdMap,
TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) { TPreDispatchInfo newEntity, TPreDispatchInfo oldEntity) {
// 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据 不为空且不相等 更新缴纳地 // 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据 不为空且不相等 更新缴纳地
if (Common.isNotNull(newEntity.getPensionAddress()) && if (Common.isNotNull(newEntity.getPensionAddress()) &&
(!newEntity.getPensionAddress().equals(oldEntity.getPensionAddress()) (!newEntity.getPensionAddress().equals(oldEntity.getPensionAddress())
|| null == oldEntity.getSocialProvince())){ || null == oldEntity.getSocialProvince())) {
return initSocialArea(areaMap, areaIdMap, newEntity,newEntity.getPensionAddress()); return initSocialArea(areaMap, areaIdMap, newEntity, newEntity.getPensionAddress());
} }
// 处理派减 不为空且不相等 更新缴纳地 // 处理派减 不为空且不相等 更新缴纳地
if (Common.isNotNull(newEntity.getPensionAddressReduce()) && if (Common.isNotNull(newEntity.getPensionAddressReduce()) &&
(!newEntity.getPensionAddressReduce().equals(oldEntity.getPensionAddressReduce()) (!newEntity.getPensionAddressReduce().equals(oldEntity.getPensionAddressReduce())
|| null == oldEntity.getSocialProvince())){ || null == oldEntity.getSocialProvince())) {
return initSocialArea(areaMap, areaIdMap, newEntity,newEntity.getPensionAddressReduce()); return initSocialArea(areaMap, areaIdMap, newEntity, newEntity.getPensionAddressReduce());
} }
return null; return null;
} }
private R<Boolean> initSocialArea(Map<String, SysArea> areaMap, private R<Boolean> initSocialArea(Map<String, SysArea> areaMap,
Map<String, SysArea> areaIdMap, TPreDispatchInfo entity,String address) { Map<String, SysArea> areaIdMap, TPreDispatchInfo entity, String address) {
SysArea area = areaMap.get(address); SysArea area = areaMap.get(address);
SysArea areaTemp; SysArea areaTemp;
if (null != area){ if (null != area) {
// 处理省数据 // 处理省数据
if (null == area.getParentId() || CommonConstants.ZERO_INT == area.getParentId().intValue()){ if (null == area.getParentId() || CommonConstants.ZERO_INT == area.getParentId().intValue()) {
entity.setSocialProvince(area.getId().toString()); entity.setSocialProvince(area.getId().toString());
entity.setSocialCity(null); entity.setSocialCity(null);
entity.setSocialTown(null); entity.setSocialTown(null);
...@@ -911,10 +1442,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -911,10 +1442,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
areaTemp = areaIdMap.get(Integer.toString(area.getParentId())); areaTemp = areaIdMap.get(Integer.toString(area.getParentId()));
// 处理市县数据 // 处理市县数据
if (handleSocialAreaSub(entity, area, areaTemp)){ if (handleSocialAreaSub(entity, area, areaTemp)) {
return R.failed(getAreaErrorInfo(entity.getType())); return R.failed(getAreaErrorInfo(entity.getType()));
} }
}else { } else {
return R.failed(getAreaErrorInfo(entity.getType())); return R.failed(getAreaErrorInfo(entity.getType()));
} }
return null; return null;
...@@ -922,25 +1453,26 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -922,25 +1453,26 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 获取社保市县 数据 * 获取社保市县 数据
* @Author huyc *
* @Date 2022-07-18
* @param newEntity * @param newEntity
* @param area * @param area
* @param areaTemp * @param areaTemp
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private boolean handleSocialAreaSub(TPreDispatchInfo newEntity, SysArea area, SysArea areaTemp) { private boolean handleSocialAreaSub(TPreDispatchInfo newEntity, SysArea area, SysArea areaTemp) {
if (null != areaTemp){ if (null != areaTemp) {
if (null == areaTemp.getParentId() || CommonConstants.ZERO_INT == areaTemp.getParentId().intValue()){ if (null == areaTemp.getParentId() || CommonConstants.ZERO_INT == areaTemp.getParentId().intValue()) {
newEntity.setSocialProvince(areaTemp.getId().toString()); newEntity.setSocialProvince(areaTemp.getId().toString());
newEntity.setSocialCity(area.getId().toString()); newEntity.setSocialCity(area.getId().toString());
newEntity.setSocialTown(null); newEntity.setSocialTown(null);
}else { } else {
newEntity.setSocialProvince(areaTemp.getParentId().toString()); newEntity.setSocialProvince(areaTemp.getParentId().toString());
newEntity.setSocialCity(areaTemp.getId().toString()); newEntity.setSocialCity(areaTemp.getId().toString());
newEntity.setSocialTown(area.getId().toString()); newEntity.setSocialTown(area.getId().toString());
} }
}else { } else {
return true; return true;
} }
return false; return false;
...@@ -948,37 +1480,47 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -948,37 +1480,47 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 验证数据完整性 * 验证数据完整性
* @Author huyc *
* @Date 2022-07-18
* @param listInfo * @param listInfo
* @param errorList * @param errorList
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private boolean dataCheck(List<TPreDispatchInfo> listInfo, List<ErrorMessage> errorList, private boolean dataCheck(List<TPreDispatchInfo> listInfo, List<ErrorMessage> errorList,
Map<String, SysArea> areaHashMap, Map<String, SysArea> areaHashMap,
Map<String,SysArea> areaIdMap) { Map<String, SysArea> areaIdMap) {
return dataCheckSub(listInfo, errorList, areaHashMap, areaIdMap); return dataCheckSub(listInfo, errorList, areaHashMap, areaIdMap);
} }
private boolean dataCheckDepart(List<ErrorMessage> errorList, R<TSettleDomainSelectVo> domainR) {
if (null == domainR || null == domainR.getData()) {
errorList.add(new ErrorMessage(-1, "访问员工基础服务异常:"));
return true;
}
return false;
}
/** /**
* 初始化区域 及验证 待处理数据是否空 * 初始化区域 及验证 待处理数据是否空
* @Author huyc *
* @Date 2022-07-18
* @param listInfo * @param listInfo
* @param errorList * @param errorList
* @param areaHashMap * @param areaHashMap
* @param areaIdMap * @param areaIdMap
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private boolean dataCheckSub(List<TPreDispatchInfo> listInfo, List<ErrorMessage> errorList, private boolean dataCheckSub(List<TPreDispatchInfo> listInfo, List<ErrorMessage> errorList,
Map<String, SysArea> areaHashMap, Map<String, SysArea> areaIdMap) { Map<String, SysArea> areaHashMap, Map<String, SysArea> areaIdMap) {
if (null == listInfo || listInfo.isEmpty()){ if (null == listInfo || listInfo.isEmpty()) {
errorList.add(new ErrorMessage(-1, CommonConstants.DATA_CAN_NOT_EMPTY)); errorList.add(new ErrorMessage(-1, CommonConstants.DATA_CAN_NOT_EMPTY));
return true; return true;
} }
R<List<SysArea>> areaListR = UpmsDaprUtils.getAreaListR(); R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS){ if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
errorList.add(new ErrorMessage(-1, PreDispatchConstants.GET_AREA_INFO)); errorList.add(new ErrorMessage(-1, PreDispatchConstants.GET_AREA_INFO));
return true; return true;
} }
...@@ -987,28 +1529,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -987,28 +1529,21 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return false; return false;
} }
private boolean dataCheckDepart(List<ErrorMessage> errorList,R<TSettleDomainSelectVo> domainR) {
if (null == domainR || null == domainR.getData()){
errorList.add(new ErrorMessage(-1, "访问员工基础服务异常:"));
return true;
}
return false;
}
/** /**
* 派增验重 * 派增验重
* @Author huyc *
* @Date 2022-07-18
* @param errorList * @param errorList
* @param existsMap * @param existsMap
* @param i * @param i
* @param info * @param info
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private boolean checkAddRepeat(List<ErrorMessage> errorList, HashMap<String, TPreDispatchInfo> existsMap, int i, TPreDispatchInfo info) { private boolean checkAddRepeat(List<ErrorMessage> errorList, HashMap<String, TPreDispatchInfo> existsMap, int i, TPreDispatchInfo info) {
TPreDispatchInfo exists; TPreDispatchInfo exists;
exists = existsMap.get(info.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+info.getPayAddress()); exists = existsMap.get(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress());
if (null != exists){ if (null != exists) {
errorList.add(new ErrorMessage(i, PreDispatchConstants.EXISTS_SAME_EMPIDCARD_ADD)); errorList.add(new ErrorMessage(i, PreDispatchConstants.EXISTS_SAME_EMPIDCARD_ADD));
return true; return true;
} }
...@@ -1017,11 +1552,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1017,11 +1552,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 一大波校验 有问题的标记派单 * 一大波校验 有问题的标记派单
* @Author huyc *
* @Date 2022-07-18
* @param info * @param info
* @param type 0 派增校验 1 派减校验 * @param type 0 派增校验 1 派减校验
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private String checkBatchSave(TPreDispatchInfo info, String type) { private String checkBatchSave(TPreDispatchInfo info, String type) {
String res = null; String res = null;
...@@ -1032,7 +1568,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1032,7 +1568,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setExceptionContent(res); info.setExceptionContent(res);
return res; return res;
} }
if (CommonConstants.ZERO_STRING.equals(type)){ if (CommonConstants.ZERO_STRING.equals(type)) {
// 派增验证 // 派增验证
res = checkAddPreDispatch(info); res = checkAddPreDispatch(info);
if (res != null) { if (res != null) {
...@@ -1041,7 +1577,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1041,7 +1577,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return res; return res;
} }
} }
if (CommonConstants.ONE_STRING.equals(type)){ if (CommonConstants.ONE_STRING.equals(type)) {
// 派减验证 // 派减验证
res = checkReducePreDispatch(info); res = checkReducePreDispatch(info);
if (res != null) { if (res != null) {
...@@ -1055,14 +1591,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1055,14 +1591,14 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
private void initBatchAreaAdd(HashMap<String, SysArea> areaHashMap, HashMap<String, SysArea> areaIdMap, TPreDispatchInfo info) { private void initBatchAreaAdd(HashMap<String, SysArea> areaHashMap, HashMap<String, SysArea> areaIdMap, TPreDispatchInfo info) {
R<Boolean> x; R<Boolean> x;
x = handleSocialAreaAdd(areaHashMap,areaIdMap,info,info.getPensionAddress()); x = handleSocialAreaAdd(areaHashMap, areaIdMap, info, info.getPensionAddress());
if (null != x){ if (null != x) {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg()); info.setExceptionContent(x.getMsg());
return; return;
} }
x = handleFundAreaAdd(areaHashMap,areaIdMap,info, info.getFundAddress()); x = handleFundAreaAdd(areaHashMap, areaIdMap, info, info.getFundAddress());
if (null != x){ if (null != x) {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(x.getMsg()); info.setExceptionContent(x.getMsg());
} }
...@@ -1070,74 +1606,78 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1070,74 +1606,78 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 批量新增 区域数据封装 * 批量新增 区域数据封装
* @Author huyc *
* @Date 2022-07-18
* @param areaMap * @param areaMap
* @param areaIdMap * @param areaIdMap
* @param entity * @param entity
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private R<Boolean> handleSocialAreaAdd(Map<String, SysArea> areaMap, private R<Boolean> handleSocialAreaAdd(Map<String, SysArea> areaMap,
Map<String,SysArea> areaIdMap, TPreDispatchInfo entity,String address) { Map<String, SysArea> areaIdMap, TPreDispatchInfo entity, String address) {
// 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据 // 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据
if (Common.isNotNull(address)){ if (Common.isNotNull(address)) {
return initSocialArea(areaMap, areaIdMap, entity,address.trim()); return initSocialArea(areaMap, areaIdMap, entity, address.trim());
} }
return null; return null;
} }
/** /**
* 处理公积金的地市数据 * 处理公积金的地市数据
* @Author huyc *
* @Date 2022-07-18
* @param areaMap * @param areaMap
* @param areaIdMap * @param areaIdMap
* @param entity * @param entity
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private R<Boolean> handleFundAreaAdd(Map<String, SysArea> areaMap, private R<Boolean> handleFundAreaAdd(Map<String, SysArea> areaMap,
Map<String, SysArea> areaIdMap, TPreDispatchInfo entity,String address) { Map<String, SysArea> areaIdMap, TPreDispatchInfo entity, String address) {
// 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据 // 为空由更新语句清空缴纳地 不为空且有变化的要重新获取数据
if (Common.isNotNull(address)){ if (Common.isNotNull(address)) {
return initFundArea(areaMap, areaIdMap, entity,address.trim()); return initFundArea(areaMap, areaIdMap, entity, address.trim());
} }
return null; return null;
} }
/** /**
* 初始化地市派单日 * 初始化地市派单日
* @Author huyc *
* @Date 2022-07-18
* @param dayConfMap * @param dayConfMap
* @param info * @param info
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void initDayLimit(HashMap<String, Integer> dayConfMap, TPreDispatchInfo info) { private void initDayLimit(HashMap<String, Integer> dayConfMap, TPreDispatchInfo info) {
if (Common.isNotNull(info.getSocialProvince())){ if (Common.isNotNull(info.getSocialProvince())) {
info.setDayLimit(dayConfMap.get(Common.isBlankToNullString(info.getSocialProvince())+ info.setDayLimit(dayConfMap.get(Common.isBlankToNullString(info.getSocialProvince()) +
CommonConstants.DOWN_LINE_STRING+ Common.isBlankToNullString(info.getSocialCity())+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialCity()) +
CommonConstants.DOWN_LINE_STRING+ Common.isBlankToNullString(info.getSocialTown()))); CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialTown())));
}else if (Common.isNotNull(info.getFundProvince())){ } else if (Common.isNotNull(info.getFundProvince())) {
info.setDayLimit(dayConfMap.get(Common.isBlankToNullString(info.getFundProvince())+ info.setDayLimit(dayConfMap.get(Common.isBlankToNullString(info.getFundProvince()) +
CommonConstants.DOWN_LINE_STRING+ Common.isBlankToNullString(info.getFundCity())+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundCity()) +
CommonConstants.DOWN_LINE_STRING+ Common.isBlankToNullString(info.getFundTown()))); CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundTown())));
} }
} }
/** /**
* 检查缴纳地对应的补缴时间是否合法 * 检查缴纳地对应的补缴时间是否合法
* @Author huyc *
* @Date 2022-07-18
* @param baseSocialSetMap * @param baseSocialSetMap
* @param baseFundSetMap * @param baseFundSetMap
* @param temp * @param temp
* @param info * @param info
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void checkStartTime(Map<String, SysBaseSetInfo> baseSocialSetMap, private void checkStartTime(Map<String, SysBaseSetInfo> baseSocialSetMap,
Map<String, SysBaseSetInfo> baseFundSetMap, Map<String, SysBaseSetInfo> baseFundSetMap,
TPreDispatchInfo temp, TPreDispatchInfo info) { TPreDispatchInfo temp, TPreDispatchInfo info) {
if (CommonConstants.ZERO_STRING.equals(info.getType())){ if (CommonConstants.ZERO_STRING.equals(info.getType())) {
// 社保地址或缴纳时间变更 要重新校验 // 社保地址或缴纳时间变更 要重新校验
checkSocialStartTime(baseSocialSetMap, temp, info); checkSocialStartTime(baseSocialSetMap, temp, info);
// 公积金缴纳地或缴纳时间变更 要重新校验 // 公积金缴纳地或缴纳时间变更 要重新校验
...@@ -1147,11 +1687,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1147,11 +1687,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 校验社保起缴时间 * 校验社保起缴时间
* @Author huyc *
* @Date 2022-07-18
* @param baseSocialSetMap * @param baseSocialSetMap
* @param temp * @param temp
* @param info * @param info
* @Author huyc
* @Date 2022-07-18
*/ */
private void checkSocialStartTime(Map<String, SysBaseSetInfo> baseSocialSetMap, TPreDispatchInfo temp, TPreDispatchInfo info) { private void checkSocialStartTime(Map<String, SysBaseSetInfo> baseSocialSetMap, TPreDispatchInfo temp, TPreDispatchInfo info) {
boolean flag; boolean flag;
...@@ -1161,19 +1702,19 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1161,19 +1702,19 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
flag = Common.isNotNull(info.getPensionAddress()) && flag = Common.isNotNull(info.getPensionAddress()) &&
Common.isNotNull(info.getPensionStart()) && Common.isNotNull(info.getPensionStart()) &&
Common.isNotNull(baseSocialSetMap); Common.isNotNull(baseSocialSetMap);
if (null != temp){ if (null != temp) {
flag = flag && (!info.getPensionAddress().equals(temp.getPensionAddress()) || flag = flag && (!info.getPensionAddress().equals(temp.getPensionAddress()) ||
!info.getPensionStart().equals(temp.getPensionStart())); !info.getPensionStart().equals(temp.getPensionStart()));
} }
if (flag){ if (flag) {
dateTime = LocalDateTimeUtils.dateOfYearAndMonth(info.getPensionStart(),LocalDateTimeUtils.DATE_SHORT_PATTERN); dateTime = LocalDateTimeUtils.dateOfYearAndMonth(info.getPensionStart(), LocalDateTimeUtils.DATE_SHORT_PATTERN);
if (null != dateTime){ if (null != dateTime) {
socialBaseSetInfo = baseSocialSetMap.get(LocalDateTimeUtils.formatTime(dateTime, ValidityConstants.DATEFORMAT3_PATTERN) socialBaseSetInfo = baseSocialSetMap.get(LocalDateTimeUtils.formatTime(dateTime, ValidityConstants.DATEFORMAT3_PATTERN)
+ CommonConstants.DOWN_LINE_STRING + info.getSocialHouseAdd() + CommonConstants.DOWN_LINE_STRING + info.getSocialHouseAdd()
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialProvince()) + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialProvince())
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialCity()) + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialCity())
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialTown())); + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getSocialTown()));
str = checkSocialStartDate(info,socialBaseSetInfo); str = checkSocialStartDate(info, socialBaseSetInfo);
if (null != str) { if (null != str) {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(str); info.setExceptionContent(str);
...@@ -1184,12 +1725,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1184,12 +1725,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 公积金缴纳地或缴纳时间变更要重新校验 * 公积金缴纳地或缴纳时间变更要重新校验
* @Author huyc *
* @Date 2022-07-18
* @param baseFundSetMap * @param baseFundSetMap
* @param temp * @param temp
* @param info * @param info
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void checkFundStartTime(Map<String, SysBaseSetInfo> baseFundSetMap, TPreDispatchInfo temp, TPreDispatchInfo info) { private void checkFundStartTime(Map<String, SysBaseSetInfo> baseFundSetMap, TPreDispatchInfo temp, TPreDispatchInfo info) {
boolean flag; boolean flag;
...@@ -1199,19 +1741,19 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1199,19 +1741,19 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
flag = Common.isNotNull(info.getFundStart()) && flag = Common.isNotNull(info.getFundStart()) &&
Common.isNotNull(info.getFundAddress()) && Common.isNotNull(info.getFundAddress()) &&
Common.isNotNull(baseFundSetMap); Common.isNotNull(baseFundSetMap);
if (null != temp){ if (null != temp) {
flag = flag && (!info.getFundAddress().equals(temp.getFundAddress()) || flag = flag && (!info.getFundAddress().equals(temp.getFundAddress()) ||
!info.getFundStart().equals(temp.getFundStart())); !info.getFundStart().equals(temp.getFundStart()));
} }
if (flag){ if (flag) {
dateTime = LocalDateTimeUtils.dateOfYearAndMonth(info.getFundStart(),LocalDateTimeUtils.DATE_SHORT_PATTERN); dateTime = LocalDateTimeUtils.dateOfYearAndMonth(info.getFundStart(), LocalDateTimeUtils.DATE_SHORT_PATTERN);
if (null != dateTime){ if (null != dateTime) {
fundBaseSetIfno = baseFundSetMap.get(LocalDateTimeUtils.formatTime(dateTime, ValidityConstants.DATEFORMAT3_PATTERN) fundBaseSetIfno = baseFundSetMap.get(LocalDateTimeUtils.formatTime(dateTime, ValidityConstants.DATEFORMAT3_PATTERN)
+ CommonConstants.DOWN_LINE_STRING + info.getFundHouseAdd() + CommonConstants.DOWN_LINE_STRING + info.getFundHouseAdd()
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundProvince()) + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundProvince())
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundCity()) + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundCity())
+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundTown())); + CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(info.getFundTown()));
str = checkFundStartDate(info,fundBaseSetIfno); str = checkFundStartDate(info, fundBaseSetIfno);
if (null != str) { if (null != str) {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
info.setExceptionContent(str); info.setExceptionContent(str);
...@@ -1221,12 +1763,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1221,12 +1763,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
private void initDayConfMap(HashMap<String, Integer> dayConfMap) { private void initDayConfMap(HashMap<String, Integer> dayConfMap) {
List<TDispatchDayConf> dayConfList = dispatchDayConfMapper.selectList(Wrappers.<TDispatchDayConf>query().lambda()); List<TDispatchDayConf> dayConfList = dispatchDayConfMapper.selectList(Wrappers.<TDispatchDayConf>query().lambda());
if (Common.isNotNull(dayConfList)){ if (Common.isNotNull(dayConfList)) {
for (TDispatchDayConf conf:dayConfList){ for (TDispatchDayConf conf : dayConfList) {
dayConfMap.put(Common.isBlankToNullString(conf.getProvince())+ dayConfMap.put(Common.isBlankToNullString(conf.getProvince()) +
CommonConstants.DOWN_LINE_STRING+Common.isBlankToNullString(conf.getCity())+ CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(conf.getCity()) +
CommonConstants.DOWN_LINE_STRING+Common.isBlankToNullString(conf.getTown()),conf.getDay()); CommonConstants.DOWN_LINE_STRING + Common.isBlankToNullString(conf.getTown()), conf.getDay());
} }
} }
...@@ -1234,36 +1776,37 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1234,36 +1776,37 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 通过身份证+派单类型 确定是否唯一(创建时间为当月的) * 通过身份证+派单类型 确定是否唯一(创建时间为当月的)
* @Author huyc *
* @Date 2022-07-18
* @param listInfo * @param listInfo
* @param existsMap * @param existsMap
* @param type 0 派增 1 派减 * @param type 0 派增 1 派减
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void initExistsMapByIdCards(List<TPreDispatchInfo> listInfo, private void initExistsMapByIdCards(List<TPreDispatchInfo> listInfo,
Map<String,TPreDispatchInfo> existsMap,String type) { Map<String, TPreDispatchInfo> existsMap, String type) {
List<String> idcards = new ArrayList<>(); List<String> idcards = new ArrayList<>();
if (Common.isNotNull(listInfo)) { if (Common.isNotNull(listInfo)) {
for (TPreDispatchInfo info:listInfo){ for (TPreDispatchInfo info : listInfo) {
idcards.add(info.getEmpIdcard()); idcards.add(info.getEmpIdcard());
} }
} }
// 初始化要更新的数据MAP // 初始化要更新的数据MAP
initExistsMapByIdCards(existsMap, idcards,type); initExistsMapByIdCards(existsMap, idcards, type);
} }
private void initExistsMapByIdCards(Map<String, TPreDispatchInfo> existsMap, List<String> idcards, String type) { private void initExistsMapByIdCards(Map<String, TPreDispatchInfo> existsMap, List<String> idcards, String type) {
if (Common.isNotNull(idcards)){ if (Common.isNotNull(idcards)) {
List<TPreDispatchInfo> preDispatchInfoList = baseMapper.selectList(Wrappers.<TPreDispatchInfo>query() List<TPreDispatchInfo> preDispatchInfoList = baseMapper.selectList(Wrappers.<TPreDispatchInfo>query()
.lambda().in(TPreDispatchInfo::getEmpIdcard,idcards) .lambda().in(TPreDispatchInfo::getEmpIdcard, idcards)
.eq(TPreDispatchInfo::getStatus,CommonConstants.ZERO_STRING) .eq(TPreDispatchInfo::getStatus, CommonConstants.ZERO_STRING)
.ne(TPreDispatchInfo::getPreStatus,CommonConstants.TWO_STRING) .ne(TPreDispatchInfo::getPreStatus, CommonConstants.TWO_STRING)
.eq(TPreDispatchInfo::getType,type) .eq(TPreDispatchInfo::getType, type)
.ge(TPreDispatchInfo::getCreateTime,LocalDateTimeUtils.firstdayOfMonth(LocalDateTime.now()))); .ge(TPreDispatchInfo::getCreateTime, LocalDateTimeUtils.firstdayOfMonth(LocalDateTime.now())));
if (Common.isNotNull(preDispatchInfoList)){ if (Common.isNotNull(preDispatchInfoList)) {
for (TPreDispatchInfo info:preDispatchInfoList){ for (TPreDispatchInfo info : preDispatchInfoList) {
existsMap.put(info.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+info.getPayAddress(),info); existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
} }
} }
} }
...@@ -1271,63 +1814,316 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1271,63 +1814,316 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
/** /**
* 初始化社保公积金基数 * 初始化社保公积金基数
* @Author huyc *
* @Date 2022-07-18
* @param listInfo * @param listInfo
* @param baseSocialSetMap * @param baseSocialSetMap
* @param baseFundSetMap * @param baseFundSetMap
* @param baseSocialTimeMap * @param baseSocialTimeMap
* @param baseFundTimeMap * @param baseFundTimeMap
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void initSocialAndFundBaseSet(List<TPreDispatchInfo> listInfo, private void initSocialAndFundBaseSet(List<TPreDispatchInfo> listInfo,
Map<String, SysBaseSetInfo> baseSocialSetMap, Map<String, SysBaseSetInfo> baseSocialSetMap,
Map<String, SysBaseSetInfo> baseFundSetMap, Map<String, SysBaseSetInfo> baseFundSetMap,
Map<String, TPreDispatchInfo> baseSocialTimeMap, Map<String, TPreDispatchInfo> baseSocialTimeMap,
Map<String, TPreDispatchInfo> baseFundTimeMap) { Map<String, TPreDispatchInfo> baseFundTimeMap) {
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
if (Common.isNotNull(listInfo)) { if (Common.isNotNull(listInfo)) {
for (TPreDispatchInfo info:listInfo){ for (TPreDispatchInfo info : listInfo) {
if (Common.isNotNull(info.getPensionStart())){ if (Common.isNotNull(info.getPensionStart())) {
baseSocialTimeMap.put(info.getPensionStart(),info); baseSocialTimeMap.put(info.getPensionStart(), info);
} }
if (Common.isNotNull(info.getFundStart())){ if (Common.isNotNull(info.getFundStart())) {
baseFundTimeMap.put(info.getFundStart(),info); baseFundTimeMap.put(info.getFundStart(), info);
} }
idList.add(info.getId()); idList.add(info.getId());
} }
} }
// 初始化社保和公积金配置数据 // 初始化社保和公积金配置数据
initBaseSetMap(baseSocialTimeMap,baseFundTimeMap,baseSocialSetMap,baseFundSetMap); initBaseSetMap(baseSocialTimeMap, baseFundTimeMap, baseSocialSetMap, baseFundSetMap);
} }
/** /**
* map数据封装 * map数据封装
* @Author huyc *
* @Date 2022-07-18
* @param settleDomainR * @param settleDomainR
* @param settleDomainNameMap * @param settleDomainNameMap
* @param customerNameMap * @param customerNameMap
* @param settleIdAndCustomerIdMap * @param settleIdAndCustomerIdMap
* @return * @return
* @Author huyc
* @Date 2022-07-18
**/ **/
private void initSettleDomainMaps(R<List<TSettleDomainSelectVo>> settleDomainR, private void initSettleDomainMaps(R<List<TSettleDomainSelectVo>> settleDomainR,
Map<String, String> settleDomainNameMap, Map<String, String> settleDomainNameMap,
Map<String, String> customerNameMap, Map<String, String> customerNameMap,
Map<String, String> settleIdAndCustomerIdMap) { Map<String, String> settleIdAndCustomerIdMap) {
List<TSettleDomainSelectVo> settleDomainList; List<TSettleDomainSelectVo> settleDomainList;
if(null != settleDomainR){ if (null != settleDomainR) {
settleDomainList = settleDomainR.getData(); settleDomainList = settleDomainR.getData();
//map数据封装 //map数据封装
if(Common.isNotNull(settleDomainList)){ if (Common.isNotNull(settleDomainList)) {
for (TSettleDomainSelectVo settleDomainSelectVo:settleDomainList){ for (TSettleDomainSelectVo settleDomainSelectVo : settleDomainList) {
settleDomainNameMap.put(settleDomainSelectVo.getId(),settleDomainSelectVo.getDepartName()); settleDomainNameMap.put(settleDomainSelectVo.getId(), settleDomainSelectVo.getDepartName());
settleIdAndCustomerIdMap.put(settleDomainSelectVo.getId(),settleDomainSelectVo.getCustomerId()); settleIdAndCustomerIdMap.put(settleDomainSelectVo.getId(), settleDomainSelectVo.getCustomerId());
if(!customerNameMap.containsKey(settleDomainSelectVo.getCustomerName())){ if (!customerNameMap.containsKey(settleDomainSelectVo.getCustomerName())) {
customerNameMap.put(settleDomainSelectVo.getCustomerId(),settleDomainSelectVo.getCustomerName()); customerNameMap.put(settleDomainSelectVo.getCustomerId(), settleDomainSelectVo.getCustomerName());
} }
} }
} }
} }
} }
/**
* 初始化派减的相关状态及数据
*
* @param selectVo
* @param info
* @return
* @Author huyc
* @Date 2022-07-18
**/
private void initReduceBaseInfo(TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setDataSubStatus(CommonConstants.ONE_STRING);
info.setStatus(CommonConstants.ZERO_STRING);
info.setPreStatus(CommonConstants.ZERO_STRING);
info.setType(CommonConstants.ONE_STRING);
// 默认社保代理 4
info.setEmpTypeAdd(CommonConstants.FOUR_STRING);
info.setPositionAdd(PreDispatchConstants.POSITION);
// 0 个人辞职 = 合同主动解除 1单位辞退 = 合同被动解除 15 死亡 = 死亡 19 其他
initLeaveReason(info);
// 默认社保代理 4
if (null != selectVo) {
info.setDepartIdAdd(selectVo.getId());
info.setDepartNameAdd(selectVo.getDepartName());
info.setUnitIdAdd(selectVo.getCustomerId());
info.setUnitNameAdd(selectVo.getCustomerName());
}
}
private void getPreAddMap(HashMap<String, String> preAddMap) {
List<TPreDispatchInfo> preList = baseMapper.selectList(Wrappers.<TPreDispatchInfo>query().lambda()
.le(TPreDispatchInfo::getCreateTime, LocalDateTime.now())
.eq(TPreDispatchInfo::getType, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getStatus, CommonConstants.ZERO_STRING)
.and(obj -> obj
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ZERO_STRING)
.or()
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ONE_STRING))
);
if (Common.isNotNull(preList)) {
for (TPreDispatchInfo info : preList) {
preAddMap.put(info.getEmpIdcard(), info.getEmpIdcard());
}
}
}
/**
* 封装需要派减的社保或公积金信息
*
* @param preList
* @param socialMap
* @param fundMap
* @return
* @Author huyc
* @Date 2022-07-18
**/
private void initReduceSocialFundInfo(List<TPreDispatchInfo> preList, HashMap<String, TSocialInfo> socialMap, HashMap<String, TProvidentFund> fundMap) {
List<String> socialReduceCards = new ArrayList<>();
List<String> fundReduceCards = new ArrayList<>();
// 初始化社保公积金
initReduceInfo(preList, socialReduceCards, fundReduceCards);
List<TSocialInfo> socialInfoList = null;
List<TProvidentFund> fundList = null;
if (Common.isNotNull(socialReduceCards)) {
socialInfoList = socialInfoMapper.selectList(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getAuditStatus, CommonConstants.ONE_STRING)
.and(obj -> obj.eq(TSocialInfo::getHandleStatus, CommonConstants.ONE_STRING)
.or().eq(TSocialInfo::getHandleStatus, CommonConstants.FIVE_STRING))
.eq(TSocialInfo::getReduceCan, CommonConstants.ZERO_STRING)
.eq(TSocialInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.in(TSocialInfo::getEmpIdcard, socialReduceCards));
}
if (Common.isNotNull(fundReduceCards)) {
fundList = providentFundMapper.selectList(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getHandleStatus, CommonConstants.ONE_STRING)
.eq(TProvidentFund::getReduceCan, CommonConstants.ZERO_STRING)
.eq(TProvidentFund::getDeleteFlag, CommonConstants.ZERO_STRING)
.in(TProvidentFund::getEmpIdcard, fundReduceCards));
}
if (Common.isNotNull(socialInfoList)) {
for (TSocialInfo social : socialInfoList) {
socialMap.put(social.getEmpIdcard(), social);
}
}
if (Common.isNotNull(fundList)) {
for (TProvidentFund fund : fundList) {
fundMap.put(fund.getEmpIdcard(), fund);
}
}
}
/**
* 初始化社保公积金
*
* @param preList
* @param socialReduceCards
* @param fundReduceCards
* @return
* @Author huyc
* @Date 2022-07-18
**/
private void initReduceInfo(List<TPreDispatchInfo> preList, List<String> socialReduceCards, List<String> fundReduceCards) {
for (TPreDispatchInfo info : preList) {
if (CommonConstants.ONE_STRING.equals(info.getType())) {
if (Common.isNotNull(info.getPensionAddressReduce())) {
socialReduceCards.add(info.getEmpIdcard());
}
if (Common.isNotNull(info.getFundAddressReduce())) {
fundReduceCards.add(info.getEmpIdcard());
}
}
}
}
/**
* 不需要派单的数据过滤
* @param pre
* @return
* @Author huyc
* @Date 2022-07-18
**/
private boolean checkLimit(TPreDispatchInfo pre) {
// 当月创建的大于 限制日期的不派单 放在次月派单 本月之前的数据正常派单
if (null != pre.getDayLimit() && pre.getCreateTime().getDayOfMonth() > pre.getDayLimit().intValue() &&
LocalDateTime.now().getMonthValue() == pre.getCreateTime().getMonthValue()) {
return true;
}
// 当派减时间为次月之后的月份 不做处理 放到次月及之后派单
if (Common.isNotNull(pre.getFundEndReduce()) && checkMonthForReduce(pre.getFundEndReduce())) {
return true;
}
return Common.isNotNull(pre.getPensionEndReduce()) && checkMonthForReduce(pre.getPensionEndReduce());
}
private boolean checkMonthForReduce(String value1) {
try {
return (Integer.parseInt(DateUtil.getYearAndMonth(value1, -1))) >
Integer.parseInt((DateUtil.getYearAndMonth(LocalDateTime.now(), CommonConstants.ZERO_INT)));
} catch (Exception e) {
return false;
}
}
/**
* 重新组装数据
* @param pre
* @param errorMessageList
* @param errorMsgList
* @param i
* @return
* @Author huyc
* @Date 2022-07-18
**/
private void resetMessageList(TPreDispatchInfo pre,
List<ErrorMessage> errorMessageList,
List<ErrorMessage> errorMsgList, int i) {
if (Common.isNotNull(errorMessageList)) {
for (ErrorMessage errorMessage : errorMessageList) {
errorMsgList.add(new ErrorMessage(i,
pre.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage()));
}
}
}
/**
* 处理派单结果
* @param preInfo
* @param errorMessageList
* @return
* @Author huyc
* @Date 2022-07-18
**/
private R<Boolean> handleDispatchAddRes(TPreDispatchInfo preInfo, List<ErrorMessage> errorMessageList) {
if (Common.isEmpty(errorMessageList)) {
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.PREDISPATCH_EXCEPTION);
}
ErrorMessage errorMessage = errorMessageList.get(CommonConstants.ZERO_INT);
if (null != errorMessage) {
if (errorMessage.getMessage().indexOf(PreDispatchConstants.DISPATCH_ADD_SUCCESS) >= CommonConstants.ZERO_INT) {
preInfo.setPreStatus(CommonConstants.TWO_STRING);
preInfo.setExceptionContent(CommonConstants.EMPTY_STRING);
baseMapper.updatePreStatusById(preInfo);
return R.ok(null, preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.DISPATCH_ADD_SUCCESS);
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(errorMessage.getMessage());
baseMapper.updatePreStatusById(preInfo);
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage());
}
}
return null;
}
private R<Boolean> handleBatchSocialFundReduce(TPreDispatchInfo preInfo,
TDispatchInfo dispatchInfo, TSocialInfo social, TProvidentFund fund) {
if (Common.isEmpty(preInfo.getSocialProvince()) && Common.isEmpty(preInfo.getFundProvince())) {
return R.failed("请检查派减缴纳地是否准确!");
}
if (Common.isNotNull(preInfo.getSocialProvince())) {
if (null != social) {
dispatchInfo.setSettleDomain(social.getSettleDomain());
dispatchInfo.setBelongUnit(social.getBelongUnit());
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(PreDispatchConstants.NO_SOCIAL_CAN_REDUCE);
baseMapper.updatePreStatusById(preInfo);
return R.failed(PreDispatchConstants.NO_SOCIAL_CAN_REDUCE);
}
}
if (Common.isNotNull(preInfo.getFundProvince())) {
if (null != fund) {
dispatchInfo.setSettleDomain(fund.getSettleDomain());
dispatchInfo.setBelongUnit(fund.getBelongUnit());
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(PreDispatchConstants.NO_FUND_CAN_REDUCE);
baseMapper.updatePreStatusById(preInfo);
return R.failed(PreDispatchConstants.NO_FUND_CAN_REDUCE);
}
}
return null;
}
/**
* 派减派单时间处理
* @param dispatchInfo
* @param pre
* @Author huyc
* @Date 2022-07-18
* @return
**/
private void dispatchReduce(TDispatchInfo dispatchInfo, TPreDispatchInfo pre) {
if (Common.isNotNull(pre.getPensionEndReduce())) {
dispatchInfo.setSocialReduceDate(DateUtil.getFirstDay(pre.getPensionEndReduce()));
}
if (Common.isNotNull(pre.getFundEndReduce())) {
dispatchInfo.setFundReduceDate(DateUtil.getFirstDay(pre.getFundEndReduce()));
}
if (null != pre.getLeaveDate()) {
dispatchInfo.setLeaveDate(pre.getLeaveDate());
}
}
} }
...@@ -233,6 +233,13 @@ ...@@ -233,6 +233,13 @@
</sql> </sql>
<sql id="tPreDispatchInfo_where"> <sql id="tPreDispatchInfo_where">
<if test="tPreDispatchInfo != null"> <if test="tPreDispatchInfo != null">
<if test="tPreDispatchInfo.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tPreDispatchInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tPreDispatchInfo.idList == null">
<if test="tPreDispatchInfo.id != null and tPreDispatchInfo.id.trim() != ''"> <if test="tPreDispatchInfo.id != null and tPreDispatchInfo.id.trim() != ''">
AND a.ID = #{tPreDispatchInfo.id} AND a.ID = #{tPreDispatchInfo.id}
</if> </if>
...@@ -542,6 +549,7 @@ ...@@ -542,6 +549,7 @@
<if test="tPreDispatchInfo.updateTime != null"> <if test="tPreDispatchInfo.updateTime != null">
AND a.UPDATE_TIME = #{tPreDispatchInfo.updateTime} AND a.UPDATE_TIME = #{tPreDispatchInfo.updateTime}
</if> </if>
</if>
</if> </if>
</sql> </sql>
<!--tPreDispatchInfo简单分页查询--> <!--tPreDispatchInfo简单分页查询-->
......
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