【8.1.1】【sys】更新批量保存用户机构

pull/60/head
fengshuonan 2024-02-12 23:32:35 +08:00
parent 993dcd4f2a
commit 8b00503b7f
2 changed files with 20 additions and 0 deletions

View File

@ -114,4 +114,12 @@ public interface SysUserOrgService extends IService<SysUserOrg>, SysUserOrgServi
*/
void disableAllOrgStatus(Long userId);
/**
*
*
* @author fengshuonan
* @since 2024/2/12 23:31
*/
void quickBatchSaveUserOrg(List<SysUserOrg> batchUserOrg);
}

View File

@ -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<SysUserOrgMapper, SysUser
this.update(updateWrapper);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void quickBatchSaveUserOrg(List<SysUserOrg> batchUserOrg) {
if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) {
this.getBaseMapper().insertBatchSomeColumn(batchUserOrg);
} else {
this.saveBatch(batchUserOrg);
}
}
@Override
public List<SysUserOrg> findList(SysUserOrgRequest sysUserOrgRequest) {
LambdaQueryWrapper<SysUserOrg> wrapper = this.createWrapper(sysUserOrgRequest);