fix: 修复循环依赖问题

pull/20/head
Parker 3 years ago
parent c5b5e0fc9c
commit f9131f1d69

@ -37,6 +37,7 @@ import org.opsli.modulars.system.dict.mapper.DictDetailMapper;
import org.opsli.modulars.system.dict.service.IDictDetailService;
import org.opsli.modulars.system.dict.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -54,6 +55,8 @@ public class DictDetailServiceImpl extends CrudServiceImpl<DictDetailMapper, Sys
@Autowired(required = false)
private DictDetailMapper mapper;
@Lazy
@Autowired
private IDictService iDictService;

@ -31,6 +31,7 @@ import org.opsli.modulars.system.role.mapper.RoleMenuRefMapper;
import org.opsli.modulars.system.role.service.IRoleMenuRefService;
import org.opsli.modulars.system.user.service.IUserRoleRefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -48,6 +49,8 @@ public class RoleMenuRefServiceImpl extends ServiceImpl<RoleMenuRefMapper,SysRol
@Autowired(required = false)
private RoleMenuRefMapper mapper;
@Lazy
@Autowired
private IUserRoleRefService iUserRoleRefService;

@ -45,6 +45,7 @@ import org.opsli.modulars.system.user.mapper.UserOrgRefMapper;
import org.opsli.modulars.system.user.service.IUserOrgRefService;
import org.opsli.modulars.system.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -72,8 +73,11 @@ public class UserOrgRefServiceImpl extends ServiceImpl<UserOrgRefMapper, SysUser
@Autowired(required = false)
private UserOrgRefMapper mapper;
@Lazy
@Autowired
private IUserService iUserService;
@Lazy
@Autowired
private ISysOrgService iSysOrgService;

@ -60,18 +60,20 @@ import java.util.List;
* @date 2020-09-16 17:33
*/
@Service
@Lazy
public class UserRoleRefServiceImpl extends ServiceImpl<UserRoleRefMapper, SysUserRoleRef> implements IUserRoleRefService {
@Autowired(required = false)
private UserRoleRefMapper mapper;
@Lazy
@Autowired
private IRoleService iRoleService;
@Lazy
@Autowired
private IUserService iUserService;
@Lazy
@Autowired
private IMenuService iMenuService;

@ -17,12 +17,10 @@ package org.opsli.modulars.system.user.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
@ -46,7 +44,6 @@ import org.opsli.core.utils.OptionsUtil;
import org.opsli.core.utils.UserUtil;
import org.opsli.core.utils.VerificationCodeUtil;
import org.opsli.modulars.system.SystemMsg;
import org.opsli.modulars.system.menu.service.IMenuService;
import org.opsli.modulars.system.role.entity.SysRole;
import org.opsli.modulars.system.role.service.IRoleService;
import org.opsli.modulars.system.user.entity.SysUser;
@ -55,7 +52,7 @@ import org.opsli.modulars.system.user.mapper.UserMapper;
import org.opsli.modulars.system.user.service.IUserRoleRefService;
import org.opsli.modulars.system.user.service.IUserService;
import org.opsli.plugins.security.utils.PasswordUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -72,6 +69,7 @@ import java.util.List;
* @date 2020-09-16 17:33
*/
@AllArgsConstructor
@Lazy
@Service
public class UserServiceImpl extends CrudServiceImpl<UserMapper, SysUser, UserModel> implements IUserService {

Loading…
Cancel
Save