| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | //获取当前登录人 |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | //监管用户,直接查询组织下所有库区 |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | } |
| | | if (Constant.USER_TYPE_20.equals(user.getUserType())) { |
| | | //银行用户,根据合同查询银行下所有库区 |
| | | return this.getDeptByBank(user.getUserData()); |
| | | } |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | //库区用户 |
| | | String deptId = user.getDeptId() + ""; |
| | | if(ContextUtil.isDepotUser(deptId)){ |
| | | //查询用户所属库区 |
| | | return this.listDept(deptId,null,null); |
| | | }else { |
| | | //查询用户所属公司下所有库区 |
| | | return this.listDept(null,null, deptId); |
| | | } |
| | | } |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | if(null != user){ |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | //监管用户,直接查询组织下所有库区 |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | } |
| | | if (Constant.USER_TYPE_20.equals(user.getUserType())) { |
| | | //银行用户,根据合同查询银行下所有库区 |
| | | return this.getDeptByBank(user.getUserData()); |
| | | } |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | //库区用户 |
| | | String deptId = user.getDeptId() + ""; |
| | | if(ContextUtil.isDepotUser(deptId)){ |
| | | //查询用户所属库区 |
| | | return this.listDept(deptId,null,null); |
| | | }else { |
| | | //查询用户所属公司下所有库区 |
| | | return this.listDept(null,null, deptId); |
| | | } |
| | | } |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | |
| | | } |
| | | return this.listDept(null,ContextUtil.getCompanyId(),null); |
| | | |
| | | } |
| | | |
| | | |