Commit 36ea5512 authored by huyuchen's avatar huyuchen

Merge branch 'develop'

# Conflicts:
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
parents d4d38d1e 75582572
/*
* 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.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
@TableName("t_employee_contract_area_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同地市权限配置表")
public class TEmployeeContractAreaRes extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 登录人id
*/
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id不能为空", maxLength = 32)
@NotBlank(message = "登录人id不能为空")
@Length(max = 32, message = "登录人id不能超过32个字符")
@ExcelProperty("登录人id")
@Schema(description = "登录人id")
private String userId;
/**
* 登录人姓名
*/
@ExcelProperty("审核人")
@Schema(description = "审核人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省",isArea = true,isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市",isArea = true,parentField = "fileProvince")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县",isArea = true,parentField = "fileCity")
@ExcelProperty("档案-县")
@Schema(description = "档案-县")
private Integer fileTown;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "审核人所在部门")
@ExcelProperty("办审核人所在部门")
@Schema(description = "审核人所在部门")
private String organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "状态")
@ExcelProperty("状态")
@Schema(description = "状态:0 启用 1 禁用")
private String status;
}
/*
* 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.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.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;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@Data
@ColumnWidth(10)
public class EmployeeContractExportAuditVO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "申请编号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("申请编号")
private String applyNo;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工编码")
@Length(max = 32, message = "员工编码不能超过32个字符")
@ExcelAttribute(name = "员工编码", isNotEmpty = true, errorInfo = "员工编码不能为空", maxLength = 32)
@Schema(description = "员工编码", name = "empNo")
private String empNo;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
@Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 32, needExport = true)
@Schema(description = "员工姓名", name = "empName")
private String empName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelAttribute(name = "身份证号", maxLength = 32, isIdCard = true, needExport = true)
@Schema(description = "身份证号", name = "empIdcard")
private String empIdcard;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("合同起始日期")
@NotBlank(message = "合同起始日期不能为空")
@ExcelAttribute(name = "合同起始日期", isNotEmpty = true, errorInfo = "合同起始日期不能为空")
@Schema(description = "合同起始日期", name = "contractStart")
private String contractStart;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("合同截止日期")
@ExcelAttribute(name = "合同截止日期", needExport = true)
@Schema(description = "合同截止日期", name = "contractEnd")
private String contractEnd;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-省")
@ExcelAttribute(name = "档案-省", maxLength = 32, isArea = true)
@Schema(description = "档案-省", name = "fileProvince")
private String fileProvince;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-市")
@ExcelAttribute(name = "档案-市", maxLength = 32, isArea = true, parentField = "fileProvince")
@Schema(description = "档案-市", name = "fileCity")
private String fileCity;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-县")
@ExcelAttribute(name = "档案-县", maxLength = 32, isArea = true, parentField = "fileCity")
@Schema(description = "档案-县", name = "fileTown")
private String fileTown;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
@Length(max = 128, message = "项目名称不能超过128个字符")
@ExcelAttribute(name = "项目名称", maxLength = 128)
@Schema(description = "项目名称", name = "subjectDepart")
private String subjectDepart;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String deptNo;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工类型")
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型(字典值,0外包1派遣2代理3内部员工)")
private String empNatrue;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("合同类型")
@NotBlank(message = "合同类型不能为空")
@Length(max = 32, message = "合同类型不能超过32个字符")
@ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true)
@Schema(description = "合同类型", name = "contractName")
private String contractName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("业务细分")
@NotBlank(message = "业务细分不能为空")
@Length(max = 32, message = "业务细分不能超过32个字符")
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
@Schema(description = "业务细分", name = "contractName")
private String contractSubName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("签订类型")
@NotBlank(message = "签订类型不能为空")
@Length(max = 1, message = "签订类型不能超过1个字符")
@ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订类型不能为空", maxLength = 100, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE)
@Schema(description = "签订类型", name = "situation")
private String situation;
/**
* 签订期限employee_contract_type
* 0 已完成一定工作任务为期限
* 1 固定期限
* 2 无固定期限
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("签订期限")
@NotBlank(message = "签订期限不能为空")
@Length(max = 32, message = "签订期限不能超过32个字符")
@ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Schema(description = "签订期限", name = "contractType")
private String contractType;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("合同甲方")
@ExcelAttribute(name = "合同甲方")
@Schema(description = "合同甲方")
@Size(max = 50, message = "合同甲方不可超过50位")
private String contractParty;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
@Length(max = 128, message = "客户名称不能超过128个字符")
@ExcelAttribute(name = "客户名称", maxLength = 128)
@Schema(description = "客户名称", name = "subjectUnit")
private String subjectUnit;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("审核状态")
@ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过")
@Schema(description = "审核状态")
private String auditStatus;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("合同状态")
@ExcelAttribute(name = "合同状态", readConverterExp = "0=可用,1=不可用")
@Schema(description = "合同状态", name = "inUse")
private String inUse;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("附件状态")
@ExcelAttribute(name = "附件状态")
@Schema(description = "附件状态", name = "isFile")
private String files;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("归档状态")
@ExcelAttribute(name = "归档状态", readConverterExp = "0=已归档,1=未归档")
@Schema(description = "归档状态", name = "isFile")
private String isFile;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建人")
private String createName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private String createTime;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("累计签订次数")
private String createNum;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("首签日期")
private String startDate;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("最晚到期日期")
private String endDate;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("历次记录")
private String history;
@TableField(exist = false)
@Schema(description = "选中的idList")
private List<String> idList;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/11/2
* @Description
* @Version 1.0
*/
@Data
public class EmployeeInfoSearchVo extends TEmployeeInfo {
/**
* 导出IDS
*/
@Schema(description = "导出IDS")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
}
...@@ -23,6 +23,7 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle; ...@@ -23,6 +23,7 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Past; import javax.validation.constraints.Past;
...@@ -484,4 +485,21 @@ public class EmployeeProjectExportParamVO extends BaseEntity { ...@@ -484,4 +485,21 @@ public class EmployeeProjectExportParamVO extends BaseEntity {
private String[] empNatureArray; private String[] empNatureArray;
private List<String> idList; private List<String> idList;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
/**
* 导出IDS
*/
@Schema(description = "导出IDS")
private String ids;
} }
/*
* 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.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmpContractAreaExportVo implements Serializable {
/**
* 登录人姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("审核人")
@Schema(description = "审核人")
private String userName;
/**
* 申請人所在部门
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "审核人所在部门")
@ExcelProperty("审核人所在部门")
@Schema(description = "审核人所在部门")
private String organName;
/**
* 档案-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "档案-省",isArea = true, isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private String fileProvince;
/**
* 档案-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "档案-市",isArea = true,parentField = "fileProvince")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private String fileCity;
/**
* 档案-县
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "档案-县",isArea = true,parentField = "fileCity")
@ExcelProperty("档案-县")
@Schema(description = "档案-县")
private String fileTown;
/**
* 状态 0 启用 1 禁用
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "授权状态",readConverterExp = "0=启用,1=禁用")
@ExcelProperty("授权状态")
@Schema(description = "授权状态:0 启用 1 禁用")
private String status;
}
/*
* 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.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmployeeContractAreaResSearchVo extends TEmployeeContractAreaRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Data
public class TEmployeeContractAreaResVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 登录人id
*/
@NotBlank(message = "登录人id 不能为空")
@Length(max = 32, message = "登录人id 不能超过32 个字符")
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id 不能为空", maxLength = 32)
@Schema(description = "登录人id")
@ExcelProperty("登录人id")
private String userId;
/**
* 档案-省
*/
@NotBlank(message = "档案-省 不能为空")
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省 不能为空")
@Schema(description = "档案-省")
@ExcelProperty("档案-省")
private String fileProvince;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@Schema(description = "档案-市")
@ExcelProperty("档案-市")
private String fileCity;
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县")
@Schema(description = "档案-县")
@ExcelProperty("档案-县")
private String fileTown;
}
...@@ -3,10 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -3,10 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonService; import com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -82,10 +84,9 @@ public class TCutsomerDataPermissonController { ...@@ -82,10 +84,9 @@ public class TCutsomerDataPermissonController {
**/ **/
@Operation(description = "权限复制 权限同项目分配客服(wxhr:tsettledomain_assign_customerservice)") @Operation(description = "权限复制 权限同项目分配客服(wxhr:tsettledomain_assign_customerservice)")
@GetMapping("/copy") @GetMapping("/copy")
//@PreAuthorize("@pms.hasPermission('tsettledomain_assign_customerservice')")
public R<String> insertForCopyCutsomerDataPermisson(String[] srcUser, String[] beUser) { public R<String> insertForCopyCutsomerDataPermisson(String[] srcUser, String[] beUser) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
R result = tCutsomerDataPermissonService.insertForCopyCutsomerDataPermisson(srcUser, beUser, user); R<String> result = tCutsomerDataPermissonService.insertForCopyCutsomerDataPermisson(srcUser, beUser, user);
if(CommonConstants.SUCCESS.equals(result.getCode())){//权限刷新 if(CommonConstants.SUCCESS.equals(result.getCode())){//权限刷新
settleDomainService.removeSettleCache(user, Arrays.asList(beUser)); settleDomainService.removeSettleCache(user, Arrays.asList(beUser));
} }
...@@ -111,11 +112,22 @@ public class TCutsomerDataPermissonController { ...@@ -111,11 +112,22 @@ public class TCutsomerDataPermissonController {
@Operation(description = "新增") @Operation(description = "新增")
@SysLog("新增客户数据权限表") @SysLog("新增客户数据权限表")
@PostMapping @PostMapping
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_add')") public R<String> save(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson){
public R<Boolean> save(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId())); settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId()));
return new R<>(tCutsomerDataPermissonService.save(tCutsomerDataPermisson)); if (Common.isNotNull(tCutsomerDataPermisson.getUserId()) && Common.isNotNull(tCutsomerDataPermisson.getSettleDomainId())) {
List<TCutsomerDataPermisson> list = tCutsomerDataPermissonService.list(Wrappers.<TCutsomerDataPermisson>query().lambda()
.eq(TCutsomerDataPermisson::getUserId, tCutsomerDataPermisson.getUserId())
.eq(TCutsomerDataPermisson::getSettleDomainId, tCutsomerDataPermisson.getSettleDomainId())
);
if (list != null && !list.isEmpty()) {
return R.failed("该用户已存在该项目");
}
tCutsomerDataPermissonService.save(tCutsomerDataPermisson);
return R.ok();
} else {
return R.failed("用户id与项目id必填");
}
} }
/** /**
...@@ -126,7 +138,6 @@ public class TCutsomerDataPermissonController { ...@@ -126,7 +138,6 @@ public class TCutsomerDataPermissonController {
@Operation(description = "修改") @Operation(description = "修改")
@SysLog("修改客户数据权限表") @SysLog("修改客户数据权限表")
@PutMapping @PutMapping
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_edit')")
public R<Boolean> update(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson) { public R<Boolean> update(@RequestBody TCutsomerDataPermisson tCutsomerDataPermisson) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId())); settleDomainService.removeSettleCache(user, Arrays.asList(tCutsomerDataPermisson.getUserId()));
...@@ -141,7 +152,6 @@ public class TCutsomerDataPermissonController { ...@@ -141,7 +152,6 @@ public class TCutsomerDataPermissonController {
@Operation(description = "删除(tcutsomerdatapermisson_del)") @Operation(description = "删除(tcutsomerdatapermisson_del)")
@SysLog("删除客户数据权限表") @SysLog("删除客户数据权限表")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
//@PreAuthorize("@pms.hasPermission('tcutsomerdatapermisson_del')")
public R<Boolean> removeById(@PathVariable String id){ public R<Boolean> removeById(@PathVariable String id){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
TCutsomerDataPermisson tdp = tCutsomerDataPermissonService.getById(id); TCutsomerDataPermisson tdp = tCutsomerDataPermissonService.getById(id);
......
/*
* 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.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeecontractareares")
@Tag(name = "合同地市权限配置表管理")
public class TEmployeeContractAreaResController {
private final TEmployeeContractAreaResService tEmployeeContractAreaResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TEmployeeContractAreaRes>> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes) {
return new R<>(tEmployeeContractAreaResService.getTEmployeeContractAreaResPage(page, tEmployeeContractAreaRes));
}
/**
* 不分页查询
*
* @param searchVo 合同地市权限配置表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('temployeecontractareares_get')" )
public R<List<TEmpContractAreaExportVo>> getTEmployeeContractAreaResNoPage(@RequestBody TEmployeeContractAreaResSearchVo searchVo) {
return R.ok(tEmployeeContractAreaResService.noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null));
}
/**
* 通过id查询合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('temployeecontractareares_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_get')")
public R<TEmployeeContractAreaRes> getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContractAreaResService.getById(id));
}
/**
* 新增合同地市权限配置表
*
* @param areaRes 合同地市权限配置表
* @return R
*/
@Operation(summary = "新增合同地市权限配置表", description = "新增合同地市权限配置表:hasPermission('temployeecontractareares_add')")
@SysLog("新增合同地市权限配置表")
@PostMapping
@PreAuthorize("@pms.hasPermission('temployeecontractareares_add')")
public R<Boolean> save(@RequestBody TEmployeeContractAreaRes areaRes) {
TEmployeeContractAreaRes res = null;
if (Common.isEmpty(areaRes.getFileTown())){
res = tEmployeeContractAreaResService.getOne(Wrappers.<TEmployeeContractAreaRes>query().lambda()
.eq(TEmployeeContractAreaRes::getFileProvince,areaRes.getFileProvince())
.eq(TEmployeeContractAreaRes::getFileCity,areaRes.getFileCity())
.isNull(TEmployeeContractAreaRes::getFileTown)
.eq(TEmployeeContractAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
}
if (Common.isEmpty(areaRes.getFileCity())){
res = tEmployeeContractAreaResService.getOne(Wrappers.<TEmployeeContractAreaRes>query().lambda()
.eq(TEmployeeContractAreaRes::getFileProvince,areaRes.getFileProvince())
.isNull(TEmployeeContractAreaRes::getFileCity)
.eq(TEmployeeContractAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
}
if (Common.isNotNull(res)){
return R.failed("已存在对应审核人及地市配置!");
}
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.save(areaRes));
}
/**
* 修改合同地市权限配置表
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return R
*/
@Operation(summary = "修改合同地市权限配置表", description = "修改合同地市权限配置表:hasPermission('temployeecontractareares_edit')")
@SysLog("修改合同地市权限配置表")
@PutMapping
@PreAuthorize("@pms.hasPermission('temployeecontractareares_edit')")
public R<Boolean> updateById(@RequestBody TEmployeeContractAreaRes tEmployeeContractAreaRes) {
return R.ok(tEmployeeContractAreaResService.updateById(tEmployeeContractAreaRes));
}
/**
* 通过id启用或禁用合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id启用或禁用合同地市权限配置表", description = "通过id启用或禁用(0 启用,1禁用)合同地市权限配置表:hasPermission('temployeecontractareares_edit')")
@SysLog("通过id启用或禁用合同地市权限配置表")
@PutMapping("/updateStatus")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_edit')")
public R<Boolean> removeById(@RequestParam(name = "id",required = true) String id,
@RequestParam(name = "status",required = true) String status) {
TEmployeeContractAreaRes areaRes = tEmployeeContractAreaResService.getById(id);
if (Common.isEmpty(areaRes)
|| !(CommonConstants.ONE_STRING).equals(status)
&& !CommonConstants.ZERO_STRING.equals(status)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
areaRes.setStatus(status);
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.updateById(areaRes));
}
/**
* 通过id删除合同地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除合同地市权限配置表", description = "通过id删除合同地市权限配置表:hasPermission('temployeecontractareares_del')")
@SysLog("通过id删除合同地市权限配置表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_del')")
public R<Boolean> removeById(@PathVariable String id) {
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.removeById(id));
}
/**
* 合同地市权限配置表 批量导入
*
* @author fxj
* @date 2022-11-01 10:30:12
**/
@SneakyThrows
@Operation(description = "批量新增合同地市权限配置表 hasPermission('temployeecontractareares-batch-import')")
@SysLog("批量新增合同地市权限配置表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('temployeecontractareares-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tEmployeeContractAreaResService.importDiy(file.getInputStream());
}
/**
* 合同地市权限配置表 批量导出
*
* @author fxj
* @date 2022-11-01 10:30:12
**/
@Operation(description = "导出合同地市权限配置表 hasPermission('temployeecontractareares-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('temployeecontractareares-export')")
public void export(HttpServletResponse response, @RequestBody TEmployeeContractAreaResSearchVo searchVo) {
tEmployeeContractAreaResService.listExport(response, searchVo);
}
}
...@@ -276,7 +276,7 @@ public class TEmployeeContractInfoController { ...@@ -276,7 +276,7 @@ public class TEmployeeContractInfoController {
} }
/** /**
* 批量导出人员档案信息 * 批量导出合同
* *
* @Author hgw * @Author hgw
* @Date 2022-6-24 09:36:06 * @Date 2022-6-24 09:36:06
...@@ -329,4 +329,20 @@ public class TEmployeeContractInfoController { ...@@ -329,4 +329,20 @@ public class TEmployeeContractInfoController {
public TEmployeeContractInfo getContractById(@RequestBody String id) { public TEmployeeContractInfo getContractById(@RequestBody String id) {
return tEmployeeContractInfoService.getById(id); return tEmployeeContractInfoService.getById(id);
} }
/**
* 批量导出合同审核
*
* @Author hgw
* @Date 2022-6-24 09:36:06
**/
@Operation(summary = "批量导出合同审核(记得传参mId)employee_export_contract", description = "批量导出合同审核 hasPermission('employee_export_contract_audit')")
@SysLog("批量导出合同审核")
@PostMapping("/exportAuditContractInfo")
@PreAuthorize("@pms.hasPermission('employee_export_contract_audit')")
public void exportAuditContractInfo(@RequestBody(required = false) TEmployeeContractInfo contractInfo, HttpServletResponse response) {
contractInfo.setAuditStatus(CommonConstants.ONE_INT);
this.setAuth(contractInfo);
tEmployeeContractInfoService.exportAuditContractInfo(contractInfo, response);
}
} }
...@@ -305,15 +305,15 @@ public class TEmployeeInfoController { ...@@ -305,15 +305,15 @@ public class TEmployeeInfoController {
@SysLog("批量导出人员档案信息") @SysLog("批量导出人员档案信息")
// @ResponseExcel // @ResponseExcel
@PostMapping("/exportEmployee") @PostMapping("/exportEmployee")
public void exportEmployee(@RequestBody(required = false) TEmployeeInfo employeeInfo, HttpServletResponse response) { public void exportEmployee(@RequestBody(required = false) EmployeeInfoSearchVo searchVo, HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user != null && Common.isNotNull(user.getId())) { if (user != null && Common.isNotNull(user.getId())) {
menuUtil.setAuthSql(user, employeeInfo); menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(employeeInfo.getAuthSql()) && employeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) { if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
employeeInfo.setAuthSql(employeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID")); searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID"));
} }
} }
tEmployeeInfoService.exportEmployee(employeeInfo, response); tEmployeeInfoService.exportEmployee(searchVo, response);
} }
/** /**
......
/*
* 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.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Mapper
public interface TEmployeeContractAreaResMapper extends BaseMapper<TEmployeeContractAreaRes> {
/**
* 合同地市权限配置表简单分页查询
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, @Param("tEmployeeContractAreaRes") TEmployeeContractAreaRes tEmployeeContractAreaRes);
List<TEmpContractAreaExportVo> noPageDiy(@Param("tEmployeeContractAreaRes") TEmployeeContractAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
int noPageCountDiy(@Param("tEmployeeContractAreaRes") TEmployeeContractAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
}
...@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchEmpVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -80,4 +77,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { ...@@ -80,4 +77,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
String getMaxEmpCode(); String getMaxEmpCode();
List<DispatchEmpVo> getDispatchEmpVo(@Param("checkVo")DispatchCheckVo checkVo); List<DispatchEmpVo> getDispatchEmpVo(@Param("checkVo")DispatchCheckVo checkVo);
// 同 getTEmployeeExportList 方法
int noPageCountDiy(@Param("tEmployeeInfo")EmployeeInfoSearchVo searchVo);
// 同 getTEmployeeExportList 方法
List<EmployeeExportVO> noPageDiy(@Param("tEmployeeInfo")EmployeeInfoSearchVo searchVo);
} }
...@@ -59,4 +59,8 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> { ...@@ -59,4 +59,8 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
* @return * @return
*/ */
List<EmployeeProjectExportVO> getTEmployeeProjectExportPage(@Param("tEmployeeProject") EmployeeProjectExportParamVO tEmployeeProject); List<EmployeeProjectExportVO> getTEmployeeProjectExportPage(@Param("tEmployeeProject") EmployeeProjectExportParamVO tEmployeeProject);
// getTEmployeeProjectExportPage 改造
List<EmployeeProjectExportVO> noPageDiy(@Param("tEmployeeProject")EmployeeProjectExportParamVO searchVo);
int noPageCountDiy(@Param("tEmployeeProject")EmployeeProjectExportParamVO searchVo);
} }
/*
* 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.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
public interface TEmployeeContractAreaResService extends IService<TEmployeeContractAreaRes> {
/**
* 合同地市权限配置表简单分页查询
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes);
List<TEmpContractAreaExportVo> noPageDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo searchVo);
void removeAuthCache();
}
...@@ -166,5 +166,12 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract ...@@ -166,5 +166,12 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
* @return: void * @return: void
**/ **/
void exportContractInfoHistory(TEmployeeContractInfo contractInfo, HttpServletResponse response); void exportContractInfoHistory(TEmployeeContractInfo contractInfo, HttpServletResponse response);
/**
* @Author fxj
* @Description 批量合同审核导出
* @Date 15:38 2022/11/2
* @Param
* @return
**/
void exportAuditContractInfo(TEmployeeContractInfo contractInfo, HttpServletResponse response);
} }
...@@ -169,7 +169,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -169,7 +169,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
* @Author: hgw * @Author: hgw
* @Date: 2022/6/23 10:30 * @Date: 2022/6/23 10:30
**/ **/
void exportEmployee(TEmployeeInfo employeeVo, HttpServletResponse response); void exportEmployee(EmployeeInfoSearchVo employeeVo, HttpServletResponse response);
/** /**
* @param employeeVo * @param employeeVo
......
/*
* 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.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractAreaResMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 合同地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:30:12
*/
@Log4j2
@Service
public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeContractAreaResMapper, TEmployeeContractAreaRes> implements TEmployeeContractAreaResService {
@Autowired
private RedisUtil redisUtil;
/**
* 合同地市权限配置表简单分页查询
*
* @param tEmployeeContractAreaRes 合同地市权限配置表
* @return
*/
@Override
public IPage<TEmployeeContractAreaRes> getTEmployeeContractAreaResPage(Page<TEmployeeContractAreaRes> page, TEmployeeContractAreaResSearchVo tEmployeeContractAreaRes) {
return baseMapper.getTEmployeeContractAreaResPage(page, tEmployeeContractAreaRes);
}
/**
* 合同地市权限配置表批量导出
*
* @param searchVo 合同地市权限配置表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo searchVo) {
String fileName = "合同审核权限批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TEmpContractAreaExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo,null, Common.getList(searchVo.getIds()),null);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TEmpContractAreaExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null);
if (Common.isNotNull(list)) {
ExcelUtil<TEmpContractAreaExportVo> util = new ExcelUtil<>(TEmpContractAreaExportVo.class);
for (TEmpContractAreaExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("合同审核权限配置表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("合同审核权限配置表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<TEmpContractAreaExportVo> noPageDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageDiy(searchVo,settleDomainIds,ids,sql);
}
private int noPageCountDiy(TEmployeeContractAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageCountDiy(searchVo,settleDomainIds,ids,sql);
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TEmployeeContractAreaResVo> util1 = new ExcelUtil<>(TEmployeeContractAreaResVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TEmployeeContractAreaResVo.class, new ReadListener<TEmployeeContractAreaResVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TEmployeeContractAreaResVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TEmployeeContractAreaResVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTEmployeeContractAreaRes(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTEmployeeContractAreaRes(List<TEmployeeContractAreaResVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TEmployeeContractAreaResVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TEmployeeContractAreaResVo excel) {
TEmployeeContractAreaRes insert = new TEmployeeContractAreaRes();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
/**
* @Author fxj
* @Description 清除项目缓存
* @Date 17:08 2022/7/11
* @Param
* @return
**/
@Override
public void removeAuthCache() {
try{
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ONE_STRING);
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ZERO_STRING);
} catch (Exception e) {
log.error("清除权限配置缓存错误:",e);
}
}
}
...@@ -983,4 +983,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -983,4 +983,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
@Override
public void exportAuditContractInfo(TEmployeeContractInfo contractInfo, HttpServletResponse response) {
}
} }
...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -59,6 +61,7 @@ import javax.servlet.ServletOutputStream; ...@@ -59,6 +61,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -1988,43 +1991,78 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1988,43 +1991,78 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* 获取导出的人员档案列表 * 获取导出的人员档案列表
*/ */
@Override @Override
public void exportEmployee(TEmployeeInfo employeeInfo, HttpServletResponse response) { public void exportEmployee(EmployeeInfoSearchVo searchVo, HttpServletResponse response) {
if (employeeInfo != null && employeeInfo.getExportFields() != null && !employeeInfo.getExportFields().isEmpty()) { if (searchVo != null && searchVo.getExportFields() != null && !searchVo.getExportFields().isEmpty()) {
String fileName = "人员档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "人员档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表 //获取要导出的列表
employeeInfo.setFileStatus(CommonConstants.ZERO_INT); List<EmployeeExportVO> list = new ArrayList<>();
List<EmployeeExportVO> list = baseMapper.getTEmployeeExportList(employeeInfo); //获取要导出的列表
searchVo.setFileStatus(CommonConstants.ZERO_INT);
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
}
try { try {
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo : list) {
util.convertEntity(vo, null, null, null);
}
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding(CommonConstants.UTF8); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(employeeInfo.getExportFields()) //EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
.sheet("人员档案").doWrite(list); ExcelWriter excelWriter = EasyExcel.write(out, EmployeeExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeExportVO.class.getDeclaredFields();
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("人员档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("人员档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush(); out.flush();
} catch (Exception e) { excelWriter.finish();
log.error(EmployeeConstants.FILE_EXPORT_EXCEPTION, e); }catch (Exception e){
} finally { log.error("执行异常" ,e);
}finally {
try { try {
if (out != null) { if (null != out) {
out.close(); out.close();
} }
} catch (IOException e) { } catch (IOException e) {
log.error(EmployeeConstants.FILE_EXPORT_EXCEPTION, e); log.error("执行异常", e);
} }
} }
} }
} }
private List<EmployeeExportVO> noPageDiy(EmployeeInfoSearchVo searchVo) {
return baseMapper.noPageDiy(searchVo);
}
private long noPageCountDiy(EmployeeInfoSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo);
}
/** /**
* 获取导出的离职档案列表 * 获取导出的离职档案列表
*/ */
......
...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -31,11 +33,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -31,11 +33,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo; import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants; import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCustomerInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
...@@ -64,6 +64,7 @@ import javax.servlet.ServletOutputStream; ...@@ -64,6 +64,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -90,9 +91,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -90,9 +91,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired @Autowired
private TSettleDomainService tSettleDomainService; private TSettleDomainService tSettleDomainService;
@Autowired
private TCustomerInfoMapper tCustomerInfoMapper;
@Autowired @Autowired
@Lazy @Lazy
private DoJointTask doJointTask; private DoJointTask doJointTask;
...@@ -1178,38 +1176,58 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1178,38 +1176,58 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Date 10:55 2022/6/23 * @Date 10:55 2022/6/23
**/ **/
@Override @Override
public void listExportProject(HttpServletResponse response, EmployeeProjectExportParamVO projectDTO, String idstr, List<String> exportFields) { public void listExportProject(HttpServletResponse response, EmployeeProjectExportParamVO searchVo, String idstr, List<String> exportFields) {
searchVo.setIdList(Common.getList(idstr));
String fileName = "项目档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "项目档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
// 根据用户传入确定要导出的字段 // 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<>(exportFields); Set<String> includeColumnFiledNames = new HashSet<>(exportFields);
//获取要导出的列表 gettEmpProInfoExportVos
//获取要导出的列表 List<EmployeeProjectExportVO> list = new ArrayList<>();
List<EmployeeProjectExportVO> list; long count = noPageCountDiy(searchVo);
//获取记录
list = gettEmpProInfoExportVos(idstr, projectDTO);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
}
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
ExcelUtil<EmployeeProjectExportVO> util = new ExcelUtil<>(EmployeeProjectExportVO.class);
for (EmployeeProjectExportVO vo : list) {
util.convertEntity(vo, null, null, null);
}
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding(CommonConstants.UTF8); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFiledNames(includeColumnFiledNames).sheet("项目档案") ExcelWriter excelWriter = EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFieldNames(includeColumnFiledNames).build();
.doWrite(list); int index = 0;
if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeProjectExportVO.class.getDeclaredFields();
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<EmployeeProjectExportVO> util = new ExcelUtil<>(EmployeeProjectExportVO.class);
for (EmployeeProjectExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("项目档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("项目档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush(); out.flush();
} catch (Exception e) { excelWriter.finish();
log.error("执行异常", e); }catch (Exception e){
} finally { log.error("执行异常" ,e);
}finally {
try { try {
if (null != out) { if (null != out) {
out.close(); out.close();
...@@ -1220,6 +1238,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1220,6 +1238,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
} }
private List<EmployeeProjectExportVO> noPageDiy(EmployeeProjectExportParamVO searchVo) {
return baseMapper.noPageDiy(searchVo);
}
private int noPageCountDiy(EmployeeProjectExportParamVO searchVo) {
return baseMapper.noPageCountDiy(searchVo);
}
/** /**
* @param employeeInfo * @param employeeInfo
* @Description: 新增项目档案 * @Description: 新增项目档案
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractAreaResMapper">
<resultMap id="tEmployeeContractAreaResMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAreaRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<resultMap id="empContractAreaResExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo">
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,a.USER_NAME,a.STATUS,a.ORGAN_NAME
</sql>
<sql id="tEmployeeContractAreaRes_where">
<if test="tEmployeeContractAreaRes != null">
<if test="tEmployeeContractAreaRes.id != null and tEmployeeContractAreaRes.id.trim() != ''">
AND a.ID = #{tEmployeeContractAreaRes.id}
</if>
<if test="tEmployeeContractAreaRes.userId != null and tEmployeeContractAreaRes.userId.trim() != ''">
AND a.USER_ID = #{tEmployeeContractAreaRes.userId}
</if>
<if test="tEmployeeContractAreaRes.fileProvince != null">
AND a.FILE_PROVINCE = #{tEmployeeContractAreaRes.fileProvince}
</if>
<if test="tEmployeeContractAreaRes.fileCity != null">
AND a.FILE_CITY = #{tEmployeeContractAreaRes.fileCity}
</if>
<if test="tEmployeeContractAreaRes.fileTown != null">
AND a.FILE_TOWN = #{tEmployeeContractAreaRes.fileTown}
</if>
<if test="tEmployeeContractAreaRes.status!= null">
AND a.status like CONCAT(#{tEmployeeContractAreaRes.status},'%')
</if>
<if test="tEmployeeContractAreaRes.userName != null">
AND a.USER_NAME like CONCAT('%',#{tEmployeeContractAreaRes.userName},'%')
</if>
<if test="tEmployeeContractAreaRes.organName != null">
AND a.ORGAN_NAME like CONCAT('%',#{tEmployeeContractAreaRes.organName},'%')
</if>
</if>
</sql>
<!--tEmployeeContractAreaRes简单分页查询-->
<select id="getTEmployeeContractAreaResPage" resultMap="tEmployeeContractAreaResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="tEmployeeContractAreaRes_where"/>
order by a.CREATE_TIME desc
</where>
</select>
<select id="noPageDiy" resultMap="empContractAreaResExportMap">
SELECT
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,a.USER_NAME,a.STATUS,a.ORGAN_NAME
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tEmployeeContractAreaRes != null">
<if test="tEmployeeContractAreaRes.authSql != null and tEmployeeContractAreaRes.authSql.trim() != ''">
${tEmployeeContractAreaRes.authSql}
</if>
<if test="tEmployeeContractAreaRes.limitStart != null">
limit #{tEmployeeContractAreaRes.limitStart},#{tEmployeeContractAreaRes.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tEmployeeContractAreaRes.authSql != null and tEmployeeContractAreaRes.authSql.trim() != ''">
${tEmployeeContractAreaRes.authSql}
</if>
</where>
</select>
<sql id="export_where">
<include refid="tEmployeeContractAreaRes_where"/>
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<!--数据权限判断-->
<if test="settleDomainIds != null">
<if test="settleDomainIds.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="settleDomainIds.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
</sql>
</mapper>
...@@ -876,7 +876,7 @@ ...@@ -876,7 +876,7 @@
left join ( left join (
select p.UNIT_NAME,p.UNIT_NO,p.DEPT_ID,p.DEPT_NAME,p.DEPT_NO,p.POST,p.EMP_ID,p.EMP_NO,P.PROJECT_STATUS,p.EMP_NATRUE select p.UNIT_NAME,p.UNIT_NO,p.DEPT_ID,p.DEPT_NAME,p.DEPT_NO,p.POST,p.EMP_ID,p.EMP_NO,P.PROJECT_STATUS,p.EMP_NATRUE
from t_employee_project p from t_employee_project p
where 1=1 where 1=1 and p.DELETE_FLAG = '0'
<if test="checkVo != null"> <if test="checkVo != null">
<if test="checkVo.codes != null"> <if test="checkVo.codes != null">
AND p.DEPT_NO in AND p.DEPT_NO in
...@@ -927,4 +927,51 @@ ...@@ -927,4 +927,51 @@
</select> </select>
<!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02-->
<select id="noPageDiy" resultMap="tEmployeeExportMap">
select
<include refid="Base_Export_List"/>,
p.IS_PROJECTS ,
p.DEPT_NAME,
p.DEPT_NO,
P.PROJECT_NUM
from t_employee_info a
LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD
<where>
a.DELETE_FLAG = '0'
<include refid="employeeInfo_where_export"/>
</where>
order by a.CREATE_TIME desc
<if test="tEmployeeInfo != null">
<if test="tEmployeeInfo.limitStart != null">
limit #{tEmployeeInfo.limitStart},#{tEmployeeInfo.limitEnd}
</if>
</if>
</select>
<!--tEmployeeInfo人员档案导出查询count fxj 2022-11-02-->
<select id="noPageCountDiy" resultType="java.lang.Integer">
select
count(1)
from t_employee_info a
LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD
<where>
a.DELETE_FLAG = '0'
<include refid="employeeInfo_where_export"/>
</where>
</select>
<sql id="employeeInfo_where_export">
<include refid="employeeInfo_where"/>
<if test="tEmployeeInfo.authSql != null and tEmployeeInfo.authSql.trim() != ''">
and
a.id in (
select b.emp_id from t_employee_project b
where
b.DELETE_FLAG = '0'
${tEmployeeInfo.authSql}
)
</if>
</sql>
</mapper> </mapper>
...@@ -802,4 +802,39 @@ ...@@ -802,4 +802,39 @@
</where> </where>
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
<!--tEmployeeInfo导出查询改造 fxj 2022-11-03-->
<select id="noPageDiy" resultMap="tEmployeeProjectExportMap">
SELECT
<include refid="Base_Export_List"/>
FROM t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id
<where>
a.DELETE_FLAG = '0'
<include refid="exportTEmployeeProject_where"/>
<if test="tEmployeeProject.authSql != null and tEmployeeProject.authSql.trim() != ''">
${tEmployeeProject.authSql}
</if>
</where>
order by a.CREATE_TIME desc
<if test="tEmployeeProject != null">
<if test="tEmployeeProject.limitStart != null">
limit #{tEmployeeProject.limitStart},#{tEmployeeProject.limitEnd}
</if>
</if>
</select>
<!--tEmployeeInfo导出查询count改造 fxj 2022-11-03-->
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id
<where>
a.DELETE_FLAG = '0'
<include refid="exportTEmployeeProject_where"/>
<if test="tEmployeeProject.authSql != null and tEmployeeProject.authSql.trim() != ''">
${tEmployeeProject.authSql}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -361,6 +361,10 @@ public interface ErrorCodes { ...@@ -361,6 +361,10 @@ public interface ErrorCodes {
* 新增异常:未找到对应社保户名称的可用基数配置信息 * 新增异常:未找到对应社保户名称的可用基数配置信息
*/ */
String EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST = "emp.dispatch.social.hold.not.exist"; String EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST = "emp.dispatch.social.hold.not.exist";
/**
* 新增异常:备案基数不可为空
*/
String EMP_DISPATCH_SOCIAL_RECORD_BASE_NOT_EXIST = "emp.dispatch.social.record.base.not.exist";
/** /**
* 新增异常:未找到对应公积金户名称的可用基数配置信息 * 新增异常:未找到对应公积金户名称的可用基数配置信息
......
...@@ -1001,4 +1001,107 @@ public class ExcelUtil <T> implements Serializable { ...@@ -1001,4 +1001,107 @@ public class ExcelUtil <T> implements Serializable {
} }
return R.ok(exportfieldsName,"成功"); return R.ok(exportfieldsName,"成功");
} }
public void convertEntityAsso(T vo, String[] exportFields, Map<String,String> diyDicMap, String dateFormat,Field[] allFields) {
// 得到所有定义字段
if (Common.isEmpty(allFields) || allFields.length == 0){
allFields = clazz.getDeclaredFields();
}
List<Field> fields = new ArrayList<>();
Class<?> superClazz = clazz.getSuperclass();
// 将需要字典表头存起来备用,如果没传,则全部翻译
List<String> allField = new ArrayList<>();
ExcelAttribute annotation;
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
annotation = field.getAnnotation(ExcelAttribute.class);
if (annotation != null && Common.isNotNull(annotation.name())) {
allField.add(annotation.name());
}
}
}
if (Common.isEmpty(exportFields) && !allField.isEmpty()) {
exportFields = new String[allField.size()];
for (int i = 0; i < allField.size(); i++) {
exportFields[i] = allField.get(i);
}
}
if (superClazz != null) {
Field[] superFields = superClazz.getDeclaredFields();
for (Field field : superFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
}
fields = getFiledsByParamFiled(fields, exportFields);
ExcelAttribute attr;
Field field;
//分割符
String divider;
for (int j = 0; j < fields.size(); j++) {
// 获得field
field = fields.get(j);
// 设置实体类私有属性可访问
field.setAccessible(true);
attr = field.getAnnotation(ExcelAttribute.class);
if (attr.isExport()) {
// 如果数据存在就填入,不存在填入空格
Class<?> classType = field.getType();
String value = null;
Date date;
try {
if (field.get(vo) != null && (classType.isAssignableFrom(Date.class) || classType.isAssignableFrom(LocalDateTime.class) || classType.isAssignableFrom(LocalDate.class))) {
if (Common.isNotNull(attr.dateFormatExport())) {
date = DateUtil.stringToDate2(String.valueOf(field.get(vo)), attr.dateFormatExport());
if (classType.isAssignableFrom(LocalDateTime.class)){
value = LocalDateTimeUtils.formatTime((LocalDateTime)field.get(vo),attr.dateFormatExport());
}else {
value = DateUtil.dateToString(date, attr.dateFormatExport());
}
} else {
date = DateUtil.stringToDate2(String.valueOf(field.get(vo)), !Common.isNotNull(dateFormat) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : dateFormat);
if (classType.isAssignableFrom(LocalDateTime.class)){
value = LocalDateTimeUtils.formatTime((LocalDateTime)field.get(vo),!Common.isNotNull(dateFormat) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : dateFormat);
}else {
value = cn.hutool.core.date.DateUtil.format(date, !Common.isNotNull(dateFormat) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : dateFormat);
}
}
}
//如果有默认字典数据直接取值
if (Common.isNotNull(attr.readConverterExp())) {
value = convertByExp(field.get(vo) == null ? "" : String.valueOf(field.get(vo)), attr.readConverterExp());
} else if (attr.isDataId()) {
//加入分割符逻辑
divider = attr.divider();
if (!"".equals(divider) && field.get(vo) != null){
try {
value = "";
for(String key : String.valueOf(field.get(vo)).split(divider)){
value += getLableById(attr, diyDicMap, key) + divider;
}
if(Common.isNotNull(value)){
value = value.substring(0,value.length()-1);
}
}catch (Exception e){
log.error("excel数据导出字符切割错误",e);
value = "字符切割错误";
}
} else {
//如果是字典数据ID或区域ID 去dicMap(包含了区域) 取值 取不到返回空
value = getLableById(attr, diyDicMap, field.get(vo) == null ? "" : String.valueOf(field.get(vo)));
}
} else if (attr.isArea()){
//区域字段处理 TODO
value = getAreaLabel((String) field.get(vo));
}
field.set(vo, Common.isNotNull(value)?value:field.get(vo));
}catch (Exception e){
log.error("字典数据解析异常");
}
}
}
}
} }
...@@ -203,7 +203,7 @@ emp.dispatch.emp.contract.end.not.empty=\u589E\u5F02\u5E38\uFF1A \u56FA\u5B9A\u6 ...@@ -203,7 +203,7 @@ emp.dispatch.emp.contract.end.not.empty=\u589E\u5F02\u5E38\uFF1A \u56FA\u5B9A\u6
emp.dispatch.emp.contract.sub.name.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u7C7B\u578B\u4E3A\u5176\u4ED6\u65F6\u4E1A\u52A1\u7EC6\u5206\u4E0D\u53EF\u4E3A\u7A7A emp.dispatch.emp.contract.sub.name.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5408\u540C\u7C7B\u578B\u4E3A\u5176\u4ED6\u65F6\u4E1A\u52A1\u7EC6\u5206\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.record.base.not.exist=\u65B0\u589E\u5F02\u5E38\uFF1A\u5907\u6848\u57FA\u6570\u4E0D\u53EF\u4E3A\u7A7A
......
/*
* 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.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
@TableName("t_insurance_area_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商险地市权限配置表")
public class TInsuranceAreaRes extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 登录人id
*/
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id不能为空", maxLength = 32)
@NotBlank(message = "登录人id不能为空")
@Length(max = 32, message = "登录人id不能超过32个字符")
@ExcelProperty("登录人id")
@Schema(description = "登录人id")
private String userId;
/**
* 登录人姓名
*/
@ExcelProperty("办理人")
@Schema(description = "办理人")
private String userName;
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省",isArea = true, isNotEmpty = true, errorInfo = "档案-省不能为空")
@NotBlank(message = "档案-省不能为空")
@ExcelProperty("档案-省")
@Schema(description = "档案-省")
private Integer province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市",isArea = true,parentField = "province")
@ExcelProperty("档案-市")
@Schema(description = "档案-市")
private Integer city;
/**
* 申請人所在部门
*/
@ExcelAttribute(name = "办理人所在部门")
@ExcelProperty("办理人所在部门")
@Schema(description = "办理人所在部门")
private String organName;
/**
* 状态 0 启用 1 禁用
*/
@ExcelAttribute(name = "状态")
@ExcelProperty("状态")
@Schema(description = "状态:0 启用 1 禁用")
private String status;
}
/*
* 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.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaExportVo implements Serializable {
/**
* 登录人姓名
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("办理人")
@Schema(description = "办理人")
private String userName;
/**
* 申請人所在部门
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "办理人所在部门")
@ExcelProperty("办理人所在部门")
@Schema(description = "办理人所在部门")
private String organName;
/**
* 办理地-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "办理地-省", isArea = true)
@NotBlank(message = "办理地-省不能为空")
@ExcelProperty("办理地-省")
@Schema(description = "办理地-省")
private String province;
/**
* 办理-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "办理地-市",isArea = true, parentField = "province")
@ExcelProperty("办理地-市")
@Schema(description = "办理地-市")
private String city;
/**
* 状态 0 启用 1 禁用
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "授权状态",readConverterExp = "0=启用,1=禁用")
@ExcelProperty("授权状态")
@Schema(description = "授权状态:0 启用 1 禁用")
private String status;
}
/*
* 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.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaResSearchVo extends TInsuranceAreaRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Data
public class TInsuranceAreaResVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 登录人id
*/
@NotBlank(message = "登录人id 不能为空")
@Length(max = 32, message = "登录人id 不能超过32 个字符")
@ExcelAttribute(name = "登录人id", isNotEmpty = true, errorInfo = "登录人id 不能为空", maxLength = 32)
@Schema(description = "登录人id")
@ExcelProperty("登录人id")
private String userId;
/**
* 档案-省
*/
@NotBlank(message = "档案-省 不能为空")
@ExcelAttribute(name = "档案-省", isNotEmpty = true, errorInfo = "档案-省 不能为空")
@Schema(description = "档案-省")
@ExcelProperty("档案-省")
private String province;
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市")
@Schema(description = "档案-市")
@ExcelProperty("档案-市")
private String city;
}
/*
* 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.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceAreaResService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tinsuranceareares")
@Tag(name = "商险地市权限配置表管理")
public class TInsuranceAreaResController {
private final TInsuranceAreaResService tInsuranceAreaResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TInsuranceAreaRes>> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, TInsuranceAreaResSearchVo tInsuranceAreaRes) {
return new R<>(tInsuranceAreaResService.getTInsuranceAreaResPage(page, tInsuranceAreaRes));
}
/**
* 不分页查询
*
* @param searchVo 商险地市权限配置表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('tinsuranceareares_get')" )
public R<List<TInsuranceAreaExportVo>> getTInsuranceAreaResNoPage(@RequestBody TInsuranceAreaResSearchVo searchVo) {
return R.ok(tInsuranceAreaResService.noPageDiy(searchVo,null, Common.getList(searchVo.getIds()),null));
}
/**
* 通过id查询商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('tinsuranceareares_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_get')")
public R<TInsuranceAreaRes> getById(@PathVariable("id") String id) {
return R.ok(tInsuranceAreaResService.getById(id));
}
/**
* 新增商险地市权限配置表
*
* @param areaRes 商险地市权限配置表
* @return R
*/
@Operation(summary = "新增商险地市权限配置表", description = "新增商险地市权限配置表:hasPermission('tinsuranceareares_add')")
@SysLog("新增商险地市权限配置表")
@PostMapping
@PreAuthorize("@pms.hasPermission('tinsuranceareares_add')")
public R<Boolean> save(@RequestBody TInsuranceAreaRes areaRes) {
TInsuranceAreaRes res = null;
if (Common.isEmpty(areaRes.getCity())){
res = tInsuranceAreaResService.getOne(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getProvince,areaRes.getProvince())
.isNull(TInsuranceAreaRes::getCity)
.eq(TInsuranceAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
}else {
res = tInsuranceAreaResService.getOne(Wrappers.<TInsuranceAreaRes>query().lambda()
.eq(TInsuranceAreaRes::getProvince,areaRes.getProvince())
.eq(TInsuranceAreaRes::getCity,areaRes.getCity())
.eq(TInsuranceAreaRes::getUserId,areaRes.getUserId())
.last(CommonConstants.LAST_ONE_SQL));
}
if (Common.isNotNull(res)){
return R.failed("已存在对应办理人及地市配置!");
}
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.save(areaRes));
}
/**
* 修改商险地市权限配置表
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return R
*/
@Operation(summary = "修改商险地市权限配置表", description = "修改商险地市权限配置表:hasPermission('tinsuranceareares_edit')")
@SysLog("修改商险地市权限配置表")
@PutMapping
@PreAuthorize("@pms.hasPermission('tinsuranceareares_edit')")
public R<Boolean> updateById(@RequestBody TInsuranceAreaRes tInsuranceAreaRes) {
return R.ok(tInsuranceAreaResService.updateById(tInsuranceAreaRes));
}
/**
* 通过id删除商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除商险地市权限配置表", description = "通过id删除商险地市权限配置表:hasPermission('tinsuranceareares_del')")
@SysLog("通过id删除商险地市权限配置表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_del')")
public R<Boolean> removeById(@PathVariable String id) {
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.removeById(id));
}
/**
* 通过id启用或禁用商险地市权限配置表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id启用或禁用商险地市权限配置表", description = "通过id启用或禁用(0 启用,1禁用)商险地市权限配置表:hasPermission('tinsuranceareares_edit')")
@SysLog("通过id启用或禁用商险地市权限配置表")
@PutMapping("/updateStatus")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_edit')")
public R<Boolean> removeById(@RequestParam(name = "id",required = true) String id,
@RequestParam(name = "status",required = true) String status) {
TInsuranceAreaRes areaRes = tInsuranceAreaResService.getById(id);
if (Common.isEmpty(areaRes)
|| !(CommonConstants.ONE_STRING).equals(status)
&& !CommonConstants.ZERO_STRING.equals(status)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
areaRes.setStatus(status);
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.updateById(areaRes));
}
/**
* 商险地市权限配置表 批量导入
*
* @author fxj
* @date 2022-11-01 10:32:05
**/
@SneakyThrows
@Operation(description = "批量新增商险地市权限配置表 hasPermission('tinsuranceareares-batch-import')")
@SysLog("批量新增商险地市权限配置表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('tinsuranceareares-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tInsuranceAreaResService.importDiy(file.getInputStream());
}
/**
* 商险地市权限配置表 批量导出
*
* @author fxj
* @date 2022-11-01 10:32:05
**/
@Operation(description = "导出商险地市权限配置表 hasPermission('tinsuranceareares-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('tinsuranceareares-export')")
public void export(HttpServletResponse response, @RequestBody TInsuranceAreaResSearchVo searchVo) {
tInsuranceAreaResService.listExport(response, searchVo);
}
}
/*
* 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.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Mapper
public interface TInsuranceAreaResMapper extends BaseMapper<TInsuranceAreaRes> {
/**
* 商险地市权限配置表简单分页查询
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
IPage<TInsuranceAreaRes> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, @Param("tInsuranceAreaRes") TInsuranceAreaRes tInsuranceAreaRes);
List<TInsuranceAreaExportVo> noPageDiy(@Param("tInsuranceAreaRes")TInsuranceAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
int noPageCountDiy(@Param("tInsuranceAreaRes")TInsuranceAreaResSearchVo searchVo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr,
@Param("sql")String sql);
}
/*
* 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.insurances.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
public interface TInsuranceAreaResService extends IService<TInsuranceAreaRes> {
/**
* 商险地市权限配置表简单分页查询
*
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
IPage<TInsuranceAreaRes> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, TInsuranceAreaResSearchVo tInsuranceAreaRes);
List<TInsuranceAreaExportVo> noPageDiy(TInsuranceAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TInsuranceAreaResSearchVo searchVo);
void removeAuthCache();
}
/*
* 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.insurances.service.insurance.impl;
import cn.hutool.core.bean.BeanUtil;
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.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceAreaResMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceAreaResService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 商险地市权限配置表
*
* @author fxj
* @date 2022-11-01 10:32:05
*/
@Log4j2
@Service
public class TInsuranceAreaResServiceImpl extends ServiceImpl<TInsuranceAreaResMapper, TInsuranceAreaRes> implements TInsuranceAreaResService {
@Autowired
private RedisUtil redisUtil;
/**
* 商险地市权限配置表简单分页查询
* @param tInsuranceAreaRes 商险地市权限配置表
* @return
*/
@Override
public IPage<TInsuranceAreaRes> getTInsuranceAreaResPage(Page<TInsuranceAreaRes> page, TInsuranceAreaResSearchVo tInsuranceAreaRes){
return baseMapper.getTInsuranceAreaResPage(page,tInsuranceAreaRes);
}
/**
* 商险地市权限配置表批量导出
* @param searchVo 商险地市权限配置表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TInsuranceAreaResSearchVo searchVo){
String fileName = "商险办理权限批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TInsuranceAreaExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo,null,Common.getList(searchVo.getIds()),null);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TInsuranceAreaExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo,null,Common.getList(searchVo.getIds()),null);
if (Common.isNotNull(list)){
ExcelUtil<TInsuranceAreaExportVo> util = new ExcelUtil<>(TInsuranceAreaExportVo.class);
for (TInsuranceAreaExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("商险办理权限配置表"+index).build();
excelWriter.write(list,writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){
list.clear();
}
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("商险办理权限配置表"+index).build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public void removeAuthCache() {
try{
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ONE_STRING);
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ZERO_STRING);
} catch (Exception e) {
log.error("清除权限配置缓存错误:",e);
}
}
@Override
public List<TInsuranceAreaExportVo> noPageDiy(TInsuranceAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageDiy(searchVo,settleDomainIds,ids,sql);
}
private Integer noPageCountDiy(TInsuranceAreaResSearchVo searchVo,
List<String> settleDomainIds,
List<String> ids,
String sql) {
return baseMapper.noPageCountDiy(searchVo,settleDomainIds,ids,sql);
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TInsuranceAreaResVo> util1 = new ExcelUtil<>(TInsuranceAreaResVo.class);;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TInsuranceAreaResVo.class, new ReadListener<TInsuranceAreaResVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TInsuranceAreaResVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TInsuranceAreaResVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex+1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)){
errorMessageList.add(errorMessage);
}else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTInsuranceAreaRes(cachedDataList,errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
}catch (Exception e){
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR,e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTInsuranceAreaRes(List<TInsuranceAreaResVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TInsuranceAreaResVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TInsuranceAreaResVo excel) {
TInsuranceAreaRes insert = new TInsuranceAreaRes();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceAreaResMapper">
<resultMap id="tInsuranceAreaResMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<resultMap id="insuranceAreaResExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo">
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="userName" column="USER_NAME"/>
<result property="status" column="STATUS"/>
<result property="organName" column="ORGAN_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.PROVINCE,
a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
</sql>
<sql id="tInsuranceAreaRes_where">
<if test="tInsuranceAreaRes != null">
<if test="tInsuranceAreaRes.id != null and tInsuranceAreaRes.id.trim() != ''">
AND a.ID = #{tInsuranceAreaRes.id}
</if>
<if test="tInsuranceAreaRes.userId != null and tInsuranceAreaRes.userId.trim() != ''">
AND a.USER_ID = #{tInsuranceAreaRes.userId}
</if>
<if test="tInsuranceAreaRes.province != null">
AND a.PROVINCE = #{tInsuranceAreaRes.province}
</if>
<if test="tInsuranceAreaRes.city != null">
AND a.CITY = #{tInsuranceAreaRes.city}
</if>
<if test="tInsuranceAreaRes.status!= null">
AND a.status like CONCAT(#{tInsuranceAreaRes.status},'%')
</if>
<if test="tInsuranceAreaRes.userName != null">
AND a.USER_NAME like CONCAT('%',#{tInsuranceAreaRes.userName},'%')
</if>
<if test="tInsuranceAreaRes.organName != null">
AND a.ORGAN_NAME like CONCAT('%',#{tInsuranceAreaRes.organName},'%')
</if>
</if>
</sql>
<!--tInsuranceAreaRes简单分页查询-->
<select id="getTInsuranceAreaResPage" resultMap="tInsuranceAreaResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_area_res a
<where>
1=1
<include refid="tInsuranceAreaRes_where"/>
order by a.CREATE_TIME desc
</where>
</select>
<select id="noPageDiy" resultMap="insuranceAreaResExportMap">
SELECT
a.PROVINCE,
a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
FROM t_insurance_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tInsuranceAreaRes != null">
<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<if test="tInsuranceAreaRes.limitStart != null">
limit #{tInsuranceAreaRes.limitStart},#{tInsuranceAreaRes.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_insurance_area_res a
<where>
1=1
<include refid="export_where"/>
<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
${tInsuranceAreaRes.authSql}
</if>
</where>
</select>
<sql id="export_where">
<include refid="tInsuranceAreaRes_where"/>
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<!--数据权限判断-->
<if test="settleDomainIds != null">
<if test="settleDomainIds.size() > 0">
and a.SETTLE_DOMAIN_ID in
<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="settleDomainIds.size() == 0">
and 1=2
</if>
</if>
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
</sql>
</mapper>
/*
* 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.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Data
@TableName("t_socialfund_house_res")
@EqualsAndHashCode()
@Schema(description = "社保公积金户权限配置表")
public class TSocialfundHouseRes {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
@TableField(exist = false)
private List<String> idList;
/**
* 登录人id
*/
@ExcelAttribute(name = "审核人id", maxLength = 32)
@Length(max = 32, message = "审核人id不能超过32个字符")
@ExcelProperty("审核人id")
@Schema(description = "审核人id")
private String userId;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", maxLength = 32)
@Length(max = 32, message = "社保户不能超过32个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHousehold;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Length(max = 32, message = "公积金户不能超过32个字符")
@ExcelProperty("公积金户")
@Schema(description = "公积金户")
private String fundHousehold;
/**
* 被授权时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "被授权时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 授权人
*/
@ExcelAttribute(name = "授权人", maxLength = 32)
@ExcelProperty("授权人")
@Schema(description = "授权人")
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 状态0启用1禁用
*/
@ExcelAttribute(name = "状态0启用1禁用", maxLength = 1)
@Length(max = 1, message = "状态0启用1禁用不能超过1个字符")
@ExcelProperty("状态0启用1禁用")
@Schema(description = "状态0启用1禁用")
private String status;
/**
* 审核人姓名
*/
@ExcelAttribute(name = "审核人姓名", maxLength = 32)
@Length(max = 32, message = "审核人姓名不能超过32个字符")
@ExcelProperty("审核人姓名")
@Schema(description = "审核人姓名")
private String userName;
/**
* 所在部门
*/
@ExcelAttribute(name = "所在部门", maxLength = 32)
@Length(max = 32, message = "所在部门不能超过32个字符")
@ExcelProperty("所在部门")
@Schema(description = "所在部门")
private String userDeptName;
/**
* 户类型 0社保户1公积金户
*/
@ExcelAttribute(name = "户类型 0社保户1公积金户", maxLength = 1)
@ExcelProperty("户类型 0社保户1公积金户")
@Schema(description = "户类型 0社保户1公积金户")
private String houseNameType; /**
* 权限类型 0审核1办理
*/
@ExcelAttribute(name = "权限类型 0审核1办理", maxLength = 1)
@ExcelProperty("权限类型 0审核1办理")
@Schema(description = "权限类型 0审核1办理")
private String authType;
}
/*
* 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.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 缴费库导出参数
* @author huyc
* @date 2022-10-31 17:01:22
*/
@Data
public class TPaymentInfoExportVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName;
/**
* 员工编码
*/
@ExcelAttribute(name = "员工编码" )
@Schema(description ="员工编码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工编码")
@Size(max = 32, message = "员工编码不可超过32位")
private String empNo;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
@Size(max = 32, message = "身份证号不可超过32位")
private String empIdcard;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称" )
@Schema(description ="客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
private String unitName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
private String settleDomainName;
/**
* 项目编码
*/
@Length(max = 50, message = "项目编码不能超过50个字符" )
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Schema(description = "项目编码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目编码" )
private String settleDomainCode;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户" )
@Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHousehold;
/**
* 社保编号
*/
@ExcelAttribute(name = "社保编号" )
@Schema(description ="社保编号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保编号")
private String socialSecurityNo;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地" )
@Schema(description ="社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地")
private String socialPayAddr;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6,isInteger = true)
@Schema(description ="社保缴纳月份")
@Length(max = 6, message = "社保缴纳月份不能超过6个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "社保生成月份不能超过6个字符")
@Schema(description ="社保生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 公积金缴纳月份
*/
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "公积金缴纳月份不能超过6个字符")
@Schema(description ="公积金缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
/**
* 公积金生成月份
*/
@ExcelAttribute(name = "公积金生成月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "公积金生成月份不能超过6个字符")
@Schema(description ="公积金生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/
@ExcelAttribute(name = "公积金缴纳地" )
@Schema(description ="公积金缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地")
private String providentPayAddr;
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", isArea = true)
@Schema(description ="公积金缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-省")
private String fundProvince;
/**
* 公积金缴纳地-市
*/
@ExcelAttribute(name = "公积金缴纳地-市",isArea = true, parentField = "fundProvince")
@Schema(description ="公积金缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-市")
private String fundCity;
/**
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "公积金缴纳地-县",isArea = true, parentField = "fundCity")
@Schema(description ="公积金缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-县")
private String fundTown;
/**
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省",isArea = true)
@Schema(description ="社保缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-省")
private String socialProvince;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", isArea = true, parentField = "socialProvince")
@Schema(description ="社保缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-市")
private String socialCity;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", isArea = true, parentField = "socialCity")
@Schema(description ="社保缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-县")
private String socialTown;
/**
* 社保合计
*/
@ExcelAttribute(name = "社保合计" )
@Schema(description ="社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保合计")
private BigDecimal socialSum;
/**
* 单位社保合计
*/
@ExcelAttribute(name = "单位社保合计" )
@Schema(description ="单位社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
/**
* 个人社保合计
*/
@ExcelAttribute(name = "个人社保合计" )
@Schema(description ="个人社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保合计")
private BigDecimal socialSecurityPersonalSum;
/**
* 公积金总合计
*/
@ExcelAttribute(name = "公积金总合计" )
@Schema(description ="公积金总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金总合计")
private BigDecimal providentSum;
/**
* 就职班组
*/
@ExcelAttribute(name = "就职班组" )
@Schema(description ="就职班组")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("就职班组")
private String inauguralTeam;
/**
* 单位社保补缴利息
*/
@ExcelAttribute(name = "单位社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保补缴利息")
private BigDecimal companyAccrual;
/**
* 个人社保补缴利息
*/
@ExcelAttribute(name = "个人社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保补缴利息")
private BigDecimal personalAccrual;
/**
* 单位养老基数
*/
@ExcelAttribute(name = "养老基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老基数")
private BigDecimal unitPensionSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "医疗基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗基数")
private BigDecimal unitMedicalSet;
/**
* 单位失业基数
*/
@ExcelAttribute(name = "失业基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业基数")
private BigDecimal unitUnemploymentSet;
/**
* 单位工伤基数
*/
@ExcelAttribute(name = "工伤基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数")
private BigDecimal unitInjurySet;
/**
* 单位生育基数
*/
@ExcelAttribute(name = "生育基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数")
private BigDecimal unitBirthSet;;
/**
* 单位养老金额
*/
@ExcelAttribute(name = "单位养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老金额")
private BigDecimal unitPensionMoney;
/**
* 单位医疗金额
*/
@ExcelAttribute(name = "单位医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗金额")
private BigDecimal unitMedicalMoney;
/**
* 单位失业金额
*/
@ExcelAttribute(name = "单位失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业金额")
private BigDecimal unitUnemploymentMoney;
/**
* 单位工伤金额
*/
@ExcelAttribute(name = "单位工伤金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤金额")
private BigDecimal unitInjuryMoney;
/**
* 单位生育金额
*/
@ExcelAttribute(name = "单位生育金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育金额")
private BigDecimal unitBirthMoney;
/**
* 单位大病金额
*/
@ExcelAttribute(name = "单位大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额")
private BigDecimal unitBigmailmentMoney;
/**
* 个人养老金额
*/
@ExcelAttribute(name = "个人养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人养老金额")
private BigDecimal personalPensionMoney;
/**
* 个人医疗金额
*/
@ExcelAttribute(name = "个人医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗金额")
private BigDecimal personalMedicalMoney;
/**
* 个人失业金额
*/
@ExcelAttribute(name = "个人失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
private BigDecimal personalUnemploymentMoney;
/**
* 个人大病金额
*/
@ExcelAttribute(name = "个人大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额")
private BigDecimal personalBigmailmentMoney;
/**
* 公积金编号
*/
@ExcelAttribute(name = "公积金编号", maxLength = 20)
@Size(max = 20, message = "公积金编号不可超过20位")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金编号")
private String providentNo;
/**
* 单位公积金基数
*/
@ExcelAttribute(name = "单位公积金基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金基数")
private BigDecimal unitProvidentSet;
/**
* 单位公积金比例
*/
@ExcelAttribute(name = "单位公积金比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金比例")
private BigDecimal providentPercent;
/**
* 单位公积金费用
*/
@ExcelAttribute(name = "单位公积金费用")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金费用")
private BigDecimal unitProvidentSum;
/**
* 个人公积金基数
*/
@ExcelAttribute(name = "个人公积金基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金基数")
private BigDecimal personalProidentSet;
/**
* 个人公积金费用
*/
@ExcelAttribute(name = "个人公积金费用")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金费用")
private BigDecimal personalProvidentSum;
/**
* 社保创建人姓名
*/
@ExcelAttribute(name = "社保创建人姓名", maxLength = 32)
@Schema(description = "社保创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保创建人姓名")
private String socialCreateName;
/**
* 社保创建时间
*/
@Schema(description = "社保创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保创建时间")
private String socialCreateTime;
/**
* 公积金创建人姓名
*/
@ExcelAttribute(name = "公积金创建人姓名", maxLength = 32)
@Schema(description = "公积金创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金创建人姓名")
private String fundCreateName;
/**
* 公积金创建时间
*/
@Schema(description = "公积金创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金创建时间")
private String fundCreateTime;
/**
* 分组键
*/
@ExcelAttribute(name = "分组键", isExport = false)
@Schema(description = "分组键")
private String keyGroup;
}
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
package com.yifu.cloud.plus.v1.yifu.social.controller; package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.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.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
...@@ -47,7 +50,6 @@ public class SysHouseHoldInfoController { ...@@ -47,7 +50,6 @@ public class SysHouseHoldInfoController {
private final SysHouseHoldInfoService sysHouseHoldInfoService; private final SysHouseHoldInfoService sysHouseHoldInfoService;
/** /**
* 简单分页查询 * 简单分页查询
* @param page 分页对象 * @param page 分页对象
...@@ -57,8 +59,9 @@ public class SysHouseHoldInfoController { ...@@ -57,8 +59,9 @@ public class SysHouseHoldInfoController {
@Operation(summary = "简单分页查询", description = "简单分页查询") @Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page") @GetMapping("/page")
public R<IPage<SysHouseHoldInfo>> getSysHouseHoldInfoPage(Page<SysHouseHoldInfo> page, SysHouseHoldInfo sysHouseHoldInfo) { public R<IPage<SysHouseHoldInfo>> getSysHouseHoldInfoPage(Page<SysHouseHoldInfo> page, SysHouseHoldInfo sysHouseHoldInfo) {
return new R<>(sysHouseHoldInfoService.getSysHouseHoldInfoPage(page,sysHouseHoldInfo)); return new R<>(sysHouseHoldInfoService.getSysHouseHoldInfoPage(page,sysHouseHoldInfo));
} }
/** /**
* 不分页查询 * 不分页查询
* @param sysHouseHoldInfo 社保户公积金户数据 * @param sysHouseHoldInfo 社保户公积金户数据
...@@ -120,4 +123,31 @@ public class SysHouseHoldInfoController { ...@@ -120,4 +123,31 @@ public class SysHouseHoldInfoController {
return R.ok(sysHouseHoldInfoService.removeById(id)); return R.ok(sysHouseHoldInfoService.removeById(id));
} }
/**
* @param flag 0/1
* @param name 户名
* @return 上级部门用户列表
*/
@PostMapping("/getHouseList")
@Operation(summary = "获取所有的户名", description = "获取所有的户名")
public R<List<SysHouseHoldInfo>> getSysUserList(@RequestParam String flag,
@RequestParam(required = false) String name) {
List<SysHouseHoldInfo> houseHoldList;
LambdaQueryWrapper<SysHouseHoldInfo> wrapper = Wrappers.lambdaQuery();
wrapper.eq(SysHouseHoldInfo::getDelFlag, CommonConstants.ZERO_STRING);
if (CommonConstants.ZERO_STRING.equals(flag)) {
wrapper.eq(SysHouseHoldInfo::getType, CommonConstants.ZERO_STRING);
if (Common.isNotNull(name)) {
wrapper.like(SysHouseHoldInfo::getName, name);
}
} else {
wrapper.eq(SysHouseHoldInfo::getType, CommonConstants.ONE_STRING);
if (Common.isNotNull(name)) {
wrapper.like(SysHouseHoldInfo::getName, name);
}
}
houseHoldList = sysHouseHoldInfoService.list(wrapper);
return R.ok(houseHoldList);
}
} }
...@@ -195,6 +195,19 @@ public class TPaymentInfoController { ...@@ -195,6 +195,19 @@ public class TPaymentInfoController {
tPaymentInfoService.listExport(response, searchVo); tPaymentInfoService.listExport(response, searchVo);
} }
/**
* 缴费库合并导出
*
* @author huyc
* @date 2022-10-31
**/
@Operation(description = "合并导出缴费库 hasPermission('social_tpaymentinfo_export')")
@PostMapping("/sumExport")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void sumExport(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.listSumExport(response, searchVo);
}
/** /**
* 根据条件批量删除 * 根据条件批量删除
* *
......
/*
* 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.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.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialfundHouseResService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialfundhouseres" )
@Tag(name = "社保公积金户权限配置表管理")
public class TSocialfundHouseResController {
private final TSocialfundHouseResService tSocialfundHouseResService;
/**
* 简单分页查询
* @param page 分页对象
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Operation(description = "社保公积金审核简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialfundHouseRes>> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes) {
return new R<>(tSocialfundHouseResService.getTSocialfundHouseResPage(page,tSocialfundHouseRes));
}
/**
* 导出查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Operation(summary = "导出查询", description = "导出查询")
@PostMapping("/exportList" )
public R<List<TSocialfundHouseRes>> getexportList(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return R.ok(tSocialfundHouseResService.getexportList(tSocialfundHouseRes));
}
/**
* 通过id查询社保公积金户权限配置表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsocialfundhouseres_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_get')" )
public R<TSocialfundHouseRes> getById(@PathVariable("id" ) String id) {
return R.ok(tSocialfundHouseResService.getById(id));
}
/**
* 新增社保公积金户权限配置表
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return R
*/
@Operation(summary = "新增社保公积金户权限配置表", description = "新增社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_add')")
@SysLog("新增社保公积金户权限配置表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_add')" )
public R save(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return tSocialfundHouseResService.saveSocialAuth(tSocialfundHouseRes);
}
/**
* 修改社保公积金户权限配置表
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return R
*/
@Operation(summary = "修改社保公积金户权限配置表", description = "修改社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_edit')")
@SysLog("修改社保公积金户权限配置表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_edit')" )
public R<Boolean> updateById(@RequestBody TSocialfundHouseRes tSocialfundHouseRes) {
return R.ok(tSocialfundHouseResService.updateById(tSocialfundHouseRes));
}
/**
* 通过id删除社保公积金户权限配置表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保公积金户权限配置表", description = "通过id删除社保公积金户权限配置表:hasPermission('social_tsocialfundhouseres_del')")
@SysLog("通过id删除社保公积金户权限配置表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tsocialfundhouseres_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialfundHouseResService.removeById(id));
}
}
...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -59,6 +60,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> { ...@@ -59,6 +60,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/ */
List<TPaymentInfo> getTPaymentInfoNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfo> getTPaymentInfoNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库合并导出查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountSumPaymentInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
List<TPaymentInfoExportVo> getTPaymentInfoSumNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/** /**
* 更新社保或者公积金 * 更新社保或者公积金
* @param tPaymentInfo 缴费库 * @param tPaymentInfo 缴费库
......
/*
* 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.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Mapper
public interface TSocialfundHouseResMapper extends BaseMapper<TSocialfundHouseRes> {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, @Param("tSocialfundHouseRes") TSocialfundHouseRes tSocialfundHouseRes);
/**
* 社保公积金户权限配置表导出查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
List<TSocialfundHouseRes> getexportList(@Param("tSocialfundHouseRes") TSocialfundHouseRes tSocialfundHouseRes);
}
...@@ -75,6 +75,13 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> { ...@@ -75,6 +75,13 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/ */
void listExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo); void listExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/**
* 合并导出缴费库
* @param response
* @param searchVo
* @return
*/
void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/** /**
* 删除缴费库数据 包括明细 * 删除缴费库数据 包括明细
......
/*
* 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.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
public interface TSocialfundHouseResService extends IService<TSocialfundHouseRes> {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes);
List<TSocialfundHouseRes> getexportList(TSocialfundHouseRes searchVo);
R saveSocialAuth(TSocialfundHouseRes searchVo);
}
...@@ -442,6 +442,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -442,6 +442,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchPart = true; dispatchPart = true;
} }
if (Common.isNotNull(excel.getSocialHousehold())){ if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isNullOrZero(excel.getRecordBase())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_RECORD_BASE_NOT_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
if (Common.isEmpty(socialSet)){ if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard()); excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
...@@ -456,7 +461,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -456,7 +461,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&& Common.isEmpty(excel.getUnemployStart()) && Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart()) && Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart()) && Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(excel.getWorkInjuryCardinal())) <= 0); && (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(excel.getWorkInjuryCardinal())) < 0);
} }
// 失败项社保派单 和已有派单户不一致 // 失败项社保派单 和已有派单户不一致
if (dispatchPart && Common.isNotNull(socialFund) if (dispatchPart && Common.isNotNull(socialFund)
......
...@@ -57,6 +57,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService; ...@@ -57,6 +57,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService; import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -69,14 +70,12 @@ import javax.servlet.http.HttpServletResponse; ...@@ -69,14 +70,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -206,6 +205,71 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -206,6 +205,71 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
/**
* 缴费库批量导出
*
* @param searchVo 缴费库
* @return
*/
@Override
public void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo) {
String fileName = "缴费库合并导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TPaymentInfoExportVo> list = new ArrayList<>();
Integer count = baseMapper.selectCountSumPaymentInfo(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfoExportVo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPaymentInfoSumNoPage(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TPaymentInfoExportVo> util = new ExcelUtil<>(TPaymentInfoExportVo.class);
for (TPaymentInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("缴费库合并导出" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("缴费库合并导出" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override @Override
public R<Boolean> removeInFoById(String id) { public R<Boolean> removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
...@@ -268,11 +332,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -268,11 +332,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override @Override
public R<Boolean> removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId, public R<Boolean> removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth) { String socialCreateMonth, String socialPayMonth) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard,socialHouseId,fundHouseId, LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard, socialHouseId, fundHouseId,
socialCreateMonth,socialPayMonth); socialCreateMonth, socialPayMonth);
List<TPaymentInfo> list = baseMapper.selectList(wrapper); List<TPaymentInfo> list = baseMapper.selectList(wrapper);
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
...@@ -296,13 +360,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -296,13 +360,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
baseMapper.deleteBatchIds(idList); baseMapper.deleteBatchIds(idList);
} }
if (delFlag) { if (delFlag) {
return R.ok(null,"存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!"); return R.ok(null, "存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
} }
return R.ok(null,"批量删除成功"); return R.ok(null, "批量删除成功");
} }
private LambdaQueryWrapper buildQueryWrapper(String empIdCard, String socialHouseId, String fundHouseId, private LambdaQueryWrapper buildQueryWrapper(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth){ String socialCreateMonth, String socialPayMonth) {
LambdaQueryWrapper<TPaymentInfo> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(empIdCard)) { if (Common.isNotNull(empIdCard)) {
wrapper.eq(TPaymentInfo::getEmpIdcard, empIdCard); wrapper.eq(TPaymentInfo::getEmpIdcard, empIdCard);
...@@ -394,8 +458,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -394,8 +458,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, List<ErrorMessage> errorMessageList, private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, List<ErrorMessage> errorMessageList,
YifuUser user, Integer rowNumber) { YifuUser user, Integer rowNumber) {
long start = System.currentTimeMillis();
HashMap<String, String> areaMap = new HashMap<>(); HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>(); HashMap<String, String> areaMap2 = new HashMap<>();
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR(); R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
...@@ -528,41 +590,41 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -528,41 +590,41 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------线程池处理list,批量保存社保信息开始-------------------------------- // -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>(); List<TPaymentInfoVo> tempList = new ArrayList<>();
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT; String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
AtomicInteger atomicLine = new AtomicInteger(CommonConstants.ZERO_INT);
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>(); // 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 创建一个数值格式化对象 // 设置精确到小数点后2位
NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(2);
// 设置精确到小数点后2位 String maerialRatio = "";
numberFormat.setMaximumFractionDigits(2); String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
String maerialRatio = ""; Integer bfInt = (Integer) redisUtil.get(sumNumKey);
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key"; if (Common.isNotNull(bfInt)) {
Integer bfInt = (Integer) redisUtil.get(sumNumKey); if (rowNumber > bfInt + 1) {
if (Common.isNotNull(bfInt)) { maerialRatio = numberFormat.format(((float) bfInt / (float) rowNumber) * 100);
if (rowNumber >= bfInt) { bfInt = bfInt + 100;
maerialRatio = numberFormat.format(((float) bfInt / (float) rowNumber) * 100); redisUtil.set(sumNumKey, bfInt, 360L);
bfInt = bfInt + 100; } else {
} else { maerialRatio = "100";
maerialRatio = "100"; redisUtil.remove(sumNumKey);
} }
}else { } else {
if (rowNumber >= 100) { if (rowNumber >= 100) {
maerialRatio = numberFormat.format(((float) 100 / (float) rowNumber) * 100); maerialRatio = numberFormat.format(((float) 100 / (float) rowNumber) * 100);
bfInt = 100; bfInt = 100;
} else { redisUtil.set(sumNumKey, bfInt, 360L);
maerialRatio = "100"; } else {
} maerialRatio = "100";
} }
redisUtil.set(sumNumKey, bfInt, 360L); }
redisUtil.set(importSuccessKey, maerialRatio, 360L); redisUtil.set(importSuccessKey, maerialRatio, 360L);
try { try {
// 1.list.size()不足partSize,直接执行 // 1.list.size()不足partSize,直接执行
if (list.size() < partSize) { if (list.size() < partSize) {
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, list, areaMap, areaMap2, executeImportSocialList(user, list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -575,7 +637,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -575,7 +637,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 处理第一个0位元素 // 处理第一个0位元素
final List<TPaymentInfoVo> finalList = list.subList(0, 1); final List<TPaymentInfoVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, finalList, areaMap, areaMap2, executeImportSocialList(user, finalList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -589,7 +651,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -589,7 +651,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
lastIdx = i; lastIdx = i;
List<TPaymentInfoVo> finalTempList = tempList; List<TPaymentInfoVo> finalTempList = tempList;
CompletableFuture.supplyAsync(() -> CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, finalTempList, areaMap, areaMap2, executeImportSocialList(user, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -613,7 +675,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -613,7 +675,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList; List<TPaymentInfoVo> finalTempList = tempList;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, finalTempList, areaMap, areaMap2, executeImportSocialList(user, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -671,7 +733,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -671,7 +733,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
/** /**
* @param user * @param user
* @param atomicLine
* @param list * @param list
* @param areaMap * @param areaMap
* @param areaMap2 * @param areaMap2
...@@ -682,17 +743,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -682,17 +743,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @return: * @return:
*/ */
private List<ErrorMessage> executeImportSocialList(YifuUser user, private List<ErrorMessage> executeImportSocialList(YifuUser user,
AtomicInteger atomicLine, List<TPaymentInfoVo> list,
List<TPaymentInfoVo> list, HashMap<String, String> areaMap,
HashMap<String, String> areaMap, HashMap<String, String> areaMap2,
HashMap<String, String> areaMap2, ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoBirMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBirMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap, List<ErrorMessage> errorMessageList) {
List<ErrorMessage> errorMessageList) {
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo; TPaymentInfo paymentInfo;
TSocialFundInfo socialInfo; TSocialFundInfo socialInfo;
...@@ -718,7 +778,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -718,7 +778,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray; String[] areaArray;
for (TPaymentInfoVo infoVo : list) { for (TPaymentInfoVo infoVo : list) {
atomicLine.incrementAndGet();
if (Common.isNotNull(infoVo.getEmpIdcard())) { if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X")); infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
} }
...@@ -1068,7 +1127,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1068,7 +1127,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/ */
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type,rowNumber); importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber);
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
}).sheet().doRead(); }).sheet().doRead();
...@@ -1221,7 +1280,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1221,7 +1280,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!")); + CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue; continue;
} }
if (fundMap.size() >CommonConstants.ZERO_INT) { if (fundMap.size() > CommonConstants.ZERO_INT) {
fund = (TSocialFundInfo) fundMap.get(infoVo.getEmpIdcard()); fund = (TSocialFundInfo) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验 //对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) { if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
...@@ -1247,7 +1306,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1247,7 +1306,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//计算公积金合计,个人金额和单位金额一致 //计算公积金合计,个人金额和单位金额一致
infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum())); infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum()));
// 判重 // 判重
if (paymentInfoMap.size() >CommonConstants.ZERO_INT) { if (paymentInfoMap.size() > CommonConstants.ZERO_INT) {
paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr() paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING + CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim() + infoVo.getEmpIdcard().trim()
...@@ -1341,8 +1400,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1341,8 +1400,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
} }
} else {
errorMessageList.add(new ErrorMessage(-1, "无数据可导入!"));
} }
} catch (Exception e) { } catch (Exception e) {
log.error("数据批量导入异常:" + e); log.error("数据批量导入异常:" + e);
...@@ -1375,6 +1432,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1375,6 +1432,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (taskSize > residualCapacity) { if (taskSize > residualCapacity) {
errorMessageList.add(new ErrorMessage(-1, MsgUtils.getMessage(ErrorCodes.SOCIALINFO_LIST_NUM_LARGE))); errorMessageList.add(new ErrorMessage(-1, MsgUtils.getMessage(ErrorCodes.SOCIALINFO_LIST_NUM_LARGE)));
} else { } else {
// -----------------------------生成paymentInfoMap本段开始-------------------------------- // -----------------------------生成paymentInfoMap本段开始--------------------------------
//已存在的档案数据 //已存在的档案数据
List<String> monthList = Common.listObjectToStrList(list, ExcelAttributeConstants.SOCIAL_PAY_MONTH).stream().distinct().collect(Collectors.toList()); List<String> monthList = Common.listObjectToStrList(list, ExcelAttributeConstants.SOCIAL_PAY_MONTH).stream().distinct().collect(Collectors.toList());
...@@ -1464,7 +1522,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1464,7 +1522,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------线程池处理list,批量保存社保信息开始-------------------------------- // -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentHeFeiVo> tempList = new ArrayList<>(); List<TPaymentHeFeiVo> tempList = new ArrayList<>();
AtomicInteger atomicLine = new AtomicInteger(CommonConstants.ZERO_INT);
List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>(); List<CompletableFuture<List<ErrorMessage>>> completableFutureList = new ArrayList<>();
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT; String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
...@@ -1477,30 +1535,32 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1477,30 +1535,32 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key"; String sumNumKey = user.getId() + CommonConstants.DOWN_LINE_STRING + "sum_key";
Integer bfInt = (Integer) redisUtil.get(sumNumKey); Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) { if (Common.isNotNull(bfInt)) {
if (bfInt <= rowNumber) { if (rowNumber > bfInt + 1) {
maerialRatio = numberFormat.format((float) bfInt / (float) rowNumber * 100); maerialRatio = numberFormat.format(((float) bfInt / (float) rowNumber) * 100);
bfInt = bfInt + 100; bfInt = bfInt + 100;
redisUtil.set(sumNumKey, bfInt, 360L);
} else { } else {
maerialRatio = "100"; maerialRatio = "100";
redisUtil.remove(sumNumKey);
} }
}else { } else {
if (100 <= rowNumber) { if (rowNumber >= 100) {
maerialRatio = numberFormat.format((float) 100 / (float) rowNumber * 100); maerialRatio = numberFormat.format(((float) 100 / (float) rowNumber) * 100);
bfInt = 100; bfInt = 100;
redisUtil.set(sumNumKey, bfInt, 360L);
} else { } else {
maerialRatio = "100"; maerialRatio = "100";
} }
} }
redisUtil.set(sumNumKey, bfInt, 360L);
redisUtil.set(importSuccessKey, maerialRatio, 360L); redisUtil.set(importSuccessKey, maerialRatio, 360L);
try { try {
// 1.list.size()不足partSize,直接执行 // 1.list.size()不足partSize,直接执行
if (list.size() < partSize) { if (list.size() < partSize) {
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, list, areaMap, areaMap2, -> executeImportSocialListThree(user, list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
paymentInfoBigMap,type, errorMessageList), paymentInfoBigMap, type, errorMessageList),
yfSocialImportThreadPoolExecutor); yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture); completableFutureList.add(listCompletableFuture);
} }
...@@ -1511,10 +1571,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1511,10 +1571,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 处理第一个0位元素 // 处理第一个0位元素
final List<TPaymentHeFeiVo> finalList = list.subList(0, 1); final List<TPaymentHeFeiVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorMessage>> oneCompletableFuture = CompletableFuture.supplyAsync(() CompletableFuture<List<ErrorMessage>> oneCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, finalList, areaMap, -> executeImportSocialListThree(user, finalList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type, paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
completableFutureList.add(oneCompletableFuture); completableFutureList.add(oneCompletableFuture);
lastIdx = 1; lastIdx = 1;
for (int i = 1; i < list.size(); i++) { for (int i = 1; i < list.size(); i++) {
...@@ -1524,10 +1584,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1524,10 +1584,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
lastIdx = i; lastIdx = i;
List<TPaymentHeFeiVo> finalTempList1 = tempList; List<TPaymentHeFeiVo> finalTempList1 = tempList;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, finalTempList1 -> executeImportSocialListThree(user, finalTempList1
, areaMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, , areaMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap,
paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoBigMap, type, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList), yfSocialImportThreadPoolExecutor); errorMessageList), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture); completableFutureList.add(listCompletableFuture);
tempList = new ArrayList<>(); tempList = new ArrayList<>();
} }
...@@ -1549,10 +1609,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1549,10 +1609,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentHeFeiVo> finalTempList = tempList; List<TPaymentHeFeiVo> finalTempList = tempList;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, atomicLine, finalTempList, areaMap, -> executeImportSocialListThree(user, finalTempList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList) paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList)
, yfSocialImportThreadPoolExecutor); , yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture); completableFutureList.add(listCompletableFuture);
} }
...@@ -1574,16 +1634,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1574,16 +1634,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
private List<ErrorMessage> executeImportSocialListThree(YifuUser user, AtomicInteger atomicLine, private List<ErrorMessage> executeImportSocialListThree(YifuUser user,
List<TPaymentHeFeiVo> list, List<TPaymentHeFeiVo> list,
HashMap<String, String> areaMap, HashMap<String, String> areaMap,
HashMap<String, String> areaMap2, HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap, ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
String type,List<ErrorMessage> errorMessageList) { String type, List<ErrorMessage> errorMessageList) {
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
TPaymentInfo payExists; TPaymentInfo payExists;
TSocialFundInfo socialInfo = null; TSocialFundInfo socialInfo = null;
...@@ -1609,7 +1669,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1609,7 +1669,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray; String[] areaArray;
for (TPaymentHeFeiVo infoVo : list) { for (TPaymentHeFeiVo infoVo : list) {
atomicLine.incrementAndGet();
if (Common.isNotNull(infoVo.getEmpIdcard())) { if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X")); infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
} }
...@@ -1618,7 +1677,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1618,7 +1677,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue; continue;
} }
//无对应员工的社保数据 //无对应员工的社保数据
if (socialMap.size() >CommonConstants.ZERO_INT) { if (socialMap.size() > CommonConstants.ZERO_INT) {
//采用客服导入的地址 //采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING); areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddressThree(areaArray, areaMap2, infoVo); infoVo = initAddressThree(areaArray, areaMap2, infoVo);
...@@ -1965,6 +2024,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1965,6 +2024,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
/** /**
* 薪资获取缴费库 * 薪资获取缴费库
*
* @Author hgw * @Author hgw
* @Date 2022-8-10 18:06:13 * @Date 2022-8-10 18:06:13
**/ **/
...@@ -2054,24 +2114,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2054,24 +2114,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void createPaymentInfoIncome() { public void createPaymentInfoIncome() {
//判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入 //判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入
List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.between(TPaymentInfo::getCreateTime,LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)), .between(TPaymentInfo::getCreateTime, LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)),
LocalDateTimeUtils.getDayStart(LocalDateTime.now())) LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
//生成收入 //生成收入
createIncomeInfo(sumList,CommonConstants.ONE_STRING); createIncomeInfo(sumList, CommonConstants.ONE_STRING);
} }
} }
@Override @Override
public void createPaymentFundIncome() { public void createPaymentFundIncome() {
List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda() List<TPaymentInfo> sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.between(TPaymentInfo::getCreateTime,LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)), .between(TPaymentInfo::getCreateTime, LocalDateTimeUtils.getThatDayStartTime(LocalDateTime.now().plusDays(-1)),
LocalDateTimeUtils.getDayStart(LocalDateTime.now())) LocalDateTimeUtils.getDayStart(LocalDateTime.now()))
.isNotNull(TPaymentInfo::getFundId)); .isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
//生成公积金收入 //生成公积金收入
createIncomeInfo(sumList,CommonConstants.TWO_STRING); createIncomeInfo(sumList, CommonConstants.TWO_STRING);
} }
} }
...@@ -2107,7 +2167,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2107,7 +2167,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.isNotNull(TPaymentInfo::getSocialId)); .isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
//生成收入 //生成收入
createIncomeInfo(sumList,CommonConstants.ONE_STRING); createIncomeInfo(sumList, CommonConstants.ONE_STRING);
} }
} }
...@@ -2118,7 +2178,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2118,7 +2178,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.isNotNull(TPaymentInfo::getFundId)); .isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(sumList)) { if (Common.isNotNull(sumList)) {
//生成公积金收入 //生成公积金收入
createIncomeInfo(sumList,CommonConstants.TWO_STRING); createIncomeInfo(sumList, CommonConstants.TWO_STRING);
} }
} }
...@@ -2135,11 +2195,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2135,11 +2195,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String, Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>(); Map<String, String> idMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR; List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo; R<TSettleDomainListVo> listVo;
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
...@@ -2148,8 +2208,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2148,8 +2208,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
TSettleDomainListVo tSettleDomainListVo = listVo.getData(); TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) { if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO(); settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) { for (TSettleDomainSelectVo vo : settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain); BeanUtils.copyProperties(vo, settleDomain);
} }
} }
} }
...@@ -2371,15 +2431,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2371,15 +2431,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
pushList.clear(); pushList.clear();
} }
}else { } else {
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
idMap.put(body,library.getId()); idMap.put(body, library.getId());
map.put(body,i); map.put(body, i);
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
for (Map.Entry<String,Integer> entry : map.entrySet()) { for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError(); TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date()); error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay()); error.setCreateDay(DateUtil.getThisDay());
...@@ -2392,8 +2452,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2392,8 +2452,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
break; break;
} }
} else { } else {
map.put(body,1); map.put(body, 1);
idMap.put(body,library.getId()); idMap.put(body, library.getId());
} }
} }
} }
...@@ -2415,11 +2475,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2415,11 +2475,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void initEkpPushFundParam(List<TPaymentInfo> unPushInfo) { public void initEkpPushFundParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>(); List<String> pushList = new ArrayList<>();
Map<String,Integer> map = new HashMap<>(); Map<String, Integer> map = new HashMap<>();
Map<String,String> idMap = new HashMap<>(); Map<String, String> idMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR; List<TSettleDomainSelectVo> settleDomainR;
R<TSettleDomainListVo> listVo; R<TSettleDomainListVo> listVo;
for (TPaymentInfo library:unPushInfo) { for (TPaymentInfo library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); TSettleDomain settleDomain = new TSettleDomain();
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId()); listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId());
...@@ -2427,8 +2487,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2427,8 +2487,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
TSettleDomainListVo tSettleDomainListVo = listVo.getData(); TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) { if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO(); settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) { for (TSettleDomainSelectVo vo : settleDomainR) {
BeanUtils.copyProperties(vo,settleDomain); BeanUtils.copyProperties(vo, settleDomain);
} }
} }
} }
...@@ -2542,15 +2602,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2542,15 +2602,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
pushList.clear(); pushList.clear();
} }
}else { } else {
if (map.get(body) > 0) { if (map.get(body) > 0) {
int i = map.get(body) + 1; int i = map.get(body) + 1;
map.put(body,i); map.put(body, i);
idMap.put(body,library.getId()); idMap.put(body, library.getId());
//单个异常超过十次,保存异常内容 //单个异常超过十次,保存异常内容
if (i >= 10) { if (i >= 10) {
baseMapper.updatePushStatus(pushList); baseMapper.updatePushStatus(pushList);
for (Map.Entry<String,Integer> entry : map.entrySet()) { for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError(); TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date()); error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay()); error.setCreateDay(DateUtil.getThisDay());
...@@ -2563,8 +2623,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2563,8 +2623,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
break; break;
} }
} else { } else {
map.put(body,1); map.put(body, 1);
idMap.put(body,library.getId()); idMap.put(body, library.getId());
} }
} }
} }
...@@ -2584,7 +2644,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2584,7 +2644,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
public void createIncomeInfo(List<TPaymentInfo> updateList,String socialFundFlag) { public void createIncomeInfo(List<TPaymentInfo> updateList, String socialFundFlag) {
List<TIncomeDetail> detailList = new ArrayList<>(); List<TIncomeDetail> detailList = new ArrayList<>();
for (TPaymentInfo paymentInfo : updateList) { for (TPaymentInfo paymentInfo : updateList) {
boolean exitFlag = false; boolean exitFlag = false;
...@@ -2715,7 +2775,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2715,7 +2775,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType, public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType,
String charges, String feeMode, BigDecimal money,String sourceType, String charges, String feeMode, BigDecimal money, String sourceType,
List<TIncomeDetail> detailList) { List<TIncomeDetail> detailList) {
//生成收入数据 //生成收入数据
TIncomeDetail detail = new TIncomeDetail(); TIncomeDetail detail = new TIncomeDetail();
......
/*
* 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.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.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.social.entity.TSocialfundHouseRes;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialfundHouseResMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialfundHouseResService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 社保公积金户权限配置表
*
* @author huyc
* @date 2022-11-02 09:13:07
*/
@Log4j2
@Service
public class TSocialfundHouseResServiceImpl extends ServiceImpl<TSocialfundHouseResMapper, TSocialfundHouseRes> implements TSocialfundHouseResService {
/**
* 社保公积金户权限配置表简单分页查询
* @param tSocialfundHouseRes 社保公积金户权限配置表
* @return
*/
@Override
public IPage<TSocialfundHouseRes> getTSocialfundHouseResPage(Page<TSocialfundHouseRes> page, TSocialfundHouseRes tSocialfundHouseRes){
return baseMapper.getTSocialfundHouseResPage(page,tSocialfundHouseRes);
}
/**
* 社保公积金户权限配置表批量导出
* @param searchVo 社保公积金户权限配置表
* @return
*/
@Override
public List<TSocialfundHouseRes> getexportList(TSocialfundHouseRes searchVo) {
return baseMapper.getexportList(searchVo);
}
@Override
public R saveSocialAuth(TSocialfundHouseRes searchVo) {
LambdaQueryWrapper<TSocialfundHouseRes> wrapper = new LambdaQueryWrapper<>();
if (Common.isNotNull(searchVo.getSocialHousehold())) {
wrapper.eq(TSocialfundHouseRes::getSocialHousehold, searchVo.getSocialHousehold());
}
if (Common.isNotNull(searchVo.getFundHousehold())){
wrapper.eq(TSocialfundHouseRes::getFundHousehold,searchVo.getFundHousehold());
}
if (Common.isNotNull(searchVo.getUserId())){
wrapper.eq(TSocialfundHouseRes::getUserId,searchVo.getUserId());
}
if (Common.isNotNull(searchVo.getAuthType())){
wrapper.eq(TSocialfundHouseRes::getAuthType,searchVo.getAuthType());
}
TSocialfundHouseRes socialfundHouseRes = baseMapper.selectOne(wrapper);
if (Common.isNotNull(socialfundHouseRes)) {
String errorMessage;
if (CommonConstants.ZERO_STRING.equals(searchVo.getAuthType())) {
errorMessage = "请勿重复添加审核人员";
} else {
errorMessage = "请勿重复添加办理人员";
}
return R.failed(errorMessage);
} else {
baseMapper.insert(searchVo);
return R.ok();
}
}
}
...@@ -101,6 +101,63 @@ ...@@ -101,6 +101,63 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="incomeStatus" column="INCOME_STATUS"/> <result property="incomeStatus" column="INCOME_STATUS"/>
</resultMap> </resultMap>
<resultMap id="tPaymentInfoSumMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empNo" column="EMP_NO"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="socialSecurityNo" column="SOCIAL_SECURITY_NO"/>
<result property="socialPayAddr" column="SOCIAL_PAY_ADDR"/>
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
<result property="providentHousehold" column="PROVIDENT_HOUSEHOLD"/>
<result property="providentPayAddr" column="PROVIDENT_PAY_ADDR"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="socialSum" column="SOCIAL_SUM"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="socialSecurityPersonalSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="providentSum" column="PROVIDENT_SUM"/>
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
<result property="companyAccrual" column="COMPANY_ACCRUAL"/>
<result property="personalAccrual" column="PERSONAL_ACCRUAL"/>
<result property="unitPensionSet" column="UNIT_PENSION_SET"/>
<result property="unitMedicalSet" column="UNIT_MEDICAL_SET"/>
<result property="unitUnemploymentSet" column="UNIT_UNEMPLOYMENT_SET"/>
<result property="unitInjurySet" column="UNIT_INJURY_SET"/>
<result property="unitBirthSet" column="UNIT_BIRTH_SET"/>
<result property="unitPensionMoney" column="UNIT_PENSION_MONEY"/>
<result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
<result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
<result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
<result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
<result property="unitBigmailmentMoney" column="UNIT_BIGMAILMENT_MONEY"/>
<result property="personalPensionMoney" column="PERSONAL_PENSION_MONEY"/>
<result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
<result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
<result property="personalBigmailmentMoney" column="PERSONAL_BIGMAILMENT_MONEY"/>
<result property="providentNo" column="PROVIDENT_NO"/>
<result property="unitProvidentSet" column="UNIT_PROVIDENT_SET"/>
<result property="providentPercent" column="PROVIDENT_PERCENT"/>
<result property="unitProvidentSum" column="UNIT_PROVIDENT_SUM"/>
<result property="personalProidentSet" column="PERSONAL_PROIDENT_SET"/>
<result property="socialCreateName" column="SOCIAL_CREATE_NAME"/>
<result property="socialCreateTime" column="SOCIAL_CREATE_TIME"/>
<result property="fundCreateName" column="FUND_CREATE_NAME"/>
<result property="fundCreateTime" column="FUND_CREATE_TIME"/>
<result property="personalProvidentSum" column="PERSONAL_PROVIDENT_SUM"/>
<result property="keyGroup" column="keyGroup"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
a.EMP_NAME, a.EMP_NAME,
...@@ -178,83 +235,6 @@ ...@@ -178,83 +235,6 @@
a.UPDATE_BY, a.UPDATE_BY,
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME a.CREATE_TIME
</sql>
<sql id="base_column_list_all">
a.ID,
a.EMP_NAME,
a.EMP_NO,
a.EMP_ID,
a.EMP_IDCARD,
a.UNIT_ID,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SETTLE_DOMAIN_ID,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_BY,
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_ID,
a.FUND_ID,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_PER,
a.UNIT_MEDICAL_PER,
a.UNIT_UNEMPLOYMENT_PER,
a.UNIT_INJURY_PER,
a.UNIT_BIRTH_PER,
a.PERSONAL_PENSION_PER,
a.PERSONAL_MEDICAL_PER,
a.PERSONAL_UNEMPLOYMENT_PER,
a.UNIT_BIGAILMENT_PER,
a.PERSONAL_BIGAILMENT_PER,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.UNIT_PROVIDENT_SUM,
a.PERSONAL_PROIDENT_SET,
a.PERSONAL_PROVIDENT_SUM
</sql> </sql>
<sql id="tPaymentInfo_where"> <sql id="tPaymentInfo_where">
<if test="tPaymentInfo != null"> <if test="tPaymentInfo != null">
...@@ -496,15 +476,9 @@ ...@@ -496,15 +476,9 @@
<if test="tPaymentInfo.empNo != null and tPaymentInfo.empNo.trim() != ''"> <if test="tPaymentInfo.empNo != null and tPaymentInfo.empNo.trim() != ''">
AND a.EMP_NO like CONCAT(#{tPaymentInfo.empNo},'%') AND a.EMP_NO like CONCAT(#{tPaymentInfo.empNo},'%')
</if> </if>
<if test="tPaymentInfo.empId != null and tPaymentInfo.empId.trim() != ''">
AND a.EMP_ID = #{tPaymentInfo.empId}
</if>
<if test="tPaymentInfo.empIdcard != null and tPaymentInfo.empIdcard.trim() != ''"> <if test="tPaymentInfo.empIdcard != null and tPaymentInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tPaymentInfo.empIdcard} AND a.EMP_IDCARD = #{tPaymentInfo.empIdcard}
</if> </if>
<if test="tPaymentInfo.unitId != null and tPaymentInfo.unitId.trim() != ''">
AND a.UNIT_ID = #{tPaymentInfo.unitId}
</if>
<if test="tPaymentInfo.settleDomainName != null and tPaymentInfo.settleDomainName.trim() != ''"> <if test="tPaymentInfo.settleDomainName != null and tPaymentInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME = #{tPaymentInfo.settleDomainName} AND a.SETTLE_DOMAIN_NAME = #{tPaymentInfo.settleDomainName}
</if> </if>
...@@ -532,12 +506,6 @@ ...@@ -532,12 +506,6 @@
<if test="tPaymentInfo.socialCreateMonth != null and tPaymentInfo.socialCreateMonth.trim() != ''"> <if test="tPaymentInfo.socialCreateMonth != null and tPaymentInfo.socialCreateMonth.trim() != ''">
AND (a.SOCIAL_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}' or a.PROVIDENT_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}') AND (a.SOCIAL_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}' or a.PROVIDENT_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}')
</if> </if>
<if test="tPaymentInfo.lockStatus != null and tPaymentInfo.lockStatus.trim() != ''">
AND a.LOCK_STATUS = #{tPaymentInfo.lockStatus}
</if>
<if test="tPaymentInfo.sumAll != null">
AND a.SUM_ALL = #{tPaymentInfo.sumAll}
</if>
<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''"> <if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''">
AND a.PROVIDENT_HOUSEHOLD like CONCAT(#{tPaymentInfo.providentHousehold},'%') AND a.PROVIDENT_HOUSEHOLD like CONCAT(#{tPaymentInfo.providentHousehold},'%')
</if> </if>
...@@ -572,144 +540,9 @@ ...@@ -572,144 +540,9 @@
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''"> <if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}') AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if> </if>
<if test="tPaymentInfo.socialId != null and tPaymentInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tPaymentInfo.socialId}
</if>
<if test="tPaymentInfo.fundId != null and tPaymentInfo.fundId.trim() != ''">
AND a.FUND_ID = #{tPaymentInfo.fundId}
</if>
<if test="tPaymentInfo.socialSum != null">
AND a.SOCIAL_SUM = #{tPaymentInfo.socialSum}
</if>
<if test="tPaymentInfo.unitSocialSum != null">
AND a.UNIT_SOCIAL_SUM = #{tPaymentInfo.unitSocialSum}
</if>
<if test="tPaymentInfo.socialSecurityPersonalSum != null">
AND a.SOCIAL_SECURITY_PERSONAL_SUM = #{tPaymentInfo.socialSecurityPersonalSum}
</if>
<if test="tPaymentInfo.providentSum != null">
AND a.PROVIDENT_SUM = #{tPaymentInfo.providentSum}
</if>
<if test="tPaymentInfo.inauguralTeam != null and tPaymentInfo.inauguralTeam.trim() != ''">
AND a.INAUGURAL_TEAM = #{tPaymentInfo.inauguralTeam}
</if>
<if test="tPaymentInfo.sortTime != null and tPaymentInfo.sortTime.trim() != ''">
AND a.SORT_TIME = #{tPaymentInfo.sortTime}
</if>
<if test="tPaymentInfo.companyAccrual != null">
AND a.COMPANY_ACCRUAL = #{tPaymentInfo.companyAccrual}
</if>
<if test="tPaymentInfo.personalAccrual != null">
AND a.PERSONAL_ACCRUAL = #{tPaymentInfo.personalAccrual}
</if>
<if test="tPaymentInfo.unitPensionSet != null">
AND a.UNIT_PENSION_SET = #{tPaymentInfo.unitPensionSet}
</if>
<if test="tPaymentInfo.unitMedicalSet != null">
AND a.UNIT_MEDICAL_SET = #{tPaymentInfo.unitMedicalSet}
</if>
<if test="tPaymentInfo.unitUnemploymentSet != null">
AND a.UNIT_UNEMPLOYMENT_SET = #{tPaymentInfo.unitUnemploymentSet}
</if>
<if test="tPaymentInfo.unitInjurySet != null">
AND a.UNIT_INJURY_SET = #{tPaymentInfo.unitInjurySet}
</if>
<if test="tPaymentInfo.unitBirthSet != null">
AND a.UNIT_BIRTH_SET = #{tPaymentInfo.unitBirthSet}
</if>
<if test="tPaymentInfo.unitPensionPer != null">
AND a.UNIT_PENSION_PER = #{tPaymentInfo.unitPensionPer}
</if>
<if test="tPaymentInfo.unitMedicalPer != null">
AND a.UNIT_MEDICAL_PER = #{tPaymentInfo.unitMedicalPer}
</if>
<if test="tPaymentInfo.unitUnemploymentPer != null">
AND a.UNIT_UNEMPLOYMENT_PER = #{tPaymentInfo.unitUnemploymentPer}
</if>
<if test="tPaymentInfo.unitInjuryPer != null">
AND a.UNIT_INJURY_PER = #{tPaymentInfo.unitInjuryPer}
</if>
<if test="tPaymentInfo.unitBirthPer != null">
AND a.UNIT_BIRTH_PER = #{tPaymentInfo.unitBirthPer}
</if>
<if test="tPaymentInfo.personalPensionPer != null">
AND a.PERSONAL_PENSION_PER = #{tPaymentInfo.personalPensionPer}
</if>
<if test="tPaymentInfo.personalMedicalPer != null">
AND a.PERSONAL_MEDICAL_PER = #{tPaymentInfo.personalMedicalPer}
</if>
<if test="tPaymentInfo.personalUnemploymentPer != null">
AND a.PERSONAL_UNEMPLOYMENT_PER = #{tPaymentInfo.personalUnemploymentPer}
</if>
<if test="tPaymentInfo.unitBigailmentPer != null">
AND a.UNIT_BIGAILMENT_PER = #{tPaymentInfo.unitBigailmentPer}
</if>
<if test="tPaymentInfo.personalBigailmentPer != null">
AND a.PERSONAL_BIGAILMENT_PER = #{tPaymentInfo.personalBigailmentPer}
</if>
<if test="tPaymentInfo.unitPensionMoney != null">
AND a.UNIT_PENSION_MONEY = #{tPaymentInfo.unitPensionMoney}
</if>
<if test="tPaymentInfo.unitMedicalMoney != null">
AND a.UNIT_MEDICAL_MONEY = #{tPaymentInfo.unitMedicalMoney}
</if>
<if test="tPaymentInfo.unitUnemploymentMoney != null">
AND a.UNIT_UNEMPLOYMENT_MONEY = #{tPaymentInfo.unitUnemploymentMoney}
</if>
<if test="tPaymentInfo.unitInjuryMoney != null">
AND a.UNIT_INJURY_MONEY = #{tPaymentInfo.unitInjuryMoney}
</if>
<if test="tPaymentInfo.unitBirthMoney != null">
AND a.UNIT_BIRTH_MONEY = #{tPaymentInfo.unitBirthMoney}
</if>
<if test="tPaymentInfo.unitBigmailmentMoney != null">
AND a.UNIT_BIGMAILMENT_MONEY = #{tPaymentInfo.unitBigmailmentMoney}
</if>
<if test="tPaymentInfo.personalPensionMoney != null">
AND a.PERSONAL_PENSION_MONEY = #{tPaymentInfo.personalPensionMoney}
</if>
<if test="tPaymentInfo.personalMedicalMoney != null">
AND a.PERSONAL_MEDICAL_MONEY = #{tPaymentInfo.personalMedicalMoney}
</if>
<if test="tPaymentInfo.personalUnemploymentMoney != null">
AND a.PERSONAL_UNEMPLOYMENT_MONEY = #{tPaymentInfo.personalUnemploymentMoney}
</if>
<if test="tPaymentInfo.personalBigmailmentMoney != null">
AND a.PERSONAL_BIGMAILMENT_MONEY = #{tPaymentInfo.personalBigmailmentMoney}
</if>
<if test="tPaymentInfo.providentNo != null and tPaymentInfo.providentNo.trim() != ''"> <if test="tPaymentInfo.providentNo != null and tPaymentInfo.providentNo.trim() != ''">
AND a.PROVIDENT_NO = #{tPaymentInfo.providentNo} AND a.PROVIDENT_NO = #{tPaymentInfo.providentNo}
</if> </if>
<if test="tPaymentInfo.unitProvidentSet != null">
AND a.UNIT_PROVIDENT_SET = #{tPaymentInfo.unitProvidentSet}
</if>
<if test="tPaymentInfo.providentPercent != null">
AND a.PROVIDENT_PERCENT = #{tPaymentInfo.providentPercent}
</if>
<if test="tPaymentInfo.unitProvidentSum != null">
AND a.UNIT_PROVIDENT_SUM = #{tPaymentInfo.unitProvidentSum}
</if>
<if test="tPaymentInfo.personalProidentSet != null">
AND a.PERSONAL_PROIDENT_SET = #{tPaymentInfo.personalProidentSet}
</if>
<if test="tPaymentInfo.personalProvidentSum != null">
AND a.PERSONAL_PROVIDENT_SUM = #{tPaymentInfo.personalProvidentSum}
</if>
<if test="tPaymentInfo.createBy != null and tPaymentInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tPaymentInfo.createBy}
</if>
<if test="tPaymentInfo.updateTime != null">
AND a.UPDATE_TIME = #{tPaymentInfo.updateTime}
</if>
<if test="tPaymentInfo.updateBy != null and tPaymentInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tPaymentInfo.updateBy}
</if>
<if test="tPaymentInfo.createName != null and tPaymentInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tPaymentInfo.createName}
</if>
<if test="tPaymentInfo.createTime != null">
AND a.CREATE_TIME = #{tPaymentInfo.createTime}
</if>
</if> </if>
</if> </if>
</sql> </sql>
...@@ -831,6 +664,227 @@ ...@@ -831,6 +664,227 @@
</where> </where>
</select> </select>
<!--tPaymentInfo合并查询-->
<select id="getTPaymentInfoSumNoPage" resultMap="tPaymentInfoSumMap">
SELECT
w.keyGroup,
w.EMP_IDCARD,
w.EMP_NO,
w.EMP_NAME,
w.UNIT_NAME,
w.SETTLE_DOMAIN_CODE,
w.SETTLE_DOMAIN_NAME,
w.SOCIAL_HOUSEHOLD,
w.SOCIAL_SECURITY_NO,
w.SOCIAL_PAY_ADDR,
w.SOCIAL_PAY_MONTH,
w.SOCIAL_CREATE_MONTH,
SUM( w.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( w.SUM_ALL ) AS SUM_ALL,
MAX( w.PROVIDENT_PAY_MONTH ) AS PROVIDENT_PAY_MONTH,
MAX( w.PROVIDENT_CREATE_MONTH ) AS PROVIDENT_CREATE_MONTH,
MAX( w.PROVIDENT_HOUSEHOLD ) AS PROVIDENT_HOUSEHOLD,
MAX( w.PROVIDENT_PAY_ADDR ) AS PROVIDENT_PAY_ADDR,
MAX( w.FUND_PROVINCE ) AS FUND_PROVINCE,
MAX( w.FUND_CITY ) AS FUND_CITY,
MAX( w.FUND_TOWN ) AS FUND_TOWN,
w.SOCIAL_PROVINCE,
w.SOCIAL_CITY,
w.SOCIAL_TOWN,
w.SOCIAL_SUM,
w.UNIT_SOCIAL_SUM,
w.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( w.PROVIDENT_SUM ) AS PROVIDENT_SUM,
w.INAUGURAL_TEAM,
w.COMPANY_ACCRUAL,
w.PERSONAL_ACCRUAL,
w.UNIT_PENSION_SET,
w.UNIT_MEDICAL_SET,
w.UNIT_UNEMPLOYMENT_SET,
w.UNIT_INJURY_SET,
w.UNIT_BIRTH_SET,
w.UNIT_PENSION_MONEY,
w.UNIT_MEDICAL_MONEY,
w.UNIT_UNEMPLOYMENT_MONEY,
w.UNIT_INJURY_MONEY,
w.UNIT_BIRTH_MONEY,
w.UNIT_BIGMAILMENT_MONEY,
w.PERSONAL_PENSION_MONEY,
w.PERSONAL_MEDICAL_MONEY,
w.PERSONAL_UNEMPLOYMENT_MONEY,
w.PERSONAL_BIGMAILMENT_MONEY,
MAX( w.PROVIDENT_NO ) AS PROVIDENT_NO,
MAX( w.PERSONAL_PROIDENT_SET ) AS PERSONAL_PROIDENT_SET,
SUM( w.UNIT_PROVIDENT_SET ) AS UNIT_PROVIDENT_SET,
SUM( w.PROVIDENT_PERCENT ) AS PROVIDENT_PERCENT,
w.SOCIAL_CREATE_NAME,
w.SOCIAL_CREATE_TIME,
MAX( w.FUND_CREATE_NAME ) AS FUND_CREATE_NAME,
MAX( w.FUND_CREATE_TIME ) AS FUND_CREATE_TIME,
SUM( w.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_NO,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
SUM( a.SOCIAL_SUM ) AS SOCIAL_SUM,
SUM( a.UNIT_SOCIAL_SUM ) AS UNIT_SOCIAL_SUM,
SUM( a.SOCIAL_SECURITY_PERSONAL_SUM ) AS SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
MAX(a.UNIT_PENSION_SET ) AS UNIT_PENSION_SET,
MAX(a.UNIT_MEDICAL_SET ) AS UNIT_MEDICAL_SET,
MAX(a.UNIT_UNEMPLOYMENT_SET ) AS UNIT_UNEMPLOYMENT_SET,
MAX(a.UNIT_INJURY_SET ) AS UNIT_INJURY_SET,
MAX(a.UNIT_BIRTH_SET ) AS UNIT_BIRTH_SET,
SUM( a.UNIT_PENSION_MONEY ) AS UNIT_PENSION_MONEY,
SUM( a.UNIT_MEDICAL_MONEY ) AS UNIT_MEDICAL_MONEY,
SUM( a.UNIT_UNEMPLOYMENT_MONEY ) AS UNIT_UNEMPLOYMENT_MONEY,
SUM( a.UNIT_INJURY_MONEY ) AS UNIT_INJURY_MONEY,
SUM( a.UNIT_BIRTH_MONEY ) AS UNIT_BIRTH_MONEY,
SUM( a.UNIT_BIGMAILMENT_MONEY ) AS UNIT_BIGMAILMENT_MONEY,
SUM( a.PERSONAL_PENSION_MONEY ) AS PERSONAL_PENSION_MONEY,
SUM( a.PERSONAL_MEDICAL_MONEY ) AS PERSONAL_MEDICAL_MONEY,
SUM( a.PERSONAL_UNEMPLOYMENT_MONEY ) AS PERSONAL_UNEMPLOYMENT_MONEY,
SUM( a.PERSONAL_BIGMAILMENT_MONEY ) AS PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
a.CREATE_NAME AS SOCIAL_CREATE_NAME,
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS SOCIAL_CREATE_TIME,
NULL AS FUND_CREATE_NAME,
NULL AS FUND_CREATE_TIME,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.SOCIAL_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_NO,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM(a.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.PROVIDENT_SUM ) AS PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
NULL AS SOCIAL_CREATE_NAME,
NULL AS SOCIAL_CREATE_TIME,
a.CREATE_NAME AS FUND_CREATE_NAME,
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS FUND_CREATE_TIME,
SUM( a.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.FUND_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
)
) w
GROUP BY w.keyGroup
ORDER BY w.SOCIAL_CREATE_TIME desc
limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd}
</select>
<!--tPaymentInfo数量查询-->
<select id="selectCountSumPaymentInfo" resultType="java.lang.Integer">
SELECT
count(1)
FROM (
select * from (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup
FROM t_payment_info a
<where>
a.SOCIAL_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup
FROM t_payment_info a
<where>
a.FUND_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
)
) w
GROUP BY w.keyGroup) c
</select>
<update id="updateDeleteInfo"> <update id="updateDeleteInfo">
update t_payment_info update t_payment_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialfundHouseResMapper">
<resultMap id="tSocialfundHouseResMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes">
<id property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="fundHousehold" column="FUND_HOUSEHOLD"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createBy" column="CREATE_BY"/>
<result property="status" column="STATUS"/>
<result property="userName" column="USER_NAME"/>
<result property="userDeptName" column="USER_DEPT_NAME"/>
<result property="houseNameType" column="HOUSE_NAME_TYPE"/>
<result property="authType" column="AUTH_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.USER_ID,
a.SOCIAL_HOUSEHOLD,
a.FUND_HOUSEHOLD,
a.CREATE_TIME,
a.CREATE_BY,
a.STATUS,
a.USER_NAME,
a.USER_DEPT_NAME,
a.HOUSE_NAME_TYPE,
a.AUTH_TYPE
</sql>
<sql id="tSocialfundHouseRes_where">
<if test="tSocialfundHouseRes != null">
<if test="tSocialfundHouseRes.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tSocialfundHouseRes.idList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
<if test="tSocialfundHouseRes.idList == null">
<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
AND a.SOCIAL_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.socialHousehold},'%')
</if>
<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
AND a.FUND_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.fundHousehold},'%')
</if>
<if test="tSocialfundHouseRes.status != null and tSocialfundHouseRes.status.trim() != ''">
AND a.STATUS = #{tSocialfundHouseRes.status}
</if>
<if test="tSocialfundHouseRes.userName != null and tSocialfundHouseRes.userName.trim() != ''">
AND a.USER_NAME like concat('%',#{tSocialfundHouseRes.userName},'%')
</if>
<if test="tSocialfundHouseRes.userDeptName != null and tSocialfundHouseRes.userDeptName.trim() != ''">
AND a.USER_DEPT_NAME like concat('%',#{tSocialfundHouseRes.userDeptName},'%')
</if>
<if test="tSocialfundHouseRes.houseNameType != null and tSocialfundHouseRes.houseNameType.trim() != ''">
AND a.HOUSE_NAME_TYPE = #{tSocialfundHouseRes.houseNameType}
</if>
<if test="tSocialfundHouseRes.authType != null and tSocialfundHouseRes.authType.trim() != ''">
AND a.AUTH_TYPE = #{tSocialfundHouseRes.authType}
</if>
</if>
</if>
</sql>
<!--tSocialfundHouseRes简单分页查询-->
<select id="getTSocialfundHouseResPage" resultMap="tSocialfundHouseResMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<!--tSocialfundHouseResa导出查询-->
<select id="getexportList" resultMap="tSocialfundHouseResMap">
SELECT
a.SOCIAL_HOUSEHOLD,
a.FUND_HOUSEHOLD,
a.STATUS,
a.USER_NAME,
a.USER_DEPT_NAME,
a.HOUSE_NAME_TYPE
FROM t_socialfund_house_res a
<where>
1=1
<include refid="tSocialfundHouseRes_where"/>
</where>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment