Commit bc0a048d authored by fangxinjiang's avatar fangxinjiang

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

parents 97242b45 5f83f09b
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -66,32 +67,36 @@ public class TElecEmployeeInfo extends BaseEntity {
* 员工编码
*/
@Schema(description ="员工编码")
@NotNull(message = "员工编码不能为空")
@Size(max = 20, message = "员工编码不可超过20位")
@TableField(exist = false)
private String empNo;
/**
* 单位名称
*/
@Schema(description ="单位名称")
private String belongUnit;
@TableField(exist = false)
private String unitName;
/**
* 项目名称
*/
@Schema(description ="项目名称")
private String itemName;
@TableField(exist = false)
private String deptName;
/**
* 项目编码
*/
@Schema(description ="项目编码")
private String itemCode;
@TableField(exist = false)
private String deptNo;
/**
* 资料类型
*/
@Schema(description ="资料类型")
@NotNull(message = "资料类型不能为空")
@Size(max = 2, message = "身资料类型不可超过2位")
private String dataType;
/**
......@@ -100,6 +105,12 @@ public class TElecEmployeeInfo extends BaseEntity {
@Schema(description ="附件")
private String attaInfo;
/**
* 附件id
*/
@Schema(description ="附件id")
private String fileId;
/**
* 是否删除 0否/1是
*/
......
......@@ -34,32 +34,26 @@ import java.util.List;
* @date 2022-06-23 10:54:40
*/
@Data
@ColumnWidth(30)
public class EmployeeProjectExportVO extends BaseEntity {
@ColumnWidth(15)
public class EmployeeProjectExportVO{
private static final long serialVersionUID = 1L;
/**
* 档案员工类型(字典值,0外包1派遣2代理)
*/
@NotNull(message = "档案员工类型不能为空")
@Max(value = 1,message = "档案员工类型不可超过1位")
@ExcelProperty(value ="档案员工类型")
private String proEmpNatrue;
/**
* 员工姓名
*/
@NotNull(message = "姓名不能为空")
@Max(value = 32,message = "姓名不可超过32位")
@ExcelProperty(value ="姓名")
private String empName;
/**
* 身份证号码
*/
@NotNull(message = "身份证号不能为空")
@Max(value = 32,message = "身份证号不可超过32位")
@ExcelProperty(value ="身份证号")
private String empIdcard;
......@@ -85,35 +79,30 @@ public class EmployeeProjectExportVO extends BaseEntity {
* 婚姻状况
*/
@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;
/**
......@@ -252,7 +241,6 @@ public class EmployeeProjectExportVO extends BaseEntity {
/**
* 项目编码
*/
@NotNull(message = "项目编码不能为空")
@ExcelProperty(value ="项目编码")
private String deptNo;
......
......@@ -20,7 +20,10 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
......@@ -46,6 +49,8 @@ public class TElecEmployeeInfoController {
private final TElecEmployeeInfoService tElecEmployeeInfoService;
private final TEmployeeInfoService tEmployeeInfoService;
/**
* 分页查询
* @param page 分页对象
......@@ -56,7 +61,7 @@ public class TElecEmployeeInfoController {
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_get')" )
public R getTElecEmployeeInfoPage(Page page, TElecEmployeeInfo tElecEmployeeInfo) {
return R.ok(tElecEmployeeInfoService.page(page, Wrappers.query(tElecEmployeeInfo)));
return R.ok(tElecEmployeeInfoService.getTElecEmployeeInfoPage(page,tElecEmployeeInfo));
}
......@@ -111,4 +116,20 @@ public class TElecEmployeeInfoController {
return R.ok(tElecEmployeeInfoService.removeById(id));
}
/**
* 通过身份证号查询人员档案
* @param idCard
* @return R
*/
@Operation(summary = "通过身份证号查询人员档案", description = "通过身份证号查询人员档案")
@SysLog("通过身份证号查询人员档案" )
@PostMapping("/getEmpInfo" )
public R getEmpInfoByCard(@RequestParam String idCard) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,idCard)));
if (Common.isNotNull(tEmployeeInfo)) {
return R.ok(tEmployeeInfo);
}
return R.failed("未找到身份证号对应的档案信息");
}
}
......@@ -37,6 +37,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
......@@ -88,7 +89,6 @@ public class TEmployeeProjectController {
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_get')" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(tEmployeeProjectService.getById(id));
}
......@@ -143,7 +143,7 @@ public class TEmployeeProjectController {
@SysLog("新增项目档案校验" )
@PostMapping("/check")
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_addcheck')" )
public R addCheck(@Valid @RequestBody TEmployeeProject tEmployeeProject) {
public R addCheck(@RequestBody TEmployeeProject tEmployeeProject) {
return R.ok(tEmployeeProjectService.addCheck(tEmployeeProject));
}
......@@ -230,11 +230,10 @@ public class TEmployeeProjectController {
* @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);
public void export(HttpServletResponse response, EmployeeProjectExportVO projectDTO, @RequestParam(name = "idstr", required = false)String idstr,
@RequestBody List<String> exportFields) {
tEmployeeProjectService.listExportProject(response,projectDTO,idstr,exportFields);
}
/**
......
......@@ -18,8 +18,11 @@
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 电子档案信息表
......@@ -30,4 +33,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TElecEmployeeInfoMapper extends BaseMapper<TElecEmployeeInfo> {
IPage<TElecEmployeeInfo> getTElecEmployeeInfoPage(Page page, @Param("tElecEmployeeInfo") TElecEmployeeInfo tElecEmployeeInfo);
}
......@@ -17,6 +17,8 @@
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.TElecEmployeeInfo;
......@@ -28,4 +30,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
*/
public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
IPage<TElecEmployeeInfo> getTElecEmployeeInfoPage(Page page, TElecEmployeeInfo vo);
}
......@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -106,8 +107,8 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
* @Date: 2022/6/23 10:30
* @return: R
**/
void listExportProject(EmployeeProjectExportVO projectDTO,String idstr,
List<String> exportFields);
void listExportProject(HttpServletResponse response, EmployeeProjectExportVO projectDTO,
String idstr, List<String> exportFields);
/**
* @param employeeInfo
* @Description: 新增项目档案
......
......@@ -16,6 +16,8 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TElecEmployeeInfoMapper;
......@@ -35,4 +37,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
public boolean save(TElecEmployeeInfo entity) {
return super.save(entity);
}
@Override
public IPage<TElecEmployeeInfo> getTElecEmployeeInfoPage(Page page, TElecEmployeeInfo tElecEmployeeInfo) {
return baseMapper.getTElecEmployeeInfoPage(page,tElecEmployeeInfo);
}
}
......@@ -49,6 +49,10 @@ import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -509,9 +513,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Date 10:55 2022/6/23
**/
@Override
public void listExportProject(EmployeeProjectExportVO projectDTO,String idstr, List<String> exportFields) {
public void listExportProject(HttpServletResponse response, EmployeeProjectExportVO projectDTO, String idstr, List<String> exportFields) {
String fileName = "项目档案批量导出" + LocalDateTime.now() + ".xls";
String fileName = "项目档案批量导出" + LocalDateTime.now() + ".xlsx";
// 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<String>();
for (String exportField : exportFields) {
......@@ -523,14 +527,29 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//获取记录
list = gettEmpProInfoExportVos(idstr, projectDTO);
ServletOutputStream out = null;
try {
if (list.size()>0) {
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(fileName, EmployeeProjectExportVO.class).includeColumnFiledNames(includeColumnFiledNames).sheet("项目档案")
.doWrite(list);
out.flush();
}
}catch (Exception e){
log.error("error:" ,e);
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
......
......@@ -28,11 +28,12 @@
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empNo" column="EMP_NO"/>
<result property="belongUnit" column="BELONG_UNIT"/>
<result property="itemName" column="ITEM_NAME"/>
<result property="itemCode" column="ITEM_CODE"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="attaInfo" column="ATTA_INFO"/>
<result property="fileId" column="FILE_ID"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
......@@ -45,12 +46,13 @@
a.ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_NO,
a.BELONG_UNIT,
a.ITEM_NAME,
a.ITEM_CODE,
b.EMP_NO,
b.UNIT_NAME,
b.deptNo,
b.DEPT_NAME,
a.DATA_TYPE,
a.ATTA_INFO,
a.FILE_ID,
a.DELETE_FLAG,
a.UPDATE_BY,
a.CREATE_BY,
......@@ -70,17 +72,17 @@
<if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
</if>
<if test="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND a.EMP_NO = #{tElecEmployeeInfo.empNo}
<if test="tElecEmployeeInfo.empCode != null and tElecEmployeeInfo.empCode.trim() != ''">
AND b.EMP_CODE = #{tElecEmployeeInfo.empCode}
</if>
<if test="tElecEmployeeInfo.belongUnit != null and tElecEmployeeInfo.belongUnit.trim() != ''">
AND a.BELONG_UNIT like concat('%',#{tElecEmployeeInfo.belongUnit},'%')
<if test="tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
</if>
<if test="tElecEmployeeInfo.itemName != null and tElecEmployeeInfo.itemName.trim() != ''">
AND a.ITEM_NAME like concat('%',#{tElecEmployeeInfo.itemName},'%')
<if test="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if test="tElecEmployeeInfo.itemCode != null and tElecEmployeeInfo.itemCode.trim() != ''">
AND a.ITEM_CODE like concat('%',#{tElecEmployeeInfo.itemCode},'%')
<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
<if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''">
AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType}
......@@ -88,6 +90,9 @@
<if test="tElecEmployeeInfo.attaInfo != null and tElecEmployeeInfo.attaInfo.trim() != ''">
AND a.ATTA_INFO = #{tElecEmployeeInfo.attaInfo}
</if>
<if test="tElecEmployeeInfo.fileId != null and tElecEmployeeInfo.fileId.trim() != ''">
AND a.FILE_ID = #{tElecEmployeeInfo.fileId}
</if>
<if test="tElecEmployeeInfo.createBy != null and tElecEmployeeInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tElecEmployeeInfo.createBy}
</if>
......@@ -111,8 +116,9 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_elec_employee_info a
left join t_employee_project b on a.EMP_IDCARD = b.EMP_IDCARD
<where>
1=1 AND a.DELETE_FLAG = 0
1=1 AND a.DELETE_FLAG = '0' AND b.DELETE_FLAG = '0'
<include refid="tElecEmployeeInfo_where"/>
</where>
</select>
......
......@@ -83,12 +83,9 @@
<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"/>
......@@ -101,7 +98,6 @@
<result property="empNatrue" 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"/>
......@@ -174,11 +170,9 @@
a.BANK_NAME,
a.BANK_SUB_NAME,
a.BANK_NO,
a.IS_LEAVE_EMPLOYEE,
a.EMP_NO,
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,
......@@ -188,7 +182,6 @@
a.ENJOIN_DATE,
a.TRY_PERIOD,
a.PROJECT_SOURCE,
a.TAX_MONTH,
b.STATUS AS PROSTATUS,
b.CREATE_NAME AS PROCREATE_NAME,
b.CREATE_TIME AS PROCREATE_TIME,
......@@ -391,24 +384,15 @@
<if test="tEmployeeProject.bankNo != null and tEmployeeProject.bankNo.trim() != ''">
AND a.BANK_NO = #{tEmployeeProject.bankNo}
</if>
<if test="tEmployeeProject.isLeaveEmployee != null">
AND a.IS_LEAVE_EMPLOYEE = #{tEmployeeProject.isLeaveEmployee}
</if>
<if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''">
AND a.EMP_NO = #{tEmployeeProject.empNo}
</if>
<if test="tEmployeeProject.unitId != null and tEmployeeProject.unitId.trim() != ''">
AND a.UNIT_ID = #{tEmployeeProject.unitId}
</if>
<if test="tEmployeeProject.unitName != null and tEmployeeProject.unitName.trim() != ''">
AND a.UNIT_NAME like concat('%',#{tEmployeeProject.unitName},'%')
</if>
<if test="tEmployeeProject.unitNo != null and tEmployeeProject.unitNo.trim() != ''">
AND a.UNIT_NO = #{tEmployeeProject.unitNo}
</if>
<if test="tEmployeeProject.deptId != null and tEmployeeProject.deptId.trim() != ''">
AND a.DEPT_ID = #{tEmployeeProject.deptId}
</if>
<if test="tEmployeeProject.deptName != null and tEmployeeProject.deptName.trim() != ''">
AND a.DEPT_NAME like concat('%',#{tEmployeeProject.deptName},'%')
</if>
......@@ -442,9 +426,6 @@
<if test="tEmployeeProject.projectSource != null and tEmployeeProject.projectSource.trim() != ''">
AND a.PROJECT_SOURCE = #{tEmployeeProject.projectSource}
</if>
<if test="tEmployeeProject.taxMonth != null and tEmployeeProject.taxMonth.trim() != ''">
AND a.TAX_MONTH = #{tEmployeeProject.taxMonth}
</if>
<if test="tEmployeeProject.proStatus != null">
AND a.STATUS = #{tEmployeeProject.proStatus}
</if>
......
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