Commit e185899f authored by hongguangwu's avatar hongguangwu

人员档案相关-最终

parent 4de7b702
...@@ -30,6 +30,8 @@ import javax.validation.constraints.NotNull; ...@@ -30,6 +30,8 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/** /**
* 人员档案表 * 人员档案表
...@@ -290,40 +292,15 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -290,40 +292,15 @@ public class TEmployeeInfo extends BaseEntity {
private String deleteFlag; private String deleteFlag;
/** /**
* 创建人id * 减档操作人id
*/ */
@Schema(description = "创建人id") @Schema(description = "减档操作人id")
private String createBy; private String leaveUser;
/**
* 创建人姓名
*/
@Schema(description = "创建人姓名")
private String createName;
/**
* 创建时间
*/
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Schema(description = "更新人id")
private String updateBy;
/**
* 更新时间
*/
@Schema(description = "更新时间")
private LocalDateTime updateTime;
/** /**
* 离职操作人id * 减档操作人姓名
*/ */
@Schema(description = "离职操作人id") @Schema(description = "离职操作姓名")
private String leaveUser; private String leaveUserName;
/** /**
* 离职时间 * 离职时间
...@@ -350,6 +327,14 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -350,6 +327,14 @@ public class TEmployeeInfo extends BaseEntity {
private String contactAddress; private String contactAddress;
// 以下是项目档案信息 // 以下是项目档案信息
@TableField(exist = false)
@Schema(description = "单位名称")
private String unitName;
@TableField(exist = false)
@Schema(description = "单位编码")
private String unitNo;
@TableField(exist = false) @TableField(exist = false)
@Schema(description = "项目id") @Schema(description = "项目id")
private String deptId; private String deptId;
...@@ -366,5 +351,12 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -366,5 +351,12 @@ public class TEmployeeInfo extends BaseEntity {
@Schema(description = "就职岗位") @Schema(description = "就职岗位")
private String post; private String post;
@TableField(exist = false)
@Schema(description = "选中的idList")
private List<String> idList;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
} }
/*
* 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.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 人员档案表excel导出对应的实体
*
* @author hgw
* @date 2022-6-24 15:15:24
*/
@Data
@ColumnWidth(10)
public class EmployeeExportVO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "员工主码")
private String empCode;
@ExcelProperty(value = "员工类型")
private String empNatrue;
@ExcelProperty(value = "姓名")
private String empName;
@ColumnWidth(20)
@ExcelProperty(value = "身份证号")
private String empIdcard;
@ExcelProperty(value = "身份证开始日期")
private LocalDateTime validityStart;
@ExcelProperty(value = "身份证截止日期")
private LocalDateTime validityEnd;
@ExcelProperty(value = "婚姻状况")
private String empMarriStatus;
@ExcelProperty(value = "民族")
private String empNational;
@ExcelProperty(value = "政治面貌")
private String politicalStatus;
@ExcelProperty(value = "手机号码")
private String empPhone;
@ExcelProperty(value = "邮箱")
private String empEmail;
@ExcelProperty(value = "户籍所在省")
private String idProvince;
@ExcelProperty(value = "户籍所在市")
private String idCity;
@ExcelProperty(value = "户籍所在县")
private String idTown;
@ExcelProperty(value = "户口性质")
private String empRegisType;
@ExcelProperty(value = "档案所在省")
private String fileProvince;
@ExcelProperty(value = "档案所在市")
private String fileCity;
@ExcelProperty(value = "档案所在县")
private String fileTown;
@ExcelProperty(value = "是否大专及以上")
private String isCollege;
@ExcelProperty(value = "最高学历")
private String hignEducation;
@ExcelProperty(value = "学校")
private String school;
@ExcelProperty(value = "专业")
private String major;
@ExcelProperty(value = "入学时间")
private LocalDateTime admissionDate;
@ExcelProperty(value = "毕业时间")
private LocalDateTime gradutionDate;
@ExcelProperty(value = "档案备注")
private String remark;
/**
* 人员档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
*/
@ExcelProperty(value = "人员档案来源")
private String fileSource;
@ExcelProperty(value = "是否多项目")
private String isProjects;
@ExcelProperty(value = "现存项目数")
private Integer projectNum;
@ExcelProperty(value = "项目名称")
private String deptName;
@ExcelProperty(value = "项目编码")
private String deptNo;
/**
* 员工合同状态(字典)
*/
@ExcelProperty(value = "合同状态")
private Integer contractStatus;
/**
* 商险状态(字典)
*/
@ExcelProperty(value = "商险状态")
private Integer insuranceStatus;
/**
* 社保状态(字典)
*/
@ExcelProperty(value = "社保状态")
private Integer socialStatus;
/**
* 公积金状态(字典)
*/
@ExcelProperty(value = "公积金状态")
private Integer fundStatus;
/**
* 近3个月发薪(0否;1是)
*/
@ExcelProperty(value = "近3个月发薪")
private Integer salaryStatus;
@ExcelProperty(value = "创建人")
private String createName;
@ExcelProperty(value = "创建时间")
private LocalDateTime proCreateTime;
@ExcelProperty(value = "减档操作人")
private String leaveUserName;
@ExcelProperty(value = "减档时间")
private LocalDateTime leaveTime;
@ExcelProperty(value = "减档原因")
private String leaveReason;
@ExcelProperty(value = "减档备注")
private String leaveRemark;
/**
* 通信地址
*/
@ExcelProperty(value = "通信地址")
private String contactAddress;
@ExcelProperty(value = "单位名称")
private String unitName;
@ExcelProperty(value = "单位编码")
private String unitNo;
}
/*
* 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 lombok.Data;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* 人员档案表-批量减档
*
* @author hgw
* @date 2022-6-24 16:04:53
*/
@Data
@ColumnWidth(30)
public class EmployeeLeaveVO implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "姓名")
@Size(max = 20, message = "姓名不可超过20位")
private String empName;
@ExcelProperty(value = "身份证号")
@Size(max = 20, message = "身份证号不可超过20位")
private String empIdcard;
@ExcelProperty(value = "减档原因")
@Size(max = 32, message = "减档原因不可超过32位")
private String leaveReason;
@ExcelProperty(value = "减档备注")
@Size(max = 255, message = "减档原因不可超过255位")
private String leaveRemark;
}
...@@ -24,6 +24,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage; ...@@ -24,6 +24,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeLeaveVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -46,6 +47,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -46,6 +47,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List; import java.util.List;
...@@ -82,7 +84,7 @@ public class TEmployeeInfoController { ...@@ -82,7 +84,7 @@ public class TEmployeeInfoController {
public R<IPage<TEmployeeInfo>> getTEmployeeInfoPage(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) { public R<IPage<TEmployeeInfo>> getTEmployeeInfoPage(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed("请登录!"); return R.failed(CommonConstants.PLEASE_LOG_IN);
} }
// 普通用户: // 普通用户:
if (CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) { if (CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
...@@ -120,26 +122,28 @@ public class TEmployeeInfoController { ...@@ -120,26 +122,28 @@ public class TEmployeeInfoController {
} }
} }
} }
if (!Common.isEmpty(obj)) { if (Common.isNotNull(obj)) {
SimpleValueWrapper objs = (SimpleValueWrapper) obj; SimpleValueWrapper objs = (SimpleValueWrapper) obj;
String sql = String.valueOf(objs.get()); if (objs != null) {
if (sql.contains("#deptId")) { String sql = String.valueOf(objs.get());
// TODO - 需要关联部门表 if (sql.contains("#deptId")) {
} // TODO - 需要关联部门表
if (sql.contains("#create_by")) { }
sql = sql.replace("#create_by", user.getId()); if (sql.contains("#create_by")) {
} sql = sql.replace("#create_by", user.getId());
if (sql.contains("#settleDomainId")) { }
// TODO - 获取人员结算主体权限 if (sql.contains("#settleDomainId")) {
// sql = sql.replace("#settleDomainId", ",'1','2' ") // TODO - 获取人员结算主体权限
sql = sql.replace("or a.settle_domain_id in ('0'#settleDomainId) ", ""); // sql = sql.replace("#settleDomainId", ",'1','2' ")
} sql = sql.replace("or a.settle_domain_id in ('0'#settleDomainId) ", "");
if (sql.contains("#deptId")) { }
// TODO - 获取人员部门权限 if (sql.contains("#deptId")) {
// sql = sql.replace("#settleDomainId", ",'1','2' ") // TODO - 获取人员部门权限
sql = sql.replace(" or dept.dept_id = #deptId ", ""); // sql = sql.replace("#settleDomainId", ",'1','2' ")
sql = sql.replace(" or dept.dept_id = #deptId ", "");
}
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo, sql));
} }
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo, sql));
} }
} }
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo, null)); return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo, null));
...@@ -159,7 +163,7 @@ public class TEmployeeInfoController { ...@@ -159,7 +163,7 @@ public class TEmployeeInfoController {
} }
/** /**
* @param empName 姓名 * @param empName 姓名
* @param empIdCard 身份证 * @param empIdCard 身份证
* @Description: 新增人员档案前的校验 * @Description: 新增人员档案前的校验
* @Author: hgw * @Author: hgw
...@@ -222,7 +226,7 @@ public class TEmployeeInfoController { ...@@ -222,7 +226,7 @@ public class TEmployeeInfoController {
} }
/** /**
* @param ids * @param idList
* @Description: 通过ids删除人员档案表 * @Description: 通过ids删除人员档案表
* @Author: hgw * @Author: hgw
* @Date: 2022/6/21 19:42 * @Date: 2022/6/21 19:42
...@@ -232,8 +236,8 @@ public class TEmployeeInfoController { ...@@ -232,8 +236,8 @@ public class TEmployeeInfoController {
@SysLog("通过ids批量删除人员档案表") @SysLog("通过ids批量删除人员档案表")
@GetMapping("/batchDeleteEmployee") @GetMapping("/batchDeleteEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_del')") @PreAuthorize("@pms.hasPermission('temployeeinfo_batch_del')")
public R<List<ErrorMessage>> batchDeleteEmployee(@RequestParam String ids) { public R<List<ErrorMessage>> batchDeleteEmployee(@RequestBody List<String> idList) {
return tEmployeeInfoService.batchDeleteEmployee(ids); return tEmployeeInfoService.batchDeleteEmployee(idList);
} }
/** /**
...@@ -247,27 +251,28 @@ public class TEmployeeInfoController { ...@@ -247,27 +251,28 @@ public class TEmployeeInfoController {
@SysLog("通过id减档人员档案表") @SysLog("通过id减档人员档案表")
@GetMapping("/minusEmployee") @GetMapping("/minusEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_minus')") @PreAuthorize("@pms.hasPermission('temployeeinfo_minus')")
public R<String> minusEmployee(@RequestParam String id) { public R<String> minusEmployee(@RequestParam String id, @RequestParam String leaveReason
return tEmployeeInfoService.minusEmployee(id); , @RequestParam(required = false) String leaveRemark) {
return tEmployeeInfoService.minusEmployee(id, leaveReason, leaveRemark);
} }
/** /**
* @param ids * @param idList
* @Description: 通过ids批量减档人员档案表 * @Description: 通过ids批量减档人员档案表
* @Author: hgw * @Author: hgw
* @Date: 2022/6/21 19:42 * @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
@Operation(summary = "通过ids批量减档人员档案表", description = "通过ids批量减档人员档案表") @Operation(summary = "批量减档人员档案表", description = "批量减档人员档案表")
@SysLog("通过ids批量减档人员档案表") @SysLog("批量减档人员档案表")
@GetMapping("/batchMinusEmployee") @GetMapping("/batchMinusEmployee")
@PreAuthorize("@pms.hasPermission('temployeeinfo_batch_minus')") @PreAuthorize("@pms.hasPermission('temployeeinfo_batch_minus')")
public R<List<ErrorMessage>> batchMinusEmployee(@RequestParam String ids) { public R<List<ErrorMessage>> batchMinusEmployee(@RequestExcel List<EmployeeLeaveVO> excelList, BindingResult bindingResult) {
return tEmployeeInfoService.batchMinusEmployee(ids); return tEmployeeInfoService.batchMinusEmployee(excelList, bindingResult);
} }
/** /**
* @param id 离职档案id * @param id 离职档案id
* @param projectIds 需要复项的项目ids * @param projectIds 需要复项的项目ids
* @Description: 档案复档 * @Description: 档案复档
* @Author: hgw * @Author: hgw
...@@ -290,7 +295,7 @@ public class TEmployeeInfoController { ...@@ -290,7 +295,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/22 11:57 * @Date: 2022/6/22 11:57
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/ **/
@Operation(description = "批量导入人员档案 hasPermission('employee_batch_import') 额外属性:isCanAdd:0不可以复档复项;1允许复档复项") @Operation(summary = "批量导入人员档案", description = "批量导入人员档案 hasPermission('employee_batch_import') 额外属性:isCanAdd:0不可以复档复项;1允许复档复项")
@SysLog("批量导入人员档案") @SysLog("批量导入人员档案")
@PostMapping("/batchImportEmployee") @PostMapping("/batchImportEmployee")
@PreAuthorize("@pms.hasPermission('employee_batch_import')") @PreAuthorize("@pms.hasPermission('employee_batch_import')")
...@@ -306,7 +311,7 @@ public class TEmployeeInfoController { ...@@ -306,7 +311,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/22 20:29 * @Date: 2022/6/22 20:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/ **/
@Operation(description = "批量更新人员档案 hasPermission('employee_batch_update')") @Operation(summary = "批量更新人员档案", description = "批量更新人员档案 hasPermission('employee_batch_update')")
@SysLog("批量更新人员档案") @SysLog("批量更新人员档案")
@PostMapping("/batchUpdateEmployee") @PostMapping("/batchUpdateEmployee")
@PreAuthorize("@pms.hasPermission('employee_batch_update')") @PreAuthorize("@pms.hasPermission('employee_batch_update')")
...@@ -314,4 +319,32 @@ public class TEmployeeInfoController { ...@@ -314,4 +319,32 @@ public class TEmployeeInfoController {
return tEmployeeInfoService.batchUpdateEmployee(excelList, bindingResult); return tEmployeeInfoService.batchUpdateEmployee(excelList, bindingResult);
} }
/**
* 批量导出人员档案信息
*
* @Author hgw
* @Date 2022-6-24 09:36:06
**/
@Operation(summary = "批量导出人员档案信息", description = "批量导出人员档案信息 hasPermission('employee_export_employee')")
@SysLog("批量导出人员档案信息")
// @ResponseExcel
@PostMapping("/exportEmployee")
public void exportEmployee(@RequestBody(required = false) TEmployeeInfo employeeInfo, HttpServletResponse response) {
tEmployeeInfoService.exportEmployee(employeeInfo, response);
}
/**
* 批量导出离职档案信息
*
* @Author hgw
* @Date 2022-6-24 09:36:06
**/
@Operation(summary = "批量导出离职档案信息", description = "批量导出离职档案信息 hasPermission('employee_export_employee_leave')")
@SysLog("批量导出离职档案信息")
// @ResponseExcel
@PostMapping("/exportLeaveEmployee")
public void exportLeaveEmployee(@RequestBody(required = false) TEmployeeInfo employeeInfo, HttpServletResponse response) {
tEmployeeInfoService.exportLeaveEmployee(employeeInfo, response);
}
} }
...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -51,4 +52,17 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { ...@@ -51,4 +52,17 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
void updateExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list); void updateExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list);
int insertExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list); int insertExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list);
/**
* 获得导出的人员档案列表
* hgw 2022-6-24 10:09:44
*/
List<EmployeeExportVO> getTEmployeeExportList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
/**
* 获得导出的离职档案列表
* hgw 2022-6-24 10:09:44
*/
List<EmployeeExportVO> getTEmployeeLeaveExportList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
} }
...@@ -23,10 +23,12 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -23,10 +23,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeLeaveVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -94,13 +96,12 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -94,13 +96,12 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
R<String> deleteEmployee(String id); R<String> deleteEmployee(String id);
/** /**
* @param ids
* @Description: 批量删除 * @Description: 批量删除
* @Author: hgw * @Author: hgw
* @Date: 2022/6/23 16:45 * @Date: 2022/6/23 16:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
R<List<ErrorMessage>> batchDeleteEmployee(String ids); R<List<ErrorMessage>> batchDeleteEmployee(List<String> idList);
/** /**
* @param id * @param id
...@@ -109,7 +110,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -109,7 +110,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
* @Date: 2022/6/21 19:50 * @Date: 2022/6/21 19:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
R<String> minusEmployee(String id); R<String> minusEmployee(String id, String leaveReason, String leaveRemark);
/** /**
* @param id * @param id
...@@ -121,13 +122,12 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -121,13 +122,12 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
R<String> restoreEmployee(String id, String projectIds); R<String> restoreEmployee(String id, String projectIds);
/** /**
* @param ids
* @Description: 批量减档 * @Description: 批量减档
* @Author: hgw * @Author: hgw
* @Date: 2022/6/23 17:12 * @Date: 2022/6/23 17:12
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/ **/
R<List<ErrorMessage>> batchMinusEmployee(String ids); R<List<ErrorMessage>> batchMinusEmployee(List<EmployeeLeaveVO> excelVOList, BindingResult bindingResult);
/** /**
* @param employeeInfo 档案信息 * @param employeeInfo 档案信息
...@@ -158,4 +158,21 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> { ...@@ -158,4 +158,21 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
R<List<ErrorMessage>> batchUpdateEmployee(List<EmployeeVO> excelVOList, BindingResult bindingResult); R<List<ErrorMessage>> batchUpdateEmployee(List<EmployeeVO> excelVOList, BindingResult bindingResult);
void updateEducationOfEmp(EmpEducationUpdateVO education); void updateEducationOfEmp(EmpEducationUpdateVO education);
/**
* @param employeeVo
* @Description: 批量导出人员档案
* @Author: hgw
* @Date: 2022/6/23 10:302022-6-24 09:35:54
**/
void exportEmployee(TEmployeeInfo employeeVo, HttpServletResponse response);
/**
* @param employeeVo
* @Description: 批量导出离职档案
* @Author: hgw
* @Date: 2022/6/23 10:302022-6-24 09:35:54
**/
void exportLeaveEmployee(TEmployeeInfo employeeVo, HttpServletResponse response);
} }
...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; ...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -392,7 +393,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -392,7 +393,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
insTEmployeeInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL); insTEmployeeInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL);
insTEmployeeInfo.setStatus(CommonConstants.dingleDigitIntArray[0]); insTEmployeeInfo.setStatus(CommonConstants.dingleDigitIntArray[0]);
//TODO HUYC 员工编码生成规则 //TODO HUYC 员工编码生成规则
insTEmployeeInfo.setEmpCode(""); insTEmployeeInfo.setEmpCode("查询人员档案的编码");
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
insTEmployeeInfo.setCreateBy(user.getId()); insTEmployeeInfo.setCreateBy(user.getId());
insTEmployeeInfo.setCreateName(user.getNickname()); insTEmployeeInfo.setCreateName(user.getNickname());
...@@ -420,7 +421,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -420,7 +421,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
insTEmployeePro.setEmpNo(str); insTEmployeePro.setEmpNo(str);
//员工编码生成规则 //员工编码生成规则
insTEmployeePro.setEmpCode(this.getCode()); insTEmployeePro.setEmpCode("查询人员档案的编码");
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
insTEmployeePro.setCreateBy(user.getId()); insTEmployeePro.setCreateBy(user.getId());
insTEmployeePro.setCreateName(user.getNickname()); insTEmployeePro.setCreateName(user.getNickname());
...@@ -439,11 +440,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -439,11 +440,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_EMP_CODE); Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_EMP_CODE);
Object nowNumObj = cache.get(nowDay); Object nowNumObj = cache.get(nowDay);
int nowNums = 1; int nowNums = 1;
if (!Common.isEmpty(nowNumObj)) { if (Common.isNotNull(nowNumObj)) {
nowNums = (Integer) nowNumObj + 1; SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} }
cache.put(nowDay, nowNums); cache.put(nowDay, nowNums);
return this.getFiveNum(String.valueOf(nowNums)); return "ZM" + nowDay + this.getFiveNum(String.valueOf(nowNums));
} }
/** /**
...@@ -563,7 +565,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -563,7 +565,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public void saveEmployeeProjectInfo(TEmployeeInfo employeeInfo) { public void saveEmployeeProjectInfo(TEmployeeInfo employeeInfo) {
TEmployeeProject tEmployeeProject = new TEmployeeProject(); TEmployeeProject tEmployeeProject = new TEmployeeProject();
tEmployeeProject.setEmpId(employeeInfo.getId()); tEmployeeProject.setEmpId(employeeInfo.getId());
tEmployeeProject.setEmpCode(this.getCode()); tEmployeeProject.setEmpCode(employeeInfo.getEmpCode());
tEmployeeProject.setEmpNatrue(employeeInfo.getEmpNatrue()); tEmployeeProject.setEmpNatrue(employeeInfo.getEmpNatrue());
tEmployeeProject.setEmpName(employeeInfo.getEmpName()); tEmployeeProject.setEmpName(employeeInfo.getEmpName());
tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard()); tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard());
......
...@@ -623,7 +623,7 @@ ...@@ -623,7 +623,7 @@
FROM FROM
t_employee_project t_employee_project
WHERE WHERE
DELETE_FLAG = 0 DELETE_FLAG = '0'
and id not like '%abc' and id not like '%abc'
and and
EMP_NO LIKE CONCAT( EMP_NO LIKE CONCAT(
...@@ -658,7 +658,7 @@ ...@@ -658,7 +658,7 @@
FROM t_employee_project a FROM t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id left join t_employee_info b on a.EMP_ID = b.id
<where> <where>
1=1 AND a.DELETE_FLAG = 0 a.DELETE_FLAG = '0'
<include refid="tEmployeeProject_where"/> <include refid="tEmployeeProject_where"/>
</where> </where>
</select> </select>
...@@ -669,7 +669,7 @@ ...@@ -669,7 +669,7 @@
FROM t_employee_project a FROM t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id left join t_employee_info b on a.EMP_ID = b.id
<where> <where>
1=1 AND a.DELETE_FLAG = 0 a.DELETE_FLAG = '0'
<include refid="exportTEmployeeProject_where"/> <include refid="exportTEmployeeProject_where"/>
</where> </where>
</select> </select>
......
...@@ -235,6 +235,13 @@ public interface CommonConstants { ...@@ -235,6 +235,13 @@ public interface CommonConstants {
String PARAM_IS_NOT_EMPTY = "参数不可为空"; String PARAM_IS_NOT_EMPTY = "参数不可为空";
String DATA_CAN_NOT_EMPTY = "数据不可为空";
String PLEASE_LOG_IN = "请登录!";
String SEX_MAN = "1";
String SEX_WONMAN = "2";
// 是否 // 是否
String IS_FALSE = "否"; String IS_FALSE = "否";
String IS_TRUE = "是"; String IS_TRUE = "是";
......
...@@ -253,6 +253,10 @@ public interface ErrorCodes { ...@@ -253,6 +253,10 @@ public interface ErrorCodes {
String ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR = "archives.import.emp.high.education.error"; String ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR = "archives.import.emp.high.education.error";
// 根据身份证未找到人员档案信息 // 根据身份证未找到人员档案信息
String ARCHIVES_IMPORT_EMP_NOT_EXISTS = "archives.import.emp.not.exists"; String ARCHIVES_IMPORT_EMP_NOT_EXISTS = "archives.import.emp.not.exists";
// 身份证必填
String ARCHIVES_IMPORT_EMP_IDCARD_MUST = "archives.import.emp.idCard.must";
// 减档原因必填
String ARCHIVES_IMPORT_EMP_LEAVEREASON_MUST = "archives.import.emp.leaveReason.must";
/** /**
* 项目档案状态为已审核,禁止删除 * 项目档案状态为已审核,禁止删除
......
...@@ -51,6 +51,10 @@ public class DateUtil { ...@@ -51,6 +51,10 @@ public class DateUtil {
* yyyyMM * yyyyMM
*/ */
public static final String DATETIME_YYYYMM = "yyyyMM"; public static final String DATETIME_YYYYMM = "yyyyMM";
/**
* yyyy
*/
public static final String DATETIME_YYYY = "yyyy";
/** /**
* yyyy-MM * yyyy-MM
*/ */
...@@ -1342,7 +1346,6 @@ public class DateUtil { ...@@ -1342,7 +1346,6 @@ public class DateUtil {
* @Date: 2020/12/21 * @Date: 2020/12/21
* @Description: 获取这个月 * @Description: 获取这个月
* @return: java.lang.String * @return: java.lang.String
* @see com.yifu.cloud.v1.common.core.util
**/ **/
public static String getThisMonth(){ public static String getThisMonth(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM); SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYYMM);
...@@ -1351,6 +1354,20 @@ public class DateUtil { ...@@ -1351,6 +1354,20 @@ public class DateUtil {
return thisMonth; return thisMonth;
} }
/**
* @param years 出生年
* @Description: 获取年龄
* @Author: hgw
* @Date: 2022/6/24 16:49
* @return: int
**/
public static int getAge(int years){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYY);
Date nowDate = new Date();
int thisYear = Integer.parseInt(sf.format(nowDate));
return thisYear - years + 1;
}
/** /**
* @Description: 返回当前年月日字符串 * @Description: 返回当前年月日字符串
* @Author: hgw * @Author: hgw
...@@ -1362,6 +1379,17 @@ public class DateUtil { ...@@ -1362,6 +1379,17 @@ public class DateUtil {
return sf.format(new Date()); return sf.format(new Date());
} }
/**
* @Description: 返回当前年月日时分秒字符串(一般用在导出文件名)
* @Author: hgw
* @Date: 2022-6-24 10:00:41
* @return: java.lang.String
**/
public static String getThisTime(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATE_PATTERN);
return sf.format(new Date());
}
/** /**
* @param * @param
......
...@@ -79,6 +79,8 @@ archives.import.emp.area.error=\u6237\u7C4D\u6240\u5728\u5730\u672A\u627E\u5230\ ...@@ -79,6 +79,8 @@ archives.import.emp.area.error=\u6237\u7C4D\u6240\u5728\u5730\u672A\u627E\u5230\
archives.import.emp.file.area.error=\u6863\u6848\u6240\u5728\u5730\u672A\u627E\u5230\u533A\u57DF archives.import.emp.file.area.error=\u6863\u6848\u6240\u5728\u5730\u672A\u627E\u5230\u533A\u57DF
archives.import.emp.high.education.error=\u5927\u4E13\u53CA\u4EE5\u4E0A\uFF0C\u6700\u9AD8\u5B66\u5386\u5FC5\u586B archives.import.emp.high.education.error=\u5927\u4E13\u53CA\u4EE5\u4E0A\uFF0C\u6700\u9AD8\u5B66\u5386\u5FC5\u586B
archives.import.emp.not.exists=\u6839\u636E\u8EAB\u4EFD\u8BC1\u672A\u627E\u5230\u4EBA\u5458\u6863\u6848\u4FE1\u606F archives.import.emp.not.exists=\u6839\u636E\u8EAB\u4EFD\u8BC1\u672A\u627E\u5230\u4EBA\u5458\u6863\u6848\u4FE1\u606F
archives.import.emp.idCard.must=\u8EAB\u4EFD\u8BC1\u5FC5\u586B
archives.import.emp.leaveReason.must=\u51CF\u6863\u539F\u56E0\u5FC5\u586B
......
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