diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/mapper/HrOrganizationMapper.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/mapper/HrOrganizationMapper.java index a3bccd9db..9a0212b08 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/mapper/HrOrganizationMapper.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/mapper/HrOrganizationMapper.java @@ -1,7 +1,7 @@ package cn.stylefeng.roses.kernel.sys.modular.org.mapper; +import cn.stylefeng.roses.kernel.db.mp.injector.CustomBaseMapper; import cn.stylefeng.roses.kernel.sys.modular.org.entity.HrOrganization; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 组织机构信息 Mapper 接口 @@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author fengshuonan * @date 2023/06/10 21:23 */ -public interface HrOrganizationMapper extends BaseMapper { +public interface HrOrganizationMapper extends CustomBaseMapper { } \ No newline at end of file diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java index b2505eeec..582383e30 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/HrOrganizationService.java @@ -153,4 +153,12 @@ public interface HrOrganizationService extends IService, Organiz */ List getOrgListName(HrOrganizationRequest hrOrganizationRequest); + /** + * 批量保存组织机构 + * + * @author fengshuonan + * @since 2024-02-19 8:42 + */ + void quickBatchSaveOrg(List batchOrgList); + } \ No newline at end of file diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java index c1ef0fb3a..61b2db653 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/org/service/impl/HrOrganizationServiceImpl.java @@ -13,9 +13,11 @@ 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.entity.BaseEntity; import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; +import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext; import cn.stylefeng.roses.kernel.event.sdk.publish.BusinessEventPublisher; import cn.stylefeng.roses.kernel.log.api.util.BusinessLogUtil; import cn.stylefeng.roses.kernel.rule.constants.TreeConstants; +import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum; import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException; import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict; @@ -536,6 +538,15 @@ public class HrOrganizationServiceImpl extends ServiceImpl batchOrgList) { + if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) { + this.getBaseMapper().insertBatchSomeColumn(batchOrgList); + } else { + this.saveBatch(batchOrgList); + } + } + @Override public String getOrgNameById(Long orgId) {