> For the complete documentation index, see [llms.txt](https://polyv.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyv.gitbook.io/document/docs/live/java/group/service.md).

# Service

## 描述

```
集团账号查询主账号账单
接口地址（仅做说明使用）：https://api.polyv.net/live/v4/group/account/billing-daily/list
```

## 调用约束

1、接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/limit.md)，调用常见异常，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/exceptionDoc/README.md)

## 单元测试

```java
	@Test
	public void testListBilling() throws IOException, NoSuchAlgorithmException {
        GroupListBillingRequest groupListBillingRequest = new GroupListBillingRequest();
        GroupListBillingResponse groupListBillingResponse;
        try {
            groupListBillingRequest.setBillingDate(super.getDate(2023, 05, 01));
            groupListBillingResponse = new GroupServiceImpl().listBilling(groupListBillingRequest);
            Assert.assertNotNull(groupListBillingResponse);
            if (groupListBillingResponse != null) {
                //to do something ......
                log.debug("测试查询主账号账单统计成功 {}", JSON.toJSONString(groupListBillingResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误，错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑，记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
```

## 单元测试说明

1、请求正确，返回GroupListBillingResponse对象，B端依据此对象处理业务逻辑；

2、请求参数校验不合格，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 输入参数 \[xxx.chat.LivexxxRequest]对象校验失败，失败字段 \[pic不能为空 / msg不能为空] ]

3、服务器处理异常，抛出PloyvSdkException，错误信息见PloyvSdkException.getMessage()，如 \[ 保利威请求返回数据错误，请求流水号：66e7ad29fd04425a84c2b2b562d2025b，错误原因： invalid signature. ]

## 请求入参描述

| 参数名         | 必选    | 类型      | 说明                                 |
| ----------- | ----- | ------- | ---------------------------------- |
| billingDate | true  | Date    | 账期，格式yyyyMM，比如202205，时间需要在202204以后 |
| pageSize    | false | Integer | 每页数据大小，默认10，最大值1000                |
| pageNumber  | false | Integer | 当前的页数，默认1                          |

## 返回对象描述

| 参数名         | 类型      | 说明                                                                                                                                                           |
| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| contents    | Array   | 账单信息列表【详见[BillingInfo参数描述](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/group/service.md?id=p9b713575c5603b6f701e1ff6e9b74a20)】 |
| pageSize    | Integer | 每页显示的数据条数，默认每页显示20条数据                                                                                                                                        |
| currentPage | Integer | 当前页【对应api文档的**pageNumber**字段】                                                                                                                                |
| totalItems  | Integer | 记录总条数                                                                                                                                                        |
| totalPage   | Integer | 总页数【对应api文档的**totalPages**字段】                                                                                                                                |

[**BillingInfo参数描述**](#/service.md?id=p9b713575c5603b6f701e1ff6e9b74a20)

| 参数名              | 类型      | 说明                                             |
| ---------------- | ------- | ---------------------------------------------- |
| unionId          | String  | 集团主帐号ID                                        |
| accountPeriod    | String  | 账期                                             |
| production       | String  | 产品 云直播/云点播                                     |
| category         | String  | 用量类型 云直播：观看分钟数/连麦分钟数/无延迟分钟数/导播时长 云点播：视频播放/存储空间 |
| itemConsumed     | Float   | 用量                                             |
| itemConsumedUnit | String  | 用量单位                                           |
| statAt           | Date    | 结算日期，天，格式为yyyy-MM-dd                           |
| tradeType        | Integer | 交易类型 1：用量结算 2：金额结算 3：补扣调账 4：退费调账               |

<br>
