Commit 3e6e75da authored by hongguangwu's avatar hongguangwu

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

parents cff2366e 84c5b112
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -110,12 +111,14 @@ public class TEmployeeContractInfo extends BaseEntity {
@NotBlank(message = "合同起始时间不能为空")
@ExcelAttribute(name = "合同起始时间", needExport = true)
@Schema(description = "合同起始时间", name = "contractStart")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private Date contractStart;
/**
* 合同到期时间
*/
@ExcelAttribute(name = "合同到期时间", needExport = true)
@Schema(description = "合同到期时间", name = "contractEnd")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private Date contractEnd;
/**
* 项目名称
......@@ -204,6 +207,7 @@ public class TEmployeeContractInfo extends BaseEntity {
*/
@ExcelAttribute(name = "入职日期")
@Schema(description = "入职日期", name = "enjoinDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime enjoinDate;
/**
......@@ -291,12 +295,14 @@ public class TEmployeeContractInfo extends BaseEntity {
*/
@ExcelAttribute(name = "试用期开始时间")
@Schema(description = "合同试用期开始时间", name = "periodStart")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date periodStart;
/**
* 合同试用期结束时间
*/
@ExcelAttribute(name = "试用期结束时间")
@Schema(description = "合同试用期结束时间", name = "periodEnd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date periodEnd;
/**
* 试用期工资元/月
......
......@@ -160,4 +160,44 @@ public class EmpContractDispatchVo implements Serializable {
@ExcelAttribute(name = "备注", maxLength = 200)
@Schema(description = "备注", name = "remark")
private String remark;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "")
@Schema(description = "档案-省", name = "fileProvince")
private Integer fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince")
@Schema(description = "档案-市", name = "fileCity")
private Integer fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity")
@Schema(description = "档案-县", name = "fileTown")
private Integer fileTown;
/**
* 客户id
*/
@Schema(description = "客户id")
private String customerId;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String unitNo;
/**
* 项目
*/
@NotBlank(message = "项目不能为空")
@Length(max = 32, message = "项目不能超过32个字符")
@ExcelAttribute(name = "项目", errorInfo = "项目不能为空", isOrgan = true, maxLength = 32)
@Schema(description = "项目", name = "settleDomain")
private String settleDomain;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -9,6 +13,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @Author fxj
......@@ -97,4 +102,73 @@ public class EmpProjectDispatchVo implements Serializable {
@Schema(description ="员工项目编码")
@Size(max = 20, message = "员工项目编码不可超过20位")
private String empNo;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
/**
* 创建者
*/
@Schema(description = "创建人")
@TableField(fill = FieldFill.INSERT)
@ExcelIgnore
private String createBy;
/**
* 业务类型一级分类
*/
@Schema(description ="业务类型一级分类")
private String businessPrimaryType;
/**
* 业务类型二级分类
*/
@Schema(description ="业务类型二级分类")
private String businessSecondType;
/**
* 业务类型三级分类
*/
@Schema(description ="业务类型三级分类")
private String businessThirdType;
/**
* 客户id
*/
@Schema(description ="客户id")
private String unitId;
/**
* 客户名称
*/
@Schema(description ="客户名称")
private String unitName;
/**
* 客户编码
*/
@Schema(description ="客户编码")
private String unitNo;
/**
* 社保-省
*/
@Schema(description = "社保-省")
private Integer socialProvince;
/**
* 社保-市
*/
@Schema(description = "社保-市")
private Integer socialCity;
/**
* 社保-县
*/
@Schema(description = "社保-县")
private Integer socialTown;
}
......@@ -60,5 +60,27 @@ public class ProjectSetInfoVo implements Serializable {
@Schema(description = "商险结算类型")
private String insuranceSettleType = CommonConstants.ONE_STRING;
/**
* 业务类型一级分类
*/
@Schema(description ="业务类型一级分类")
private String businessPrimaryType;
/**
* 业务类型二级分类
*/
@Schema(description ="业务类型二级分类")
private String businessSecondType;
/**
* 业务类型三级分类
*/
@Schema(description ="业务类型三级分类")
private String businessThirdType;
/**
* 服务状态:0正常 1停止服务
*/
@Schema(description = "服务状态:0正常 1停止服务")
private String stopFlag;
}
......@@ -291,7 +291,7 @@ public class TEmployeeContractInfoController {
@Operation(summary = "通过id查询", description = "通过id查询员工合同")
@Inner
@PostMapping("/getContractById")
public R<TEmployeeContractInfo> getContractById(@RequestBody String id) {
return R.ok(tEmployeeContractInfoService.getById(id));
public TEmployeeContractInfo getContractById(@RequestBody String id) {
return tEmployeeContractInfoService.getById(id);
}
}
......@@ -2106,6 +2106,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
emp = empAddsMap.get(contract.getEmpIdcard());
if (Common.isNotNull(emp)){
contract.setEmpId(emp.getId());
contract.setEmpNatrue(emp.getEmpNatrue());
contract.setFileProvince(emp.getFileProvince());
contract.setFileCity(emp.getFileCity());
contract.setFileTown(emp.getFileTown());
}
}
contractMapper.insert(contract);
......
......@@ -198,7 +198,11 @@
a.INSURANCE_SETTLE_TYPE,
c.ID AS 'customerId',
c.CUSTOMER_NAME as 'customerName',
c.CUSTOMER_CODE as 'customerCode'
c.CUSTOMER_CODE as 'customerCode',
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.STOP_FLAG
FROM t_settle_domain a
LEFT JOIN t_customer_info c ON a.CUSTOMER_ID = c.ID
where 1=1
......
......@@ -420,6 +420,8 @@ public interface CommonConstants {
public static final int TWENTY_INT = 20;
public static final int TWENTY_ONE_STRING = 21;
public static final String ERROR_MSG_PRFIX = "error=";
public static final String SUCCESS_MSG_PREFIX = "success=";
......
......@@ -185,6 +185,12 @@ public @interface ExcelAttribute {
*/
public abstract boolean isOrgan() default false;
/**
* 是否转义,默认 true 如果是字典会转义, false不会转义值
* @return
*/
public abstract boolean isConvert() default true;
/**
* 是否为区域数据 前提:isDataId = true
* @Author fxj
......
......@@ -448,4 +448,24 @@ public interface ErrorCodes {
* 派增异常: 社保各项起缴日不一致,委托备注必填
*/
String EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR = "emp.dispatch.social.date.limit.error";
/**
* 派增异常: 社保各项起缴月份需为可补缴月份,请确认后操作
*/
String EMP_DISPATCH_SOCIAL_START_IS_ERROR = "emp.dispatch.social.start.is.error";
/**
* 派增异常: 公积金起缴月份需为可补缴月份,请确认后操作
*/
String EMP_DISPATCH_FUND_DATE_LIMIT_ERROR = "emp.dispatch.fund.start.is.error";
/**
* 派增异常: 合同相关信息不可为空
*/
String EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY = "emp.dispatch.emp.contract.not.empty";
/**
* 派增异常: 系统无对应项目档案,档案相关同色字段必填
*/
String EMP_DISPATCH_EMP_NOT_EMPTY = "emp.dispatch.emp.not.empty";
/**
* 派增异常: 对应项目编码已停止合作
*/
String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop";
}
......@@ -475,7 +475,11 @@ public class ExcelUtil <T> implements Serializable {
boolean flag = true;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(c.trim())){
if (attr.isConvert()){
tempStr = entry.getKey();
}else {
tempStr = c;
}
flag = false;
break;
}
......
......@@ -167,6 +167,15 @@ emp.dispatch.social.base.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD
emp.dispatch.social.date.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u5404\u9879\u8D77\u7F34\u65E5\u4E0D\u4E00\u81F4\uFF0C\u59D4\u6258\u5907\u6CE8\u5FC5\u586B
emp.dispatch.social.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u5404\u9879\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01
emp.dispatch.fund.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u516C\u79EF\u91D1\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01
emp.dispatch.emp.contract.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.emp.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u7CFB\u7EDF\u65E0\u5BF9\u5E94\u9879\u76EE\u6863\u6848\uFF0C\u6863\u6848\u76F8\u5173\u540C\u8272\u5B57\u6BB5\u5FC5\u586B
emp.dispatch.settleDomain.stop=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u5DF2\u505C\u6B62\u5408\u4F5C
......
......@@ -156,7 +156,7 @@ public class ArchivesDaprUtil {
public R<TEmployeeContractInfo> getContractById(String id) {
R<TEmployeeContractInfo> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeeinfo/inner/getContractById" , id, TEmployeeContractInfo.class, SecurityConstants.FROM_IN);
,"/temployeecontractinfo/getContractById" , id, TEmployeeContractInfo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取档案信息失败!");
}
......
......@@ -76,6 +76,14 @@ public class InsurancesConstants {
* 投保信息不存在
*/
public static final String DATA_IS_NOT_EXIST = "投保信息不存在";
/**
* 结算信息不存在
*/
public static final String SETTLE_DATA_IS_NOT_EXIST = "结算信息不存在";
/**
* 推送信息不存在
*/
public static final String PUSH_DATA_IS_NOT_EXIST = "推送信息不存在";
/**
* 被替换员工投保记录不存在
*/
......@@ -253,21 +261,21 @@ public class InsurancesConstants {
*/
public static final String INSURANCE_CITY_NAME_NOT_EXIST = "商险购买地市不存在";
/**
* 商险办理省名称不能为空
* 商险办理省名称不能为空
*/
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY = "商险办理省名称不能为空";
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY = "商险办理省名称不能为空";
/**
* 商险办理省不存在
* 商险办理省不存在
*/
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST = "商险办理省不存在";
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST = "商险办理省不存在";
/**
* 商险办理城市名称不能为空
* 商险办理城市名称不能为空
*/
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY = "商险办理城市名称不能为空";
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY = "商险办理城市名称不能为空";
/**
* 商险办理城市不存在
* 商险办理城市不存在
*/
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EXIST = "商险办理城市不存在";
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EXIST = "商险办理城市不存在";
/**
* 结算月不能为空
*/
......@@ -565,6 +573,12 @@ public class InsurancesConstants {
* 修改保险公司
*/
public static final String UPDATE_INSURANCE_COMPANY = "修改保险公司";
/**
* 删除保险公司
*/
public static final String DELETE_INSURANCE_COMPANY = "删除保险公司";
/**
* 新增险种
*/
......@@ -591,6 +605,38 @@ public class InsurancesConstants {
public static final String DELETE_INSURANCE_TYPE_STANDARD = "删除购买标准";
/**
* 导入减员数据
*/
public static final String INSURANCE_REFUND_IMPORT = "导入减员数据";
/**
* 导出待减员数据
*/
public static final String INSURANCE_REFUND_EXPORT = "导出待减员数据";
/**
* 减员成功
*/
public static final String INSURANCE_REFUND_SUCCESS = "减员成功";
/**
* 减员退回
*/
public static final String INSURANCE_REFUND_FAILED = "减员退回";
/**
* 变更所属项目
*/
public static final String DEPT_CHANGE = "变更所属项目";
/**
* 变更结算月
*/
public static final String MONTH_CHANGE = "变更结算月";
}
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -8,7 +8,7 @@ import java.io.Serializable;
/**
* @author zhaji
* @description 项目
* @description 项目信息
* @date 2022-07-29 09:35:31
*/
@Data
......@@ -26,4 +26,9 @@ public class Dept implements Serializable {
*/
@Schema(description = "项目名称")
private String projectName;
public Dept(String departNo, String departName) {
this.deptNo =departNo;
this.projectName =departName;
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author licancan
* @description EKP2INSURANCES 更新结算请求参数
* @date 2022-08-01 09:50:33
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "EKP2INSURANCES 更新结算请求参数")
public class UpdateInsuranceSettleParam implements Serializable {
private static final long serialVersionUID = 1459385763943903153L;
/**
* 结算信息
*/
@Schema(description = "结算信息")
private List<SettleData> settleData;
/**
* 推送信息
*/
@Schema(description = "推送信息")
private PushData pushData;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SettleData implements Serializable {
private static final long serialVersionUID = 4572786452410956413L;
/**
* 结算单号(唯一标识) 生成规则:商险明细id + "_" + 结算id
*/
@Schema(description = "结算单号(唯一标识)")
private String sn;
/**
* 结算状态
*/
@Schema(description = "结算状态")
private String settleStatus;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class PushData implements Serializable {
private static final long serialVersionUID = 4572786452410956413L;
/**
* 推送时间
*/
@Schema(description = "推送时间")
private LocalDateTime pushTime;
}
}
......@@ -3,7 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
......@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.core.userdetails.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -35,6 +36,20 @@ public class TInsuranceDetailController {
private TInsuranceDetailService tInsuranceDetailService;
/***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
@Operation(summary = "更新结算状态", description = "更新结算状态")
@PostMapping("/updateInsuranceSettle")
public R<String> updateInsuranceSettle(@RequestBody UpdateInsuranceSettleParam param) {
return tInsuranceDetailService.updateInsuranceSettle(param);
}
/**
* 投保办理分页查询
*
......@@ -390,4 +405,18 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.getDeptList();
}
/**
* 出险
*
* @author zhaji
* @param userName 姓名
* @param empIdcardNo 身份证
* @return {@link R<List< RefundExportListVo >>}
*/
@Operation(summary = "紧急出险", description = "紧急出险")
@GetMapping("/urgentUpdateIsUse")
public R urgentUpdateIsUse(String userName,String empIdcardNo) {
return tInsuranceDetailService.urgentUpdateIsUse(userName,empIdcardNo);
}
}
......@@ -18,6 +18,16 @@ import java.util.List;
public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
/***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
R<String> updateInsuranceSettle(UpdateInsuranceSettleParam param);
/**
* 投保办理分页查询
*
......@@ -266,4 +276,14 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
R getDeptList();
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
R urgentUpdateIsUse(String userName, String empIdcardNo);
}
......@@ -5,23 +5,24 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
......@@ -35,15 +36,34 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
@Resource
private TInsuranceDetailService insuranceDetailService;
private TInsuranceDetailService tInsuranceDetailService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/**
* 分页查询保险公司
*
* @author zhaji
* @param page 分页参数
* @param insuranceCompany 查询类
* @return {@link IPage< TInsuranceCompany>}
*/
@Override
public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) {
LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(TInsuranceCompany::getCreateTime);
return this.baseMapper.selectPage(page,wrapper);
IPage<TInsuranceCompany> list = this.baseMapper.selectPage(page, wrapper);
return list;
}
/**
* 新增保险公司
*
* @author zhaji
* @param insuranceCompany 新增类
* @return {@link R}
*/
@Override
public R saveInsuranceCompany(TInsuranceCompany insuranceCompany) {
if(Common.isEmpty(insuranceCompany)){
......@@ -63,9 +83,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany.setCreateName(user.getNickname());
insuranceCompany.setCreateTime(LocalDateTime.now());
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
return R.ok(save(insuranceCompany),"新增成功");
save(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.DELETE_INSURANCE_COMPANY);
return R.ok("新增成功");
}else{
return R.failed("当前保险公司已存在");
return R.failed("保险公司名称不能重复添加");
}
}
......@@ -104,7 +126,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
LambdaQueryWrapper<TInsuranceDetail> detailQueryWrapper = new LambdaQueryWrapper<>();
detailQueryWrapper.eq(TInsuranceDetail::getInsuranceCompanyName,companyName)
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(detailQueryWrapper);
List<TInsuranceDetail> list = tInsuranceDetailService.list(detailQueryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前保险公司的名称已存在对应的商险信息,不能进行修改");
}else{
......@@ -119,7 +141,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
}else{
insuranceCompany.setUpdateBy(user.getId());
insuranceCompany.setUpdateTime(LocalDateTime.now());
return R.ok(updateById(insuranceCompany));
updateById(insuranceCompany);
addOperate(one,user, InsurancesConstants.UPDATE_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
}
}
/**
......@@ -143,10 +167,36 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
.set(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.set(TInsuranceCompany :: getUpdateBy,user.getId())
.set(TInsuranceCompany :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper));
update(updateWrapper);
addOperate(one,user, InsurancesConstants.DELETE_INSURANCE_COMPANY);
return R.ok("删除成功");
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceCompany 保险公司
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceCompany insuranceCompany,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceCompany.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
/**
* 查询当前保险公司列表
*
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -79,6 +80,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @param param
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> updateInsuranceSettle(UpdateInsuranceSettleParam param) {
if(!Optional.ofNullable(param).isPresent()){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
if (CollectionUtils.isEmpty(param.getSettleData())){
return R.failed(InsurancesConstants.SETTLE_DATA_IS_NOT_EXIST);
}
if (!Optional.ofNullable(param.getPushData()).isPresent()){
return R.failed(InsurancesConstants.PUSH_DATA_IS_NOT_EXIST);
}
try {
LocalDateTime pushTime = param.getPushData().getPushTime();
List<UpdateInsuranceSettleParam.SettleData> settleData = param.getSettleData();
List<TInsuranceSettle> list = new ArrayList<>();
for (UpdateInsuranceSettleParam.SettleData settleDatum : settleData) {
TInsuranceSettle settle = new TInsuranceSettle();
String settleId = settleDatum.getSn().split("_")[1];
settle.setId(settleId);
settle.setUpdateTime(pushTime);
settle.setSettleHandleStatus(settleDatum.getSettleStatus());
if (CommonConstants.THREE_STRING.equals(settleDatum.getSettleStatus())){
settle.setSettleDoneTime(pushTime);
}
list.add(settle);
}
if (CollectionUtils.isNotEmpty(list)){
tInsuranceSettleService.saveOrUpdateBatch(list);
}
}catch (Exception e){
e.printStackTrace();
return R.failed();
}
return R.ok();
}
/**
* 投保办理分页查询
*
......@@ -2055,9 +2099,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList);
List<InsuranceRefundCheck> successList = refundMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)){
for (InsuranceRefundCheck refund : successList){
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceRefund.setInsDetailId(refund.getId());
insuranceRefund.setReduceHandleStatus(CommonConstants.ONE_INT);
insuranceRefund.setCreateBy(user.getId());
......@@ -2077,8 +2123,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
updateWrapper.eq(TInsuranceDetail :: getId,refund.getId());
update(updateWrapper);
insuranceOperate.setInsuranceDetailId(refund.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_IMPORT);
operateList.add(insuranceOperate);
}
}
tInsuranceOperateService.saveBatch(operateList);
List<InsuranceRefundCheck> errorList = refundMap.get("errorList");
return R.ok(errorList,"校验完成");
}
......@@ -2298,7 +2351,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//操作记录
addOperate(detailList,user,InsurancesConstants.REFUND_EXPORT);
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT);
}
return refundExportList;
}
......@@ -2323,6 +2376,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
......@@ -2347,6 +2401,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
}
successList.add(tInsuranceDetail);
//新增减员记录
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
......@@ -2364,9 +2419,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateBatchById(successList);
//操作记录
if(CommonConstants.FOUR_INT == refundType){
addOperate(successList,user,InsurancesConstants.REFUND_EXPORT_SUCCESS);
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_SUCCESS);
}else{
addOperate(successList,user,InsurancesConstants.REFUND_EXPORT_FAILED);
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_FAILED);
}
return R.ok(errorList,"操作成功");
}
......@@ -2388,6 +2443,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList);
//todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(successList)){
for (SettleMonthChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
......@@ -2396,8 +2452,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate);
}
}
tInsuranceOperateService.saveBatch(operateList);
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
return R.ok(errorList,"导入成功");
}
......@@ -2419,19 +2483,97 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList);
//todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
//如果旧项目为合并结算,且新项目也是合并结算,则计算新的预估保费,作废旧的预估保费
if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ZERO_INT == newSettleType){
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
//如果存在则更新,不存在则新建
if (StringUtils.isNotBlank(success.getDefaultSettleId())){
tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//将结算id赋值给保单信息
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
}
}
//如果旧项目为预估,且新的项目为单独结算,则作废旧的预估保费,更新项目信息
if(CommonConstants.ZERO_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){
//更新旧的结算信息
if (StringUtils.isNotBlank(success.getDefaultSettleId())){
tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setEstimatePremium(new BigDecimal("0"));
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
//更新预估保费
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0"));
}
}
//如果旧项目为单独结算,且新项目为合并结算,则计算预估保费,作废旧的预估保费
if(CommonConstants.ONE_INT == oldSettleType && CommonConstants.ZERO_INT == newSettleType){
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
//更新旧的结算信息
if (StringUtils.isNotBlank(success.getDefaultSettleId())){
tInsuranceSettle.setId(success.getDefaultSettleId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
//推送EKP
}else{
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//更新保单信息
updateWrapper.set(TInsuranceDetail::getDefaultSettleId,tInsuranceSettle.getId());
}
}
//如果旧项目为单独结算,且新项目也是单独结算,则更新单独结算信息
if(CommonConstants.ONE_INT == oldSettleType && CommonConstants.ONE_INT == newSettleType){
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
}
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate);
}
}
tInsuranceOperateService.saveBatch(operateList);
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
return R.ok(errorList,"导入成功");
}
......@@ -2506,7 +2648,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(CommonConstants.FIVE_INT == buyHandleStatus){
return R.failed("当前员工已减员,不能进行出险操作");
}
if(null != reduceHandleStatus){
if(null != reduceHandleStatus && CommonConstants.THREE_INT != reduceHandleStatus){
return R.failed("当前员工在减员中,不能进行出险操作");
}
Integer isEffect = insuranceDetail.getIsEffect();
......@@ -3144,7 +3286,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//预估
if (insuranceDetail.getSettleType() == CommonConstants.ZERO_INT){
if (param.getNewSettleType() == CommonConstants.ZERO_INT){
//根据险种获取费率,没费率返回错误
TInsuranceType insuranceType = tInsuranceTypeService.getById(insuranceDetail.getInsuranceTypeId());
//险种存不存在
......@@ -3177,7 +3319,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else {
// 预估保费 = 费率 * 购买标准
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).multiply(new BigDecimal(typeRate.getRate())).setScale(2,BigDecimal.ROUND_HALF_UP);
insuranceDetail.setEstimatePremium(estimatePremium);
param.setEstimatePremium(estimatePremium);
}
}else {
//按天
......@@ -3185,15 +3327,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
long day = LocalDateUtil.betweenDay(insuranceDetail.getPolicyStart().toString(), insuranceDetail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).divide(new BigDecimal("365"),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(2,BigDecimal.ROUND_HALF_UP);
insuranceDetail.setEstimatePremium(estimatePremium);
param.setEstimatePremium(estimatePremium);
}
}
}
}
//判断当前数据中是否存在重复数据
param.setEstimatePremium(insuranceDetail.getEstimatePremium());
param.setActualPremium(insuranceDetail.getActualPremium());
param.setOldSettleType(insuranceDetail.getSettleType());
param.setDefaultSettleId(insuranceDetail.getDefaultSettleId());
param.setId(insuranceDetail.getId());
successList.add(param);
}
......@@ -3202,21 +3342,75 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return map;
}
/**
* 查询项目列表
*
* @author zhaji
* @param
* @return {@link R}
*/
@Override
public R getDeptList(){
List<Dept> deptList = new ArrayList<>();
R<TSettleDomainListVo> tSettleDomainListVoR = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (null != tSettleDomainListVoR && tSettleDomainListVoR.getCode() == CommonConstants.SUCCESS && Common.isNotNull(tSettleDomainListVoR.getData())) {
TSettleDomainListVo data = tSettleDomainListVoR.getData();
List<TSettleDomainSelectVo> listSelectVO = data.getListSelectVO();
List<Dept> deptList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(listSelectVO)){
//listSelectVO.stream().filter(item->deptList.add(new Dept(item.getDepartNo(),item.getDepartName())));
for (TSettleDomainSelectVo tSettleDomainSelectVo : listSelectVO) {
Dept dept = new Dept();
dept.setDeptNo(tSettleDomainSelectVo.getDepartNo());
dept.setProjectName(tSettleDomainSelectVo.getDepartName());
deptList.add(dept);
deptList.add(new Dept(tSettleDomainSelectVo.getDepartNo(),tSettleDomainSelectVo.getDepartName()));
}
}
}
return R.ok(deptList);
};
}
/**
* EKP紧急出险
*
* @author zhaji
* @param userName
* @param empIdcardNo
* @return {@link R}
*/
@Override
public R urgentUpdateIsUse(String userName, String empIdcardNo) {
//员工姓名
if(StringUtils.isBlank(userName)){
}
//员工身份证
if(StringUtils.isBlank(empIdcardNo)){
return R.failed("身份证号为空");
}
//员工身份证
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(empIdcardNo)){
return R.failed("身份证格式不正确");
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
//查询所有在保,未出险,未过期,未失效,未减员的保单信息
queryWrapper.eq(TInsuranceDetail :: getEmpIdcardNo,empIdcardNo).eq(TInsuranceDetail :: getBuyHandleStatus ,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getIsEffect,CommonConstants.ZERO_INT).eq(TInsuranceDetail :: getIsUse,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail :: getIsOverdue,CommonConstants.ZERO_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT)
.ne(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (CollectionUtils.isEmpty(list)){
return R.failed("无可出险的保单");
}
for (TInsuranceDetail tInsuranceDetail : list) {
tInsuranceDetail.setIsUse(CommonConstants.ONE_INT);
//tInsuranceDetail.setUpdateBy();
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
}
boolean b = updateBatchById(list);
if(b){
return R.ok("EKP紧急出险成功");
}else{
return R.ok("EKP紧急出险失败");
}
}
}
......@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -11,19 +10,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -39,7 +34,10 @@ import java.util.List;
public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService {
@Resource
private TInsuranceCompanyService insuranceCompanyService;
private TInsuranceCompanyService tInsuranceCompanyService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/**
* 险种分页查询
......@@ -85,22 +83,23 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper);
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceType> typeWrapper = new LambdaQueryWrapper<>();
typeWrapper.eq(TInsuranceType :: getInsuranceCompanyId ,companyId).eq(TInsuranceType::getName,insuranceType.getName()).eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceType type = getOne(typeWrapper);
if (!Common.isEmpty(type)){
return R.failed("当前险种已存在");
return R.failed("当前保险公司已存在该险种");
}else{
insuranceType.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceType.setCreateBy(user.getId());
insuranceType.setCreateName(user.getNickname());
insuranceType.setCreateTime(LocalDateTime.now());
return R.ok(save(insuranceType));
save(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.NEW_INSURANCE_TYPE);
return R.ok("新增险种信息成功");
}
}
......@@ -136,6 +135,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
*/
@Override
public R updateInsuranceType(TInsuranceType insuranceType) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceType.getId())){
return R.failed("险种ID不能为空");
}
......@@ -144,7 +144,11 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
return R.failed("当前险种信息不存在或已被删除");
}
if(byId.getName().equals(insuranceType.getName())){
return R.ok(this.updateById(insuranceType),"修改险种信息成功");
insuranceType.setUpdateBy(user.getId());
insuranceType.setUpdateTime(LocalDateTime.now());
updateById(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.UPDATE_INSURANCE_TYPE);
return R.ok("修改险种信息成功");
}else{
LambdaQueryWrapper<TInsuranceType> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceType::getName,insuranceType.getName())
......@@ -152,13 +156,40 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
.eq(TInsuranceType::getDeleteFlag,CommonConstants.ZERO_INT);
TInsuranceType one = this.getOne(queryWrapper);
if (Common.isEmpty(one)){
return R.ok(this.updateById(insuranceType),"修改险种信息成功");
insuranceType.setUpdateBy(user.getId());
insuranceType.setUpdateTime(LocalDateTime.now());
updateById(insuranceType);
addOperate(insuranceType,user, InsurancesConstants.UPDATE_INSURANCE_TYPE);
return R.ok("修改险种信息成功");
}else{
return R.failed("当前险种名称已存在");
}
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceType 险种信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceType insuranceType,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceType.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
/**
* 查询险种列表
*
......@@ -178,7 +209,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
}else{
LambdaQueryWrapper<TInsuranceCompany> companyWrapper = new LambdaQueryWrapper<>();
companyWrapper.eq(TInsuranceCompany::getId,companyId).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany insuranceCompany = insuranceCompanyService.getOne(companyWrapper);
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(companyWrapper);
if(Common.isEmpty(insuranceCompany)){
return R.failed("所属保险公司不存在或已被删除");
}else{
......
......@@ -107,7 +107,7 @@
#{item}
</foreach>
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
......@@ -152,7 +152,7 @@
#{item}
</foreach>
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
......@@ -284,7 +284,8 @@
detail.POLICY_END as policyEnd,
detail.POLICY_EFFECT as policyEffect,
detail.IS_USE as isUse,
detail.INVOICE_NO as isOverdue,
detail.IS_EFFECT as isEffect,
detail.IS_OVERDUE as isOverdue,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard
......
......@@ -69,7 +69,7 @@
a.INSURANCE_COMPANY_ID = b.ID
and
a.DELETE_FLAG = 0
ORDER BY a.create_time DESC
</select>
<select id="getInsuranceTypeDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo">
select
......
......@@ -148,22 +148,6 @@ public class TPaymentInfo extends BaseEntity {
@ExcelProperty("锁定状态 0 未锁定 1 锁定")
private String lockStatus;
/**
* 社保结算状态 0: 未结算 1: 待结算 2: 已结算
*/
@ExcelAttribute(name = "社保结算状态 0: 未结算 1: 待结算 2: 已结算" )
@Schema(description ="社保结算状态 0: 未结算 1: 待结算 2: 已结算")
@ExcelProperty("社保结算状态 0: 未结算 1: 待结算 2: 已结算")
private String socialSettlementFlag;
/**
* 公积金结算状态
*/
@ExcelAttribute(name = "公积金结算状态" )
@Schema(description ="公积金结算状态")
@ExcelProperty("公积金结算状态")
private String fundSettlementFlag;
/**
* 总合计
*/
......@@ -316,22 +300,6 @@ public class TPaymentInfo extends BaseEntity {
@ExcelProperty("公积金核准表ID")
private String fundSettlementId;
/**
* 工资社保结算状态 0: 未结算 1: 已结算
*/
@ExcelAttribute(name = "工资社保结算状态 0: 未结算 1: 已结算" )
@Schema(description ="工资社保结算状态 0: 未结算 1: 已结算")
@ExcelProperty("工资社保结算状态 0: 未结算 1: 已结算")
private String salarySocialFlag;
/**
* 工资公积金结算状态 0: 未结算 1: 已结算
*/
@ExcelAttribute(name = "工资公积金结算状态 0: 未结算 1: 已结算" )
@Schema(description ="工资公积金结算状态 0: 未结算 1: 已结算")
@ExcelProperty("工资公积金结算状态 0: 未结算 1: 已结算")
private String salaryFundFlag;
/**
* 就职班组
*/
......@@ -372,6 +340,14 @@ public class TPaymentInfo extends BaseEntity {
@ExcelProperty("财务账单ID")
private String financeBillId;
/**
* 财务账单ID
*/
@ExcelAttribute(name = "推送状态 0已推送 1未推送" )
@Schema(description ="推送状态 0已推送 1未推送")
@ExcelProperty("推送状态 0已推送 1未推送")
private String pushStatus;
/**
* 单位社保补缴利息
*/
......
......@@ -553,12 +553,12 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelProperty("补缴是否采用最新基数0是1否" )
private String latestCardinality;
/**
* 大病是否收费:0否 1 是
* 大病是否收费:0收取;1不收取
*/
@Length(max = 1, message = "大病是否收费:0否 1 是 不能超过1个字符" )
@ExcelAttribute(name = "大病是否收费:0否 1 是", maxLength = 1)
@Schema(description = "大病是否收费:0否 1 是" )
@ExcelProperty("大病是否收费:0否 1 是" )
@Length(max = 1, message = "大病是否收费:0收取;1不收取 不能超过1个字符" )
@ExcelAttribute(name = "大病是否收费:0收取;1不收取", maxLength = 1)
@Schema(description = "大病是否收费:0收取;1不收取" )
@ExcelProperty("大病是否收费:0收取;1不收取" )
private String isIllness;
/**
* 大病缴纳周期:0按年1按月
......
......@@ -392,12 +392,12 @@ public class TSocialInfo extends BaseEntity {
@ExcelProperty("个人大病金额" )
private BigDecimal personalBigailmentMoney;
/**
* 大病取值方式0 按比例 1按定值
* 大病取值方式 0.按定值1比例
*/
@Length(max = 1, message = "大病取值方式0 按比例 1按定值 不能超过1个字符" )
@ExcelAttribute(name = "大病取值方式0 按比例 1按定值", maxLength = 1)
@Schema(description = "大病取值方式0 按比例 1按定值" )
@ExcelProperty("大病取值方式0 按比例 1按定值" )
@Length(max = 1, message = "大病取值方式 0.按定值1比例 不能超过1个字符" )
@ExcelAttribute(name = "大病取值方式 0.按定值1比例", maxLength = 1)
@Schema(description = "大病取值方式 0.按定值1比例" )
@ExcelProperty("大病取值方式 0.按定值1比例" )
private String valueType;
/**
* 个人大病比例
......@@ -414,12 +414,12 @@ public class TSocialInfo extends BaseEntity {
@ExcelProperty("单位大病救助比例" )
private BigDecimal unitBigailmentPer;
/**
* 是否收取大病费用0否 1 是
* 是否收取大病费用: 0收取;1不收取
*/
@Length(max = 1, message = "是否收取大病费用0否 1 是 不能超过1个字符" )
@ExcelAttribute(name = "是否收取大病费用0否 1 是", maxLength = 1)
@Schema(description = "是否收取大病费用0否 1 是" )
@ExcelProperty("是否收取大病费用0否 1 是" )
@Length(max = 1, message = "是否收取大病费用0收取;1不收取 不能超过1个字符" )
@ExcelAttribute(name = "是否收取大病费用0收取;1不收取", maxLength = 1)
@Schema(description = "是否收取大病费用0收取;1不收取" )
@ExcelProperty("是否收取大病费用0收取;1不收取" )
private String isIllness;
/**
* 大病按年收收取月份1-12月
......
......@@ -54,7 +54,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 身份证号
*/
@Length(max = 20, message = "身份证号 不能超过20 个字符" )
@ExcelAttribute(name = "身份证号", maxLength = 20, isNotEmpty = true)
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号" )
@ExcelProperty("身份证号" )
private String empIdcard;
......@@ -62,7 +62,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 员工类型
*/
@Length(max = 32, message = "员工类型 不能超过32 个字符" )
@ExcelAttribute(name = "员工类型", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE, isNotEmpty = true)
@ExcelAttribute(name = "员工类型", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型" )
@ExcelProperty("员工类型" )
private String empType;
......@@ -70,7 +70,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 手机号码
*/
@Length(max = 32, message = "手机号码 不能超过32 个字符" )
@ExcelAttribute(name = "手机号码", maxLength = 32, isNotEmpty = true)
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" )
@ExcelProperty("手机号码" )
private String empMobile;
......@@ -123,7 +123,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true)
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince")
@Schema(description = "档案-市" )
@ExcelProperty("档案-市" )
private String fileCity;
......@@ -191,7 +191,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 合同类型
*/
@Length(max = 32, message = "合同类型 不能超过32 个字符" )
@ExcelAttribute(name = "合同类型", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
@ExcelAttribute(name = "合同类型", maxLength = 32, isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
@Schema(description = "合同类型" )
@ExcelProperty("合同类型" )
private String contractName;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* 派单信息记录表
*
* @author fxj
* @date 2022-07-15 11:38:05
*/
@Data
public class TDispatchInfoPageVo extends TDispatchInfo {
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
}
......@@ -16,7 +16,9 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -64,4 +66,21 @@ public class TDispatchInfoSearchVo extends TDispatchInfo {
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
}
......@@ -40,7 +40,7 @@ public class TPaymentInfoImportLogVo extends RowIndex implements Serializable {
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "主键 不能为空")
@Schema(description = "主键")
@ExcelProperty("主键")
private Integer id;
......@@ -48,7 +48,7 @@ public class TPaymentInfoImportLogVo extends RowIndex implements Serializable {
* 姓名
*/
@Length(max = 50, message = "姓名 不能超过50 个字符")
@ExcelAttribute(name = "姓名", maxLength = 50)
@ExcelAttribute(name = "empName", maxLength = 50)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
......@@ -56,7 +56,7 @@ public class TPaymentInfoImportLogVo extends RowIndex implements Serializable {
* 身份证号
*/
@Length(max = 32, message = "身份证号 不能超过32 个字符")
@ExcelAttribute(name = "身份证号", maxLength = 32)
@ExcelAttribute(name = "idCard", maxLength = 32)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String idCard;
......@@ -64,14 +64,14 @@ public class TPaymentInfoImportLogVo extends RowIndex implements Serializable {
* 错误信息
*/
@Length(max = 500, message = "错误信息 不能超过500 个字符")
@ExcelAttribute(name = "错误信息", maxLength = 500)
@ExcelAttribute(name = "errMsg", maxLength = 500)
@Schema(description = "错误信息")
@ExcelProperty("错误信息")
private String errMsg;
/**
* 问题行数
*/
@ExcelAttribute(name = "问题行数")
@ExcelAttribute(name = "line")
@Schema(description = "问题行数")
@ExcelProperty("问题行数")
private Integer line;
......@@ -79,7 +79,7 @@ public class TPaymentInfoImportLogVo extends RowIndex implements Serializable {
* 导入标识key
*/
@Length(max = 64, message = "导入标识key 不能超过64 个字符")
@ExcelAttribute(name = "导入标识key", maxLength = 64)
@ExcelAttribute(name = "randomKey", maxLength = 64)
@Schema(description = "导入标识key")
@ExcelProperty("导入标识key")
private String randomKey;
......
......@@ -145,22 +145,6 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
@Schema(description = "锁定状态 0 未锁定 1 锁定")
@ExcelProperty("锁定状态 0 未锁定 1 锁定")
private String lockStatus;
/**
* 社保结算状态 0: 未结算 1: 待结算 2: 已结算
*/
@Length(max = 1, message = "社保结算状态 0: 未结算 1: 待结算 2: 已结算 不能超过1 个字符")
@ExcelAttribute(name = "社保结算状态 0: 未结算 1: 待结算 2: 已结算", maxLength = 1)
@Schema(description = "社保结算状态 0: 未结算 1: 待结算 2: 已结算")
@ExcelProperty("社保结算状态 0: 未结算 1: 待结算 2: 已结算")
private String socialSettlementFlag;
/**
* 公积金结算状态
*/
@Length(max = 1, message = "公积金结算状态 不能超过1 个字符")
@ExcelAttribute(name = "公积金结算状态", maxLength = 1)
@Schema(description = "公积金结算状态")
@ExcelProperty("公积金结算状态")
private String fundSettlementFlag;
/**
* 总合计
*/
......@@ -308,22 +292,6 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
@Schema(description = "公积金核准表ID")
@ExcelProperty("公积金核准表ID")
private String fundSettlementId;
/**
* 工资社保结算状态 0: 未结算 1: 已结算
*/
@Length(max = 1, message = "工资社保结算状态 0: 未结算 1: 已结算 不能超过1 个字符")
@ExcelAttribute(name = "工资社保结算状态 0: 未结算 1: 已结算", maxLength = 1)
@Schema(description = "工资社保结算状态 0: 未结算 1: 已结算")
@ExcelProperty("工资社保结算状态 0: 未结算 1: 已结算")
private String salarySocialFlag;
/**
* 工资公积金结算状态 0: 未结算 1: 已结算
*/
@Length(max = 1, message = "工资公积金结算状态 0: 未结算 1: 已结算 不能超过1 个字符")
@ExcelAttribute(name = "工资公积金结算状态 0: 未结算 1: 已结算", maxLength = 1)
@Schema(description = "工资公积金结算状态 0: 未结算 1: 已结算")
@ExcelProperty("工资公积金结算状态 0: 未结算 1: 已结算")
private String salaryFundFlag;
/**
* 就职班组
*/
......
......@@ -409,12 +409,12 @@ public class TSocialInfoVo extends RowIndex implements Serializable {
@ExcelProperty("单位大病救助比例" )
private BigDecimal unitBigailmentPer;
/**
* 是否收取大病费用0否 1 是
* 是否收取大病费用0收取;1不收取
*/
@Length(max = 1, message = "是否收取大病费用0否 1 是 不能超过1 个字符" )
@ExcelAttribute(name = "是否收取大病费用0否 1 是", maxLength = 1)
@Schema(description = "是否收取大病费用0否 1 是" )
@ExcelProperty("是否收取大病费用0否 1 是" )
@Length(max = 1, message = "是否收取大病费用0收取;1不收取 不能超过1 个字符" )
@ExcelAttribute(name = "是否收取大病费用0收取;1不收取", maxLength = 1)
@Schema(description = "是否收取大病费用0收取;1不收取" )
@ExcelProperty("是否收取大病费用0收取;1不收取" )
private String isIllness;
/**
* 大病按年收收取月份1-12月
......
......@@ -7,17 +7,6 @@ package com.yifu.cloud.plus.v1.yifu.social.constants;
**/
public class PaymentConstants {
public static final String saveFailExistsSocialSettlement = "社保数据已生成核准表,无法删除!";
public static final String saveFailExistsSalarySocialSettlement = "社保数据已工资结算,无法删除!";
public static final String saveFailExistsFundSettlement = "公积金数据已生成核准表,无法删除!";
public static final String saveFailExistsSalaryFundSettlement = "公积金数据已工资结算,无法删除!";
public static final String saveFailExistsAgentSettlement = "对应缴费库数据已生成代理类结算单,无法删除!";
public static final String saveFailExistsFinanceBillSettlement = "数据已生成财务账单,无法删除!";
public static final String PENSION_RISK = "养老保险";
public static final String PENSION = "养老";
public static final String UNEMPLOYEEMENT_RISK = "失业保险";
......
......@@ -28,10 +28,7 @@ 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.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -69,7 +66,7 @@ public class TDispatchInfoController {
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TDispatchInfo>> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
public R<IPage<TDispatchInfoPageVo>> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
return new R<>(tDispatchInfoService.getTDispatchInfoPage(page,tDispatchInfo));
}
......@@ -94,7 +91,7 @@ public class TDispatchInfoController {
*/
@Operation(description = "简单分页查询--申请")
@GetMapping("/pageApply")
public R<IPage<TDispatchInfo>> getTDispatchApplyPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
public R<IPage<TDispatchInfoPageVo>> getTDispatchApplyPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
......@@ -112,7 +109,7 @@ public class TDispatchInfoController {
*/
@Operation(description = "简单分页查询--审核")
@GetMapping("/pageAudit")
public R<IPage<TDispatchInfo>> getTDispatchAuditPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
public R<IPage<TDispatchInfoPageVo>> getTDispatchAuditPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
tDispatchInfo.setStatus(CommonConstants.ONE_STRING);
return new R<>(tDispatchInfoService.getTDispatchInfoPage(page,tDispatchInfo));
......
......@@ -96,24 +96,21 @@ public class TPaymentInfoController {
@SysLog("通过id删除缴费库" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tPaymentInfoService.removeById(id));
public R removeById(@PathVariable String id) {
return tPaymentInfoService.removeInFoById(id);
}
/**
* 按类型删除
* @author huyc
* @date 2022-07-22 17:01:22
* @param id
* @param type
* @return
**/
@Operation(summary = "按类型删除", description = "按类型删除:hasPermission('social_tpaymentinfo_del')")
@SysLog("按类型删除缴费库")
@GetMapping("/removeByIdAndType")
* 通过ids删除一条记录
* @param ids
* @return R
*/
@Operation(summary = "通过ids删除缴费库", description = "通过ids删除缴费库:hasPermission('social_tpaymentinfo_del')")
@SysLog("删除缴费库")
@DeleteMapping("/removeBatchByIds")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R<Boolean> removeByIdAndType(@RequestParam String id, @RequestParam String type) {
return tPaymentInfoService.removeByIdAndType(id,type);
public R<Boolean> removeBatchByIds(String ids) {
return tPaymentInfoService.removeAllInfoById(ids);
}
/**
......@@ -177,31 +174,9 @@ public class TPaymentInfoController {
**/
@Operation(description = "导出缴费库 hasPermission('social_tpaymentinfo_export')")
@PostMapping("/export")
// @PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void export(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.listExport(response,searchVo);
}
/**
* 删除当前登录人当前月的社保或公积金数据
* @param type 0 全部删除 1 删除社保 2 删除公积金 必填
* @param settleDepartId 项目ID 可选
* @param unitId 单位ID 可选
* @param empIdCard 员工身份证 可选
* @param socialHouseId 社保户 可选
* @param fundHouseId 公积金户 可选
* @return R
*/
@Operation(description = "删除(social_tpaymentinfo_del)")
@SysLog("删除缴费库")
@PostMapping("/removeBatchByIdsAndType")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R removeBatchByIdsAndType(@RequestParam(name = "type",required = true) String type,
@RequestParam(name = "settleDepartId",required = false) String settleDepartId,
@RequestParam(name = "unitId",required = false) String unitId,
@RequestParam(name = "empIdCard",required = false) String empIdCard,
@RequestParam(name = "socialHouseId",required = false) String socialHouseId,
@RequestParam(name = "fundHouseId",required = false) String fundHouseId) {
return tPaymentInfoService.removeBatchByIdsAndType(type,settleDepartId,unitId,empIdCard,socialHouseId,fundHouseId);
}
}
......@@ -22,12 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.FundHandleExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -46,7 +41,7 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
* @param tDispatchInfo 派单信息记录表
* @return
*/
IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfo tDispatchInfo);
IPage<TDispatchInfoPageVo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfoSearchVo tDispatchInfo);
/**
* @Description: 派单导出
......
......@@ -86,12 +86,4 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* */
List<TPaymentInfo> selectListForPaymentImport(@Param("months")List<String> months, @Param("idcards")List<String> idcards);
/*
* 已存在社保缴费库数据 非删除状态
* @param months
* @param idcards
* @return
* */
List<TPaymentInfoVo> selectPaymentAllInfoByMonthAndIdCard(@Param("months")List<String> months, @Param("idcards")List<String> idcards);
}
......@@ -42,7 +42,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
* @param tDispatchInfo 派单信息记录表
* @return
*/
IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfo tDispatchInfo);
IPage<TDispatchInfoPageVo> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
......
......@@ -71,36 +71,32 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/
void listExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/**
* 按类型删除
* 删除缴费库数据 包括明细
* @Author huyc
* @Date 2022-07-24
* @param id
* @param type
* @return
**/
R<Boolean> removeByIdAndType(String id, String type);
R removeInFoById(String id);
/**
* 通过ID获取缴费库 及社保、公积金明细
* 删除缴费库数据 包括明细
* @Author huyc
* @Date 2022-07-24
* @param id
* @param ids
* @return
**/
R getAllInfoById(String id);
R<Boolean> removeAllInfoById(String ids);
/**
* 删除当月 当前登录人的 指定类型的缴费库数据
* 通过ID获取缴费库 及社保、公积金明细
* @Author huyc
* @Date 2022-07-27
* @param type
* @param settleDepartId
* @param unitId
* @param empIdCard
* @param socialHouseId
* @param fundHouseId
* @Date 2022-07-24
* @param id
* @return
**/
R removeBatchByIdsAndType(String type, String settleDepartId, String unitId, String empIdCard, String socialHouseId, String fundHouseId);
R getAllInfoById(String id);
}
......@@ -93,7 +93,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @param tDispatchInfo 派单信息记录表
*/
@Override
public IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfo tDispatchInfo) {
public IPage<TDispatchInfoPageVo> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
return baseMapper.getTDispatchInfoPage(page, tDispatchInfo);
}
......@@ -354,7 +354,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 初始化新增信息:档案、项目档案、员工合同
initAddInfo(empAddsMap, contractsMap, projectsMap, empVo, excel);
initAddInfo(empAddsMap, contractsMap, projectsMap, empVo, excel,user,setInfoVo,socialSet);
// 新增社保
initSocialAddInfo(socialsMap, empVo, socialSet, excel,socialFundMap);
// 新增公积金
......@@ -720,10 +720,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
if (Common.isNotNull(excel.getProvidentHousehold())){
socialFund.setSettleDomain(setInfoVo.getId());
socialFund.setSettleDomainName(setInfoVo.getDepartName());
socialFund.setSettleDomainCode(setInfoVo.getDepartNo());
socialFund.setUnitName(setInfoVo.getCustomerName());
socialFund.setSettleDomainFund(setInfoVo.getId());
socialFund.setSettleDomainNameFund(setInfoVo.getDepartName());
socialFund.setSettleDomainCodeFund(setInfoVo.getDepartNo());
socialFund.setUnitNameFund(setInfoVo.getCustomerName());
socialFund.setUnitIdFund(setInfoVo.getCustomerId());
socialFund.setFundStatus(CommonConstants.ZERO_STRING);
socialFund.setProvidentStart(excel.getProvidentStart());
......@@ -760,6 +760,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchImportVo excel) {
TDispatchInfo dispatch;
dispatch = new TDispatchInfo();
dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId());
dispatch.setCreateTime(LocalDateTime.now());
dispatch.setContractSubName(excel.getContractSubName());
dispatch.setContractName(excel.getContractName());
dispatch.setEmpIdcard(excel.getEmpIdcard());
......@@ -817,6 +820,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setFileCity(empVo.getFileCity());
dispatch.setFileTown(empVo.getFileTown());
dispatch.setContractId(empVo.getContractId());
dispatch.setEmpType(empVo.getEmpNatrue());
dispatch.setSettleDomainCode(empVo.getDeptNo());
dispatch.setSettleDomain(empVo.getDeptId());
if (Common.isNotNull(empVo.getIdProvince())){
dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
......@@ -842,6 +848,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo)){
fund.setEmpId(empVo.getId());
fund.setEmpNo(empVo.getEmpNo());
fund.setSettleDomain(empVo.getDeptId());
}
fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName());
......@@ -853,6 +860,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund.setProvidentStart(excel.getProvidentStart());
if (Common.isNotNull(fundSet)){
fund.setProvidentHousehold(fundSet.getDepartId());
fund.setProvidentHouseholdName(fundSet.getDepartName());
if (!checkFundPer(fundSet.getFundProList(), excel)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_PERCENT_NOT_EXIST)));
return true;
......@@ -895,29 +903,30 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private void initAddInfo(Map<String, EmpAddDispatchVo> empAdds,
Map<String, EmpContractDispatchVo> contracts,
Map<String, EmpProjectDispatchVo> projects,
DispatchEmpVo empVo, TDispatchImportVo excel) {
DispatchEmpVo empVo, TDispatchImportVo excel,
YifuUser user, ProjectSetInfoVo setInfoVo, SysBaseSetInfo socialSet) {
// 无档案无项目档案无合同无学历
if (Common.isEmpty(empVo) || Common.isEmpty(empVo.getId())) {
// 初始化档案
initEmpAddInfo(empAdds, excel);
initEmpAddInfo(empAdds, excel,user);
// 初始化项目档案
initProjectInfo(projects, excel, empVo);
initProjectInfo(projects, excel, empVo,user,setInfoVo,socialSet);
// 初始化合同
initContractInfo(contracts, excel, empVo);
initContractInfo(contracts, excel, empVo,setInfoVo);
}
// 有档案无项目档案无合同
if (Common.isNotNull(empVo) && Common.isEmpty(empVo.getDeptNo())) {
// 初始化项目档案
initProjectInfo(projects, excel, empVo);
initProjectInfo(projects, excel, empVo, user, setInfoVo, socialSet);
// 初始化合同
initContractInfo(contracts, excel, empVo);
initContractInfo(contracts, excel, empVo, setInfoVo);
}
// 有档案有项目档案无合同
if (Common.isNotNull(empVo)
&& Common.isNotNull(empVo.getDeptNo())
&& Common.isEmpty(empVo.getContractType())) {
// 初始化合同
initContractInfo(contracts, excel, empVo);
initContractInfo(contracts, excel, empVo, setInfoVo);
}
}
......@@ -1056,17 +1065,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}else if (CommonConstants.ONE_STRING.equals(social.getCollectType())) {
//收取方式按月
if (CommonConstants.ZERO_STRING.equals(social.getValueType())) {
//收取大病按比例
social.setUnitBigailmentMoney(BigDecimalUtils.safeMultiply(social.getUnitBigailmentCardinal(), socialSet.getPayCompanyPro(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
social.setPersonalBigailmentMoney(BigDecimalUtils.safeMultiply(social.getPersonalBigailmentCardinal(), socialSet.getPayPersonalPro(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
} else if (CommonConstants.ONE_STRING.equals(social.getValueType()) && Common.isNotNull(socialSet)) {
//收取大病方式按定值
social.setUnitBigailmentMoney(socialSet.getChargeCompany());
social.setPersonalBigailmentMoney(socialSet.getChargePersonal());
social.setUnitBigailmentMoney(socialSet.getPayCompany());
social.setPersonalBigailmentMoney(socialSet.getPayPersonal());
social.setPersonalBigailmentCardinal(null);
social.setPersonalBigailmentPer(null);
social.setUnitBigailmentCardinal(null);
social.setUnitBigailmentPer(null);
} else if (CommonConstants.ONE_STRING.equals(social.getValueType()) && Common.isNotNull(socialSet)) {
//收取大病按比例
social.setUnitBigailmentMoney(BigDecimalUtils.safeMultiply(social.getUnitBigailmentCardinal(), socialSet.getPayCompanyPro(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
social.setPersonalBigailmentMoney(BigDecimalUtils.safeMultiply(social.getPersonalBigailmentCardinal(), socialSet.getPayPersonalPro(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
}
}
}
......@@ -1139,7 +1149,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
.eq(SysBaseSetInfo::getBaseType, CommonConstants.ZERO_STRING)
.le(SysBaseSetInfo::getApplyStartDate, now)
.in(SysBaseSetInfo::getDepartName,socialholds)
.eq(SysBaseSetInfo::getStatus,CommonConstants.ZERO_STRING)
.eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.and(obj-> obj.isNull(SysBaseSetInfo::getApplyEndDate).or().ge(SysBaseSetInfo::getApplyEndDate,now))
.groupBy(SysBaseSetInfo::getDepartName));
if (Common.isNotNull(socialBases)) {
for (SysBaseSetInfo set:socialBases){
......@@ -1161,7 +1173,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private void initContractInfo(Map<String, EmpContractDispatchVo> contracts,
TDispatchImportVo excel,
DispatchEmpVo empVo) {
DispatchEmpVo empVo, ProjectSetInfoVo setInfoVo) {
// 合同开始时间和截止时间一致直接跳过
if (Common.isNotNull(excel.getContractStart())
&& Common.isNotNull(empVo)
......@@ -1189,19 +1201,27 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isEmpty(excel.getSocialHousehold()) && Common.isNotNull(excel.getProvidentHousehold())){
contract.setContractParty(excel.getSocialHousehold());
}
contract.setSettleDomain(setInfoVo.getId());
contract.setDeptNo(setInfoVo.getDepartNo());
contract.setCustomerId(setInfoVo.getCustomerId());
if (Common.isNotNull(empVo)) {
contract.setEmpId(empVo.getId());
contract.setEmpNo(empVo.getEmpNo());
contract.setEmpType(empVo.getEmpNatrue());
contract.setFileProvince(empVo.getFileProvince());
contract.setFileCity(empVo.getFileCity());
contract.setFileTown(empVo.getFileTown());
}
contracts.put(excel.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+excel.getSettleDomainCode(),contract);
}
private void initProjectInfo(Map<String, EmpProjectDispatchVo> projects,
TDispatchImportVo excel,
DispatchEmpVo empVo) {
DispatchEmpVo empVo, YifuUser user, ProjectSetInfoVo setInfoVo, SysBaseSetInfo socialSet) {
EmpProjectDispatchVo project;
project = new EmpProjectDispatchVo();
project.setCreateBy(user.getId());
project.setCreateName(user.getNickname());
project.setDeptNo(excel.getSettleDomainCode());
project.setContractType(excel.getContractType());
project.setEmpIdcard(excel.getEmpIdcard());
......@@ -1209,17 +1229,32 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project.setEmpNatrue(excel.getEmpType());
project.setPost(excel.getPost());
project.setWorkingHours(excel.getWorkingHours());
if (Common.isNotNull(socialSet)){
project.setSocialProvince(socialSet.getProvince());
project.setSocialCity(socialSet.getCity());
project.setSocialTown(socialSet.getTown());
}
if (Common.isNotNull(empVo)) {
project.setEmpId(empVo.getId());
project.setEmpCode(empVo.getEmpCode());
project.setEmpNo(empVo.getEmpNo());
}
if (Common.isNotNull(setInfoVo)){
project.setBusinessPrimaryType(setInfoVo.getBusinessPrimaryType());
project.setBusinessSecondType(setInfoVo.getBusinessSecondType());
project.setBusinessThirdType(setInfoVo.getBusinessThirdType());
project.setUnitId(setInfoVo.getCustomerId());
project.setUnitName(setInfoVo.getCustomerName());
project.setUnitNo(setInfoVo.getCustomerCode());
}
projects.put(excel.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+excel.getSettleDomainCode(),project);
}
private void initEmpAddInfo(Map<String, EmpAddDispatchVo> empAdds, TDispatchImportVo excel) {
private void initEmpAddInfo(Map<String, EmpAddDispatchVo> empAdds, TDispatchImportVo excel, YifuUser user) {
EmpAddDispatchVo emp;
emp = new EmpAddDispatchVo();
emp.setCreateBy(user.getId());
emp.setCreateName(user.getNickname());
emp.setEmpIdcard(excel.getEmpIdcard());
emp.setEmpName(excel.getEmpName());
emp.setEmpNational(excel.getEmpNational());
......@@ -1349,15 +1384,63 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
return true;
}
if (CommonConstants.ONE_STRING.equals(setInfoVo.getStopFlag())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SETTLEDOMAIN_STOP)));
return true;
}
if (Common.isEmpty(empVo)){
if (Common.isEmpty(excel.getFileProvince())
|| Common.isEmpty(excel.getFileCity())
|| Common.isEmpty(excel.getWorkingHours())
|| Common.isEmpty(excel.getEmpNational())
|| Common.isEmpty(excel.getEmpMobile())
|| Common.isEmpty(excel.getEmpType())
|| Common.isEmpty(excel.getPost())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_EMPTY)));
return true;
}
if (Common.isEmpty(excel.getContractName()) && validContractInfo(errorMessageList,excel,empVo)){
return true;
}
}
/*项目档案有可用状态的合同:
不对合同做判断,取值:项目档案的合同;
项目档案无可用状态的合同:
合同类型必填、业务细分(合同类型为其他时必填)、签订期限必填
签订期限:无固定期限 合同到期时间、合同期限非必填,合同开始时间必填;
签订期限:固定期限、已完成一定工作任务为期限 合同期限非必填,合同开始时间、合同到期时间都必填*/
if (Common.isNotNull(empVo)){
if (CommonConstants.ONE_STRING.equals(empVo.getProjectStatus())){
if (Common.isNotNull(empVo.getProjectStatus()) && empVo.getProjectStatus().intValue() == CommonConstants.ONE_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_PROJECT_NOT_USED)));
return true;
}
if (CommonConstants.ONE_STRING.equals(empVo.getFileStatus())){
if (Common.isNotNull(empVo.getFileStatus()) && empVo.getFileStatus().intValue() == CommonConstants.ONE_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED)));
return true;
}
// 档案无合同 合同起日期、合同类型必填
if (Common.isEmpty(empVo.getContractName()) && validContractInfo(errorMessageList,excel,empVo)){
return true;
}
excel.setEmpType(empVo.getEmpNatrue());
excel.setEmpMobile(empVo.getEmpPhone());
excel.setFileProvince(Common.isNotNullToStr(empVo.getFileProvince()));
excel.setFileCity(Common.isNotNullToStr(empVo.getFileCity()));
excel.setFileTown(Common.isNotNullToStr(empVo.getFileTown()));
excel.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
excel.setEmpNational(empVo.getEmpNational());
excel.setEmpRegisType(empVo.getEmpRegisType());
excel.setPost(empVo.getPost());
if (Common.isNotNull(empVo.getContractStart())){
excel.setContractStart(empVo.getContractStart());
excel.setContractEnd(empVo.getContractEnd());
excel.setContractType(empVo.getContractType());
excel.setContractSubName(empVo.getContractSubName());
excel.setContractName(empVo.getEmpName());
excel.setContractTerm(empVo.getContractTerm());
}
}
excel.setSettleDomainId(setInfoVo.getId());
excel.setDepartName(setInfoVo.getDepartName());
......@@ -1431,6 +1514,56 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
if (Common.isNotNull(excel.getSocialHousehold())){
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate(excel);
// 校验各项起缴日期 查看是否符合社保补缴政策
if (validSocialStartDate(errorMessageList, excel, socialSet)) return true;
//校验各项基数
if (validSocialBaseInfo(errorMessageList, excel, empVo, socialSet)) return true;
}
// 校验公积金上下限和起缴日期
if (Common.isNotNull(excel.getProvidentHousehold())){
if(Common.isNotNull(fundSet)
&& Common.isNotNull(excel.getProvidentCardinal())
&& excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getProvidentStart()),
fundSet.getCanOverpay(),fundSet.getOverpayNumber(),fundSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_DATE_LIMIT_ERROR)));
return true;
}
}
return false;
}
private boolean validContractInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo){
// 合同起缴时间、合同类型、签订期限必填
if ((Common.isEmpty(excel.getContractStart())
|| Common.isEmpty(excel.getContractType())
|| Common.isEmpty(excel.getContractName()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
// 业务细分(合同类型为其他时必填)
if (excel.getContractType().equals(CommonConstants.TWENTY_ONE_STRING)
&& Common.isEmpty(excel.getContractSubName())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
// 签订期限:固定期限、已完成一定工作任务为期限 合同期限非必填,合同开始时间、合同到期时间都必填
if ((excel.getContractType().equals(CommonConstants.ONE_STRING)
|| excel.getContractType().equals(CommonConstants.ZERO_STRING))
&& Common.isEmpty(excel.getContractEnd())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_CONTRACT_NOT_EMPTY)));
return true;
}
return false;
}
private boolean validSocialBaseInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (Common.isNotNull(excel.getPensionCardinal())
&& excel.getPensionCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
......@@ -1456,9 +1589,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
// 备案基数和养老基数 养老起缴日期 必填在前面已必填校验,这里不重复校验
if (Common.isEmpty(excel.getRecordBase()) && Common.isEmpty(excel.getSocialHousehold())){
boolean flag = false;
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate(excel);
// 自定义 只要有一个不相当同的 日期或基数 就要提示
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
......@@ -1505,15 +1635,42 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
return false;
}
if (Common.isNotNull(excel.getProvidentHousehold())
&& Common.isNotNull(fundSet)
&& Common.isNotNull(excel.getProvidentCardinal())
&& excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR)));
private boolean validSocialStartDate(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getPensionStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getMedicalStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getUnemployStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getWorkInjuryStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getBirthStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getBigailmentStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
}
return false;
}
......@@ -1936,7 +2093,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
remark += "公积金";
}
providentFund = fundMapper.selectById(dis.getFundId());
if (Common.isNotNull(providentFund)) {
if (Common.isEmpty(providentFund)) {
errorList.add(new ErrorMessage(-1, "找不到员工公积金派单数据:" + dis.getEmpName()));
continue;
}
......
......@@ -86,7 +86,7 @@ public class TPaymentInfoImportLogServiceImpl extends ServiceImpl<TPaymentInfoIm
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFiledNames(getExportFieldNameDetailByClass(TPaymentInfoImportLogVo.class)).sheet("社保导入日志")
EasyExcel.write(out, TPaymentInfoImportLogVo.class).includeColumnFiledNames(getExportFieldNameDetailByClass(TPaymentInfoImportLogVo.class)).sheet("社保导入日志")
.doWrite(list);
out.flush();
} catch (IOException e) {
......
......@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -53,17 +54,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -138,7 +136,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).includeColumnFiledNames(searchVo.getExportFields()).build();;
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
;
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......@@ -184,256 +183,57 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
/**
* 按类型删除 社保或公积金缴费库数据
*
* @param id
* @param type 0 删除社保 1删除公积金
* @return
* @Author huyc
* @Date 2022-07-24
**/
@Override
public R<Boolean> removeByIdAndType(String id, String type) {
if (Common.isEmpty(id) || Common.isEmpty(type)
|| (!CommonConstants.ZERO_STRING.equals(type) && !CommonConstants.ONE_STRING.equals(type))) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
TPaymentInfo info = baseMapper.selectById(id);
R<Boolean> x = removeByIdAndTypeCheck(type, info);
if (x != null) {
return x;
}
if (CommonConstants.ZERO_STRING.equals(type)
&& (CommonConstants.ONE_STRING.equals(info.getSalarySocialFlag())
|| CommonConstants.TWO_STRING.equals(info.getSalarySocialFlag()))) {
return R.failed(PaymentConstants.saveFailExistsSalarySocialSettlement);
}
if (CommonConstants.ONE_STRING.equals(type)
&& (CommonConstants.ONE_STRING.equals(info.getSalaryFundFlag())
|| CommonConstants.TWO_STRING.equals(info.getSalaryFundFlag()))) {
return R.failed(PaymentConstants.saveFailExistsSalaryFundSettlement);
}
// 存在差余额生成
List<String> idList = new ArrayList<>();
idList.add(id);
removeByType(type, info);
return R.ok();
}
public R removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser();
/**
* 通过ID获取缴费库 及社保、公积金明细
*
* @param id
* @Author huyc
* @Date 2022-07-24
**/
@Override
public R getAllInfoById(String id) {
TPaymentInfoVo vo = baseMapper.getAllInfoById(id);
return R.ok(vo, "查询成功!");
TPaymentInfo paymentInfo = baseMapper.selectById(id);
if (!user.getId().equals(paymentInfo.getCreateBy()) && !CommonConstants.ONE_STRING.equals(user.getId())) {
return R.failed("非本人创建的数据禁止删除!");
}
@Override
public R removeBatchByIdsAndType(String type, String settleDepartId, String unitId, String empIdCard,
String socialHouseId, String fundHouseId) {
YifuUser user = SecurityUtils.getUser();
List<TPaymentInfo> paymentInfoList = null;
TPaymentInfo queryEntity = new TPaymentInfo();
initQueryCondition(user.getId(), settleDepartId, unitId, empIdCard, socialHouseId, fundHouseId, queryEntity,type);
//大于零不可删除
// int socialSettleCount = 0;
// int salarySettleCount = 0;
// socialSettleCount = baseMapper.selectCountForDelete(queryEntity,CommonConstants.ZERO_INT,type);
// if (socialSettleCount > 0) {
// return R.failed(PaymentConstants.paymentSaveFailExistsSettlement);
// }
// salarySettleCount = baseMapper.selectCountForDelete(queryEntity,CommonConstants.ONE_INT,type);
// if (salarySettleCount > 0) {
// return R.failed(PaymentConstants.paymentSaveFailExistsSalarySettlement);
// }
paymentInfoList = baseMapper.selectListForDelete(queryEntity);
if (Common.isEmpty(paymentInfoList)){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
if (CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()) &&
!CommonConstants.ONE_STRING.equals(user.getId())) {
return R.failed("已推送至结算平台禁止删除!");
}
// 删除操作开始
deletePaymentByType(type, paymentInfoList);
baseMapper.deleteById(id);
return R.ok();
}
/**
* 删除社保或公积金校验
*
* @param type
* @param info
* @Author huyc
* @Date 2022-07-24
* @return
**/
private R<Boolean> removeByIdAndTypeCheck(String type, TPaymentInfo info) {
if (null == info) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
// 已财务账单结算不可删除
if (Common.isNotNull(info.getFinanceBillId())) {
return R.failed(PaymentConstants.saveFailExistsFinanceBillSettlement);
}
if (CommonConstants.ZERO_STRING.equals(type) && Common.isNotNull(info.getSocialSettlementId())) {
return R.failed(PaymentConstants.saveFailExistsSocialSettlement);
}
if (CommonConstants.ONE_STRING.equals(type) && Common.isNotNull(info.getFundSettlementId())) {
return R.failed(PaymentConstants.saveFailExistsFundSettlement);
}
if (Common.isNotNull(info.getAgentId())) {
return R.failed(PaymentConstants.saveFailExistsAgentSettlement);
}
return null;
@Override
public R<Boolean> removeAllInfoById(String ids) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(ids)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<String> idList = Common.initStrToList(ids, CommonConstants.COMMA_STRING);
TPaymentInfo paymentInfo = null;
/**
* 初始化查询条件
* @Author huyc
* @Date 2022-07-27
* @param userId
* @param settleDepartId
* @param unitId
* @param empIdCard
* @param socialHouseId
* @param fundHouseId
* @param queryEntity
* @param type 0 全部删除 1 删除社保 2 删除公积金 必填
* @return
**/
private void initQueryCondition(String userId, String settleDepartId, String unitId, String empIdCard,
String socialHouseId, String fundHouseId, TPaymentInfo queryEntity,String type) {
queryEntity.setCreateBy(userId);
// 公积金删除 以外的情况 都是查社保生成月份删除
if (CommonConstants.ZERO_STRING.equals(type)){
queryEntity.setSocialCreateMonth( DateUtil.getYearAndMonth(LocalDateTime.now(),0));
queryEntity.setProvidentCreateMonth( DateUtil.getYearAndMonth(LocalDateTime.now(),0));
}else if (CommonConstants.ONE_STRING.equals(type)){
queryEntity.setSocialCreateMonth( DateUtil.getYearAndMonth(LocalDateTime.now(),0));
}else if (CommonConstants.TWO_STRING.equals(type)){
queryEntity.setProvidentCreateMonth( DateUtil.getYearAndMonth(LocalDateTime.now(),0));
}
if (Common.isNotNull(settleDepartId)){
queryEntity.setSettleDomainId(settleDepartId);
}
if (Common.isNotNull(unitId)){
queryEntity.setUnitId(unitId);
}
if (Common.isNotNull(empIdCard)){
queryEntity.setEmpIdcard(empIdCard);
for (String id : idList) {
paymentInfo = baseMapper.selectById(id);
if (null != paymentInfo && Common.isNotNull(paymentInfo.getId())) {
if ((!user.getId().equals(paymentInfo.getCreateBy()) ||
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()))
&& !CommonConstants.ONE_STRING.equals(user.getId())) {
return R.failed("存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
}
if (Common.isNotNull(socialHouseId)){
queryEntity.setSocialHousehold(socialHouseId);
baseMapper.deleteById(id);
}
if (Common.isNotNull(fundHouseId)){
queryEntity.setProvidentHousehold(fundHouseId);
}
return R.ok();
}
/**
* 删除社保或公积金
* 通过ID获取缴费库 及社保、公积金明细
*
* @param type
* @param info
* @param id
* @Author huyc
* @Date 2022-07-24
* @return
**/
private void removeByType(String type, TPaymentInfo info) {
// 只删除社保
if (CommonConstants.ZERO_STRING.equals(type) && Common.isNotNull(info.getSocialId())) {
info.setSumAll(BigDecimalUtils.safeAdd(info.getProvidentSum()));
info.setSocialSum(BigDecimal.ZERO);
info.setUnitSocialSum(BigDecimal.ZERO);
info.setSocialSecurityPersonalSum(BigDecimal.ZERO);
info.setSocialHousehold(null);
info.setSocialId(null);
if (Common.isNotNull(info.getFundId())) {
baseMapper.updateDeleteInfo(info);
} else {
baseMapper.deleteById(info.getId());
}
// 只删除公积金
} else if (CommonConstants.ONE_STRING.equals(type) && Common.isNotNull(info.getFundId())) {
info.setSumAll(BigDecimalUtils.safeAdd(info.getSocialSum()));
info.setProvidentSum(BigDecimal.ZERO);
info.setProvidentHousehold(null);
info.setFundId(null);
if (Common.isNotNull(info.getSocialId())) {
baseMapper.updateDeleteInfo(info);
} else {
baseMapper.deleteById(info.getId());
}
}
}
/**
* 按类型删除缴费库数据
* @Author huyc
* @Date 2022-07-27
* @param type
* @param paymentInfoList
* @return
**/
private void deletePaymentByType(String type, List<TPaymentInfo> paymentInfoList) {
for (TPaymentInfo info:paymentInfoList){
// 全部删除
if (CommonConstants.ZERO_STRING.equals(type)){
if (Common.isNotNull(info.getId())){
baseMapper.deleteById(info.getId());
}
// 只删除社保
}else if (CommonConstants.ONE_STRING.equals(type)){
info.setSumAll(BigDecimalUtils.safeAdd(info.getProvidentSum()));
info.setSocialSum(BigDecimal.ZERO);
info.setUnitSocialSum(BigDecimal.ZERO);
info.setSocialSecurityPersonalSum(BigDecimal.ZERO);
info.setSocialHousehold(null);
info.setSocialId(null);
if (Common.isNotNull(info.getFundId())){
baseMapper.updateDeleteInfo(info);
}else {
baseMapper.deleteById(info.getId());
}
// 只删除公积金
}else if (CommonConstants.TWO_STRING.equals(type)){
info.setSumAll(BigDecimalUtils.safeAdd(info.getSocialSum()));
info.setProvidentSum(BigDecimal.ZERO);
info.setProvidentHousehold(null);
info.setFundId(null);
if (Common.isNotNull(info.getSocialId())){
baseMapper.updateDeleteInfo(info);
}else {
baseMapper.deleteById(info.getId());
}
}
}
}
private Long noPageCountDiy(TPaymentInfoSearchVo searchVo) {
LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(searchVo);
if (Common.isNotNull(searchVo.getIdList())) {
wrapper.in(TPaymentInfo::getId, searchVo.getIdList());
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TPaymentInfoSearchVo entity) {
LambdaQueryWrapper<TPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TPaymentInfo::getCreateTime, entity.getCreateTimes()[0])
.le(TPaymentInfo::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TPaymentInfo::getCreateName, entity.getCreateName());
}
return wrapper;
@Override
public R getAllInfoById(String id) {
TPaymentInfoVo vo = baseMapper.getAllInfoById(id);
return R.ok(vo, "查询成功!");
}
@Override
......@@ -542,7 +342,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<String> monthList = Common.listObjectToStrList(list, ExcelAttributeConstants.SOCIAL_PAY_MONTH).stream().distinct().collect(Collectors.toList());
//已存在社保缴费库数据 非删除状态
List<TPaymentInfo> paymentInfos = baseMapper.selectListForPaymentImport(monthList, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD));
//社保唯一性检验条件:身份证+社保缴纳月份+生成月份
//养老
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap = new ConcurrentHashMap<>();
//大病救助金
......@@ -559,7 +358,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (TPaymentInfo info : paymentInfos) {
if (BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(info.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(info.getPersonalPensionMoney())).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoBigMap.put(info.getSocialPayAddr()
paymentInfoPensionMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
......@@ -572,7 +371,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
if (BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(info.getPersonalBigmailmentMoney()),
BigDecimalUtils.isNullToZero(info.getUnitBigmailmentMoney())).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoPensionMap.put(info.getSocialPayAddr()
paymentInfoBigMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
......@@ -868,10 +667,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
String[] areaArray;
List<TPaymentInfo> paymentInfoListTemp;
BigDecimal cTemp;
String result = null;
String lockKey;
String checkRes;
for (TPaymentInfoVo infoVo : list) {
atomicLine.incrementAndGet();
......@@ -1163,15 +958,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialPayAddr(paymentInfo.getSocialPayAddr() + CommonConstants.CENTER_SPLIT_LINE_STRING + temp);
}
}
// 同时设置公积金缴纳地 如果是安徽省公积金不做变更
if (!CommonConstants.ANHUISTRING.equals(paymentInfo.getProvidentPayAddr())) {
paymentInfo.setProvidentPayAddr(paymentInfo.getSocialPayAddr());
}
paymentInfo.setSocialSettlementFlag(CommonConstants.ZERO_STRING);
paymentInfo.setSocialSecurityNo(infoVo.getSocialSecurityNo());
paymentInfo.setSocialCreateMonth(infoVo.getSocialCreateMonth());
// 同时增加公积金生成月
paymentInfo.setProvidentCreateMonth(paymentInfo.getSocialCreateMonth());
paymentInfo.setUnitPensionMoney(infoVo.getUnitPensionMoney());
paymentInfo.setUnitMedicalMoney(infoVo.getUnitMedicalMoney());
paymentInfo.setUnitBirthMoney(null == infoVo.getUnitBirthMoney() ? BigDecimal.ZERO : infoVo.getUnitBirthMoney());
......@@ -1216,7 +1004,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, paymentInfo.getPersonalAccrual()));
paymentInfo.setSocialSum(BigDecimalUtils.safeAdd(
paymentInfo.getUnitSocialSum(), paymentInfo.getSocialSecurityPersonalSum()));
paymentInfo.setSumAll(BigDecimalUtils.safeAdd(paymentInfo.getSocialSum(), paymentInfo.getProvidentSum()));
paymentInfo.setSumAll(paymentInfo.getSocialSum());
paymentInfo.setUpdateBy(user.getId());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getSocialId())) {
paymentInfo.setSocialId(UUID.randomUUID().toString());
......@@ -1678,53 +1466,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo = null;
}
//安徽省的公积金合并到合肥市的社保缴费库数据中
if (CommonConstants.ANHUISTRING.equals(infoVo.getProvidentPayAddr())) {
paymentInfoListTemp = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.and(obj -> obj
.eq(TPaymentInfo::getSocialPayAddr, CommonConstants.HEFEISTRING)
.or()
.eq(TPaymentInfo::getProvidentPayAddr, CommonConstants.ANHUISTRING))
.eq(TPaymentInfo::getEmpIdcard, infoVo.getEmpIdcard())
.eq(TPaymentInfo::getProvidentPayMonth, infoVo.getProvidentPayMonth().trim())
.eq(TPaymentInfo::getProvidentCreateMonth, infoVo.getProvidentCreateMonth().trim()));
} else {
paymentInfoListTemp = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getSocialPayAddr, infoVo.getProvidentPayAddr())
.eq(TPaymentInfo::getEmpIdcard, infoVo.getEmpIdcard())
.eq(TPaymentInfo::getProvidentPayMonth, infoVo.getProvidentPayMonth().trim())
.eq(TPaymentInfo::getProvidentCreateMonth, infoVo.getProvidentCreateMonth().trim()));
}
if (Common.isNotNull(paymentInfoListTemp)) {
for (TPaymentInfo info : paymentInfoListTemp) {
cTemp = BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getPersonalProvidentSum());
//如果是退费:社保为零 或 社保相等更新
if ((BigDecimalUtils.isNullToZero(info.getSumAll()).compareTo(BigDecimal.ZERO) < 0) &&
cTemp.compareTo(BigDecimal.ZERO) < 0 &&
(BigDecimalUtils.isNullToZero(info.getProvidentSum()).compareTo(BigDecimal.ZERO) == 0
|| cTemp.compareTo(info.getProvidentSum()) == 0)) {
paymentInfo = info;
break;
}
//社保为零 或者社保金额相等是更新 其他新增
if ((BigDecimalUtils.isNullToZero(info.getProvidentSum()).compareTo(BigDecimal.ZERO) == 0
&& BigDecimalUtils.isNullToZero(info.getSumAll()).compareTo(BigDecimal.ZERO) > 0)
|| (BigDecimalUtils.isNullToZero(info.getProvidentSum()).compareTo(BigDecimal.ZERO) > 0
&& cTemp.compareTo(info.getProvidentSum()) == 0)) {
paymentInfo = info;
break;
}
}
}
if (Common.isNotNull(paymentInfo) &&
(CommonConstants.ONE_STRING.equals(paymentInfo.getSalaryFundFlag())
|| CommonConstants.TWO_STRING.equals(paymentInfo.getSalaryFundFlag()))) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "对应员工身份证" +
infoVo.getEmpName() + CommonConstants.DOWN_LINE_STRING + infoVo.getEmpIdcard()
+ "公积金缴费数据已薪资结算,无法更新!"));
continue;
}
if (null == paymentInfo) {
paymentInfo = new TPaymentInfo();
paymentInfo.setLockStatus(CommonConstants.ZERO_STRING);
......@@ -1740,11 +1481,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setProvidentPayMonth(infoVo.getProvidentPayMonth());
//同时设置社保缴纳日期方便导入处理
paymentInfo.setSocialPayMonth(infoVo.getProvidentPayMonth());
paymentInfo.setFundSettlementFlag(CommonConstants.ZERO_STRING);
paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown());
paymentInfo.setProvidentHousehold(fund.getProvidentHousehold());
if (null != paymentInfo.getFundProvince()) {
temp = areaMap.get(paymentInfo.getFundProvince());
......@@ -1766,14 +1505,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.CENTER_SPLIT_LINE_STRING + temp);
}
}
if (CommonConstants.ANHUISTRING.equals(paymentInfo.getProvidentPayAddr())) {
paymentInfo.setSocialPayAddr(CommonConstants.HEFEISTRING);
} else {
paymentInfo.setSocialPayAddr(paymentInfo.getProvidentPayAddr());
}
paymentInfo.setProvidentCreateMonth(infoVo.getProvidentCreateMonth());
//同步新增社保生成月份
paymentInfo.setSocialCreateMonth(paymentInfo.getProvidentCreateMonth());
paymentInfo.setUnitProvidentSet(null == infoVo.getUnitProvidentSet() ? BigDecimal.ZERO : infoVo.getUnitProvidentSet());
paymentInfo.setPersonalProidentSet(null == infoVo.getUnitProvidentSet() ? BigDecimal.ZERO : infoVo.getUnitProvidentSet());
paymentInfo.setProvidentPercent(null == infoVo.getProvidentPercent() ? BigDecimal.ZERO : infoVo.getProvidentPercent());
......@@ -1781,7 +1514,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setPersonalProvidentSum(null == infoVo.getUnitProvidentSum() ? BigDecimal.ZERO : infoVo.getUnitProvidentSum());
paymentInfo.setUnitProvidentSum(null == infoVo.getUnitProvidentSum() ? BigDecimal.ZERO : infoVo.getUnitProvidentSum());
paymentInfo.setProvidentSum(BigDecimalUtils.safeAdd(paymentInfo.getUnitProvidentSum(), paymentInfo.getPersonalProvidentSum()));
paymentInfo.setSumAll(BigDecimalUtils.safeAdd(paymentInfo.getSocialSum(), paymentInfo.getProvidentSum()));
paymentInfo.setSumAll(paymentInfo.getProvidentSum());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getFundId())) {
paymentInfo.setFundId(UUID.randomUUID().toString());
}
......@@ -1850,15 +1583,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
getErrorMessageHashMapThree(user, random, errorMessageList, key, listMap);
}
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if (CollUtil.isNotEmpty(list)) {
int taskSize = list.size() / partSize + CommonConstants.ONE_INT;
int residualCapacity = yfSocialImportThreadPoolExecutor.getResidualCapacity();
if (taskSize > residualCapacity) {
errorMessageList.add(new ErrorMessage(-1, MsgUtils.getMessage(ErrorCodes.SOCIALINFO_LIST_NUM_LARGE)));
}
}
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if (CollUtil.isNotEmpty(list)) {
......@@ -1873,19 +1597,72 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//已存在的档案数据
List<String> monthList = Common.listObjectToStrList(list, ExcelAttributeConstants.SOCIAL_PAY_MONTH).stream().distinct().collect(Collectors.toList());
//已存在社保缴费库数据 非删除状态
List<TPaymentInfoVo> paymentInfos = baseMapper.selectPaymentAllInfoByMonthAndIdCard(monthList,
List<TPaymentInfo> paymentInfos = baseMapper.selectListForPaymentImport(monthList,
Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD));
//社保唯一性检验条件:身份证+社保缴纳月份+生成月份
ConcurrentHashMap<String, TPaymentInfoVo> paymentInfoMap = new ConcurrentHashMap<>();
//养老
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap = new ConcurrentHashMap<>();
//大病救助金
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap = new ConcurrentHashMap<>();
//失业
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap = new ConcurrentHashMap<>();
//工伤
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap = new ConcurrentHashMap<>();
//医保
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap = new ConcurrentHashMap<>();
if (Common.isNotNull(paymentInfos)) {
for (TPaymentInfoVo info : paymentInfos) {
paymentInfoMap.putIfAbsent(info.getSocialPayAddr()
for (TPaymentInfo info : paymentInfos) {
if (BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(info.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(info.getPersonalPensionMoney())).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoPensionMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialPayMonth()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialCreateMonth(), info);
+ info.getSocialCreateMonth()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.PENSION_RISK
, info);
}
if (BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(info.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(info.getPersonalUnemploymentMoney())).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoUnEmpMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialPayMonth()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialCreateMonth()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.UNEMPLOYEEMENT_RISK
, info);
}
if (BigDecimalUtils.isNullToZero(info.getUnitInjuryMoney()).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoInjuryMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialPayMonth()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialCreateMonth()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.INJURY_RISK
, info);
}
if (BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(info.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(info.getPersonalMedicalMoney())).compareTo(BigDecimal.ZERO) != 0) {
paymentInfoMedicalMap.put(info.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ info.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialPayMonth()
+ CommonConstants.DOWN_LINE_STRING
+ info.getSocialCreateMonth()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.MEDICAL
, info);
}
}
}
// -----------------------------生成paymentInfoMap本段结束--------------------------------
......@@ -1904,7 +1681,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (list.size() < partSize) {
CompletableFuture<List<TPaymentInfoImportLog>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, random, list, areaMap, areaMap2,
paymentInfoMap, CommonConstants.ONE_INT, type), yfSocialImportThreadPoolExecutor)
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, CommonConstants.ONE_INT, type), yfSocialImportThreadPoolExecutor)
.whenComplete((result, e) -> {
if (CollectionUtils.isNotEmpty(result)) {
this.tPaymentInfoImportLogService.saveBatch(result);
......@@ -1922,7 +1700,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
final List<TPaymentHeFeiVo> finalList = list.subList(0, 1);
CompletableFuture<List<TPaymentInfoImportLog>> oneCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, random, finalList, areaMap, areaMap2,
paymentInfoMap, CommonConstants.ONE_INT, type), yfSocialImportThreadPoolExecutor)
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, CommonConstants.ONE_INT, type), yfSocialImportThreadPoolExecutor)
.whenComplete((result, e) -> {
if (CollectionUtils.isNotEmpty(result)) {
this.tPaymentInfoImportLogService.saveBatch(result);
......@@ -1940,7 +1719,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentHeFeiVo> finalTempList1 = tempList;
CompletableFuture<List<TPaymentInfoImportLog>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, random, finalTempList1, areaMap,
areaMap2, paymentInfoMap, idx, type), yfSocialImportThreadPoolExecutor)
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, idx, type), yfSocialImportThreadPoolExecutor)
.whenComplete((result, e) -> {
if (CollectionUtils.isNotEmpty(result)) {
this.tPaymentInfoImportLogService.saveBatch(result);
......@@ -1971,7 +1751,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int finalLastIdx = lastIdx + 1;
CompletableFuture<List<TPaymentInfoImportLog>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, random, finalTempList, areaMap,
areaMap2, paymentInfoMap, finalLastIdx, type), yfSocialImportThreadPoolExecutor)
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, finalLastIdx, type), yfSocialImportThreadPoolExecutor)
.whenComplete((result, e) -> {
if (CollectionUtils.isNotEmpty(result)) {
this.tPaymentInfoImportLogService.saveBatch(result);
......@@ -2000,7 +1781,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil.remove(key);
errorMessageList.add(new ErrorMessage(-1, "数据批量导入异常:" + e));
} finally {
paymentInfoMap.clear();
paymentInfoPensionMap.clear();
paymentInfoBigMap.clear();
paymentInfoMedicalMap.clear();
paymentInfoUnEmpMap.clear();
paymentInfoInjuryMap.clear();
}
}
......@@ -2039,16 +1824,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentHeFeiVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfoVo> paymentInfoMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
int idx,
String type) {
int i = idx;
List<TPaymentInfoImportLog> logList = new ArrayList<>();
if (Common.isNotNull(list)) {
TPaymentInfoVo payExists = null;
TPaymentInfo payExists = null;
TSocialInfo socialInfo = null;
String temp;
TPaymentInfo tempPay;
int res = -1;
List<String> idcards = Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD);
// 全部办理成功 和 部分办理失败
......@@ -2087,8 +1874,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray;
String checkRes;
String result = null;
String lockKey;
for (TPaymentHeFeiVo infoVo : list) {
atomicLine.incrementAndGet();
++i;
......@@ -2170,48 +1955,114 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, CommonConstants.ERROR_MSG_PRFIX + "必填项校验失败:社保缴纳月份不可为空!", i, random));
continue;
}
// 判重 此处代码块要同步,否则无法保证导入数据的重复性
lockKey = infoVo.getSocialPayAddr()
//判断是否存在养老缴费数据
if (PaymentConstants.PENSION_RISK.equals(infoVo.getRiskType())) {
payExists = paymentInfoPensionMap.get(infoVo.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialCreateMonth().trim();
try {
result = RedisDistributedLock.tryLock(lockKey, CommonConstants.ONE_STRING, 500, null);
} catch (InterruptedException e) {
+ infoVo.getSocialCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.PENSION_RISK);
//存在社保缴费数据
if (null != payExists && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitSet())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalPensionMoney()))).compareTo(BigDecimal.ZERO) > 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "竞争导入异常,请重新导入!", i, random));
RedisDistributedLock.unlock(lockKey, result);
, CommonConstants.ERROR_MSG_PRFIX + "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的养老缴费数据,请勿重复导入!", i, random));
continue;
} else {
payExists = null;
}
if (Common.isNotNull(result)) {
try {
if (null != paymentInfoMap) {
payExists = paymentInfoMap.get(lockKey);
}
//判断是否存在失业缴费数据
if (PaymentConstants.UNEMPLOYEEMENT_RISK.equals(infoVo.getRiskType())) {
payExists = paymentInfoUnEmpMap.get(infoVo.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.UNEMPLOYEEMENT_RISK);
//存在社保缴费数据
if (Common.isNotNull(payExists)) {
// 已结算 提示, 考虑到退费和正常缴纳的 :1.正交缴纳和退费: 生成月份+缴纳月份不可能一致的无需派单 2.异地缴纳:不同区域缴纳也不用判断
if (CommonConstants.ONE_STRING.equals(payExists.getSalarySocialFlag())
|| CommonConstants.TWO_STRING.equals(payExists.getSalarySocialFlag())
|| CommonConstants.ONE_STRING.equals(payExists.getSocialSettlementFlag())
|| CommonConstants.TWO_STRING.equals(payExists.getSocialSettlementFlag())) {
if (null != payExists && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitSet())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalUnemploymentMoney()))).compareTo(BigDecimal.ZERO) > 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "对应员工身份证" + infoVo.getEmpIdcard()
+ "社保已工资或核准表结算!", i, random));
, CommonConstants.ERROR_MSG_PRFIX + "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的失业缴费数据,请勿重复导入!", i, random));
continue;
} else {
payExists = null;
}
}
// 校验每种险种是否可以导入
if (checkImportInfo(random, i, logList, payExists, infoVo, type)) {
//判断是否存在医保缴费数据
if (CommonConstants.ONE_STRING.equals(type)) {
payExists = paymentInfoMedicalMap.get(infoVo.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.MEDICAL);
//存在社保缴费数据
if (null != payExists && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalMedicalMoney()))).compareTo(BigDecimal.ZERO) > 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医保缴费数据,请勿重复导入!", i, random));
continue;
} else {
payExists = null;
}
}
//判断是否存在工伤缴费数据
if (PaymentConstants.INJURY_RISK.equals(infoVo.getRiskType())) {
payExists = paymentInfoInjuryMap.get(infoVo.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getSocialCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ PaymentConstants.INJURY_RISK);
//存在社保缴费数据
if (null != payExists && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())),
BigDecimalUtils.isNullToZero(payExists.getUnitInjuryMoney())).compareTo(BigDecimal.ZERO) > 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的单位工伤缴费数据,请勿重复导入!", i, random));
continue;
} else {
payExists = null;
}
}
if (null == payExists) {
payExists = new TPaymentInfoVo();
payExists = new TPaymentInfo();
payExists.setLockStatus(CommonConstants.ZERO_STRING);
payExists.setEmpId(socialInfo.getEmpId());
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
......@@ -2221,9 +2072,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setUnitId(socialInfo.getBelongUnit());
payExists.setInauguralTeam(socialInfo.getInauguralTeam());
payExists.setTelecomNumber(socialInfo.getTelecomNumber());
payExists.setSalaryFundFlag(CommonConstants.ZERO_STRING);
payExists.setSalarySocialFlag(CommonConstants.ZERO_STRING);
payExists.setSocialSettlementFlag(CommonConstants.ZERO_STRING);
}
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
......@@ -2252,15 +2100,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSocialPayAddr(payExists.getSocialPayAddr() + CommonConstants.CENTER_SPLIT_LINE_STRING + temp);
}
}
// 同时设置公积金缴纳地 如果是安徽省公积金不做变更
if (!CommonConstants.ANHUISTRING.equals(payExists.getProvidentPayAddr())) {
payExists.setProvidentPayAddr(payExists.getSocialPayAddr());
}
payExists.setSocialSettlementFlag(CommonConstants.ZERO_STRING);
payExists.setSocialSecurityNo(infoVo.getSocialSecurityNo());
payExists.setSocialCreateMonth(infoVo.getSocialCreateMonth());
// 同时增加公积金生成月
payExists.setProvidentCreateMonth(payExists.getSocialCreateMonth());
if (PaymentConstants.PENSION_RISK.equals(infoVo.getRiskType())) {
payExists.setUnitPensionMoney(infoVo.getUnitMoney());
payExists.setPersonalPensionMoney(infoVo.getPersonalMoney());
......@@ -2320,13 +2161,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, payExists.getSocialSecurityPersonalSum()));
}
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
payExists.setSumAll(BigDecimalUtils.safeAdd(payExists.getSocialSum(), payExists.getProvidentSum()));
payExists.setSumAll(payExists.getSocialSum());
if (null != payExists && Common.isEmpty(payExists.getSocialId())) {
payExists.setSocialId(UUID.randomUUID().toString());
}
tempPay = reflectionPaymentInfo(payExists);
if (null != payExists && Common.isNotNull(payExists.getId())) {
res = baseMapper.updateById(tempPay);
res = baseMapper.updateById(payExists);
if (res < 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + infoVo.getEmpIdcard() + "_缴费库更新失败!", i, random));
......@@ -2334,41 +2174,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} else {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.SUCCESS_MSG_PREFIX + infoVo.getEmpIdcard() + "_缴费库更新成功!", i, random));
paymentInfoMap.putIfAbsent(payExists.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getSocialCreateMonth().trim(), payExists);
continue;
}
} else {
res = insertAndSTimestamp(tempPay);
res = insertAndSTimestamp(payExists);
if (res < 0) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + infoVo.getEmpIdcard() + "_缴费库保存失败!", i, random));
continue;
}
payExists.setId(tempPay.getId());
paymentInfoMap.putIfAbsent(payExists.getSocialPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getEmpIdcard().trim()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getSocialPayMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ payExists.getSocialCreateMonth().trim(), payExists);
}
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.SUCCESS_MSG_PREFIX + "保存成功!", i, random));
} finally {
RedisDistributedLock.unlock(lockKey, result);
}
} else {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "竞争导入失败,请重新导入!", i, random));
}
}
} else {
return null;
......@@ -2379,7 +2196,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
/**
* 导入校验
**/
private boolean socialThreeCheckBase(String random, int i, List<TPaymentInfoImportLog> logList, TPaymentHeFeiVo infoVo, String type) {
private boolean socialThreeCheckBase(String random, int i, List<TPaymentInfoImportLog> logList, TPaymentHeFeiVo
infoVo, String type) {
if (!Common.isNotNull(infoVo.getSocialPayMonth())) {
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.ERROR_MSG_PRFIX + "社保缴纳月份不可为空!", i, random));
......@@ -2405,58 +2223,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return false;
}
/**
* 字段对应
**/
private TPaymentInfo reflectionPaymentInfo(TPaymentInfoVo from) {
TPaymentInfo to = new TPaymentInfo();
if (Common.isNotNull(from)) {
to.setId(from.getId());
to.setEmpName(from.getEmpName());
to.setEmpNo(from.getEmpNo());
to.setEmpId(from.getEmpId());
to.setEmpIdcard(from.getEmpIdcard());
to.setUnitId(from.getUnitId());
to.setSettleDomainId(from.getSettleDomainId());
to.setSocialHousehold(from.getSocialHousehold());
to.setSocialSecurityNo(from.getSocialSecurityNo());
to.setSocialPayAddr(from.getSocialPayAddr());
to.setSocialProvince(from.getSocialProvince());
to.setSocialCity(from.getSocialCity());
to.setSocialTown(from.getSocialTown());
to.setSocialCreateMonth(from.getSocialCreateMonth());
to.setSocialPayMonth(from.getSocialPayMonth());
to.setLockStatus(from.getLockStatus());
to.setProvidentPayMonth(from.getProvidentPayMonth());
to.setProvidentCreateMonth(from.getProvidentCreateMonth());
to.setProvidentHousehold(from.getProvidentHousehold());
to.setProvidentPayAddr(from.getProvidentPayAddr());
to.setFundProvince(from.getFundProvince());
to.setFundCity(from.getFundCity());
to.setFundTown(from.getFundTown());
to.setSumAll(from.getSumAll());
to.setSocialId(from.getSocialId());
to.setFundId(from.getFundId());
to.setSocialSum(from.getSocialSum());
to.setUnitSocialSum(from.getUnitSocialSum());
to.setSocialSecurityPersonalSum(from.getSocialSecurityPersonalSum());
to.setProvidentSum(from.getProvidentSum());
to.setSalarySocialFlag(from.getSalarySocialFlag());
to.setSalaryFundFlag(from.getSalaryFundFlag());
to.setSocialSettlementFlag(from.getSocialSettlementFlag());
to.setFundSettlementFlag(from.getFundSettlementFlag());
to.setSocialSettlementId(from.getSocialSettlementId());
to.setFundSettlementId(from.getFundSettlementId());
to.setInauguralTeam(from.getInauguralTeam());
to.setTelecomNumber(from.getTelecomNumber());
}
return to;
}
/**
* 转换缴纳地址为省市县ID
**/
private TPaymentHeFeiVo initAddressThree(String[] areaArray, HashMap<String, String> areaMap2, TPaymentHeFeiVo s) {
private TPaymentHeFeiVo initAddressThree(String[]
areaArray, HashMap<String, String> areaMap2, TPaymentHeFeiVo s) {
if (null == areaArray || null == areaMap2 || null == s) {
return s;
}
......@@ -2495,7 +2266,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @Author huyc
* @Date 2022-07-27
**/
private boolean checkImportInfo(String random, int i, List<TPaymentInfoImportLog> logList, TPaymentInfoVo payExists
private boolean checkImportInfo(String random, int i, List<TPaymentInfoImportLog> logList, TPaymentInfoVo
payExists
, TPaymentHeFeiVo infoVo, String type) {
boolean flag;
if (CommonConstants.ZERO_STRING.equals(type)) {
......@@ -2605,16 +2377,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}else {
} else {
return null;
}
}else if (areaArray.length == 1) {
} else if (areaArray.length == 1) {
if (null != s.getFundProvince() && null == s.getFundCity()) {
if (areaArray[0].equals(areaMap.get(String.valueOf(s.getFundProvince())))) {
return s;
}
}else {
} else {
return null;
}
}
......
......@@ -1125,12 +1125,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
if (Common.isEmpty(tPreDispatchInfo.getPensionAddress())
&& Common.isEmpty(tPreDispatchInfo.getFundAddress())
&& CommonConstants.ZERO_STRING.equals(tPreDispatchInfo.getType())) {
return "派增的社保缴纳地与公积金缴纳地不可同时为空!";
return "派增的养老数据和公积金数据不能同时为空,请完善!";
}
if (Common.isEmpty(tPreDispatchInfo.getPensionAddressReduce())
&& Common.isEmpty(tPreDispatchInfo.getFundAddressReduce())
&& CommonConstants.ONE_STRING.equals(tPreDispatchInfo.getType())) {
return "派减的社保缴纳地与公积金缴纳地不可同时为空!";
return "派减的养老数据和公积金数据不能同时为空,请完善!";
}
return null;
}
......@@ -1190,7 +1190,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return "公积金基数不可为空!";
}
if (Common.isNullOrZero(tPreDispatchInfo.getFundCompanyPer())) {
return "公积金单位比例不可为空!";
return "公积金企业比例不可为空!";
}
if (Common.isNullOrZero(tPreDispatchInfo.getFundPersonalPer())) {
return "公积个人比例不可为空!";
......
......@@ -155,4 +155,31 @@ public class ServiceUtil {
}
return false;
}
/**
* 查看社保公积金起缴日期是否符合补缴逻辑
* @Author fxj
* @Date 2020-09-07
* @param socialStartDate 起缴日期
* @param canOverpay 是否可补缴 0:是,1:否
* @param overpayNumber 补缴期限 整数
* @param haveThisMonth 是否含当月 0:是,1:否 如果无符合条件默认不含当月
* @return 符合 false 不符合 true
**/
public static boolean checkDispatchDate(LocalDateTime socialStartDate,String canOverpay,Integer overpayNumber,String haveThisMonth){
if (null == socialStartDate){
return false;
}
LocalDateTime temp = null;
LocalDateTime now = LocalDateTime.now();
if (CommonConstants.ZERO_STRING.equals(canOverpay)){
temp = socialStartDate.plusMonths(CommonConstants.ZERO_STRING.equals(haveThisMonth)?(long)overpayNumber:(long)(overpayNumber+1));
}else if (CommonConstants.ONE_STRING.equals(canOverpay)){
temp = socialStartDate;
}
return (null != temp && (temp.getYear() < now.getYear() || isaBoolean(temp, now)));
}
private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
return temp.getYear() == now.getYear() && temp.getMonthValue() < now.getMonthValue();
}
}
......@@ -94,7 +94,10 @@
<result property="idCardTown" column="ID_CARD_TOWN"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
</resultMap>
<resultMap id="dispatchPageMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPageVo" extends="tDispatchInfoMap">
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
</resultMap>
<!-- 派单导出vo -->
<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo">
<id property="id" column="ID"/>
......@@ -249,6 +252,13 @@
<if test="tDispatchInfo.settleDomain != null and tDispatchInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tDispatchInfo.settleDomain}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME like CONCAT(CONCAT(#{tDispatchInfo.settleDomainName}), '%')
</if>
<if test="tDispatchInfo.settleDomainCode != null and tDispatchInfo.settleDomainCode.trim() != ''">
AND a.SETTLE_DOMAIN_CODE = #{tDispatchInfo.settleDomainCode}
</if>
<if test="tDispatchInfo.deleteFlag != null and tDispatchInfo.deleteFlag.trim() != ''">
AND a.DELETE_FLAG = #{tDispatchInfo.deleteFlag}
</if>
......@@ -372,19 +382,27 @@
<if test="tDispatchInfo.dispatchItem != null and tDispatchInfo.dispatchItem.trim() != ''">
AND a.DISPATCH_ITEM = #{tDispatchInfo.dispatchItem}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME = #{tDispatchInfo.settleDomainName}
</if>
<if test="tDispatchInfo.belongUnitName != null and tDispatchInfo.belongUnitName.trim() != ''">
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND s.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND f.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if>
</if>
</sql>
<!--tDispatchInfo简单分页查询-->
<select id="getTDispatchInfoPage" resultMap="tDispatchInfoMap">
<select id="getTDispatchInfoPage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,
s.SOCIAL_HOUSEHOLD_NAME,
f.PROVIDENT_HOUSEHOLD_NAME
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID
<where>
1=1
<include refid="tDispatchInfo_where"/>
......@@ -553,15 +571,17 @@
</select>
<!--tDispatchInfo 社保办理数据查询-->
<select id="getTDispatchSocialHandlePage" resultMap="tDispatchInfoMap">
<select id="getTDispatchSocialHandlePage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,
b.SOCIAL_HOUSEHOLD_NAME
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 公积金办理数据查询-->
<select id="getTDispatchFundHandlePage" resultMap="tDispatchInfoMap">
<select id="getTDispatchFundHandlePage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,
c.PROVIDENT_HOUSEHOLD_NAME
<include refid="where_getFundRecord"/>
</select>
......@@ -712,7 +732,7 @@
FROM t_dispatch_info a
left join t_provident_fund c on a.FUND_ID = c.id
<where>
1=1 and b.DELETE_FLAG = 0
1=1 and a.DELETE_FLAG = 0
<if test="idsStr != null">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
......
......@@ -36,8 +36,7 @@
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="lockStatus" column="LOCK_STATUS"/>
<result property="socialSettlementFlag" column="SOCIAL_SETTLEMENT_FLAG"/>
<result property="fundSettlementFlag" column="FUND_SETTLEMENT_FLAG"/>
<result property="pushStatus" column="PUSH_STATUS"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
......@@ -57,8 +56,6 @@
<result property="providentSum" column="PROVIDENT_SUM"/>
<result property="socialSettlementId" column="SOCIAL_SETTLEMENT_ID"/>
<result property="fundSettlementId" column="FUND_SETTLEMENT_ID"/>
<result property="salarySocialFlag" column="SALARY_SOCIAL_FLAG"/>
<result property="salaryFundFlag" column="SALARY_FUND_FLAG"/>
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
<result property="telecomNumber" column="TELECOM_NUMBER"/>
<result property="sortTime" column="SORT_TIME"/>
......@@ -120,8 +117,7 @@
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.LOCK_STATUS,
a.SOCIAL_SETTLEMENT_FLAG,
a.FUND_SETTLEMENT_FLAG,
a.PUSH_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
......@@ -141,8 +137,6 @@
a.PROVIDENT_SUM,
a.SOCIAL_SETTLEMENT_ID,
a.FUND_SETTLEMENT_ID,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.INAUGURAL_TEAM,
a.TELECOM_NUMBER,
a.SORT_TIME,
......@@ -227,8 +221,6 @@
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.TELECOM_NUMBER,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
......@@ -310,11 +302,8 @@
<if test="tPaymentInfo.lockStatus != null and tPaymentInfo.lockStatus.trim() != ''">
AND a.LOCK_STATUS = #{tPaymentInfo.lockStatus}
</if>
<if test="tPaymentInfo.socialSettlementFlag != null and tPaymentInfo.socialSettlementFlag.trim() != ''">
AND a.SOCIAL_SETTLEMENT_FLAG = #{tPaymentInfo.socialSettlementFlag}
</if>
<if test="tPaymentInfo.fundSettlementFlag != null and tPaymentInfo.fundSettlementFlag.trim() != ''">
AND a.FUND_SETTLEMENT_FLAG = #{tPaymentInfo.fundSettlementFlag}
<if test="tPaymentInfo.pushStatus != null and tPaymentInfo.pushStatus.trim() != ''">
AND a.PUSH_STATUS = #{tPaymentInfo.pushStatus}
</if>
<if test="tPaymentInfo.sumAll != null">
AND a.SUM_ALL = #{tPaymentInfo.sumAll}
......@@ -383,12 +372,6 @@
<if test="tPaymentInfo.fundSettlementId != null and tPaymentInfo.fundSettlementId.trim() != ''">
AND a.FUND_SETTLEMENT_ID = #{tPaymentInfo.fundSettlementId}
</if>
<if test="tPaymentInfo.salarySocialFlag != null and tPaymentInfo.salarySocialFlag.trim() != ''">
AND a.SALARY_SOCIAL_FLAG = #{tPaymentInfo.salarySocialFlag}
</if>
<if test="tPaymentInfo.salaryFundFlag != null and tPaymentInfo.salaryFundFlag.trim() != ''">
AND a.SALARY_FUND_FLAG = #{tPaymentInfo.salaryFundFlag}
</if>
<if test="tPaymentInfo.inauguralTeam != null and tPaymentInfo.inauguralTeam.trim() != ''">
AND a.INAUGURAL_TEAM = #{tPaymentInfo.inauguralTeam}
</if>
......@@ -578,12 +561,6 @@
<if test="tPaymentInfo.lockStatus != null and tPaymentInfo.lockStatus.trim() != ''">
AND a.LOCK_STATUS = #{tPaymentInfo.lockStatus}
</if>
<if test="tPaymentInfo.socialSettlementFlag != null and tPaymentInfo.socialSettlementFlag.trim() != ''">
AND a.SOCIAL_SETTLEMENT_FLAG = #{tPaymentInfo.socialSettlementFlag}
</if>
<if test="tPaymentInfo.fundSettlementFlag != null and tPaymentInfo.fundSettlementFlag.trim() != ''">
AND a.FUND_SETTLEMENT_FLAG = #{tPaymentInfo.fundSettlementFlag}
</if>
<if test="tPaymentInfo.sumAll != null">
AND a.SUM_ALL = #{tPaymentInfo.sumAll}
</if>
......@@ -651,12 +628,6 @@
<if test="tPaymentInfo.fundSettlementId != null and tPaymentInfo.fundSettlementId.trim() != ''">
AND a.FUND_SETTLEMENT_ID = #{tPaymentInfo.fundSettlementId}
</if>
<if test="tPaymentInfo.salarySocialFlag != null and tPaymentInfo.salarySocialFlag.trim() != ''">
AND a.SALARY_SOCIAL_FLAG = #{tPaymentInfo.salarySocialFlag}
</if>
<if test="tPaymentInfo.salaryFundFlag != null and tPaymentInfo.salaryFundFlag.trim() != ''">
AND a.SALARY_FUND_FLAG = #{tPaymentInfo.salaryFundFlag}
</if>
<if test="tPaymentInfo.inauguralTeam != null and tPaymentInfo.inauguralTeam.trim() != ''">
AND a.INAUGURAL_TEAM = #{tPaymentInfo.inauguralTeam}
</if>
......@@ -814,8 +785,6 @@
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="lockStatus" column="LOCK_STATUS"/>
<result property="socialSettlementFlag" column="SOCIAL_SETTLEMENT_FLAG"/>
<result property="fundSettlementFlag" column="FUND_SETTLEMENT_FLAG"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
......@@ -884,9 +853,6 @@
<result property="fundTown" column="FUND_TOWN"/>
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
<result property="telecomNumber" column="TELECOM_NUMBER"/>
<result property="salarySocialFlag" column="SALARY_SOCIAL_FLAG"/>
<result property="salaryFundFlag" column="SALARY_FUND_FLAG"/>
</resultMap>
<!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoPage" resultMap="tPaymentInfoMap">
......@@ -986,15 +952,10 @@
FROM t_payment_info a
where 1=1
<if test="months != null and months.size > 0">
AND (a.SOCIAL_PAY_MONTH in
AND a.SOCIAL_PAY_MONTH in
<foreach item="item" index="index" collection="months" open="(" separator="," close=")">
#{item}
</foreach>
or a.PROVIDENT_PAY_MONTH in
<foreach item="item" index="index" collection="months" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="idcards != null and idcards.size > 0">
AND a.EMP_IDCARD IN
......@@ -1004,31 +965,6 @@
</if>
</select>
<!--tPaymentInfo 按ID查收缴费库包含社保和公积金明细的数据查询-->
<select id="selectPaymentAllInfoByMonthAndIdCard" resultMap="tPaymentAllInfoMap">
SELECT
<include refid="base_column_list_all"/>,
FROM t_payment_info a
where 1=1
<if test="months != null and months.size > 0">
AND (a.SOCIAL_PAY_MONTH in
<foreach item="item" index="index" collection="months" open="(" separator="," close=")">
#{item}
</foreach>
or a.PROVIDENT_PAY_MONTH in
<foreach item="item" index="index" collection="months" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="idcards != null and idcards.size > 0">
AND A.EMP_IDCARD IN
<foreach item="item" index="index" collection="idcards" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--tPaymentInfo 查询缴费库要删除的数据-->
<select id="selectListForDelete" resultType="com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo">
select
......
......@@ -771,202 +771,6 @@
where id = #{id}
</update>
<update id="updateBatchPreDispatchById" parameterType="com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo">
update t_pre_dispatch_info
<trim prefix="SET" suffixOverrides=",">
<if test="date != null ">date = #{date},</if>
<if test="company != null and company != ''">company = #{company},</if>
<if test="payAddress != null and payAddress != ''">pay_address = #{payAddress},</if>
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
<if test="empName != null and empName != ''">emp_name = #{empName},</if>
<if test="empIdcard != null and empIdcard != ''">emp_idcard = #{empIdcard},</if>
<if test="telOne != null and telOne != ''">tel_one = #{telOne},</if>
<if test="telTwo != null and telTwo != ''">tel_two = #{telTwo},</if>
<if test="entryDate != null ">entry_date = #{entryDate},</if>
<if test="formalSalary != null and formalSalary != ''">formal_salary = #{formalSalary},</if>
<if test="dispatchStart != null and dispatchStart != ''">dispatch_start = #{dispatchStart},</if>
<if test="dispatchEnd != null and dispatchEnd != ''">dispatch_end = #{dispatchEnd},</if>
<if test="contractType != null and contractType != ''">contract_type = #{contractType},</if>
<if test="contractStart != null and contractStart != ''">contract_start = #{contractStart},</if>
<if test="contractEnd != null and contractEnd != ''">contract_end = #{contractEnd},</if>
<if test="contractNameAdd != null and contractNameAdd != ''">
contract_name_add = #{contractNameAdd},
</if>
<if test="contractTypeAdd != null and contractTypeAdd != ''">
contract_type_add = #{contractTypeAdd},
</if>
<if test="contractStartAdd != null and contractStartAdd != ''">
contract_start_add = #{contractStartAdd},
</if>
<if test="contractEndAdd != null and contractEndAdd != ''">
contract_end_add = #{contractEndAdd},
</if>
<if test="contractTermAdd != null and contractTermAdd != ''">
contract_term_add = #{contractTermAdd},
</if>
<if test="contractNameAdd == null or contractNameAdd == ''">
contract_name_add = null,
</if>
<if test="contractTypeAdd == null or contractTypeAdd == ''">
contract_type_add = null,
</if>
<if test="contractStartAdd == null or contractStartAdd == ''">
contract_start_add = null,
</if>
<if test="contractEndAdd == null or contractEndAdd == ''">
contract_end_add = null,
</if>
<if test="contractTermAdd == null or contractTermAdd == ''">
contract_term_add = null,
</if>
<if test="trialStart != null and trialStart != ''">trial_start = #{trialStart},</if>
<if test="trialEnd != null and trialEnd != ''">trial_end = #{trialEnd},</if>
<if test="trialSalary != null and trialSalary !='' ">trial_salary = #{trialSalary},</if>
<if test="workingSystem != null and workingSystem != ''">working_system = #{workingSystem},</if>
<if test="contractVersion != null and contractVersion != ''">contract_version = #{contractVersion},</if>
<if test="telNotice != null and telNotice != ''">tel_notice = #{telNotice},</if>
<if test="workingAddress != null and workingAddress != ''">working_address = #{workingAddress},</if>
<if test="remarkOne != null and remarkOne != ''">remark_one = #{remarkOne},</if>
<if test="remarkTwo != null and remarkTwo != ''">remark_two = #{remarkTwo},</if>
<if test='type == "0"'>
<if test="pensionAddress != null and pensionAddress != ''">
pension_address = #{pensionAddress},
<if test="socialProvince != null and socialProvince != ''">social_province = #{socialProvince},</if>
<if test="socialCity != null and socialCity != ''">social_city = #{socialCity},</if>
<if test="socialTown != null and socialTown != ''">social_town = #{socialTown},</if>
</if>
<if test='pensionAddress == null || pensionAddress == ""'>
pension_address = null,
social_province = null,
social_city = null,
social_town = null,
</if>
<if test="fundAddress != null and fundAddress != ''">
fund_address = #{fundAddress},
<if test="fundProvince != null and fundProvince != ''">
fund_province = #{fundProvince},
<if test="fundCity == null">fund_city = null,</if>
<if test="fundTown == null">fund_town = null,</if>
</if>
<if test="fundCity != null and fundCity != ''">fund_city = #{fundCity},</if>
<if test="fundTown != null and fundTown != ''">fund_town = #{fundTown},</if>
</if>
<if test='fundAddress == null || fundAddress == ""'>
fund_address = null,
fund_province = null,
fund_city = null,
fund_town = null,
</if>
</if>
<if test='type == "1"'>
<if test="pensionAddressReduce != null and pensionAddressReduce != ''">
pension_address_reduce = #{pensionAddressReduce},
pension_address = #{pensionAddressReduce},
<if test="socialProvince != null and socialProvince != ''">social_province = #{socialProvince},</if>
<if test="socialCity != null and socialCity != ''">social_city = #{socialCity},</if>
<if test="socialTown != null and socialTown != ''">social_town = #{socialTown},</if>
</if>
<if test='pensionAddressReduce == null || pensionAddressReduce ==""'>
pension_address_reduce = null,
pension_end_reduce = null,
pension_address = null,
social_province = null,
social_city = null,
social_town = null,
</if>
<if test="fundAddressReduce != null and fundAddressReduce != ''">
fund_address_reduce = #{fundAddressReduce},
fund_address = #{fundAddressReduce},
<if test="fundProvince != null and fundProvince != ''">
fund_province = #{fundProvince},
<if test="fundCity == null">fund_city = null,</if>
<if test="fundTown == null">fund_town = null,</if>
</if>
<if test="fundCity != null and fundCity != ''">fund_city = #{fundCity},</if>
<if test="fundTown != null and fundTown != ''">fund_town = #{fundTown},</if>
</if>
<if test='fundAddressReduce == null || fundAddressReduce == ""'>
fund_address_reduce = null,
fund_address = null,
fund_end_reduce = null,
fund_province = null,
fund_city = null,
fund_town = null,
</if>
</if>
<if test="pensionBase != null ">pension_base = #{pensionBase},</if>
<if test="pensionStart != null and pensionStart != ''">pension_start = #{pensionStart},</if>
<if test="medicalAddress != null and medicalAddress != ''">medical_address = #{medicalAddress},</if>
<if test="medicalBase != null ">medical_base = #{medicalBase},</if>
<if test="medicalStart != null and medicalStart != ''">medical_start = #{medicalStart},</if>
<if test="injuryAddress != null and injuryAddress != ''">injury_address = #{injuryAddress},</if>
<if test="injuryBase != null ">injury_base = #{injuryBase},</if>
<if test="injuryStart != null and injuryStart != ''">injury_start = #{injuryStart},</if>
<if test="birthAddress != null and birthAddress != ''">birth_address = #{birthAddress},</if>
<if test="birthBase != null ">birth_base = #{birthBase},</if>
<if test="birthStart != null and birthStart != ''">birth_start = #{birthStart},</if>
<if test="unemploymentAddress != null and unemploymentAddress != ''">unemployment_address = #{unemploymentAddress},</if>
<if test="unemploymentBase != null ">unemployment_base = #{unemploymentBase},</if>
<if test="unemploymentStart != null and unemploymentStart != ''">unemployment_start = #{unemploymentStart},</if>
<if test="pensionBase == null ">pension_base = null,</if>
<if test="pensionStart == null">pension_start = null,</if>
<if test="medicalAddress == null or medicalAddress == ''">medical_address = null,</if>
<if test="medicalBase == null ">medical_base = null,</if>
<if test="medicalStart == null">medical_start = null,</if>
<if test="injuryAddress == null or injuryAddress == ''">injury_address = null,</if>
<if test="injuryBase == null ">injury_base = null,</if>
<if test="injuryStart == null">injury_start = null,</if>
<if test="birthAddress == null or birthAddress == ''">birth_address = null,</if>
<if test="birthBase == null ">birth_base = null,</if>
<if test="birthStart == null">birth_start = null,</if>
<if test="unemploymentAddress == null or unemploymentAddress == ''">unemployment_address = null,</if>
<if test="unemploymentBase == null ">unemployment_base = null,</if>
<if test="unemploymentStart == null">unemployment_start = null,</if>
<if test="fundBase != null ">fund_base = #{fundBase},</if>
<if test="fundStart != null and fundStart != ''">fund_start = #{fundStart},</if>
<if test="fundPersonalPer != null ">fund_personal_per = #{fundPersonalPer},</if>
<if test="fundCompanyPer != null ">fund_company_per = #{fundCompanyPer},</if>
<if test="fundBase == null ">fund_base = null,</if>
<if test="fundStart == null">fund_start = null,</if>
<if test="fundPersonalPer == null ">fund_personal_per = null,</if>
<if test="fundCompanyPer == null ">fund_company_per = null,</if>
<if test="dispatchCompany != null and dispatchCompany != ''">dispatch_company = #{dispatchCompany},</if>
<if test="customerService != null and customerService != ''">customer_service = #{customerService},</if>
<if test="contractMinorName != null and contractMinorName != ''">contract_minor_name = #{contractMinorName},</if>
<if test="uniqueNumber != null and uniqueNumber != ''">unique_number = #{uniqueNumber},</if>
<if test="customerNumber != null and customerNumber != ''">customer_number = #{customerNumber},</if>
<if test="serviceType != null and serviceType != ''">service_type = #{serviceType},</if>
<if test="pensionEndReduce != null and pensionEndReduce != ''">pension_end_reduce = #{pensionEndReduce},</if>
<if test="medicalAddressReduce != null and medicalAddressReduce != ''">medical_address_reduce = #{medicalAddressReduce},</if>
<if test="medicalEndReduce != null and medicalEndReduce != ''">medical_end_reduce = #{medicalEndReduce},</if>
<if test="injuryAddressReduce != null and injuryAddressReduce != ''">injury_address_reduce = #{injuryAddressReduce},</if>
<if test="injuryEndReduce != null and injuryEndReduce != ''">injury_end_reduce = #{injuryEndReduce},</if>
<if test="birthAddressReduce != null and birthAddressReduce != ''">birth_address_reduce = #{birthAddressReduce},</if>
<if test="birthEndReduce != null and birthEndReduce != ''">birth_end_reduce = #{birthEndReduce},</if>
<if test="unemploymentAddressReduce != null and unemploymentAddressReduce != ''">unemployment_address_reduce = #{unemploymentAddressReduce},</if>
<if test="unemploymentEndReduce != null and unemploymentEndReduce != ''">unemployment_end_reduce = #{unemploymentEndReduce},</if>
<if test="fundEndReduce != null and fundEndReduce != ''">fund_end_reduce = #{fundEndReduce},</if>
<if test="leaveDate != null ">leave_date = #{leaveDate},</if>
<if test="leaveReason != null and leaveReason != ''">leave_reason = #{leaveReason},</if>
<if test="leaveReasonAdd != null and leaveReasonAdd != ''">leave_reason_add = #{leaveReasonAdd},</if>
<if test="empTypeAdd != null and empTypeAdd != ''">emp_type_add = #{empTypeAdd},</if>
<if test="unitIdAdd != null and unitIdAdd != ''">unit_id_add = #{unitIdAdd},</if>
<if test="departIdAdd != null and departIdAdd != ''">depart_id_add = #{departIdAdd},</if>
<if test="socialHouseAdd != null and socialHouseAdd != ''">social_house_add = #{socialHouseAdd},</if>
<if test="fundHouseAdd != null and fundHouseAdd != ''">fund_house_add = #{fundHouseAdd},</if>
<if test="preStatus != null and preStatus != ''">pre_status = #{preStatus},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="exceptionContent != null">exception_content = #{exceptionContent},</if>
<if test="dataSubStatus != null and dataSubStatus != ''">data_sub_status = #{dataSubStatus},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="dispatchFlag != null and dispatchFlag != ''">dispatch_flag = #{dispatchFlag},</if>
<if test="cancelRemark != null and cancelRemark != ''">cancel_remark = #{cancelRemark},</if>
</trim>
where id = #{id}
</update>
<!-- 批量更新资料提交状态-->
<update id="modifyDataSubmitStatus">
update t_pre_dispatch_info
......
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