Commit 3d2ddd99 authored by fangxinjiang's avatar fangxinjiang

人员花名册

parent 1ea9af7b
......@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
......@@ -40,7 +41,7 @@ import java.util.Date;
@Data
@TableName("t_personnel_roster")
@Schema(description = "")
public class TPersonnelRoster{
public class TPersonnelRoster extends BaseEntity {
/**
* id
......@@ -424,4 +425,14 @@ public class TPersonnelRoster{
@ExcelIgnore
private String dataCreateMonth;
/**
* 项目
*/
@Length(max = 32, message = "项目 不能超过32个字符" )
@ExcelAttribute(name = "项目", maxLength = 32)
@Schema(description = "项目" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目" )
private String settleDomain;
}
/*
* 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.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
* @author fxj
* @date 2023-06-13 15:42:17
*/
@Data
public class TPersonnelRosterExportVo{
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelIgnore
private String id;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
@Schema(description = "客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String customerName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
@Schema(description = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String departName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Length(max = 50, message = "项目编码不能超过50个字符")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String departNo;
/**
* 业务类型
*/
@ExcelAttribute(name = "业务类型", maxLength = 50)
@Length(max = 50, message = "业务类型不能超过50个字符")
@ExcelProperty("业务类型")
@Schema(description = "业务类型")
@HeadFontStyle(fontHeightInPoints = 11)
private String businessPrimary;
/**
* 二级分类
*/
@ExcelAttribute(name = "二级分类", maxLength = 50)
@Length(max = 50, message = "二级分类不能超过50个字符")
@ExcelProperty("二级分类")
@Schema(description = "二级分类")
@HeadFontStyle(fontHeightInPoints = 11)
private String businessSecond;
/**
* 三级分类
*/
@ExcelAttribute(name = "三级分类", maxLength = 50)
@Length(max = 50, message = "三级分类不能超过50个字符")
@ExcelProperty("三级分类")
@Schema(description = "三级分类")
@HeadFontStyle(fontHeightInPoints = 11)
private String businessThird;
/**
* 标签
*/
@ExcelAttribute(name = "标签", maxLength = 50)
@Length(max = 50, message = "标签不能超过50个字符")
@ExcelProperty("标签")
@Schema(description = "标签")
@HeadFontStyle(fontHeightInPoints = 11)
private String label;
/**
* 条线类型
*/
@ExcelAttribute(name = "条线类型", maxLength = 50)
@Length(max = 50, message = "条线类型不能超过50个字符")
@ExcelProperty("条线类型")
@Schema(description = "条线类型")
@HeadFontStyle(fontHeightInPoints = 11)
private String businessType;
/**
* BU归属
*/
@ExcelAttribute(name = "BU归属", maxLength = 30)
@Length(max = 30, message = "BU归属不能超过30个字符")
@ExcelProperty("BU归属")
@Schema(description = "BU归属")
@HeadFontStyle(fontHeightInPoints = 11)
private String buBelong;
/**
* 员工类型
*/
@ExcelAttribute(name = "员工类型", errorInfo = "员工类型不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Length(max = 20, message = "员工类型不能超过20个字符")
@ExcelProperty("员工类型")
@Schema(description = "员工类型")
@HeadFontStyle(fontHeightInPoints = 11)
private String empType;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
private String empName;
/**
* 性别
*/
@ExcelAttribute(name = "性别", maxLength = 10,isDataId = true,readConverterExp = "1=男,2=女")
@Length(max = 10, message = "性别不能超过10个字符")
@ExcelProperty("性别")
@Schema(description = "性别")
@HeadFontStyle(fontHeightInPoints = 11)
private String empSex;
/**
* 出生日期
*/
@DateTimeFormat("yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@ExcelAttribute(name = "出生日期", isDate = true)
@ExcelProperty("出生日期")
@Schema(description = "出生日期")
@HeadFontStyle(fontHeightInPoints = 11)
private Date empBirthDate;
/**
* 年龄
*/
@ExcelAttribute(name = "年龄", maxLength = 3)
@Length(max = 3, message = "年龄不能超过3个字符")
@ExcelProperty("年龄")
@Schema(description = "年龄")
@HeadFontStyle(fontHeightInPoints = 11)
private String empAge;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Length(max = 20, message = "身份证号不能超过20个字符")
@ExcelProperty("身份证号")
@Schema(description = "身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
private String empIdcard;
/**
* 银行卡号
*/
@ExcelAttribute(name = "银行卡号", maxLength = 25)
@Length(max = 25, message = "银行卡号不能超过25个字符")
@ExcelProperty("银行卡号")
@Schema(description = "银行卡号")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNo;
/**
* 开户行总行
*/
@ExcelAttribute(name = "开户行总行", maxLength = 50)
@Length(max = 50, message = "开户行总行不能超过50个字符")
@ExcelProperty("开户行总行")
@Schema(description = "开户行总行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankName;
/**
* 开户行-省
*/
@ExcelAttribute(name = "开户行-省", maxLength = 30,isArea = true)
@Length(max = 30, message = "开户行-省不能超过30个字符")
@ExcelProperty("开户行-省")
@Schema(description = "开户行-省")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankProvince;
/**
* 开户行-市
*/
@ExcelAttribute(name = "开户行-市", maxLength = 30,isArea = true,parentField = "bankProvince")
@Length(max = 30, message = "开户行-市不能超过30个字符")
@ExcelProperty("开户行-市")
@Schema(description = "开户行-市")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankCity;
/**
* 开户行支行
*/
@ExcelAttribute(name = "开户行支行", maxLength = 50)
@Length(max = 50, message = "开户行支行不能超过50个字符")
@ExcelProperty("开户行支行")
@Schema(description = "开户行支行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNameSub;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 15)
@Length(max = 15, message = "手机号码不能超过15个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
@HeadFontStyle(fontHeightInPoints = 11)
private String empPhone;
/**
* 档案地-省
*/
@ExcelAttribute(name = "档案地-省", maxLength = 30,isArea = true)
@Length(max = 30, message = "档案地-省不能超过30个字符")
@ExcelProperty("档案地-省")
@Schema(description = "档案地-省")
@HeadFontStyle(fontHeightInPoints = 11)
private String empProvince;
/**
* 档案地-市
*/
@ExcelAttribute(name = "档案地-市", maxLength = 30,isArea = true,parentField = "empProvince")
@Length(max = 30, message = "档案地-市不能超过30个字符")
@ExcelProperty("档案地-市")
@Schema(description = "档案地-市")
@HeadFontStyle(fontHeightInPoints = 11)
private String empCity;
/**
* 档案地-县
*/
@ExcelAttribute(name = "档案地-县", maxLength = 30,isArea = true,parentField = "empCity")
@Length(max = 30, message = "档案地-县不能超过30个字符")
@ExcelProperty("档案地-县")
@Schema(description = "档案地-县")
@HeadFontStyle(fontHeightInPoints = 11)
private String empTown;
/**
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地", maxLength = 50,isArea = true)
@Length(max = 50, message = "社保缴纳地不能超过50个字符")
@ExcelProperty("社保缴纳地")
@Schema(description = "社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
private String socialProvince;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 50,isArea = true,parentField = "socialProvince")
@Length(max = 50, message = "社保缴纳地-市不能超过50个字符")
@ExcelProperty("社保缴纳地-市")
@Schema(description = "社保缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
private String socialCity;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 50,isArea = true,parentField = "socialCity")
@Length(max = 50, message = "社保缴纳地-县不能超过50个字符")
@ExcelProperty("社保缴纳地-县")
@Schema(description = "社保缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
private String socialTown;
/**
* 合同申请编号
*/
@ExcelAttribute(name = "合同申请编号", maxLength = 32)
@Length(max = 32, message = "合同申请编号不能超过32个字符")
@ExcelProperty("合同申请编号")
@Schema(description = "合同申请编号")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractApplyNo;
/**
* 合同起始时间
*/
@ExcelAttribute(name = "合同起始时间", maxLength = 20)
@Length(max = 20, message = "合同起始时间不能超过20个字符")
@ExcelProperty("合同起始时间")
@Schema(description = "合同起始时间")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractStart;
/**
* 合同截止时间
*/
@ExcelAttribute(name = "合同截止时间", maxLength = 20)
@Length(max = 20, message = "合同截止时间不能超过20个字符")
@ExcelProperty("合同截止时间")
@Schema(description = "合同截止时间")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractEnd;
/**
* 合同类型
*/
@ExcelAttribute(name = "合同类型")
@Length(max = 10, message = "合同类型不能超过10个字符")
@ExcelProperty("合同类型")
@Schema(description = "合同类型")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractType;
/**
* 业务细分
*/
@ExcelAttribute(name = "业务细分")
@Length(max = 20, message = "业务细分不能超过20个字符")
@ExcelProperty("业务细分")
@Schema(description = "业务细分")
@HeadFontStyle(fontHeightInPoints = 11)
private String businessDetail;
/**
* 签订类型
*/
@ExcelAttribute(name = "签订类型")
@Length(max = 20, message = "签订类型不能超过20个字符")
@ExcelProperty("签订类型")
@Schema(description = "签订类型")
@HeadFontStyle(fontHeightInPoints = 11)
private String signType;
/**
* 签订期限
*/
@ExcelAttribute(name = "签订期限", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Length(max = 10, message = "签订期限不能超过10个字符")
@ExcelProperty("签订期限")
@Schema(description = "签订期限")
@HeadFontStyle(fontHeightInPoints = 11)
private String signTerm;
/**
* 合同甲方
*/
@ExcelAttribute(name = "合同甲方", maxLength = 50)
@Length(max = 50, message = "合同甲方不能超过50个字符")
@ExcelProperty("合同甲方")
@Schema(description = "合同甲方")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractPartyA;
/**
* 合同岗位
*/
@ExcelAttribute(name = "合同岗位", maxLength = 20)
@Length(max = 20, message = "合同岗位不能超过20个字符")
@ExcelProperty("合同岗位")
@Schema(description = "合同岗位")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractPost;
/**
* 工时制
*/
@ExcelAttribute(name = "工时制",maxLength = 10,isDataId = true,dataType = ExcelAttributeConstants.WORKING_HOURS)
@Length(max = 10, message = "工时制不能超过10个字符")
@ExcelProperty("工时制")
@Schema(description = "工时制")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractTaskTime;
/**
* 合同编码
*/
@ExcelAttribute(name = "合同编码", maxLength = 30)
@Length(max = 30, message = "合同编码不能超过30个字符")
@ExcelProperty("合同编码")
@Schema(description = "合同编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractCode;
/**
* 合同创建人
*/
@ExcelAttribute(name = "合同创建人", maxLength = 10)
@Length(max = 10, message = "合同创建人不能超过10个字符")
@ExcelProperty("合同创建人")
@Schema(description = "合同创建人")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractCreater;
/**
* 合同创建时间
*/
@ExcelAttribute(name = "合同创建时间", maxLength = 10)
@Length(max = 10, message = "合同创建时间不能超过10个字符")
@ExcelProperty("合同创建时间")
@Schema(description = "合同创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
private String contractCreateTime;
/**
* 数据生成月
*/
@ExcelAttribute(name = "数据生成月", maxLength = 10)
@Length(max = 10, message = "数据生成月不能超过10个字符")
@ExcelProperty("数据生成月")
@Schema(description = "数据生成月")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelIgnore
private String dataCreateMonth;
}
......@@ -21,10 +21,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPersonnelRosterService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -48,18 +55,28 @@ import java.util.List;
public class TPersonnelRosterController {
private final TPersonnelRosterService tPersonnelRosterService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
* @param page 分页对象
* @param tPersonnelRoster
* @param searchVo
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TPersonnelRoster>> getTPersonnelRosterPage(Page<TPersonnelRoster> page, TPersonnelRosterSearchVo tPersonnelRoster) {
return new R<>(tPersonnelRosterService.getTPersonnelRosterPage(page,tPersonnelRoster));
public R<IPage<TPersonnelRoster>> getTPersonnelRosterPage(Page<TPersonnelRoster> page, TPersonnelRosterSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
if (searchVo.getAuthSql().contains("1=2 EXISTS")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
return new R<>(tPersonnelRosterService.getTPersonnelRosterPage(page,searchVo));
}
/**
* 不分页查询
......@@ -68,7 +85,7 @@ public class TPersonnelRosterController {
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage" )
public R<List<TPersonnelRoster>> getTPersonnelRosterNoPage(@RequestBody TPersonnelRosterSearchVo tPersonnelRoster) {
public R<List<TPersonnelRosterExportVo>> getTPersonnelRosterNoPage(@RequestBody TPersonnelRosterSearchVo tPersonnelRoster) {
return R.ok(tPersonnelRosterService.noPageDiy(tPersonnelRoster));
}
......@@ -131,6 +148,16 @@ public class TPersonnelRosterController {
@Operation(description = "导出 hasPermission('demo_tpersonnelroster-export')")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody TPersonnelRosterSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
if (searchVo.getAuthSql().contains("1=2 EXISTS")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
tPersonnelRosterService.listExport(response,searchVo);
}
......@@ -147,4 +174,17 @@ public class TPersonnelRosterController {
public void everyMonthUpdateRoster() {
tPersonnelRosterService.everyMonthUpdateRoster();
}
private void setAuth(TPersonnelRosterSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
if (searchVo.getAuthSql().contains(CommonConstants.A_CREATE_BY)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_CREATE_BY, "CREATE_BY"));
}
}
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -54,5 +55,5 @@ public interface TPersonnelRosterMapper extends BaseMapper<TPersonnelRoster> {
int noPageCountDiy(@Param("tPersonnelRoster")TPersonnelRosterSearchVo searchVo);
List<TPersonnelRoster> noPageDiy(@Param("tPersonnelRoster")TPersonnelRosterSearchVo searchVo);
List<TPersonnelRosterExportVo> noPageDiy(@Param("tPersonnelRoster")TPersonnelRosterSearchVo searchVo);
}
......@@ -21,6 +21,7 @@ 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.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -45,7 +46,7 @@ public interface TPersonnelRosterService extends IService<TPersonnelRoster> {
void listExport(HttpServletResponse response, TPersonnelRosterSearchVo searchVo);
List<TPersonnelRoster> noPageDiy(TPersonnelRosterSearchVo searchVo);
List<TPersonnelRosterExportVo> noPageDiy(TPersonnelRosterSearchVo searchVo);
void everyMonthUpdateRoster();
}
......@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPersonnelRosterMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPersonnelRosterService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -86,7 +87,7 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
public void listExport(HttpServletResponse response, TPersonnelRosterSearchVo searchVo){
String fileName = "人员花名册" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TPersonnelRoster> list = new ArrayList<>();
List<TPersonnelRosterExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
......@@ -96,22 +97,24 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TPersonnelRoster.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TPersonnelRosterExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
ExcelUtil<TPersonnelRosterExportVo> util;
WriteSheet writeSheet;
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<TPersonnelRoster> util = new ExcelUtil<>(TPersonnelRoster.class);
for (TPersonnelRoster vo:list){
util = new ExcelUtil<>(TPersonnelRosterExportVo.class);
for (TPersonnelRosterExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet(""+index).build();
writeSheet = EasyExcel.writerSheet(""+index).build();
excelWriter.write(list,writeSheet);
index++;
}
......@@ -143,7 +146,7 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
}
@Override
public List<TPersonnelRoster> noPageDiy(TPersonnelRosterSearchVo searchVo) {
public List<TPersonnelRosterExportVo> noPageDiy(TPersonnelRosterSearchVo searchVo) {
return baseMapper.noPageDiy(searchVo);
}
......
......@@ -66,6 +66,53 @@
<result property="contractCreater" column="CONTRACT_CREATER"/>
<result property="contractCreateTime" column="CONTRACT_CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
</resultMap>
<resultMap id="tPersonnelRosterExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterExportVo">
<id property="id" column="ID"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="departName" column="DEPART_NAME"/>
<result property="departNo" column="DEPART_NO"/>
<result property="businessPrimary" column="BUSINESS_PRIMARY"/>
<result property="businessSecond" column="BUSINESS_SECOND"/>
<result property="businessThird" column="BUSINESS_THIRD"/>
<result property="label" column="LABEL"/>
<result property="businessType" column="BUSINESS_TYPE"/>
<result property="buBelong" column="BU_BELONG"/>
<result property="empType" column="EMP_TYPE"/>
<result property="empName" column="EMP_NAME"/>
<result property="empSex" column="EMP_SEX"/>
<result property="empBirthDate" column="EMP_BIRTH_DATE"/>
<result property="empAge" column="EMP_AGE"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="bankNo" column="BANK_NO"/>
<result property="bankName" column="BANK_NAME"/>
<result property="bankProvince" column="BANK_PROVINCE"/>
<result property="bankCity" column="BANK_CITY"/>
<result property="bankNameSub" column="BANK_NAME_SUB"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="empProvince" column="EMP_PROVINCE"/>
<result property="empCity" column="EMP_CITY"/>
<result property="empTown" column="EMP_TOWN"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="contractApplyNo" column="CONTRACT_APPLY_NO"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="businessDetail" column="BUSINESS_DETAIL"/>
<result property="signType" column="SIGN_TYPE"/>
<result property="signTerm" column="SIGN_TERM"/>
<result property="contractPartyA" column="CONTRACT_PARTY_A"/>
<result property="contractPost" column="CONTRACT_POST"/>
<result property="contractTaskTime" column="CONTRACT_TASK_TIME"/>
<result property="contractCode" column="CONTRACT_CODE"/>
<result property="contractCreater" column="CONTRACT_CREATER"/>
<result property="contractCreateTime" column="CONTRACT_CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -109,7 +156,8 @@
a.CONTRACT_CODE,
a.CONTRACT_CREATER,
a.CONTRACT_CREATE_TIME,
a.DATA_CREATE_MONTH
a.DATA_CREATE_MONTH,
a.SETTLE_DOMAIN
</sql>
<sql id="tPersonnelRoster_where">
<if test="tPersonnelRoster != null">
......@@ -135,7 +183,7 @@
AND a.BUSINESS_THIRD = #{tPersonnelRoster.businessThird}
</if>
<if test="tPersonnelRoster.label != null and tPersonnelRoster.label.trim() != ''">
AND a.LABEL = #{tPersonnelRoster.label}
AND a.LABEL like CONCAT(#{tPersonnelRoster.label},'%')
</if>
<if test="tPersonnelRoster.businessType != null and tPersonnelRoster.businessType.trim() != ''">
AND a.BUSINESS_TYPE = #{tPersonnelRoster.businessType}
......@@ -239,6 +287,9 @@
<if test="tPersonnelRoster.dataCreateMonth != null and tPersonnelRoster.dataCreateMonth.trim() != ''">
AND a.DATA_CREATE_MONTH = #{tPersonnelRoster.dataCreateMonth}
</if>
<if test="tPersonnelRoster.authSql != null and tPersonnelRoster.authSql.trim() != ''">
${tPersonnelRoster.authSql}
</if>
<if test="tPersonnelRoster.businessTypes != null and tPersonnelRoster.businessTypes.size() > 0">
AND a.BUSINESS_TYPE in
......@@ -271,6 +322,7 @@
1=1
<include refid="tPersonnelRoster_where"/>
</where>
order by a.CONTRACT_CREATE_TIME ASC
</select>
<select id="getTPersonnelRoster" resultMap="tPersonnelRosterMap">
select p.UNIT_NAME as 'CUSTOMER_NAME',p.DEPT_NAME as 'DEPART_NAME',p.DEPT_NO as 'DEPART_NO',
......@@ -282,7 +334,8 @@
c1.CONTRACT_START as 'CONTRACT_START',c1.CONTRACT_END as 'CONTRACT_END',c1.CONTRACT_NAME as 'CONTRACT_TYPE',c1.CONTRACT_SUB_NAME as 'BUSINESS_DETAIL',
c1.SITUATION as 'SIGN_TYPE',c1.CONTRACT_TYPE as 'SIGN_TERM',
c1.CONTRACT_PARTY as 'CONTRACT_PARTY_A',c1.POST as 'CONTRACT_POST',c1.WORKING_HOURS as 'CONTRACT_TASK_TIME',
c1.CONTRACT_NO as 'CONTRACT_CODE',c1.CREATE_NAME as 'CONTRACT_CREATER',c1.CREATE_TIME as 'CONTRACT_CREATE_TIME'
c1.CONTRACT_NO as 'CONTRACT_CODE',c1.CREATE_NAME as 'CONTRACT_CREATER',c1.CREATE_TIME as 'CONTRACT_CREATE_TIME',
d.id as "SETTLE_DOMAIN"
from
(select MAX(c.CREATE_TIME),c.id,c.EMP_IDCARD,c.DEPT_NO from t_employee_contract_info c WHERE c.IN_USE = 0 and c.DELETE_FLAG='0' and c.IS_OBSOLETE='0'
GROUP BY c.DEPT_NO,c.EMP_IDCARD) t
......@@ -317,7 +370,7 @@
</select>
<!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02-->
<select id="noPageDiy" resultMap="tPersonnelRosterMap">
<select id="noPageDiy" resultMap="tPersonnelRosterExportMap">
select
<include refid="Base_Column_List"/>
from t_personnel_roster a
......@@ -325,7 +378,7 @@
1=1
<include refid="tPersonnelRoster_where"/>
</where>
order by a.CREATE_TIME desc
order by a.CONTRACT_CREATE_TIME ASC
<if test="tPersonnelRoster != null">
<if test="tPersonnelRoster.limitStart != null">
limit #{tPersonnelRoster.limitStart},#{tPersonnelRoster.limitEnd}
......
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