From eacf18a4a822d2893108ffe46c3e821009d857a4 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 21 Mar 2024 17:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E5=90=8C?= =?UTF-8?q?=E6=AD=A52.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/op/job/task/RyTask.java | 4 --- .../service/impl/SysUserServiceImpl.java | 30 +++++++++++++++++-- .../resources/mapper/system/SysUserMapper.xml | 13 ++++---- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java b/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java index 5ec9f551..fb387861 100644 --- a/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java +++ b/op-modules/op-job/src/main/java/com/op/job/task/RyTask.java @@ -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+++++"); diff --git a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java index 39a22380..3475cd68 100644 --- a/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java +++ b/op-modules/op-system/src/main/java/com/op/system/service/impl/SysUserServiceImpl.java @@ -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 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 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; diff --git a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml index 8bdce94c..0739a7b6 100644 --- a/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/op-modules/op-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -187,13 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 - (#{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') @@ -235,8 +235,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_user set - section = #{item.section}, + section = #{item.deptId}, post = #{item.post}, + phonenumber = #{item.phonenumber}, + sex = #{item.sex}, + del_flag = #{item.delFlag}, update_by = #{item.updateBy}, update_time = #{updateTime} where