人员信息同步2.0

master
zhaoxiaolin 10 months ago
parent 8a0a9b7634
commit eacf18a4a8

@ -168,17 +168,13 @@ public class RyTask {
logger.info("++hr人力基础数据同步+开始++syncUserInfoTask+++++");
remoteUserService.syncUserInfoTask();
}
/************hr 人力基础数据定时任务结束*****************/
/************岗位基础数据定时任务开始*****************/
//岗位基本数据同步每天
public void sysPostInfoTask(){
logger.info("++hr岗位基础数据同步+开始++sysPostInfoTask+++++");
remoteUserService.sysPostInfoTask();
}
/************岗位基础数据定时任务开始*****************/
/************部门基础数据定时任务开始*****************/
//部门基本数据同步每天
public void sysDeptInfoTask(){
logger.info("++hr部门基础数据同步+开始++sysPostInfoTask+++++");

@ -603,6 +603,20 @@ public class SysUserServiceImpl implements ISysUserService {
.collect(Collectors.toList());
if(!CollectionUtils.isEmpty(updates)){
int allsize = updates.size();
int inserttimes = allsize/150+1;
for(int m=0;m<inserttimes;m++){
List<HRInfo> everyList;
if(m<(inserttimes-1)){
everyList = updates.subList(m*150,(m+1)*150);
}else{
everyList = updates.subList(m*150,allsize);
}
if(everyList.size()>0){
m = userMapper.updateUserBatchs(everyList);
System.out.println("人员新增成功条数:"+ m);
}
}
int m = userMapper.updateUserBatchs(updates);
System.out.println("人员更新成功条数:"+m);
}
@ -611,8 +625,20 @@ public class SysUserServiceImpl implements ISysUserService {
.collect(Collectors.toList());
if(!CollectionUtils.isEmpty(adds)){
n = userMapper.addUserBatchs(adds);
System.out.println("人员新增成功条数:"+ n);
int allsize = adds.size();
int inserttimes = allsize/150+1;
for(int m=0;m<inserttimes;m++){
List<HRInfo> everyList;
if(m<(inserttimes-1)){
everyList = adds.subList(m*150,(m+1)*160);
}else{
everyList = adds.subList(m*150,allsize);
}
if(everyList.size()>0){
n = userMapper.addUserBatchs(everyList);
System.out.println("人员新增成功条数:"+ n);
}
}
}
return n;

@ -187,13 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<insert id="addUserBatchs">
insert into sys_user
(user_name,nick_name,
post,section,dept_id,
(user_name,nick_name,post,dept_id,
phonenumber,sex,status,
create_by,create_time,del_flag)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
(#{item.userCode},#{item.userName},#{item.post},
#{item.section},#{item.deptId},
(#{item.userName},#{item.nickName},#{item.post},#{item.deptId},
#{item.phonenumber},#{item.sex},#{item.status},
#{item.createBy},#{item.createTime},'0')
</foreach>
</insert>
@ -235,8 +235,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach collection="list" item="item" separator=";">
update sys_user
set
<if test="item.section!=null">section = #{item.section},</if>
<if test="item.deptId!=null">section = #{item.deptId},</if>
<if test="item.post!=null">post = #{item.post},</if>
<if test="item.phonenumber!=null">phonenumber = #{item.phonenumber},</if>
sex = #{item.sex},
del_flag = #{item.delFlag},
update_by = #{item.updateBy},
update_time = #{updateTime}
where

Loading…
Cancel
Save