Commit 3d371dc8 by duanhq

优化资源匹配 by duanht 2019/3/29

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@19092 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a86fe825
...@@ -574,17 +574,17 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -574,17 +574,17 @@ public class SysUserServiceImpl implements SysUserService {
sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), userQueryVo.getOrgId()); sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), userQueryVo.getOrgId());
} else { } else {
//获取根目录下的服务商 //获取根目录下的服务商
sysUserList = getServiceListByGroupId(userQueryVo); sysUserList = sysUserMapper.getUserByIdAndName(userQueryVo);
//list复制 //list复制
copyBeanProperties(sysUserList, sysOrganizationList); copyBeanProperties(sysUserList, sysOrganizationList);
} }
} else { } else {
//搜索模式(获取符合条件的服务商组织以及下面的服务商,不符合的删除) //搜索模式(获取符合条件的服务商组织以及下面的服务商)
sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), 0); sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), 0);
List<SysOrganization> removeOrg = new ArrayList<>(); List<SysOrganization> removeOrg = new ArrayList<>();
for (SysOrganization sysOrganization : sysOrganizationList) { for (SysOrganization sysOrganization : sysOrganizationList) {
userQueryVo.setOrgId(sysOrganization.getId()); userQueryVo.setOrgId(sysOrganization.getId());
sysUserList = getServiceListByGroupId(userQueryVo); sysUserList = sysUserMapper.getUserByIdAndName(userQueryVo);
sysOrganization.setSysUserList(sysUserList); sysOrganization.setSysUserList(sysUserList);
} }
//删除无服务商的组织 //删除无服务商的组织
...@@ -635,22 +635,6 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -635,22 +635,6 @@ public class SysUserServiceImpl implements SysUserService {
} }
} }
private List<SysUser> getServiceListByGroupId(UserQueryVo userQueryVo) {
//获取当前用户下所有的服务商
List<SysUser> sysUserList = sysUserMapper.getUserByIdAndName(userQueryVo);
List<SysUser> removeUserList = new ArrayList<>();
for (SysUser sysUser : sysUserList) {
//根据商户组织id查询出集团
Integer groupIds = iSysOrganizationService.getGroupIdByOrgId(sysUser.getOrgId());
if (!groupIds.equals(userQueryVo.getOrgId())) {
removeUserList.add(sysUser);
}
}
sysUserList.removeAll(removeUserList);
return sysUserList;
}
@Override @Override
public SysUser getUserById(Integer id) { public SysUser getUserById(Integer id) {
return sysUserMapper.selectByPrimaryKey(id); return sysUserMapper.selectByPrimaryKey(id);
......
...@@ -1031,6 +1031,7 @@ ...@@ -1031,6 +1031,7 @@
LEFT JOIN sys_organization so ON uo.org_id = so.id LEFT JOIN sys_organization so ON uo.org_id = so.id
WHERE u.user_type = 1 WHERE u.user_type = 1
and u.user_status='sys_user_status_normal' and u.user_status='sys_user_status_normal'
and u.group_id = #{orgId,jdbcType=INTEGER}
<if test="id != 0 and id!=''"> <if test="id != 0 and id!=''">
AND uo.user_id = #{id,jdbcType=INTEGER} AND uo.user_id = #{id,jdbcType=INTEGER}
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!