Commit 92e1b740 authored by hongguangwu's avatar hongguangwu

员工合同相关

parent 155396a5
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@Data
@TableName("t_employee_contract_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "员工合同")
public class TEmployeeContrctInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 员工编码
*/
@Schema(description ="员工编码")
private String empNo;
/**
* 员工主键
*/
@Schema(description ="员工主键")
private String empId;
/**
* 员工姓名
*/
@Schema(description ="员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description ="员工身份证号")
private String empIdcard;
/**
* 合同名称
*/
@Schema(description ="合同名称")
private String contractName;
/**
* 合同类型
*/
@Schema(description ="合同类型")
private String contractType;
/**
* 合同起始时间
*/
@Schema(description ="合同起始时间")
private LocalDate contractStart;
/**
* 合同到期时间
*/
@Schema(description ="合同到期时间")
private LocalDate contractEnd;
/**
* 合同主体部门
*/
@Schema(description ="合同主体部门")
private String subjectDepart;
/**
* 合同主体单位
*/
@Schema(description ="合同主体单位")
private String subjectUnit;
/**
* 签订情况
*/
@Schema(description ="签订情况")
private String situation;
/**
* 合同年限
*/
@Schema(description ="合同年限")
private Double contractTerm;
/**
* 合同编码
*/
@Schema(description ="合同编码")
private String contractNo;
/**
* remark
*/
@Schema(description ="remark")
private String remark;
/**
* 是否作废 0否/1是
*/
@Schema(description ="是否作废 0否/1是")
private String isObsolete;
/**
* 是否归档 0是/1否
*/
@Schema(description ="是否归档 0是/1否")
private String isFile;
/**
* 数据迁移ID
*/
@Schema(description ="数据迁移ID")
private Integer oldId;
/**
* 入职日期
*/
@Schema(description ="入职日期")
private LocalDateTime enjoinDate;
/**
* 合同岗位
*/
@Schema(description ="合同岗位")
private String post;
/**
* 工时制(数据字典)
*/
@Schema(description ="工时制(数据字典)")
private String workingHours;
/**
* 档案柜号
*/
@Schema(description ="档案柜号")
private String fileCabinetNo;
/**
* 结算主体ID
*/
@Schema(description ="结算主体ID")
private String settleDomain;
/**
* 是否在用:0 是 1 否
*/
@Schema(description ="是否在用:0 是 1 否")
private String inUse;
/**
* 作废理由
*/
@Schema(description ="作废理由")
private String obsoleteReason;
/**
* 客户id
*/
@Schema(description ="客户id")
private String customerId;
/**
* 档案-省
*/
@Schema(description ="档案-省")
private Integer fileProvince;
/**
* 档案-市
*/
@Schema(description ="档案-市")
private Integer fileCity;
/**
* 档案-县
*/
@Schema(description ="档案-县")
private Integer fileTown;
/**
* 0 在职 1 个人离职 2 单位辞退 3 临时 4 特殊人员 5 退休 6 退休返聘
*/
@Schema(description ="0 在职 1 个人离职 2 单位辞退 3 临时 4 特殊人员 5 退休 6 退休返聘")
private String workingStatusSub;
/**
* 在职状态 0是/1否
*/
@Schema(description ="在职状态 0是/1否")
private String workFlag;
/**
* 合同试用期开始时间
*/
@Schema(description ="合同试用期开始时间")
private LocalDateTime periodStart;
/**
* 合同试用期结束时间
*/
@Schema(description ="合同试用期结束时间")
private LocalDateTime periodEnd;
/**
* 试用期工资 元/月
*/
@Schema(description ="试用期工资 元/月")
private BigDecimal periodSalaryPerMonth;
/**
* 工资形式 1.计时工资 2.计件工资 3.其他
*/
@Schema(description ="工资形式 1.计时工资 2.计件工资 3.其他")
private String salaryType;
/**
* 计时工资 工资标准 元/月
*/
@Schema(description ="计时工资 工资标准 元/月 ")
private BigDecimal salaryStandardPerHour;
/**
* 计件工资 工资标准单价/元
*/
@Schema(description ="计件工资 工资标准单价/元 ")
private BigDecimal salaryStandardPerPiece;
/**
* 派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废
*/
@Schema(description ="派单标识 1 代表派单生成, 派单审核通过后清空标识 专门用于派单作废")
private String dispatchFlag;
/**
* 邮件提醒人id
*/
@Schema(description ="邮件提醒人id")
private String warnEmailUserId;
/**
* 法大大电子合同标识 0不开通 1开通电子合同
*/
@Schema(description ="法大大电子合同标识 0不开通 1开通电子合同")
private String fddFlag;
/**
* isSign
*/
@Schema(description ="isSign")
private Integer isSign;
}
......@@ -18,6 +18,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.Data;
......@@ -38,6 +40,7 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "员工主码")
private String empCode;
@ExcelAttribute(name = "员工类型", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@ExcelProperty(value = "员工类型")
private String empNatrue;
......@@ -54,12 +57,15 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "身份证截止日期")
private LocalDateTime validityEnd;
@ExcelAttribute(name = "婚姻状况", isDataId = true,dataType = ExcelAttributeConstants.EMP_MARRIED)
@ExcelProperty(value = "婚姻状况")
private String empMarriStatus;
@ExcelAttribute(name = "民族", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATIONAL)
@ExcelProperty(value = "民族")
private String empNational;
@ExcelAttribute(name = "政治面貌", isDataId = true,dataType = ExcelAttributeConstants.EMP_POLITICAL)
@ExcelProperty(value = "政治面貌")
private String politicalStatus;
......@@ -69,30 +75,39 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "邮箱")
private String empEmail;
@ExcelAttribute(name = "户籍所在省", isDataId = true, isArea = true)
@ExcelProperty(value = "户籍所在省")
private String idProvince;
@ExcelAttribute(name = "户籍所在市", isDataId = true, isArea = true, parentField = "idProvince")
@ExcelProperty(value = "户籍所在市")
private String idCity;
@ExcelAttribute(name = "户籍所在县", isDataId = true, isArea = true, parentField = "idCity")
@ExcelProperty(value = "户籍所在县")
private String idTown;
@ExcelAttribute(name = "户口性质", isDataId = true,dataType = ExcelAttributeConstants.EMP_REGISTYPE)
@ExcelProperty(value = "户口性质")
private String empRegisType;
@ExcelAttribute(name = "档案所在省", isArea = true)
@ExcelProperty(value = "档案所在省")
private String fileProvince;
@ExcelAttribute(name = "档案所在市", isArea = true, parentField = "fileProvince")
@ExcelProperty(value = "档案所在市")
private String fileCity;
@ExcelAttribute(name = "档案所在县", isArea = true, parentField = "fileCity")
@ExcelProperty(value = "档案所在县")
private String fileTown;
@ExcelAttribute(name = "是否大专及以上", readConverterExp = "0=否,1=是")
@ExcelProperty(value = "是否大专及以上")
private String isCollege;
@ExcelAttribute(name = "最高学历", isDataId = true,dataType = ExcelAttributeConstants.EDUCATION)
@ExcelProperty(value = "最高学历")
private String hignEducation;
......@@ -114,6 +129,7 @@ public class EmployeeExportVO extends BaseEntity {
/**
* 人员档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
*/
@ExcelAttribute(name = "人员档案来源", readConverterExp = "1=社保公积金,2=薪酬,3=商险,4=人员档案新建")
@ExcelProperty(value = "人员档案来源")
private String fileSource;
......@@ -132,30 +148,35 @@ public class EmployeeExportVO extends BaseEntity {
/**
* 员工合同状态(字典)
*/
@ExcelAttribute(name = "合同状态", isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_STATE)
@ExcelProperty(value = "合同状态")
private Integer contractStatus;
/**
* 商险状态(字典)
*/
@ExcelAttribute(name = "商险状态", isDataId = true,dataType = ExcelAttributeConstants.COMMERCIAL_SATTE)
@ExcelProperty(value = "商险状态")
private Integer insuranceStatus;
/**
* 社保状态(字典)
*/
@ExcelAttribute(name = "社保状态", isDataId = true,dataType = ExcelAttributeConstants.SOCIAL_ECURITY_STATE)
@ExcelProperty(value = "社保状态")
private Integer socialStatus;
/**
* 公积金状态(字典)
*/
@ExcelAttribute(name = "公积金状态", isDataId = true,dataType = ExcelAttributeConstants.FUND_STATUS)
@ExcelProperty(value = "公积金状态")
private Integer fundStatus;
/**
* 近3个月发薪(0否;1是)
*/
@ExcelAttribute(name = "近3个月发薪", readConverterExp = "0=无,1=是,2=否")
@ExcelProperty(value = "近3个月发薪")
private Integer salaryStatus;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContrctInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeecontrctinfo")
@Tag(name = "员工合同管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TEmployeeContrctInfoController {
private final TEmployeeContrctInfoService tEmployeeContrctInfoService;
/**
* 分页查询
*
* @param page 分页对象
* @param tEmployeeContrctInfo 员工合同
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_get')")
public R getTEmployeeContrctInfoPage(Page page, TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.page(page, Wrappers.query(tEmployeeContrctInfo)));
}
/**
* 通过id查询员工合同
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('contract_temployeecontrctinfo_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_get')")
public R getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContrctInfoService.getById(id));
}
/**
* 新增员工合同
*
* @param tEmployeeContrctInfo 员工合同
* @return R
*/
@Operation(summary = "新增员工合同", description = "新增员工合同:hasPermission('contract_temployeecontrctinfo_add')")
@SysLog("新增员工合同")
@PostMapping
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_add')")
public R save(@RequestBody TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.save(tEmployeeContrctInfo));
}
/**
* 修改员工合同
*
* @param tEmployeeContrctInfo 员工合同
* @return R
*/
@Operation(summary = "修改员工合同", description = "修改员工合同:hasPermission('contract_temployeecontrctinfo_edit')")
@SysLog("修改员工合同")
@PutMapping
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_edit')")
public R updateById(@RequestBody TEmployeeContrctInfo tEmployeeContrctInfo) {
return R.ok(tEmployeeContrctInfoService.updateById(tEmployeeContrctInfo));
}
/**
* 通过id删除员工合同
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除员工合同", description = "通过id删除员工合同:hasPermission('contract_temployeecontrctinfo_del')")
@SysLog("通过id删除员工合同")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('contract_temployeecontrctinfo_del')")
public R removeById(@PathVariable String id) {
return R.ok(tEmployeeContrctInfoService.removeById(id));
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@Mapper
public interface TEmployeeContrctInfoMapper extends BaseMapper<TEmployeeContrctInfo> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
public interface TEmployeeContrctInfoService extends IService<TEmployeeContrctInfo> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContrctInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContrctInfoService;
import org.springframework.stereotype.Service;
/**
* 员工合同
*
* @author hgw
* @date 2022-06-29 20:45:22
*/
@Service
public class TEmployeeContrctInfoServiceImpl extends ServiceImpl<TEmployeeContrctInfoMapper, TEmployeeContrctInfo> implements TEmployeeContrctInfoService {
}
......@@ -37,10 +37,7 @@ 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.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
......@@ -680,8 +677,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List<TEmployeeInfo> saveList = new ArrayList<>();
// 调用字典服务,渲染字典值
R<Map<String, Map<String, String>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToLable", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
// 婚姻状况
Map<String, String> empMarriMap;
......@@ -695,10 +693,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, String> educationMap;
// 员工类型
Map<String, String> empNatrueMap;
if (dictR == null) {
if (dictR == null || dictR.getData() == null) {
return R.failed("获取字典失败!");
} else {
dictMap = dictR.getData();
dictDataMap = dictR.getData();
dictMap = dictDataMap.get("data");
empMarriMap = dictMap.get("emp_married");
empNationalMap = dictMap.get("emp_national");
empPoliticalMap = dictMap.get("emp_political");
......@@ -1074,8 +1073,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List<EmployeeNewOldVO> updateList = new ArrayList<>();
// 调用字典服务,渲染字典值
R<Map<String, Map<String, String>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToLable", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
// 婚姻状况
Map<String, String> empMarriMap;
......@@ -1089,10 +1089,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, String> educationMap;
// 员工类型
Map<String, String> empNatrueMap;
if (dictR == null) {
if (dictR == null || dictR.getData() == null) {
return R.failed("获取字典失败!");
} else {
dictMap = dictR.getData();
dictDataMap = dictR.getData();
dictMap = dictDataMap.get("data");
empMarriMap = dictMap.get("emp_married");
empNationalMap = dictMap.get("emp_national");
empPoliticalMap = dictMap.get("emp_political");
......@@ -1356,6 +1357,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (list != null && !list.isEmpty()) {
ServletOutputStream out = null;
try {
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo : list) {
util.convertEntity(vo,null,null,null);
}
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="archives.contract.mapper.TEmployeeContrctInfoMapper">
<resultMap id="tEmployeeContrctInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContrctInfo">
<id property="id" column="ID"/>
<result property="empNo" column="EMP_NO"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="contractName" column="CONTRACT_NAME"/>
<result property="contractType" column="CONTRACT_TYPE"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="subjectDepart" column="SUBJECT_DEPART"/>
<result property="subjectUnit" column="SUBJECT_UNIT"/>
<result property="situation" column="SITUATION"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="contractNo" column="CONTRACT_NO"/>
<result property="remark" column="REMARK"/>
<result property="isObsolete" column="IS_OBSOLETE"/>
<result property="isFile" column="IS_FILE"/>
<result property="oldId" column="OLD_ID"/>
<result property="enjoinDate" column="ENJOIN_DATE"/>
<result property="post" column="POST"/>
<result property="workingHours" column="WORKING_HOURS"/>
<result property="fileCabinetNo" column="FILE_CABINET_NO"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="inUse" column="IN_USE"/>
<result property="obsoleteReason" column="OBSOLETE_REASON"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="fileProvince" column="FILE_PROVINCE"/>
<result property="fileCity" column="FILE_CITY"/>
<result property="fileTown" column="FILE_TOWN"/>
<result property="workingStatusSub" column="WORKING_STATUS_SUB"/>
<result property="workFlag" column="WORK_FLAG"/>
<result property="periodStart" column="PERIOD_START"/>
<result property="periodEnd" column="PERIOD_END"/>
<result property="periodSalaryPerMonth" column="PERIOD_SALARY_PER_MONTH"/>
<result property="salaryType" column="SALARY_TYPE"/>
<result property="salaryStandardPerHour" column="SALARY_STANDARD_PER_HOUR"/>
<result property="salaryStandardPerPiece" column="SALARY_STANDARD_PER_PIECE"/>
<result property="dispatchFlag" column="DISPATCH_FLAG"/>
<result property="warnEmailUserId" column="WARN_EMAIL_USER_ID"/>
<result property="fddFlag" column="FDD_FLAG"/>
<result property="isSign" column="IS_SIGN"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
</mapper>
package com.yifu.cloud.plus.v1.yifu.common.core.constant;
/**
* @Author hgw
* @Date 2022-6-29 19:27:33
* @return
* @Description 注解式 静态数据
**/
public class ExcelAttributeConstants {
// 员工类型
public static final String EMP_NATRUE = "emp_natrue";
// 婚姻状况
public static final String EMP_MARRIED = "emp_married";
// 民族
public static final String EMP_NATIONAL = "emp_national";
// 政治面貌
public static final String EMP_POLITICAL = "emp_political";
// 户口性质
public static final String EMP_REGISTYPE = "emp_registype";
// 最高学历
public static final String EDUCATION = "education";
// 合同状态
public static final String PERSONNEL_STATE = "personnel_state";
// 商险状态
public static final String COMMERCIAL_SATTE = "commercial_satte";
// 社保状态
public static final String SOCIAL_ECURITY_STATE = "social_ecurity_state";
// 公积金状态
public static final String FUND_STATUS = "fund_status";
}
......@@ -41,12 +41,24 @@ public class ExcelUtil <T> implements Serializable {
public void convertEntity(T vo, String[] exportFields, Map<String,String> diyDicMap, String dateFormat) {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
List<Field> fields = new ArrayList<Field>();
List<Field> fields = new ArrayList<>();
Class<?> superClazz = clazz.getSuperclass();
// 得到所有field并存放到一个list中
// 将需要字典表头存起来备用,如果没传,则全部翻译
List<String> allField = new ArrayList<>();
ExcelAttribute annotation;
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
annotation = field.getAnnotation(ExcelAttribute.class);
if (annotation != null && Common.isNotNull(annotation.name())) {
allField.add(annotation.name());
}
}
}
if (Common.isEmpty(exportFields) && !allField.isEmpty()) {
exportFields = new String[allField.size()];
for (int i = 0; i < allField.size(); i++) {
exportFields[i] = allField.get(i);
}
}
if (superClazz != null) {
......@@ -98,7 +110,20 @@ public class ExcelUtil <T> implements Serializable {
} else if (attr.isDataId()) {
//加入分割符逻辑
divider = attr.divider();
if(!"".equals(divider) && field.get(vo) != null) {
if (!"".equals(divider) && field.get(vo) != null){
try {
value = "";
for(String key : String.valueOf(field.get(vo)).split(divider)){
value += getLableById(attr, diyDicMap, key) + divider;
}
if(Common.isNotNull(value)){
value = value.substring(0,value.length()-1);
}
}catch (Exception e){
log.error("excel数据导出字符切割错误",e);
value = "字符切割错误";
}
} else {
//如果是字典数据ID或区域ID 去dicMap(包含了区域) 取值 取不到返回空
value = getLableById(attr, diyDicMap, field.get(vo) == null ? "" : String.valueOf(field.get(vo)));
}
......
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