From 8b00503b7f49dfa1b2b9d4ddb5cba4da973b35b4 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 12 Feb 2024 23:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.1.1=E3=80=91=E3=80=90sys=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=B9=E9=87=8F=E4=BF=9D=E5=AD=98=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9C=BA=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/modular/user/service/SysUserOrgService.java | 8 ++++++++ .../user/service/impl/SysUserOrgServiceImpl.java | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/SysUserOrgService.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/SysUserOrgService.java index a3d3ea7b1..ffc1a9344 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/SysUserOrgService.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/SysUserOrgService.java @@ -114,4 +114,12 @@ public interface SysUserOrgService extends IService, SysUserOrgServi */ void disableAllOrgStatus(Long userId); + /** + * 批量保存用户机构 + * + * @author fengshuonan + * @since 2024/2/12 23:31 + */ + void quickBatchSaveUserOrg(List batchUserOrg); + } \ No newline at end of file diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserOrgServiceImpl.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserOrgServiceImpl.java index 47f5e1d24..b62e2d6c9 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserOrgServiceImpl.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserOrgServiceImpl.java @@ -7,6 +7,8 @@ import cn.stylefeng.roses.kernel.db.api.DbOperatorApi; import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory; import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; +import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext; +import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum; import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum; import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException; @@ -139,6 +141,16 @@ public class SysUserOrgServiceImpl extends ServiceImpl batchUserOrg) { + if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) { + this.getBaseMapper().insertBatchSomeColumn(batchUserOrg); + } else { + this.saveBatch(batchUserOrg); + } + } + @Override public List findList(SysUserOrgRequest sysUserOrgRequest) { LambdaQueryWrapper wrapper = this.createWrapper(sysUserOrgRequest);