| | |
| | | end_time = DateTimeUtil.searchStrToTimestamp(endTime); |
| | | } |
| | | |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | |
| | | |
| | | |
| | | List<Integer> ids = new ArrayList<>(); |
| | | if(null != agentId){ |
| | | if(null != searchId){ |
| | | ids = getSubordinates(searchId); |
| | | ids.add(agentId); |
| | | ids.add(searchId); |
| | | } |
| | | |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, |
| | | userId, ids, positionSn, begin_time, end_time,null); |
| | | |
| | |
| | | List<AdminPositionVO> adminPositionVOS = Lists.newArrayList(); |
| | | for (UserPosition position : userPositions) { |
| | | AdminPositionVO adminPositionVO = assembleAdminPositionVO(position); |
| | | AgentUser agentUser = agentUserMapper.selectById(adminPositionVO.getAgentId()); |
| | | adminPositionVO.setAgentName(agentUser.getAgentName()); |
| | | User user = userMapper.selectById(adminPositionVO.getUserId()); |
| | | adminPositionVO.setPhone(user.getPhone()); |
| | | adminPositionVOS.add(adminPositionVO); |
| | | } |
| | | PageInfo pageInfo = new PageInfo(userPositions); |
| | |
| | | |
| | | private AgentPositionVO assembleAgentPositionVO(UserPosition position) { |
| | | AgentPositionVO agentPositionVO = new AgentPositionVO(); |
| | | |
| | | User user = userMapper.selectById(position.getUserId()); |
| | | if(null != user){ |
| | | AgentUser agentUser = agentUserMapper.selectById(user.getAgentId()); |
| | | agentPositionVO.setPhone(user.getPhone()); |
| | | if(null != agentUser){ |
| | | agentPositionVO.setAgentName(agentUser.getAgentName()); |
| | | } |
| | | } |
| | | agentPositionVO.setId(position.getId()); |
| | | agentPositionVO.setPositionSn(position.getPositionSn()); |
| | | agentPositionVO.setPositionType(position.getPositionType()); |