Commit 658e11c1 authored by hongguangwu's avatar hongguangwu

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

parents a237a176 235ca7f3
/*
* 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;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.Past;
......@@ -484,4 +485,21 @@ public class EmployeeProjectExportParamVO extends BaseEntity {
private String[] empNatureArray;
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;
}
/*
* 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 {
}
/**
* 批量导出人员档案信息
* 批量导出合同
*
* @Author hgw
* @Date 2022-6-24 09:36:06
......@@ -329,4 +329,20 @@ public class TEmployeeContractInfoController {
public TEmployeeContractInfo getContractById(@RequestBody String 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);
}
}
......@@ -302,15 +302,15 @@ public class TEmployeeInfoController {
@SysLog("批量导出人员档案信息")
// @ResponseExcel
@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();
if (user != null && Common.isNotNull(user.getId())) {
menuUtil.setAuthSql(user, employeeInfo);
if (Common.isNotNull(employeeInfo.getAuthSql()) && employeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
employeeInfo.setAuthSql(employeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID"));
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_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;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.vo.DispatchCheckVo;
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 com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -80,4 +77,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
String getMaxEmpCode();
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> {
* @return
*/
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
* @return: void
**/
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> {
* @Author: hgw
* @Date: 2022/6/23 10:30
**/
void exportEmployee(TEmployeeInfo employeeVo, HttpServletResponse response);
void exportEmployee(EmployeeInfoSearchVo employeeVo, HttpServletResponse response);
/**
* @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
}
}
@Override
public void exportAuditContractInfo(TEmployeeContractInfo contractInfo, HttpServletResponse response) {
}
}
......@@ -19,10 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -59,6 +61,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -1988,43 +1991,78 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* 获取导出的人员档案列表
*/
@Override
public void exportEmployee(TEmployeeInfo employeeInfo, HttpServletResponse response) {
if (employeeInfo != null && employeeInfo.getExportFields() != null && !employeeInfo.getExportFields().isEmpty()) {
public void exportEmployee(EmployeeInfoSearchVo searchVo, HttpServletResponse response) {
if (searchVo != null && searchVo.getExportFields() != null && !searchVo.getExportFields().isEmpty()) {
String fileName = "人员档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
employeeInfo.setFileStatus(CommonConstants.ZERO_INT);
List<EmployeeExportVO> list = baseMapper.getTEmployeeExportList(employeeInfo);
List<EmployeeExportVO> list = new ArrayList<>();
//获取要导出的列表
searchVo.setFileStatus(CommonConstants.ZERO_INT);
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
}
try {
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo : list) {
util.convertEntity(vo, null, null, null);
}
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(employeeInfo.getExportFields())
.sheet("人员档案").doWrite(list);
//EasyExcel.write(out, TEmpBadRecord.class).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();
} catch (Exception e) {
log.error(EmployeeConstants.FILE_EXPORT_EXCEPTION, e);
} finally {
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (out != null) {
if (null != out) {
out.close();
}
} 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;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -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.vo.CheckBankNoVo;
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.TEmployeeProject;
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.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
......@@ -64,6 +64,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -90,9 +91,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired
private TSettleDomainService tSettleDomainService;
@Autowired
private TCustomerInfoMapper tCustomerInfoMapper;
@Autowired
@Lazy
private DoJointTask doJointTask;
......@@ -1178,38 +1176,58 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Date 10:55 2022/6/23
**/
@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;
// 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<>(exportFields);
//获取要导出的列表
List<EmployeeProjectExportVO> list;
//获取记录
list = gettEmpProInfoExportVos(idstr, projectDTO);
//获取要导出的列表 gettEmpProInfoExportVos
List<EmployeeProjectExportVO> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
}
try {
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.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFiledNames(includeColumnFiledNames).sheet("项目档案")
.doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeProjectExportVO.class).includeColumnFieldNames(includeColumnFiledNames).build();
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();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
......@@ -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
* @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 @@
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
from t_employee_project p
where 1=1
where 1=1 and p.DELETE_FLAG = '0'
<if test="checkVo != null">
<if test="checkVo.codes != null">
AND p.DEPT_NO in
......@@ -927,4 +927,51 @@
</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>
......@@ -802,4 +802,39 @@
</where>
order by a.CREATE_TIME desc
</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>
......@@ -361,6 +361,10 @@ public interface ErrorCodes {
* 新增异常:未找到对应社保户名称的可用基数配置信息
*/
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 {
}
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
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();
}
......@@ -1553,8 +1553,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//如果当前实缴信息已推送,且金额与本次不一致,则推送实缴更新
BigDecimal bigDecimal = new BigDecimal(success.getActualPremium());
boolean b = bigDecimal.compareTo(detail.getActualPremium()) == CommonConstants.ZERO_INT;
if(CommonConstants.ONE_INT == isActualPush && !b){
boolean c = !Common.isNotNull(detail.getActualPremium()) ||
bigDecimal.compareTo(detail.getActualPremium()) != 0;
if(CommonConstants.ONE_INT == isActualPush && c){
//推送保费更新
settle.setActualPremium(bigDecimal);
settle.setIsActualPush(CommonConstants.ZERO_INT);
......@@ -1592,7 +1593,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果当前保单为单独结算
if(settleType == CommonConstants.ONE_INT){
//推送过实缴信息且金额与本次不一致,则推送更新
if(StringUtils.isNotBlank(defaultSettleId) && (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0)){
boolean c = !Common.isNotNull(detail.getActualPremium()) ||
new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0;
if(StringUtils.isNotBlank(defaultSettleId) && c){
//推送保费更新
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
......@@ -1641,8 +1644,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String policyNo = success.getPolicyNo();
boolean booleanInvoiceNo = StringUtils.isNotBlank(invoiceNo) && !invoiceNo.equals(detail.getInvoiceNo());
boolean booleanPolicyNo = StringUtils.isNotBlank(policyNo) && !policyNo.equals(detail.getPolicyNo());
boolean isEquals = Common.isNotNull(detail.getActualPremium()) && new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) == 0;
//如果当前保费为空,且保单号或发票号不一样
if((StringUtils.isBlank(success.getActualPremium()) || new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) == 0) && (booleanInvoiceNo || booleanPolicyNo)){
if((StringUtils.isBlank(success.getActualPremium()) || isEquals) && (booleanInvoiceNo || booleanPolicyNo)){
if(StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if(Optional.ofNullable(settle).isPresent()){
......
<?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;
}
......@@ -40,6 +40,18 @@ import java.util.Date;
@Schema(description = "派单审核导出Vo")
public class TDispatchAuditExportVo {
@ExcelAttribute(name = "派单类型", readConverterExp = "0=增加派单,1=减少派单")
@Schema(description = "派单类型:0派增1派减")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("派单类型")
private String type;
@Schema(description = "创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Schema(description = "员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -64,12 +76,6 @@ public class TDispatchAuditExportVo {
@ExcelProperty("项目名称")
private String settleDomainName;
@ExcelAttribute(name = "派单类型", readConverterExp = "0=增加派单,1=减少派单")
@Schema(description = "派单类型:0派增1派减")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("派单类型")
private String type;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Schema(description = "社保户")
@HeadFontStyle(fontHeightInPoints = 11)
......@@ -82,6 +88,14 @@ public class TDispatchAuditExportVo {
@ExcelProperty("公积金户")
private String providentHouseholdName;
/**
* 合同类型(字典值)
*/
@ExcelAttribute(name = "合同类型",maxLength = 10)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="合同类型")
private String contractName;
/**
* 合同起始时间
*/
......@@ -92,14 +106,6 @@ public class TDispatchAuditExportVo {
@ExcelProperty("合同起始时间" )
private Date contractStart;
/**
* 合同类型(字典值)
*/
@ExcelAttribute(name = "合同类型",maxLength = 10)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="合同类型")
private String contractName;
/**
* 合同到期时间
*/
......@@ -110,17 +116,21 @@ public class TDispatchAuditExportVo {
@ExcelProperty("合同到期时间" )
private Date contractEnd;
/**
* 工时制:1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 1, message = "工时制 不能超过1个字符" )
@ExcelAttribute(name = "工时制", maxLength = 1, readConverterExp = "1=标准工时,2=综合工时,3=不定时工时制")
@Schema(description = "工时制:1标准工时 2 综合工时 3不定时工时制" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工时制" )
private String workingHours;
@Schema(description = "创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建人姓名")
private String createName;
@Schema(description = "创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 委托备注
*/
......@@ -141,16 +151,6 @@ public class TDispatchAuditExportVo {
@ExcelProperty("备案基数" )
private String recordBase;
/**
* 工时制:1标准工时 2 综合工时 3不定时工时制
*/
@Length(max = 1, message = "工时制 不能超过1个字符" )
@ExcelAttribute(name = "工时制", maxLength = 1, readConverterExp = "1=标准工时,2=综合工时,3=不定时工时制")
@Schema(description = "工时制:1标准工时 2 综合工时 3不定时工时制" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工时制" )
private String workingHours;
@ExcelAttribute(name = "缴纳类型", readConverterExp = "0=最低,1=自定义,2=最高")
@Schema(description = "缴纳类型(0最低、1自定义、2最高)")
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -8,10 +8,7 @@ package com.yifu.cloud.plus.v1.yifu.social.constants;
public class PaymentConstants {
public static final String PENSION_RISK = "养老保险";
public static final String PENSION = "养老";
public static final String UNEMPLOYEEMENT_RISK = "失业保险";
public static final String UNEMPLOYEEMENT = "失业";
public static final String INJURY_RISK = "工伤保险";
public static final String INJURY = "工伤";
public static final String MEDICAL = "医疗";
}
......@@ -12,6 +12,8 @@ public class SocialConstants {
public static final String DIFF_TYPE_ONE = "预估";
public static final String DIFF_TYPE_THR = "实缴";
public static final String DIFF_TYPE_TWO = "差额";
public static final String ERROR_TEMPLATE = "模板中已存在对应员工";
public static final String EXIT_TEMPLATE = "已存在对应员工身份证";
public static final String YL = "养老";
public static final String DB = "大病";
......
......@@ -17,9 +17,12 @@
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.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.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
......@@ -47,7 +50,6 @@ public class SysHouseHoldInfoController {
private final SysHouseHoldInfoService sysHouseHoldInfoService;
/**
* 简单分页查询
* @param page 分页对象
......@@ -57,8 +59,9 @@ public class SysHouseHoldInfoController {
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
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 社保户公积金户数据
......@@ -120,4 +123,31 @@ public class SysHouseHoldInfoController {
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 {
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;
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.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.TPaymentInfoVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -59,6 +60,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
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 缴费库
......
/*
* 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> {
*/
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
dispatchPart = true;
}
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)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
......@@ -456,7 +461,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& 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)
......@@ -2592,7 +2597,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.setDeptId(dispatch.getSettleDomain());
temp.setEmpId(dispatch.getEmpId());
R<TEmployeeProject> res = archivesDaprUtil.getTEmployeeProjectById(temp);
if (Common.isNotNull(res)){
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
if (Common.isNotNull(res.getData().getWorkingHours())) {
dispatch.setWorkingHours(res.getData().getWorkingHours());
}
......
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