Commit 6a69ad2b authored by fangxinjiang's avatar fangxinjiang

导入优化

parent 76335095
......@@ -31,11 +31,6 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
<!-- excel 导入导出 https://github.com/pig-mesh/excel-spring-boot-starter -->
<dependency>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
......
......@@ -8,6 +8,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.constants;
*/
public class ArchivesConstants {
public static final String EMP_BAD_RECORD="不良记录";
/**
* 复档
*/
......
/*
* 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.ExcelIgnore;
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 java.util.Date;
/**
* 员工合同续签待办
*
* @author fxj
* @date 2022-07-01 14:15:05
*/
@Data
@TableName("t_emp_contract_alert")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "员工合同续签待办")
public class TEmpContractAlert extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelAttribute(name = "主键" )
@Schema(description ="主键")
@ExcelIgnore
private String id;
/**
* 员工名称
*/
@ExcelAttribute(name = "员工名称" )
@Schema(description ="员工名称")
@ExcelProperty("员工名称")
private String empName;
/**
* 员工ID
*/
@ExcelAttribute(name = "员工ID" )
@Schema(description ="员工ID")
@ExcelProperty("员工ID")
private String empId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@ExcelProperty("项目名称")
private String project;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码" )
@Schema(description ="项目编码")
@ExcelProperty("项目编码")
private String projectNo;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 员工编码
*/
@ExcelAttribute(name = "员工编码" )
@Schema(description ="员工编码")
@ExcelProperty("员工编码")
private String empCode;
/**
* 合同开始日期
*/
@ExcelAttribute(name = "合同开始日期" )
@Schema(description ="合同开始日期")
@ExcelProperty("合同开始日期")
private Date contractStart;
/**
* 合同截止日期
*/
@ExcelAttribute(name = "合同截止日期" )
@Schema(description ="合同截止日期")
@ExcelProperty("合同截止日期")
private Date contractEnd;
/**
* 档案地-省
*/
@ExcelAttribute(name = "档案地-省" )
@Schema(description ="档案地-省")
@ExcelProperty("档案地-省")
private String fileProvince;
/**
* 档案地-市
*/
@ExcelAttribute(name = "档案地-市" )
@Schema(description ="档案地-市")
@ExcelProperty("档案地-市")
private String fileCity;
/**
* 档案地-县
*/
@ExcelAttribute(name = "档案地-县" )
@Schema(description ="档案地-县")
@ExcelProperty("档案地-县")
private String fileTown;
/**
* 员工类型
*/
@ExcelAttribute(name = "员工类型" )
@Schema(description ="员工类型")
@ExcelProperty("员工类型")
private String empType;
/**
* 合同类型
*/
@ExcelAttribute(name = "合同类型" )
@Schema(description ="合同类型")
@ExcelProperty("合同类型")
private String contractType;
/**
* 合同期限
*/
@ExcelAttribute(name = "合同期限" )
@Schema(description ="合同期限")
@ExcelProperty("合同期限")
private String contractTerm;
/**
* 到期天数
*/
@ExcelAttribute(name = "到期天数" )
@Schema(description ="到期天数")
@ExcelProperty("到期天数")
private Integer daysDue;
/**
* 是否过期:0 未过期 1 过期
*/
@ExcelAttribute(name = "是否过期:0 未过期 1 过期" )
@Schema(description ="是否过期:0 未过期 1 过期")
@ExcelProperty("是否过期:0 未过期 1 过期")
private String dueFlag;
/**
* 过期天数
*/
@ExcelAttribute(name = "过期天数" )
@Schema(description ="过期天数")
@ExcelProperty("过期天数")
private Integer daysOver;
/**
* 首次提醒时间
*/
@ExcelAttribute(name = "首次提醒时间" )
@Schema(description ="首次提醒时间")
@ExcelProperty("首次提醒时间")
private Date firstAlertTime;
/**
* 提醒人
*/
@ExcelAttribute(name = "提醒人" )
@Schema(description ="提醒人")
@ExcelProperty("提醒人")
private String alertPerson;
/**
* 处理状态
*/
@ExcelAttribute(name = "处理状态" )
@Schema(description ="处理状态")
@ExcelProperty("处理状态")
private String handleStatus;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author fxj
* @Date 2022/7/1
* @Description
* @Version 1.0
*/
@Data
public class ContractAlertExportVo implements Serializable {
/**
* 员工名称
*/
@ExcelAttribute(name = "员工名称" )
@Schema(description ="员工名称")
@ExcelProperty("员工名称")
private String empName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@ExcelProperty("项目名称")
private String project;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码" )
@Schema(description ="项目编码")
@ExcelProperty("项目编码")
private String projectNo;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 员工编码
*/
@ExcelAttribute(name = "员工编码" )
@Schema(description ="员工编码")
@ExcelProperty("员工编码")
private String empCode;
/**
* 合同开始日期
*/
@ExcelAttribute(name = "合同开始日期",isDate = true )
@Schema(description ="合同开始日期")
@ExcelProperty("合同开始日期")
private Date contractStart;
/**
* 合同截止日期
*/
@ExcelAttribute(name = "合同截止日期" ,isDate = true)
@Schema(description ="合同截止日期")
@ExcelProperty("合同截止日期")
private Date contractEnd;
/**
* 档案地-省
*/
@ExcelAttribute(name = "档案地-省" ,isArea = true)
@Schema(description ="档案地-省")
@ExcelProperty("档案地-省")
private String fileProvince;
/**
* 档案地-市
*/
@ExcelAttribute(name = "档案地-市" ,isArea = true,parentField = "fileProvince")
@Schema(description ="档案地-市")
@ExcelProperty("档案地-市")
private String fileCity;
/**
* 档案地-县
*/
@ExcelAttribute(name = "档案地-县" ,isArea = true,parentField = "fileCity")
@Schema(description ="档案地-县")
@ExcelProperty("档案地-县")
private String fileTown;
/**
* 员工类型
*/
@ExcelAttribute(name = "员工类型" ,isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description ="员工类型")
@ExcelProperty("员工类型")
private String empType;
/**
* 合同类型
*/
@ExcelAttribute(name = "合同类型", isDataId = true,dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE)
@Schema(description ="合同类型")
@ExcelProperty("合同类型")
private String contractType;
/**
* 合同期限
*/
@ExcelAttribute(name = "合同期限" )
@Schema(description ="合同期限")
@ExcelProperty("合同期限")
private String contractTerm;
/**
* 到期天数
*/
@ExcelAttribute(name = "到期天数" )
@Schema(description ="到期天数")
@ExcelProperty("到期天数")
private Integer daysDue;
/**
* 是否过期:0 未过期 1 过期
*/
@ExcelAttribute(name = "是否过期",readConverterExp = "0=未过期,1=过期")
@Schema(description ="是否过期:0 未过期 1 过期")
@ExcelProperty("是否过期")
private String dueFlag;
/**
* 过期天数
*/
@ExcelAttribute(name = "过期天数" )
@Schema(description ="过期天数")
@ExcelProperty("过期天数")
private Integer daysOver;
/**
* 首次提醒时间
*/
@ExcelAttribute(name = "首次提醒时间" )
@Schema(description ="首次提醒时间")
@ExcelProperty("首次提醒时间")
private Date firstAlertTime;
/**
* 提醒人
*/
@ExcelAttribute(name = "提醒人" )
@Schema(description ="提醒人")
@ExcelProperty("提醒人")
private String alertPerson;
/**
* 处理状态
*/
@ExcelAttribute(name = "处理状态", readConverterExp = "0=待处理,1=处理中")
@Schema(description ="处理状态")
@ExcelProperty("处理状态")
private String handleStatus;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/7/1
* @Description
* @Version 1.0
*/
@Data
public class ContractAlertSearchVo extends TEmpContractAlert {
/**
* 导出IDS
*/
@Schema(description = "导出IDS")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
}
......@@ -3,6 +3,7 @@ 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.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -37,7 +38,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 资格类型
*/
@ExcelAttribute(name = "资格类型",isNotEmpty = true,errorInfo = "资格类型不可为空",isDataId = true, dataType = "qualification_type")
@ExcelAttribute(name = "资格类型",isNotEmpty = true,errorInfo = "资格类型不可为空",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE)
@NotNull(message = "资格类型不可为空")
@ExcelProperty(value ="资格类型")
private String qualificationType;
......@@ -45,7 +46,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 资格等级
*/
@ExcelAttribute(name = "资格等级",isNotEmpty = true,errorInfo = "资格等级不可为空",isDataId = true, dataType = "qualification_level")
@ExcelAttribute(name = "资格等级",isNotEmpty = true,errorInfo = "资格等级不可为空",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_LEVEL)
@NotNull(message = "资格等级不可为空")
@ExcelProperty(value ="资格等级")
private String qualificationLevel;
......@@ -60,7 +61,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 获取方式
*/
@ExcelAttribute(name = "获取方式",isDataId = true, dataType = "obtain_type")
@ExcelAttribute(name = "获取方式",isDataId = true, dataType = ExcelAttributeConstants.OBTAIN_TYPE)
@ExcelProperty(value ="获取方式")
private String obtainType;
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -57,7 +58,7 @@ public class EmpDisabilityExcelVO extends RowIndex implements Serializable {
/**
* 伤残等级
*/
@ExcelAttribute(name = "伤残等级",isNotEmpty = true, errorInfo = "伤残等级不能为空",isDataId = true, dataType = "disability_grade")
@ExcelAttribute(name = "伤残等级",isNotEmpty = true, errorInfo = "伤残等级不能为空",isDataId = true, dataType = ExcelAttributeConstants.DISABILITY_GRADE)
@NotNull(message = "伤残等级不能为空")
@ExcelProperty(value ="伤残等级")
private String disabilityLevel;
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -64,7 +65,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/**
* 学历名称
*/
@ExcelAttribute(name = "学历",isNotEmpty = true, errorInfo = "学历不可为空",isDataId = true,dataType = "education")
@ExcelAttribute(name = "学历",isNotEmpty = true, errorInfo = "学历不可为空",isDataId = true,dataType = ExcelAttributeConstants.EDUCATION)
@NotNull(message = "学历不可为空")
@ExcelProperty(value ="学历")
private String educationName;
......@@ -72,7 +73,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/**
* 学历类型:全日制、自考、函授等
*/
@ExcelAttribute(name = "学历类型",isDataId = true,dataType = "education_type")
@ExcelAttribute(name = "学历类型",isDataId = true,dataType = ExcelAttributeConstants.EDUCATION_TYPE)
@ExcelProperty(value ="学历类型")
private String type;
......@@ -87,7 +88,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/**
* 学制类型:四年、三年、五年、二年
*/
@ExcelAttribute(name = "学制类型",isDataId = true,dataType = "education_system")
@ExcelAttribute(name = "学制类型",isDataId = true,dataType = ExcelAttributeConstants.EDUCATION_SYSTEM)
@ExcelProperty(value ="学制类型")
private String educationSystem;
......
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -52,7 +53,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 学历名称
*/
@ExcelAttribute(name = "学历", isNotEmpty = true,errorInfo = "学历不可为空", isDataId = true, dataType = "education")
@ExcelAttribute(name = "学历", isNotEmpty = true,errorInfo = "学历不可为空", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION)
@NotNull(message = "学历不可为空")
@ExcelProperty(value ="学历")
private String educationName;
......@@ -60,7 +61,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 学历类型:全日制、自考、函授等
*/
@ExcelAttribute(name = "学历类型", isDataId = true, dataType = "education_type")
@ExcelAttribute(name = "学历类型", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION_TYPE)
@ExcelProperty(value ="学历类型")
private String type;
......@@ -75,7 +76,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/**
* 学制类型:四年、三年、五年、二年
*/
@ExcelAttribute(name = "学制类型", isDataId = true, dataType = "education_system")
@ExcelAttribute(name = "学制类型", isDataId = true, dataType = ExcelAttributeConstants.EDUCATION_SYSTEM)
@ExcelProperty(value ="学制类型")
private String educationSystem;
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -48,7 +49,7 @@ public class EmpFamilyExcelVO extends RowIndex implements Serializable {
/**
* 与本人关系
*/
@ExcelAttribute(name = "与本人关系",isNotEmpty = true,isDataId = true,dataType = "family_relation",errorInfo = "与本人关系不可为空")
@ExcelAttribute(name = "与本人关系",isNotEmpty = true,isDataId = true,dataType = ExcelAttributeConstants.FAMILY_RELATION,errorInfo = "与本人关系不可为空")
//@DictValidator(dictType = "family_relation",message = "与本人关系字典不匹配")
@NotNull(message = "与本人关系不可为空")
private String relationshipSelf;
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data;
import javax.validation.constraints.NotNull;
......@@ -63,7 +64,7 @@ public class EmpWorkRecordExcelVO extends RowIndex implements Serializable {
/**
* 工作类型
*/
@ExcelAttribute(name = "工作类型",isDataId = true,dataType = "workinfo_type")
@ExcelAttribute(name = "工作类型",isDataId = true,dataType = ExcelAttributeConstants.WORKINFO_TYPE)
@ExcelProperty(value ="工作类型")
private String workingType;
......
......@@ -49,7 +49,7 @@ public class FileUploadController {
@Operation(description = "OSS文件上传接口" +
"@ApiImplicitParam(name = \"file\", value = \"Form文件上传\", required = true, dataType = \"__file\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"filePath\", value = \"文件上传路径\", required = false, dataType = \"String\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(0员工附件-学历 1 员工附件-伤残 2.员工附件-职业 )\", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(0员工附件-学历 1 员工附件-伤残 2.员工附件-职业 3.员工附件-不良记录 4.员工附件-合同)\", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t")
/*@ApiImplicitParams({
......
......@@ -27,11 +27,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -90,21 +88,6 @@ public class TEmpBadRecordController {
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" )
public R<TEmpBadRecord> getById(@PathVariable("id" ) String id) {
/* TEmpBadRecord record;
List<TEmpBadRecord> list = new ArrayList<>();
for (int i=200000;i<500000;i++){
record = new TEmpBadRecord();
record.setEmpId("1");
record.setEmpName("2");
record.setEmpIdcard("323333333333");
record.setHappenTime(new Date());
record.setLoseFee(BigDecimal.ONE);
record.setId(String.valueOf(i));
record.setProject("test");
record.setProjectCode("test");
list.add(record);
}
tEmpBadRecordService.saveBatch(list);*/
return R.ok(tEmpBadRecordService.getById(id));
}
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
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.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 员工合同续签待办
*
* @author fxj
* @date 2022-07-01 14:15:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tempcontractalert" )
@Tag(name = "员工合同续签待办管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TEmpContractAlertController {
private final TEmpContractAlertService tEmpContractAlertService;
/**
* 分页查询
* @param page 分页对象
* @param searchVo 员工合同续签待办
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<IPage<TEmpContractAlert>> getTEmpContractAlertPage(Page page, ContractAlertSearchVo searchVo) {
return R.ok(tEmpContractAlertService.pageDiy(page, searchVo));
}
/**
* 不分页查询
* @param searchVo 员工合同续签待办
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<List<TEmpContractAlert>> getTEmpContractAlertNoPage(@RequestBody ContractAlertSearchVo searchVo) {
return R.ok(tEmpContractAlertService.listDiy(searchVo));
}
/**
* 通过id查询员工合同续签待办
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tempcontractalert_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<TEmpContractAlert> getById(@PathVariable("id" ) String id) {
return R.ok(tEmpContractAlertService.getById(id));
}
/**
* 新增员工合同续签待办
* @param tEmpContractAlert 员工合同续签待办
* @return R
*/
@Operation(summary = "新增员工合同续签待办", description = "新增员工合同续签待办:hasPermission('demo_tempcontractalert_add')")
@SysLog("新增员工合同续签待办" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_add')" )
public R<Boolean> save(@RequestBody TEmpContractAlert tEmpContractAlert) {
return R.ok(tEmpContractAlertService.save(tEmpContractAlert));
}
/**
* 修改员工合同续签待办
* @param tEmpContractAlert 员工合同续签待办
* @return R
*/
@Operation(summary = "修改员工合同续签待办", description = "修改员工合同续签待办:hasPermission('demo_tempcontractalert_edit')")
@SysLog("修改员工合同续签待办" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_edit')" )
public R<Boolean> updateById(@RequestBody TEmpContractAlert tEmpContractAlert) {
return R.ok(tEmpContractAlertService.updateById(tEmpContractAlert));
}
/**
* 通过id删除员工合同续签待办
* @param id id
* @return R
*/
@Operation(summary = "通过id删除员工合同续签待办", description = "通过id删除员工合同续签待办:hasPermission('demo_tempcontractalert_del')")
@SysLog("通过id删除员工合同续签待办" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmpContractAlertService.removeById(id));
}
/**
* 批量导出合同信息
* @param searchVo
* @return R<List>
* @Author FXJ
* @Date 2022-07-1
**/
@Operation(description = "导出")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody ContractAlertSearchVo searchVo) {
tEmpContractAlertService.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.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import org.apache.ibatis.annotations.Mapper;
/**
* 员工合同续签待办
*
* @author fxj
* @date 2022-07-01 14:15:05
*/
@Mapper
public interface TEmpContractAlertMapper extends BaseMapper<TEmpContractAlert> {
}
/*
* 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.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 员工合同续签待办
*
* @author fxj
* @date 2022-07-01 14:15:05
*/
public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo);
List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo);
void listExport(HttpServletResponse response, ContractAlertSearchVo searchVo);
}
......@@ -235,22 +235,21 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
WriteSheet writeSheet = EasyExcel.writerSheet("不良记录"+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)){
list.clear();
}
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("不良记录"+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
......
/*
* 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.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.FamilySearchVO;
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.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 员工合同续签待办
*
* @author fxj
* @date 2022-07-01 14:15:05
*/
@Service
public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertMapper, TEmpContractAlert> implements TEmpContractAlertService {
@Override
public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectPage(page,wrapper);
}
@Override
public List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList);
}
return baseMapper.selectList(wrapper);
}
private long noPageCountDiy(ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() >= 0){
wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd());
}
return baseMapper.selectCount(wrapper);
}
@Override
public void listExport(HttpServletResponse response, ContractAlertSearchVo searchVo) {
String fileName = ArchivesConstants.EMP_BAD_RECORD + LocalDateTime.now() + ".xlsx";
//获取要导出的列表
List<TEmpContractAlert> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.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 = listDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<TEmpContractAlert> util = new ExcelUtil<>(TEmpContractAlert.class);
for (TEmpContractAlert vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
}
if (Common.isNotNull(list)){
list.clear();
}
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity){
LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0])
.le(TEmpContractAlert::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getEmpName())){
wrapper.eq(TEmpContractAlert::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())){
wrapper.eq(TEmpContractAlert::getEmpIdcard,entity.getEmpIdcard());
}
if (Common.isNotNull(entity.getProject())){
wrapper.eq(TEmpContractAlert::getProject,entity.getProject());
}
if (Common.isNotNull(entity.getProjectNo())){
wrapper.eq(TEmpContractAlert::getProjectNo,entity.getProjectNo());
}
if (Common.isNotNull(entity.getEmpType())){
wrapper.eq(TEmpContractAlert::getEmpType,entity.getEmpType());
}
if (Common.isNotNull(entity.getContractType())){
wrapper.eq(TEmpContractAlert::getContractType,entity.getContractType());
}
if (Common.isNotNull(entity.getFileProvince())){
wrapper.eq(TEmpContractAlert::getFileProvince,entity.getFileProvince());
}
if (Common.isNotNull(entity.getFileCity())){
wrapper.eq(TEmpContractAlert::getFileCity,entity.getFileCity());
}
if (Common.isNotNull(entity.getFileTown())){
wrapper.eq(TEmpContractAlert::getFileTown,entity.getFileTown());
}
if (Common.isNotNull(entity.getAlertPerson())){
wrapper.eq(TEmpContractAlert::getAlertPerson,entity.getAlertPerson());
}
if (Common.isNotNull(entity.getDueFlag())){
wrapper.eq(TEmpContractAlert::getDueFlag,entity.getDueFlag());
}
if (Common.isNotNull(entity.getHandleStatus())){
wrapper.eq(TEmpContractAlert::getHandleStatus,entity.getHandleStatus());
}
return wrapper;
}
}
<?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.TEmpContractAlertMapper">
<resultMap id="tEmpContractAlertMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empId" column="EMP_ID"/>
<result property="project" column="PROJECT"/>
<result property="projectNo" column="PROJECT_NO"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empCode" column="EMP_CODE"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="empType" column="EMP_TYPE"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="daysDue" column="DAYS_DUE"/>
<result property="dueFlag" column="DUE_FLAG"/>
<result property="daysOver" column="DAYS_OVER"/>
<result property="firstAlertTime" column="FIRST_ALERT_TIME"/>
<result property="alertPerson" column="ALERT_PERSON"/>
<result property="handleStatus" column="HANDLE_STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
</mapper>
......@@ -37,11 +37,6 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
<!-- excel 导入导出 https://github.com/pig-mesh/excel-spring-boot-starter -->
<dependency>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
......
......@@ -63,7 +63,6 @@
<mybatis-plus.version>3.5.1</mybatis-plus.version>
<mysql.version>8.0.29</mysql.version>
<seata.version>1.4.2</seata.version>
<excel.version>1.1.1</excel.version>
<asm.version>7.1</asm.version>
<oss.version>1.0.4</oss.version>
<sms.version>2.0.2</sms.version>
......@@ -162,12 +161,6 @@
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- excel 导入导出 -->
<dependency>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
<version>${excel.version}</version>
</dependency>
<!-- 阿里云短信下发 -->
<dependency>
<groupId>io.springboot.sms</groupId>
......
......@@ -257,4 +257,31 @@ public interface CommonConstants {
String ID = "ID";
String PARAM_IS_NOT_ERROR = "传参异常,请检查参数";
int EXCEL_EXPORT_LIMIT = 60000;
/**
* multipart/form-data
* @Author fxj
* @Date 2020-10-13
**/
public static final String MULTIPART_FORM_DATA = "multipart/form-data";
/**
* Content-Disposition
* @Author fxj
* @Date 2020-10-13
**/
public static final String CONTENT_DISPOSITION = "Content-Disposition";
/**
* attachment;filename=
* @Author fxj
* @Date 2020-10-13
**/
public static final String ATTACHMENT_FILENAME = "attachment;filename=";
/**
* USER_AGENT
* @Author fxj
* @Date 2020-10-26
**/
public static final String USER_AGENT = "USER-AGENT";
}
......@@ -100,5 +100,8 @@ public class ExcelAttributeConstants {
//工资形式 1.计时工资 2.计件工资 3.其他
public static final String SALARY_TYPE = "salary_type";
// 关系类型
public static final String FAMILY_RELATION = "family_relation";
// 工作类型---工具履历
public static final String WORKINFO_TYPE = "workinfo_type";
}
......@@ -82,7 +82,22 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
</dependencies>
</project>
......@@ -56,6 +56,7 @@
<dependency>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>
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