Commit e52f0d52 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 5db3136a
/*
* 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 lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.time.LocalDateTime;
import java.util.List;
/**
* 项目档案表excel导出对应的实体
*
* @author huyc
* @date 2022-06-23 10:54:40
*/
@Data
@ColumnWidth(30)
public class EmployeeProjectExportVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 档案员工类型(字典值,0外包1派遣2代理)
*/
@NotNull(message = "档案员工类型不能为空")
@Max(value = 1,message = "档案员工类型不可超过1位")
@ExcelProperty(value ="档案员工类型")
private String empNatrue;
/**
* 员工姓名
*/
@NotNull(message = "姓名不能为空")
@Max(value = 32,message = "姓名不可超过32位")
@ExcelProperty(value ="姓名")
private String empName;
/**
* 身份证号码
*/
@NotNull(message = "身份证号不能为空")
@Max(value = 32,message = "身份证号不可超过32位")
@ExcelProperty(value ="身份证号")
private String empIdcard;
/**
* 员工主码(系统自动生成:ZM+年月日+5位数字)
*/
@ExcelProperty(value ="员工主码")
private String empCode;
/**
* 身份证有效期起
*/
@ExcelProperty(value = "身份证开始日期")
private LocalDateTime validityStart;
/**
* 身份证有效期止
*/
@ExcelProperty(value = "身份证截止日期")
private LocalDateTime validityEnd;
/**
* 婚姻状况
*/
@ExcelProperty(value = "婚姻状况")
@Max(value = 32, message = "婚姻状况不可超过32位")
private String empMarriStatus;
/**
* 民族
*/
@ExcelProperty(value = "民族")
@Max(value = 32, message = "民族不可超过32位")
private String empNational;
/**
* 政治面貌
*/
@ExcelProperty(value = "政治面貌")
@Max(value = 32, message = "政治面貌不可超过32位")
private String politicalStatus;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号码")
@Max(value = 11, message = "手机号码不可超过11位")
private String empPhone;
/**
* 邮箱
*/
@ExcelProperty(value = "邮箱")
@Max(value = 32, message = "邮箱不可超过32位")
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;
/**
* 是否大专及以上(0否1是)
*/
@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;
/**
* 人员档案状态(0草稿、1已审核)
*/
@ExcelProperty(value = "人员档案状态")
private Integer status;
/**
* 档案状态(0正常;1已减档)
*/
@ExcelProperty(value = "档案状态")
private Integer fileStatus;
/**
* 创建者-姓名
*/
@ExcelProperty(value = "人员档案创建人")
private String createName;
/**
* 创建时间
*/
@ExcelProperty(value = "人员档案创建时间")
private LocalDateTime createTime;
/**
* 开户行
*/
@ExcelProperty(value ="开户行")
private String bankName;
/**
* 支行
*/
@ExcelProperty(value ="支行")
private String bankSubName;
/**
* 银行卡号
*/
@ExcelProperty(value ="银行卡号")
private String bankNo;
/**
* 项目编码
*/
@NotNull(message = "项目编码不能为空")
@ExcelProperty(value ="项目编码")
private String deptNo;
/**
* 合同类型(字典值)
*/
@ExcelProperty(value ="合同类型")
private String contractType;
/**
* 工时制
*/
@ExcelProperty(value ="工时制")
private String workingHours;
/**
* 就职岗位
*/
@ExcelProperty(value ="就职岗位")
private String post;
/**
* 入职日期
*/
@ExcelProperty(value ="入职日期")
@Past
private LocalDateTime enjoinDate;
/**
* 试用期(单位月)
*/
@ExcelProperty(value ="试用期")
private String tryPeriod;
/**
* 项目员工类型
*/
@ExcelProperty(value ="项目员工类型")
private String proEmpNatrue;
/**
* 员工编码
*/
@ExcelProperty(value ="员工编码")
private String empNo;
/**
* 客户名称
*/
@ExcelProperty(value ="客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelProperty(value ="客户编码")
private String unitNo;
/**
* 项目名称
*/
@ExcelProperty(value ="项目名称")
private String deptName;
/**
* 员工合同状态(字典)
*/
@ExcelProperty(value ="合同状态")
private Integer contractStatus;
/**
* 业务类型
*/
@ExcelProperty(value ="业务类型")
private String businessType;
/**
* 商险状态(字典)
*/
@ExcelProperty(value ="商险状态")
private Integer insuranceStatus;
/**
* 社保状态(字典)
*/
@ExcelProperty(value ="社保状态")
private Integer socialStatus;
/**
* 公积金状态(字典)
*/
@ExcelProperty(value ="公积金状态")
private Integer fundStatus;
/**
* 近3个月发薪(0否;1是)
*/
@ExcelProperty(value ="近3个月发薪")
private Integer salaryStatus;
/**
* 项目档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
*/
@ExcelProperty(value ="项目档案来源")
private String projectSource;
/**
* 项目档案状态(0草稿、1已审核)
*/
@ExcelProperty(value ="项目档案状态")
private Integer proStatus;
/**
* 项目档案创建人
*/
@ExcelProperty(value ="项目档案创建人")
private String proCreateName;
/**
* 项目档案创建时间
*/
@ExcelProperty(value ="项目档案创建时间")
private LocalDateTime proCreateTime;
private List<String> idList;
}
...@@ -42,7 +42,7 @@ public class EmployeeProjectVO implements Serializable { ...@@ -42,7 +42,7 @@ public class EmployeeProjectVO implements Serializable {
* 员工类型(字典值,0外包1派遣2代理) * 员工类型(字典值,0外包1派遣2代理)
*/ */
@NotNull(message = "员工类型不能为空") @NotNull(message = "员工类型不能为空")
@Max(value = 1,message = "最大长度不能超过1位") @Max(value = 1,message = "员工类型不可超过1位")
@ExcelProperty(value ="员工类型") @ExcelProperty(value ="员工类型")
private String empNatrue; private String empNatrue;
...@@ -50,6 +50,7 @@ public class EmployeeProjectVO implements Serializable { ...@@ -50,6 +50,7 @@ public class EmployeeProjectVO implements Serializable {
* 员工姓名 * 员工姓名
*/ */
@NotNull(message = "员工姓名不能为空") @NotNull(message = "员工姓名不能为空")
@Max(value = 32,message = "员工姓名不可超过32位")
@ExcelProperty(value ="员工姓名") @ExcelProperty(value ="员工姓名")
private String empName; private String empName;
...@@ -57,6 +58,7 @@ public class EmployeeProjectVO implements Serializable { ...@@ -57,6 +58,7 @@ public class EmployeeProjectVO implements Serializable {
* 身份证号码 * 身份证号码
*/ */
@NotNull(message = "身份证号不能为空") @NotNull(message = "身份证号不能为空")
@Max(value = 32,message = "身份证号不可超过32位")
@ExcelProperty(value ="身份证号") @ExcelProperty(value ="身份证号")
private String empIdcard; private String empIdcard;
......
...@@ -21,9 +21,11 @@ import com.alibaba.fastjson.JSONObject; ...@@ -21,9 +21,11 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.RequestExcel; import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -192,8 +194,8 @@ public class TEmployeeProjectController { ...@@ -192,8 +194,8 @@ public class TEmployeeProjectController {
/** /**
* 批量更新项目档案信息 * 批量更新项目档案信息
*
* @param excelVOList * @param excelVOList
* @param bindingResult
* @return R<List> * @return R<List>
* @Author huyc * @Author huyc
* @Date 2022-06-21 * @Date 2022-06-21
...@@ -218,4 +220,21 @@ public class TEmployeeProjectController { ...@@ -218,4 +220,21 @@ public class TEmployeeProjectController {
public R<List<ErrorMessage>> removeByIds(@RequestParam String ids) { public R<List<ErrorMessage>> removeByIds(@RequestParam String ids) {
return tEmployeeProjectService.batchRemoveByIds(ids); return tEmployeeProjectService.batchRemoveByIds(ids);
} }
/**
* 批量导出项目档案信息
* @param projectDTO
* @param idstr
* @param exportFields
* @return R<List>
* @Author huyc
* @Date 2022-06-21
**/
@ResponseExcel
@PostMapping("/export")
public void export(EmployeeProjectExportVO projectDTO,@RequestParam(name = "idstr", required = false)String idstr,
@RequestBody List<String> exportFields) {
tEmployeeProjectService.listExportProject(projectDTO,idstr,exportFields);
}
} }
...@@ -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.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
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,10 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> { ...@@ -51,4 +52,10 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
IPage<TEmployeeProject> getTEmployeeProjectInfoPage(Page page, @Param("tEmployeeProject") TEmployeeProject tEmployeeProject); IPage<TEmployeeProject> getTEmployeeProjectInfoPage(Page page, @Param("tEmployeeProject") TEmployeeProject tEmployeeProject);
/**
* 获得导出的项目档案列表
* @param tEmployeeProject
* @return
*/
List<EmployeeProjectExportVO> getTEmployeeProjectExportPage(@Param("tEmployeeProject")EmployeeProjectExportVO tEmployeeProject);
} }
...@@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; 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.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
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 org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
...@@ -43,6 +45,15 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -43,6 +45,15 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R deleteEmpPro(TEmployeeProject tEmployeeProject); R deleteEmpPro(TEmployeeProject tEmployeeProject);
/**
* @param excelVOList
* @param bindingResult
* @param isAdd
* @Description: 批量新增项目档案
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R<List<ErrorMessage>> importListAdd(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult, String isAdd); R<List<ErrorMessage>> importListAdd(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult, String isAdd);
/** /**
...@@ -65,6 +76,14 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -65,6 +76,14 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
**/ **/
List<TEmployeeProject> getListByEmpIdAndDeptNo(String empId, String deptNo); List<TEmployeeProject> getListByEmpIdAndDeptNo(String empId, String deptNo);
/**
* @param excelVOList
* @param bindingResult
* @Description: 批量更新项目档案
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R<List<ErrorMessage>> importEmpProjectUpdate(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult); R<List<ErrorMessage>> importEmpProjectUpdate(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult);
/** /**
...@@ -77,4 +96,16 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -77,4 +96,16 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R<List<ErrorMessage>> batchRemoveByIds(String ids); R<List<ErrorMessage>> batchRemoveByIds(String ids);
IPage<TEmployeeProject> getTEmployeeProjectInfoPage(Page page, TEmployeeProject vo); IPage<TEmployeeProject> getTEmployeeProjectInfoPage(Page page, TEmployeeProject vo);
/**
* @param projectDTO
* @param idstr
* @param exportFields
* @Description: 批量导出项目档案
* @Author: huyc
* @Date: 2022/6/23 10:30
* @return: R
**/
void listExportProject(EmployeeProjectExportVO projectDTO,String idstr,
List<String> exportFields);
} }
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -32,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; ...@@ -32,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
...@@ -44,6 +46,8 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; ...@@ -44,6 +46,8 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -320,6 +324,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -320,6 +324,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
List<TEmployeeProject> list = this.list(); List<TEmployeeProject> list = this.list();
Set<String> errorMsg; Set<String> errorMsg;
Map<String, Integer> checkCountMap = new HashMap<>();
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个 // 已有验证报错直接下一个
...@@ -329,6 +334,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -329,6 +334,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
EmployeeProjectVO excel = excelVOList.get(i); EmployeeProjectVO excel = excelVOList.get(i);
String checkCount = excel.getEmpIdcard().concat(excel.getDeptNo());
if (Common.isNotNull(checkCountMap.get(checkCount))) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号+项目编码与第" + checkCountMap.get(checkCount) + "行重复!"));
} else {
checkCountMap.put(checkCount, i + 2);
}
//根据身份证和项目编码获取项目档案 //根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
...@@ -448,6 +459,50 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -448,6 +459,50 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return baseMapper.getTEmployeeProjectInfoPage(page,tEmployeeProject); return baseMapper.getTEmployeeProjectInfoPage(page,tEmployeeProject);
} }
/**
* @Author huyc
* @Description 批量导出项目档案信息
* @Date 10:55 2022/6/23
**/
@Override
public void listExportProject(EmployeeProjectExportVO projectDTO,String idstr, List<String> exportFields) {
String fileName = "项目档案批量导出" + LocalDateTime.now() + ".xls";
// 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<String>();
for (String exportField : exportFields) {
includeColumnFiledNames.add(exportField);
}
//获取要导出的列表
List<EmployeeProjectExportVO> list = new ArrayList<>();
//获取记录
list = gettEmpProInfoExportVos(idstr, projectDTO);
try {
if (list.size()>0) {
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(fileName, EmployeeProjectExportVO.class).includeColumnFiledNames(includeColumnFiledNames).sheet("项目档案")
.doWrite(list);
}
}catch (Exception e){
log.error("error:" ,e);
}
}
/**
* 获取导出的项目档案列表
*/
private List<EmployeeProjectExportVO> gettEmpProInfoExportVos(String idstr,EmployeeProjectExportVO projectDTO) {
List<EmployeeProjectExportVO> list;
if (!Common.isEmpty(idstr)) {
projectDTO.setIdList(Common.initStrToList(idstr, CommonConstants.COMMA_STRING));
}
list = baseMapper.getTEmployeeProjectExportPage(projectDTO);
return list;
}
/** /**
* 更新人员档案 * 更新人员档案
*/ */
......
...@@ -54,6 +54,67 @@ ...@@ -54,6 +54,67 @@
<result property="fundStatus" column="FUND_STATUS"/> <result property="fundStatus" column="FUND_STATUS"/>
</resultMap> </resultMap>
<resultMap id="tEmployeeProjectExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO">
<result property="empCode" column="EMP_CODE"/>
<result property="proEmpNatrue" column="PROEMP_NATRUE"/>
<result property="empNatrue" column="EMP_NATRUE"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="validityStart" column="VALIDITY_START"/>
<result property="validityEnd" column="VALIDITY_END"/>
<result property="empMarriStatus" column="EMP_MARRI_STATUS"/>
<result property="empNational" column="EMP_NATIONAL"/>
<result property="politicalStatus" column="POLITICAL_STATUS"/>
<result property="empEmail" column="EMP_EMAIL"/>
<result property="idProvince" column="ID_PROVINCE"/>
<result property="idCity" column="ID_CITY"/>
<result property="idTown" column="ID_TOWN"/>
<result property="empRegisType" column="EMP_REGIS_TYPE"/>
<result property="isCollege" column="IS_COLLEGE"/>
<result property="hignEducation" column="HIGN_EDUCATION"/>
<result property="school" column="SCHOOL"/>
<result property="major" column="MAJOR"/>
<result property="admissionDate" column="ADMISSION_DATE"/>
<result property="gradutionDate" column="GRADUTION_DATE"/>
<result property="remark" column="REMARK"/>
<result property="fileSource" column="FILE_SOURCE"/>
<result property="proStatus" column="PROSTATUS"/>
<result property="fileStatus" column="FILE_STATUS"/>
<result property="bankName" column="BANK_NAME"/>
<result property="bankSubName" column="BANK_SUB_NAME"/>
<result property="bankNo" column="BANK_NO"/>
<result property="isLeaveEmployee" column="IS_LEAVE_EMPLOYEE"/>
<result property="empNo" column="EMP_NO"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="businessType" column="BUSINESS_TYPE"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="workingHours" column="WORKING_HOURS"/>
<result property="post" column="POST"/>
<result property="enjoinDate" column="ENJOIN_DATE"/>
<result property="tryPeriod" column="TRY_PERIOD"/>
<result property="projectSource" column="PROJECT_SOURCE"/>
<result property="proEmpNatrue" column="EMP_NATRUE"/>
<result property="proCreateName" column="PROCREATE_NAME"/>
<result property="proCreateTime" column="PROCREATE_TIME"/>
<result property="taxMonth" column="TAX_MONTH"/>
<result property="status" column="STATUS"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="salaryStatus" column="SALARY_STATUS"/>
<result property="insuranceStatus" column="INSURANCE_STATUS"/>
<result property="socialStatus" column="SOCIAL_STATUS"/>
<result property="fundStatus" column="FUND_STATUS"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
a.EMP_ID, a.EMP_ID,
...@@ -104,6 +165,65 @@ ...@@ -104,6 +165,65 @@
b.FILE_TOWN, b.FILE_TOWN,
b.SALARY_STATUS b.SALARY_STATUS
</sql> </sql>
<sql id="Base_Export_List">
a.EMP_ID,
a.EMP_CODE,
a.EMP_NATRUE AS PROEMP_NATRUE,
a.EMP_NAME,
a.EMP_IDCARD,
a.BANK_NAME,
a.BANK_SUB_NAME,
a.BANK_NO,
a.IS_LEAVE_EMPLOYEE,
a.EMP_NO,
a.UNIT_ID,
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_ID,
a.DEPT_NAME,
a.DEPT_NO,
concat(a.BUSINESS_PRIMARY_TYPE,'-',BUSINESS_SECOND_TYPE,'-',a.BUSINESS_THIRD_TYPE) AS BUSINESS_TYPE,
a.CONTRACT_TYPE,
a.WORKING_HOURS,
a.POST,
a.ENJOIN_DATE,
a.TRY_PERIOD,
a.PROJECT_SOURCE,
a.TAX_MONTH,
a.STATUS,
a.CREATE_NAME AS PROCREATE_NAME,
a.CREATE_TIME AS PROCREATE_TIME,
b.EMP_PHONE,
b.INSURANCE_STATUS,
b.SOCIAL_STATUS,
b.FUND_STATUS,
b.FILE_PROVINCE,
b.FILE_CITY,
b.FILE_TOWN,
b.SALARY_STATUS,
b.VALIDITY_START,
b.validityEnd,
b.EMP_MARRI_STATUS,
b.EMP_NATIONAL,
b.POLITICAL_STATUS,
b.ID_PROVINCE,
b.ID_CITY,
b.ID_TOWN,
b.EMP_REGIS_TYPE,
b.IS_COLLEGE,
b.HIGN_EDUCATION,
b.SCHOOL,
b.MAJOR,
b.ADMISSION_DATE,
b.GRADUTION_DATE,
b.REMARK,
b.STATUS,
b.CREATE_NAME,
b.CREATE_TIME,
b.EMP_NATRUE
</sql>
<sql id="tEmployeeProject_where"> <sql id="tEmployeeProject_where">
<if test="tEmployeeProject != null"> <if test="tEmployeeProject != null">
<if test="tEmployeeProject.id != null and tEmployeeProject.id.trim() != ''"> <if test="tEmployeeProject.id != null and tEmployeeProject.id.trim() != ''">
...@@ -155,7 +275,7 @@ ...@@ -155,7 +275,7 @@
AND a.UNIT_ID = #{tEmployeeProject.unitId} AND a.UNIT_ID = #{tEmployeeProject.unitId}
</if> </if>
<if test="tEmployeeProject.unitName != null and tEmployeeProject.unitName.trim() != ''"> <if test="tEmployeeProject.unitName != null and tEmployeeProject.unitName.trim() != ''">
AND a.UNIT_NAME = #{tEmployeeProject.unitName} AND a.UNIT_NAME like concat('%',#{tEmployeeProject.unitName},'%')
</if> </if>
<if test="tEmployeeProject.unitNo != null and tEmployeeProject.unitNo.trim() != ''"> <if test="tEmployeeProject.unitNo != null and tEmployeeProject.unitNo.trim() != ''">
AND a.UNIT_NO = #{tEmployeeProject.unitNo} AND a.UNIT_NO = #{tEmployeeProject.unitNo}
...@@ -164,7 +284,7 @@ ...@@ -164,7 +284,7 @@
AND a.DEPT_ID = #{tEmployeeProject.deptId} AND a.DEPT_ID = #{tEmployeeProject.deptId}
</if> </if>
<if test="tEmployeeProject.deptName != null and tEmployeeProject.deptName.trim() != ''"> <if test="tEmployeeProject.deptName != null and tEmployeeProject.deptName.trim() != ''">
AND a.DEPT_NAME = #{tEmployeeProject.deptName} AND a.DEPT_NAME like concat('%',#{tEmployeeProject.deptName},'%')
</if> </if>
<if test="tEmployeeProject.deptNo != null and tEmployeeProject.deptNo.trim() != ''"> <if test="tEmployeeProject.deptNo != null and tEmployeeProject.deptNo.trim() != ''">
AND a.DEPT_NO = #{tEmployeeProject.deptNo} AND a.DEPT_NO = #{tEmployeeProject.deptNo}
...@@ -205,9 +325,6 @@ ...@@ -205,9 +325,6 @@
<if test="tEmployeeProject.projectStatus != null"> <if test="tEmployeeProject.projectStatus != null">
AND a.PROJECT_STATUS = #{tEmployeeProject.projectStatus} AND a.PROJECT_STATUS = #{tEmployeeProject.projectStatus}
</if> </if>
<if test="tEmployeeProject.deleteFlag != null and tEmployeeProject.deleteFlag.trim() != ''">
AND a.DELETE_FLAG = #{tEmployeeProject.deleteFlag}
</if>
<if test="tEmployeeProject.createBy != null and tEmployeeProject.createBy.trim() != ''"> <if test="tEmployeeProject.createBy != null and tEmployeeProject.createBy.trim() != ''">
AND a.CREATE_BY = #{tEmployeeProject.createBy} AND a.CREATE_BY = #{tEmployeeProject.createBy}
</if> </if>
...@@ -436,11 +553,30 @@ ...@@ -436,11 +553,30 @@
<!--tEmployeeInfo简单分页查询--> <!--tEmployeeInfo简单分页查询-->
<select id="getTEmployeeProjectInfoPage" resultMap="tEmployeeProjectMap"> <select id="getTEmployeeProjectInfoPage" resultMap="tEmployeeProjectMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>,
b.
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
<include refid="tEmployeeProject_where"/> <include refid="tEmployeeProject_where"/>
</where> </where>
</select> </select>
<!--tEmployeeInfo导出查询-->
<select id="getTEmployeeProjectExportPage" 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>
1=1 AND a.DELETE_FLAG = 0
<include refid="tEmployeeProject_where"/>
<if test="tEmployeeInfo.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tEmployeeInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment