Commit 129077ac by 张富康

feat(perfSalary): 新增北森员工考勤数据清洗初步实现

- 引入BeiSenEmployeeInfo数据传输对象,用于承载北森员工信息
- 实现attendanceDataCleansing方法框架,包含批量拆分员工数据的逻辑
- 通过配置文件读取员工批处理大小,支持灵活调整
- 设计依据手机号分批处理考勤数据的初步流程
- 在rpc-dj-staff模块添加platform-merchants-api依赖,准备支持相关功能扩展
1 parent e0fdf8af
package cn.com.glsx.dj.staff.dto.perfSalary;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BeiSenEmployeeInfo implements Serializable {
/**
* 员工UserID
*/
private Integer userID;
/**
* 姓名
*/
private String name;
/**
* 姓名(拼音)
*/
private String namePinyin;
/**
* 姓拼音
*/
private String phoneticOfXing;
/**
* 名拼音
*/
private String phoneticOfMing;
/**
* 性别:0男、1女
*/
private Integer gender;
/**
* 电子邮件
*/
private String email;
/**
* 证件类型(查看可用选项)
*/
private String iDType;
/**
* 证件号码
*/
private String iDNumber;
/**
* 时区,示例:Asia/Shanghai
*/
private String timeZone;
/**
* 是否长期证件
*/
private Boolean isLongTermCertificate;
/**
* 证件开始日期
*/
private Date certificateStartDate;
/**
* 证件截止日期
*/
private Date certificateValidityTerm;
/**
* 出生日期
*/
private Date birthday;
/**
* 参加工作日期
*/
private Date workDate;
/**
* 手机号码
*/
private String mobilePhone;
/**
* 微信
*/
private String weiXin;
/**
* 照片路径(DFS附件路径)
*/
private String idPhoto;
/**
* 照片缩略图路径
*/
private String smallIdPhoto;
/**
* 身份证人像面路径
*/
private String idPortraitSide;
/**
* 身份证国徽面路径
*/
private String idCountryEmblemSide;
/**
* 允许登录系统
*/
private Boolean allowToLoginIn;
/**
* 个人主页
*/
private String personalHomepage;
/**
* 专业
*/
private String major;
/**
* 邮政编码
*/
private String postalCode;
/**
* 护照号码
*/
private String passportNumber;
/**
* 星座
*/
private String constellation;
/**
* 血型
*/
private String bloodType;
/**
* 入党/团日期
*/
private Date joinPartyDate;
/**
* 户口类别(查看可用选项)
*/
private Integer domicileType;
/**
* 紧急联系人
*/
private String emergencyContact;
/**
* 紧急联系人与本人关系
*/
private String emergencyContactRelationship;
/**
* 紧急联系电话
*/
private String emergencyContactPhone;
/**
* QQ
*/
private String qq;
/**
* 家庭电话
*/
private String homePhone;
/**
* 毕业时间
*/
private Date graduateDate;
/**
* 婚姻状况(查看可用选项)
*/
private String marryCategory;
/**
* 政治面貌(查看可用选项)
*/
private String politicalStatus;
/**
* 国家(地区)(查看可用选项)
*/
private Integer nationality;
/**
* 民族(查看可用选项)
*/
private String nation;
/**
* 户籍所在地
*/
private String birthplace;
/**
* 籍贯(查看可用选项)
*/
private String registAddress;
/**
* 最高学历:1本科,2硕士研究生,3高中,4中技,5大专,6MBA,7博士研究生,8初中,9小学,10保密,120EMBA,130MPA
*/
private String educationLevel;
/**
* 毕业学校
*/
private String lastSchool;
/**
* 其他语言姓名
*/
private String engName;
/**
* 其他语言姓名_名
*/
private String firstname;
/**
* 其他语言姓名_姓
*/
private String lastname;
/**
* 办公电话
*/
private String officeTel;
/**
* 个人邮箱
*/
private String backupMail;
/**
* 应聘者id(招聘系统使用)
*/
private Integer applicantId;
/**
* 招聘申请id
*/
private String applyIdV6;
/**
* 应聘者id(只查询)
*/
private String applicantIdV6;
/**
* 年龄
*/
private Integer age;
/**
* 业务修改人
*/
private Integer businessModifiedBy;
/**
* 业务修改时间
*/
private Date businessModifiedTime;
/**
* 类型(查看可用选项)
*/
private Integer sourceType;
/**
* 首次进入公司日期
*/
private Date firstEntryDate;
/**
* 最新进入公司日期
*/
private Date latestEntryDate;
/**
* 导师UserID
*/
private Integer tutorNew;
/**
* 证件正面路径
*/
private String idFront;
/**
* 证件反面路径
*/
private String idBehind;
/**
* 预计退休日期
*/
private Date preRetireDate;
/**
* 实际退休日期
*/
private Date actualRetireDate;
/**
* 预计退休日期已核准
*/
private Boolean isConfirmRetireDate;
/**
* 账号激活状态:0未激活、1已激活
*/
private Byte activationState;
/**
* 签发机关
*/
private String issuingAuthority;
/**
* 是否残疾人
*/
private Boolean isDisabled;
/**
* 残疾证号
*/
private String disabledNumber;
/**
* 排序编码
*/
private Integer orderCode;
/**
* 业务对象实体主键GUID
*/
private String objectId;
/**
* 创建人员工UserID
*/
private Integer createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 修改人员工UserID
*/
private Integer modifiedBy;
/**
* 修改时间
*/
private Date modifiedTime;
/**
* 是否删除:0否,1是
*/
private Integer stdIsDeleted;
/**
* 在职状态:0.是,1.否
*/
private Integer zzStatus;
/**
* 离职时间
*/
private Date lastWorkDate;
/**
* 入职时间
*/
private Date entryDate;
private String homeAddress;
private String speciality;
private String residenceAddress;
private String aboutMe;
private String businessAddress;
private String oIdJobPost;
private String changeReason;
private String oIdJobPostId;
private Integer oIdDepartmentId;
}
\ No newline at end of file \ No newline at end of file
...@@ -50,6 +50,13 @@ ...@@ -50,6 +50,13 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<!-- todz 待修改-->
<version>5.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.oreframework.boot</groupId> <groupId>org.oreframework.boot</groupId>
<artifactId>ore-boot-starter-elasticjob</artifactId> <artifactId>ore-boot-starter-elasticjob</artifactId>
</dependency> </dependency>
......
package cn.com.glsx.dj.staff.service.perfSalary; package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.BeiSenEmployeeInfo;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class AttendanceDataCleansingService { public class AttendanceDataCleansingService {
// 员工批量处理大小
Integer EMPLOYEE_BATCH_SIZE = OrePropertyConfigurer.getProperty("EMPLOYEE_BATCH_SIZE", Integer.class, 50);
public void attendanceDataCleansing() { public void attendanceDataCleansing() {
// 查询北森全量数据
List<BeiSenEmployeeInfo> beiSenEmployeeInfos = new ArrayList<>();
beiSenEmployeeInfos.add(new BeiSenEmployeeInfo());
beiSenEmployeeInfos.add(new BeiSenEmployeeInfo());
// 对员工分批查询上月考勤信息
List<List<BeiSenEmployeeInfo>> beiSenEmployeeInfoBatches = new ArrayList<>();
for (int i = 0; i < beiSenEmployeeInfos.size(); i += EMPLOYEE_BATCH_SIZE) {
beiSenEmployeeInfoBatches.add(new ArrayList<>(beiSenEmployeeInfos.subList(
i,
Math.min(i + EMPLOYEE_BATCH_SIZE, beiSenEmployeeInfos.size())
)));
}
// 通过手机号查询当月考勤数据处理
for (List<BeiSenEmployeeInfo> itemList : beiSenEmployeeInfoBatches) {
List<String> mobilePhones = itemList.stream().map(BeiSenEmployeeInfo::getMobilePhone).collect(Collectors.toList());
}
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!