| | |
| | | end_time = DateTimeUtil.searchStrToTimestamp(endTime); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | List<Integer> ids = new ArrayList<>(); |
| | | if(null != searchId){ |
| | | ids = getSubordinates(searchId); |
| | | ids.add(searchId); |
| | | } |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, |
| | | userId, searchId, positionSn, begin_time, end_time,null); |
| | | userId, ids, positionSn, begin_time, end_time,null); |
| | | |
| | | List<AgentPositionVO> agentPositionVOS = Lists.newArrayList(); |
| | | for (UserPosition position : userPositions) { |
| | |
| | | } |
| | | |
| | | |
| | | List<Integer> ids = new ArrayList<>(); |
| | | if(null != agentId){ |
| | | ids = getSubordinates(agentId); |
| | | ids.add(agentId); |
| | | } |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, Integer.valueOf(1), |
| | | null, agentId, null, begin_time, end_time,null); |
| | | null, ids, null, begin_time, end_time,null); |
| | | |
| | | |
| | | BigDecimal order_fee_amt = new BigDecimal("0"); |
| | |
| | | if (StringUtils.isNotBlank(endTime)) { |
| | | end_time = DateTimeUtil.searchStrToTimestamp(endTime); |
| | | } |
| | | List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, userId, agentId, positionSn, begin_time, end_time,phone); |
| | | List<Integer> ids = new ArrayList<>(); |
| | | if(null != agentId){ |
| | | ids = getSubordinates(agentId); |
| | | ids.add(agentId); |
| | | } |
| | | |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.listByAgent(positionType, state, userId, ids, positionSn, begin_time, end_time,phone); |
| | | 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); |
| | | pageInfo.setList(adminPositionVOS); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } |
| | | |
| | | public List<Integer> getSubordinates(Integer id) { |
| | | List<AgentUser> agentUsers = agentUserMapper.selectList(new LambdaQueryWrapper<AgentUser>()); |
| | | List<Integer> subordinates = new ArrayList<>(); |
| | | for (AgentUser user : agentUsers) { |
| | | if (id.equals(user.getParentId())) { |
| | | subordinates.add(user.getId()); |
| | | subordinates.addAll(getSubordinates(user.getId())); |
| | | } |
| | | } |
| | | return subordinates; |
| | | } |
| | | |
| | | public int CountPositionNum(Integer state, Integer accountType) { |
| | |
| | | |
| | | 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()); |