|
@@ -8,28 +8,19 @@ import com.sckw.core.model.page.PageHelperUtil;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.utils.BeanUtils;
|
|
import com.sckw.core.utils.BeanUtils;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
|
-import com.sckw.core.utils.PasswordUtils;
|
|
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
-import com.sckw.core.web.context.LoginUserHolder;
|
|
|
|
|
import com.sckw.system.api.RemoteUserService;
|
|
import com.sckw.system.api.RemoteUserService;
|
|
|
import com.sckw.system.api.model.dto.req.*;
|
|
import com.sckw.system.api.model.dto.req.*;
|
|
|
import com.sckw.system.api.model.dto.res.*;
|
|
import com.sckw.system.api.model.dto.res.*;
|
|
|
-import com.sckw.system.dao.KwsEnterpriseDao;
|
|
|
|
|
-import com.sckw.system.dao.KwsUserLoginDao;
|
|
|
|
|
-import com.sckw.system.dao.SysAreaDao;
|
|
|
|
|
-import com.sckw.system.dao.SysDictDao;
|
|
|
|
|
|
|
+import com.sckw.system.dao.*;
|
|
|
import com.sckw.system.model.*;
|
|
import com.sckw.system.model.*;
|
|
|
import com.sckw.system.model.pojo.FindEntUserPojo;
|
|
import com.sckw.system.model.pojo.FindEntUserPojo;
|
|
|
import com.sckw.system.model.pojo.FindMenuTreePojo;
|
|
import com.sckw.system.model.pojo.FindMenuTreePojo;
|
|
|
import com.sckw.system.model.vo.req.FindListReqVo;
|
|
import com.sckw.system.model.vo.req.FindListReqVo;
|
|
|
-import com.sckw.system.model.vo.req.ForgetPasswordReqVo;
|
|
|
|
|
import com.sckw.system.model.vo.res.KwsMenuResVo;
|
|
import com.sckw.system.model.vo.res.KwsMenuResVo;
|
|
|
import com.sckw.system.model.vo.res.KwsUserResVo;
|
|
import com.sckw.system.model.vo.res.KwsUserResVo;
|
|
|
-import com.sckw.system.service.*;
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
|
-
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -46,20 +37,17 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
private RemoteBaseService remoteBaseService;
|
|
private RemoteBaseService remoteBaseService;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- private KwsUserService kwsUserService;
|
|
|
|
|
|
|
+ private KwsUserDao kwsUserDao;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- private KwsRoleService kwsRoleService;
|
|
|
|
|
|
|
+ private KwsUserRoleDao kwsUserRoleDao;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- private KwsMenuService kwsMenuService;
|
|
|
|
|
|
|
+ private KwsMenuDao kwsMenuDao;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private KwsUserLoginDao kwsUserLoginDao;
|
|
private KwsUserLoginDao kwsUserLoginDao;
|
|
|
|
|
|
|
|
- @Resource
|
|
|
|
|
- private KwsEnterpriseService kwsEnterpriseService;
|
|
|
|
|
-
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private KwsEnterpriseDao kwsEnterpriseDao;
|
|
private KwsEnterpriseDao kwsEnterpriseDao;
|
|
|
|
|
|
|
@@ -69,9 +57,6 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
@Resource
|
|
@Resource
|
|
|
private SysAreaDao sysAreaDao;
|
|
private SysAreaDao sysAreaDao;
|
|
|
|
|
|
|
|
- @Resource
|
|
|
|
|
- private CommonService commonService;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public KwsEnterpriseResDto queryEnterpriseById(Long id) {
|
|
public KwsEnterpriseResDto queryEnterpriseById(Long id) {
|
|
@@ -86,13 +71,13 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<UserAccessMenuInfoResDto> queryUserAccessMenu(long id) {
|
|
public List<UserAccessMenuInfoResDto> queryUserAccessMenu(long id) {
|
|
|
FindMenuTreePojo findMenuTreePojo = new FindMenuTreePojo();
|
|
FindMenuTreePojo findMenuTreePojo = new FindMenuTreePojo();
|
|
|
- List<KwsUserRole> kwsUserRoles = kwsRoleService.findAllByUserId(id);
|
|
|
|
|
|
|
+ List<KwsUserRole> kwsUserRoles = kwsUserRoleDao.findAllByUserId(id);
|
|
|
if (CollectionUtils.isEmpty(kwsUserRoles)) {
|
|
if (CollectionUtils.isEmpty(kwsUserRoles)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
findMenuTreePojo.setRoleIds(kwsUserRoles.stream().map(KwsUserRole::getRoleId).toList());
|
|
findMenuTreePojo.setRoleIds(kwsUserRoles.stream().map(KwsUserRole::getRoleId).toList());
|
|
|
|
|
|
|
|
- List<KwsMenuResVo> kwsMenuResVos = kwsMenuService.findList(findMenuTreePojo);
|
|
|
|
|
|
|
+ List<KwsMenuResVo> kwsMenuResVos = kwsMenuDao.findList(findMenuTreePojo);
|
|
|
if (CollectionUtils.isEmpty(kwsMenuResVos)) {
|
|
if (CollectionUtils.isEmpty(kwsMenuResVos)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
@@ -100,12 +85,6 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
return BeanUtils.copyToList(kwsMenuResVos, UserAccessMenuInfoResDto.class);
|
|
return BeanUtils.copyToList(kwsMenuResVos, UserAccessMenuInfoResDto.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void forgetPassword(ForgetPasswordReqDto reqDto) throws SystemException {
|
|
|
|
|
- com.sckw.system.model.vo.req.ForgetPasswordReqVo forgetPasswordReqVo = new ForgetPasswordReqVo();
|
|
|
|
|
- BeanUtils.copyProperties(reqDto, forgetPasswordReqVo);
|
|
|
|
|
- kwsUserService.forgetPassword(forgetPasswordReqVo);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void saveUserLogin(UserLoginReqDto userLoginReqDto) {
|
|
public void saveUserLogin(UserLoginReqDto userLoginReqDto) {
|
|
@@ -136,19 +115,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void updatePassword(UpdatePasswordReqDto updatePassword) {
|
|
|
|
|
- kwsUserService.updatePassword(updatePassword);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void resetPassword(Long id) {
|
|
|
|
|
- kwsUserService.resetPassword(id);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void bindManager(Long entId, Long userId) {
|
|
public void bindManager(Long entId, Long userId) {
|
|
|
- KwsEnterprise kwsEnterprise = kwsEnterpriseService.queryKwsEnterpriseById(entId);
|
|
|
|
|
|
|
+ KwsEnterprise kwsEnterprise = kwsEnterpriseDao.selectByKey(entId);
|
|
|
if (Objects.isNull(kwsEnterprise)) {
|
|
if (Objects.isNull(kwsEnterprise)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -168,11 +137,6 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
return sysDictResDtos.stream().collect(Collectors.toMap(SysDictResDto::getId, item -> item, (oldValue, newValue) -> newValue));
|
|
return sysDictResDtos.stream().collect(Collectors.toMap(SysDictResDto::getId, item -> item, (oldValue, newValue) -> newValue));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void checkRegisterParam(String entName, String phone, Integer systemType) {
|
|
|
|
|
- commonService.checkEntRepeat(entName, phone);
|
|
|
|
|
- kwsUserService.checkAccountValid(phone, systemType);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<EntTypeResDto> queryEntTypeById(Long entId) {
|
|
public List<EntTypeResDto> queryEntTypeById(Long entId) {
|
|
@@ -234,11 +198,12 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
public List<FindEntUserResDto> findEntUser(Long entId) {
|
|
public List<FindEntUserResDto> findEntUser(Long entId) {
|
|
|
FindListReqVo findListReqVo = new FindListReqVo();
|
|
FindListReqVo findListReqVo = new FindListReqVo();
|
|
|
findListReqVo.setId(entId);
|
|
findListReqVo.setId(entId);
|
|
|
- List<FindEntUserPojo> entUser = kwsEnterpriseService.findEntUser(findListReqVo);
|
|
|
|
|
- if(CollectionUtils.isEmpty(entUser)) {
|
|
|
|
|
|
|
+ List<FindEntUserPojo> list = kwsEnterpriseDao.findUserByEntIds(Collections.singletonList(entId));
|
|
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
- return BeanUtils.copyToList(entUser,FindEntUserResDto.class);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return BeanUtils.copyToList(list, FindEntUserResDto.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -266,10 +231,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
**/
|
|
**/
|
|
|
@Override
|
|
@Override
|
|
|
public List<Long> findEntIds(List<Integer> entTypes, String firmName) {
|
|
public List<Long> findEntIds(List<Integer> entTypes, String firmName) {
|
|
|
- Map<String, Object> params = new HashMap<>(Global.NUMERICAL_SIXTEEN){{
|
|
|
|
|
- put("entTypes", entTypes);
|
|
|
|
|
- put("firmName", firmName);
|
|
|
|
|
- }};
|
|
|
|
|
|
|
+ Map<String, Object> params = new HashMap<>(Global.NUMERICAL_FOUR);
|
|
|
|
|
+ params.put("entTypes", entTypes);
|
|
|
|
|
+ params.put("firmName", firmName);
|
|
|
List<KwsEnterprise> ents = remoteBaseService.findEnts(params);
|
|
List<KwsEnterprise> ents = remoteBaseService.findEnts(params);
|
|
|
List<Long> endIds = new ArrayList<>();
|
|
List<Long> endIds = new ArrayList<>();
|
|
|
ents.forEach(ent -> endIds.add(ent.getId()));
|
|
ents.forEach(ent -> endIds.add(ent.getId()));
|
|
@@ -285,11 +249,10 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
**/
|
|
**/
|
|
|
@Override
|
|
@Override
|
|
|
public List<Long> findUserIds(List<Long> entIds, String userName) {
|
|
public List<Long> findUserIds(List<Long> entIds, String userName) {
|
|
|
- Map<String, Object> params = new HashMap<>(Global.NUMERICAL_SIXTEEN){{
|
|
|
|
|
- put("entIds", entIds);
|
|
|
|
|
- put("userName", userName);
|
|
|
|
|
- }};
|
|
|
|
|
- List<KwsUserResVo> users = kwsUserService.findList(params);
|
|
|
|
|
|
|
+ Map<String, Object> params = new HashMap<>(Global.NUMERICAL_FOUR);
|
|
|
|
|
+ params.put("entIds", entIds);
|
|
|
|
|
+ params.put("userName", userName);
|
|
|
|
|
+ List<KwsUserResVo> users = kwsUserDao.findList(params);
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
users.forEach(user -> userIds.add(user.getId()));
|
|
users.forEach(user -> userIds.add(user.getId()));
|
|
|
return userIds;
|
|
return userIds;
|
|
@@ -299,7 +262,6 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
/**
|
|
/**
|
|
|
* 根据用户名查用户信息
|
|
* 根据用户名查用户信息
|
|
|
* @param username 用户账号
|
|
* @param username 用户账号
|
|
|
- * @return
|
|
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public KwsUserResDto getUserByAccount(String username) {
|
|
public KwsUserResDto getUserByAccount(String username) {
|
|
@@ -327,22 +289,5 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|
|
return remoteBaseService.queryDeptByIds(ids);
|
|
return remoteBaseService.queryDeptByIds(ids);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void register(RegisterReqDto reqDto) throws SystemException {
|
|
|
|
|
- kwsUserService.register(reqDto);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void checkPassword(String password, String currentPwd) throws SystemException {
|
|
|
|
|
- kwsUserService.checkPassword(password, currentPwd);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public List<KwsUserResDto> checkUserBase(String account, int systemType) throws SystemException {
|
|
|
|
|
- KwsUser kwsUser = kwsUserService.checkUserBase(account, systemType);
|
|
|
|
|
- KwsUserResDto kwsUserService = new KwsUserResDto();
|
|
|
|
|
- BeanUtils.copyProperties(kwsUser, kwsUserService);
|
|
|
|
|
- return Collections.singletonList(kwsUserService);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|