1
zj
2024-08-19 2bb6d396b9e9a8d58ba47504591b71e48d6d6bfb
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -686,8 +686,14 @@
        PageHelper.startPage(pageNum, pageSize);
        List<Integer> ids = new ArrayList<>();
        if(null != agentId){
            ids = getSubordinates(searchId);
            ids.add(agentId);
        }
        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) {
@@ -716,8 +722,14 @@
        }
        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");
@@ -749,7 +761,14 @@
        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);
@@ -760,6 +779,18 @@
        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) {
        return this.userPositionMapper.CountPositionNum(state, accountType);
    }