Commit 0d12d710 by zhengxj

finish 只返回当前用户相关组织 on 20190318 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18597 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a9e6fa22
...@@ -9,6 +9,7 @@ import java.util.HashMap; ...@@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,10 +43,9 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{ ...@@ -42,10 +43,9 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{
@Autowired @Autowired
private SysUserOrgMapper sysUserOrgDao; private SysUserOrgMapper sysUserOrgDao;
public org.slf4j.Logger logger = LoggerFactory.getLogger(SysOrganizationServiceImpl.class);
/**
* SysOrganization selectDetailById(Integer id);
*/
@Override @Override
public long countByExample(SysOrganizationExample example) { public long countByExample(SysOrganizationExample example) {
...@@ -153,10 +153,13 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{ ...@@ -153,10 +153,13 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService{
List<Integer> ids=new ArrayList<>(); List<Integer> ids=new ArrayList<>();
if (Constants.USER_TYPE_MANAGER != sysUser.getUserType()) { if (Constants.USER_TYPE_MANAGER != sysUser.getUserType()) {
ids=orgDao.selectOrgByUserId(sysUser.getId()); ids = orgDao.selectOrgByUserId(sysUser.getId());
if(ids.size()>0){ if (ids.size() == 0) {
criteria.andIdIn(ids); logger.info("当前用户未指定组织,userId:"+sysUser.getId());
return null;
} }
criteria.andIdIn(ids);
} }
// TODO 查询当前用户的 // TODO 查询当前用户的
List<SysOrganization> resultList = orgDao.selectByExample(example); List<SysOrganization> resultList = orgDao.selectByExample(example);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!