
# 查询检查单模板及KCP（API名称：openTask/queryKcpModeByTemplateId）
#### 功能介绍
查询检查单模板及KCP。
#### 相关接口
| **接口名称**                                                             | **调用说明**                                                     |
|:---|:---|
| [获取Token](https://support.huaweicloud.com/api-isdp/api_01_0019.html) | 调用该接口获取到Token，再调用其他接口时，需要在请求消息头中添加"Authorization"，其值即为Token。 |
   
#### URL
| **请求方式** | **HTTPS地址**                                                        | **服务架构** | **消息体类型**        |
|:---|:---|:---|:---|
| POST     | https://***isdp+域名***/openapi/v1/openTask/queryKcpModeByTemplateId | OpenAPI  | application/json |
   
#### 请求头
| **KEY**       | **VALUE**              | **是否必填** | **描述**                                                                                           |
|:---|:---|:---|:---|
| Content-Type  | application/json       | 是        | 无                                                                                                |
| Authorization | bearer ${access_token} | 是        | bearer +" "+[5.2.1](https://support.huaweicloud.com/api-isdp/api_01_0019.html)中获取的access_token的值 |
   
#### 请求参数
| **参数**     | **类型** | **是否必填** | **描述** |
|:---|:---|:---|:---|
| templateId | Long   | 是        | 模板ID   |
   
#### 响应参数
| **参数**       | **类型** | **描述**                                                                                                                                                                                                          |
|:---|:---|:---|
| stateCode    | String | 响应状态码： - 0-成功  - 其他-失败   |
| errorMessage | String | 响应描述                                                                                                                                                                                                            |
| result       | Object | 响应结果内容data、分页数据                                                                                                                                                                                                 |
   
result出参：
| **参数**        | **类型**        | **描述** |
|:---|:---|:---|
| kcpList       | List          | 输出项    |
| templateModel | TemplateModel | 模板     |
   
kcpList：
| **参数**           | **类型**    | **描述**     |
|:---|:---|:---|
| templateId       | Long      | 模板ID       |
| name             | String    | KCP名称      |
| lastUpdatedBy    | Long      | 更新人        |
| lastUpdateDate   | TimeStamp | 最后更新时间     |
| kcpIndex         | Integer   | KCP索引值     |
| kcpId            | Long      | kcp ID     |
| entityName       | String    | 实体名称       |
| demoVideoId      | String    | 样例视频ID     |
| deleteFlag       | Integer   | 有效标识       |
| creationDate     | TimeStamp | 创建时间       |
| createdBy        | Long      | 创建人        |
| children         | List      | KCP关联的item |
| appName          | String    | 应用名称       |
| kcpDemoVideoList | List      | 视频样例       |
   
children:
| **参数**                        | **类型**                                      | **描述**                        |
|:---|:---|:---|
| allowedNa                     | Integer                                     | 采集设置：是否允许NA(1: 是; 0: 否)       |
| appName                       | String  | 应用名称                          |
| collectNa                     | Integer                                     | 是否采集NA                        |
| createdBy                     | Long                                        | 创建人                           |
| creationDate                  | TimeStamp                                   | 创建时间                          |
| deleteFlag                    | Integer                                     | 有效标识                          |
| entityName                    | String                                      | 实体名称                          |
| handlerNameInspection         | String                                      | 问题处理人名字(自检)                   |
| handlerNameQualityInspection  | String                                      | 问题处理人名字(质检)                   |
| identificationType            | String                                      | 识别方式(1: 人员识别; 2: 扫码识别)        |
| intelligentReviewRules        | String                                      | 智能评审规则(1:规则1; 2:规则2)          |
| isExemption                   | Integer                                     | 评审设置：是否免审（1: 是; 0: 否）         |
| issueHandlerInspection        | String                                      | 问题处理人(自检)                     |
| issueHandlerQualityInspection | String                                      | 问题处理人(质检)                     |
| issueTypeInspection           | String                                      | 问题类别(自检)                      |
| issueTypeQualityInspection    | String                                      | 问题类别(质检)                      |
| itemCode                      | String                                      | 条目编码                          |
| itemId                        | Long                                        | item ID                       |
| itemIndex                     | Integer                                     | ITEM下标                        |
| itemType                      | Integer                                     | 条目类型（1：临时检查项；0：非临时检查项；2：标准条目） |
| kcpId                         | Long                                        | KcpID                         |
| kcpIndex                      | Integer                                     | Kcp下标                         |
| kcpName                       | String                                      | Kcp名称                         |
| lastUpdateDate                | TimeStamp                                   | 更新时间                          |
| lastUpdatedBy                 | Long                                        | 更新人                           |
| name                          | String                                      | 条目名称                          |
| objectIndustryTypeId          | String                                      | 质检,巡检行业分类组合，多个用";"分隔          |
| objectIndustryTypeIdText      | String                                      | 质检,巡检行业分类，多个用";"分隔            |
| operationGuide                | String                                      | 作业指导                          |
| qualificationType             | Integer                                     | 资质类别(1:按资质; 2:按资质+数量)         |
| qualityStandard               | String                                      | 质量标准                          |
| rejectionReason               | String                                      | 驳回原因                          |
| sceneTypeName                 | String                                      | 作业场景名称                        |
| severity                      | Integer                                     | 问题严重级别                        |
| templateId                    | Long                                        | 模板ID                          |
| tenantId                      | Long                                        | 租户ID                          |
| outputList                    | List                                        | 输出项列表                         |
   
outputList：
| **参数**                 | **类型**  | **描述**                                          |
|:---|:---|:---|
| appName                | String  | 应用名称                                            |
| audioIdentifyInfo      | String  | 目标识别信息                                          |
| collectScene           | Integer | 采集场景(0-普通 1-设计值智能比对)                            |
| compressionRatio       | Double  | 图片压缩比                                           |
| coordinateValue        | String  | 坐标值                                             |
| createdBy              | Long    | 创建人                                             |
| creationDate           | Date    | 创建时间                                            |
| defaultValue           | String  | 默认值                                             |
| deleteFlag             | Integer | 有效性标识                                           |
| demoPictureId          | String  | 样例图                                             |
| designValue            | String  | 设计值                                             |
| designValueOrder       | String  | 设计值顺序                                           |
| deviationValue         | String  | 允差值                                             |
| entityName             | String  | 实体名称                                            |
| enumValue              | String  | 枚举值                                             |
| intelligentAnalysisUrl | String  | 智能分析URL                                         |
| intelligentObject      | String  | 智能对象                                            |
| isAudioIdentify        | Integer | 是否语音识别                                          |
| isCascading            | Integer | 是否启用级联输出项 1是                                    |
| isNecessary            | Integer | 是否必填                                            |
| itemId                 | Long    | 条目Id                                            |
| itemType               | Integer | item类型（1：临时检查项；0：非临时检查项）                        |
| lastUpdateDate         | Date    | 最近更新时间                                          |
| lastUpdatedBy          | Long    | 最近更新人                                           |
| maxValue               | String  | 最大值                                             |
| measurementOrder       | Integer | (默认值：0;父输出项：-1;天资测量：1:下倾角；2：方位角；3：挂高；4：图片；5：备注) |
| minValue               | String  | 最小值                                             |
| outputCode             | String  | 输出项编码                                           |
| outputId               | Long    | 级联输出项ID                                         |
| outputIndex            | Integer | 输出项索引                                           |
| outputName             | String  | 输出项名称                                           |
| outputType             | Integer | 输出项类型                                           |
| parentEnum             | String  | 父级输出项枚举                                         |
| parentEnumName         | String  | 父级输出项枚举名称                                       |
| scoreIndex             | String  | 评分输出项下标                                         |
| templateId             | Long    | 模板ID                                            |
| txactValue             | String  | 精确值                                             |
| udf1                   | String  | 扩展字段1                                           |
   
kcpDemoVideoList：
| **参数**             | **类型**    | **描述**              |
|:---|:---|:---|
| appName            | String    | 应用名称                |
| createdBy          | Long      | 创建人                 |
| createName         | String    | 创建人名字               |
| creationDate       | TimeStamp | 创建时间                |
| entityName         | String    | 实体名称                |
| id                 | Long      | 主键ID                |
| isExample          | String    | 是否是样例(1 样例 0或空 非样例) |
| kcpId              | Long      | KcpID               |
| lastUpdateDate     | TimeStamp | 更新时间                |
| lastUpdatedBy      | Long      | 更新人                 |
| lastUpdateName     | String    | 更新人名字               |
| projectCode        | String    | 项目编码                |
| Status             | Integer   | 状态（0 正常 1删除）        |
| templateId         | Long      | 模板Id                |
| tenantId           | Long      | 租户ID                |
| thumbnailsId       | String    | 缩略图ID               |
| Valid              | String    | 视频有效标识(Y,N)         |
| videoId            | String    | 视频Id                |
| videoName          | String    | 视频名称                |
| videoTime          | String    | 音视频时间               |
| videoWatermarkInfo | String    | 水印视频信息              |
| videoWaterMarkKey  | String    | 水印视频信息Key           |
| vidPassMk          | String    | 视频通过标示              |
   
templateModel：
| **参数**                  | **类型**    | **描述**                           |
|:---|:---|:---|
| adminOrganizationCode   | String    | 行政组织编码                           |
| adminOrganizationName   | String    | 行政组织名称                           |
| appName                 | String    | 应用名称                             |
| createdBy               | Long      | 创建人                              |
| createName              | String    | 创建人名称                            |
| creationDate            | Date      | 创建时间                             |
| creationTimestamp       | TimeStamp | 创建时间戳                            |
| dataSource              | String    | 标识数据来源                           |
| deleteFlag              | Integer   | 有效标识                             |
| deliveryScene           | String    | 交付场景                             |
| enabledReferenceValue   | Integer   | 是否开启参考值                          |
| entityName              | String    | 实体名称                             |
| indoor                  | String    | 室内                               |
| isCommandTemplate       | Integer   | 是否指令式采集模板                        |
| isDefaultTemplate       | Integer   | 是否为默认模板                          |
| isDesignItem            | Integer   | 是否按设计生成检查项(0-否 1-是)              |
| isManualReviewAutoPass  | Integer   | AI评审通过则条目的人工评审自动通过（0：否；1：是）      |
| isNewVersion            | String    | 最新版本标示                           |
| isPercentage            | Integer   | 是否百分制 (0 百分制，1非百分制)              |
| isScores                | Integer   | 是否得分制 (0 得分制，1扣分制)               |
| isSupportRating         | Integer   | 是否支持评分                           |
| isVideoAcceptance       | Integer   | 是否视频审核。1：是；0：否                   |
| lastUpdateDate          | Date      | 最近更新时间                           |
| lastUpdatedBy           | Long      | 最近更新人                            |
| lastUpdateName          | String    | 最近更新人名称                          |
| lastUpdateTimestamp     | TimeStamp | 最近更新时间戳                          |
| locationType            | String    | 设置位置类型                           |
| originalTemplateId      | Long      | 原始模板ID                           |
| otherRecognitionObjects | String    | 其他识别对象(非智能识别对象)                  |
| outdoor                 | String    | 室外                               |
| personQualification     | String    | 资质选择                             |
| ppeEquipsObject         | String    | PPE及装备对象选择                       |
| productForm             | String    | 产品形态                             |
| productType             | String    | 产品类别                             |
| projectCode             | String    | 项目编码                             |
| remarks                 | String    | 备注                               |
| serviceType             | String    | 业务类型                             |
| status                  | Integer   | 模板状态                             |
| templateChildType       | Integer   | 模板子类型 1表示质检； 2表示巡检； 3表示作业； 4表示许可 |
| templateCode            | String    | 模板编码                             |
| templateId              | Long      | 模板Id                             |
| templateName            | String    | 模板名称                             |
| templateParam           | String    | 模板结构数据                           |
| tenantId                | Long      | 租户ID                             |
| type                    | String    | 交付场景                             |
| validRequired           | Integer   | 必填项全采后才能提交评审                     |
| version                 | String    | 版本号                              |
   
#### 请求示例
```
{
    "templateId": 316491
}
```
#### 响应示例
```
{
    "stateCode": "0",
    "errorMessage": null,
    "result": {
        "templateModel": {
            "adminOrganizationCode": "830",
            "adminOrganizationName": "杨凌作业系统测试",
            "appName": "isdp-qc-server",
            "createdBy": 930218,
            "createName": "汤文祥",
            "creationDate": "2024-01-18T07:39:53.000+00:00",
            "creationTimestamp": 1705563593787,
            "dataSource": null,
            "deleteFlag": 0,
            "deliveryScene": "",
            "enabledReferenceValue": 0,
            "entityName": "QcTemplate",
            "indoor": null,
            "isCommandTemplate": 0,
            "isDefaultTemplate": 1,
            "isDesignItem": 0,
            "isManualReviewAutoPass": 1,
            "isNewVersion": "Y",
            "isPercentage": 0,
            "isScores": 0,
            "isSupportRating": 0,
            "isVideoAcceptance": 0,
            "lastUpdateDate": "2024-01-18T07:40:31.000+00:00",
            "lastUpdatedBy": 930218,
            "lastUpdateName": "汤文祥",
            "lastUpdateTimestamp": 1705563631792,
            "locationType": "",
            "originalTemplateId": 316491,
            "otherRecognitionObjects": null,
            "outdoor": null,
            "personQualification": null,
            "ppeEquipsObject": null,
            "productForm": "",
            "productType": "",
            "projectCode": "",
            "remarks": "",
            "serviceType": "02-新增",
            "status": 1,
            "templateChildType": 1,
            "templateCode": "QC20240118153953787",
            "templateId": 316491,
            "templateName": "通用检查模板test20240118",
            "templateParam": null,
            "tenantId": 886,
            "type": 1,
            "validRequired": 0,
            "version": "1.0"
        },
        "kcpList": [
            {
                "appName": "isdp-qc-server",
                "createdBy": 930218,
                "creationDate": "2024-01-18T07:40:32.000+00:00",
                "deleteFlag": 0,
                "demoVideoId": null,
                "entityName": "TemplateKcp",
                "kcpId": 442769,
                "kcpIndex": 0,
                "lastUpdateDate": "2024-01-18T07:40:32.000+00:00",
                "lastUpdatedBy": 930218,
                "name": "new kcp1",
                "score": 0,
                "templateId": 316491,
                "children": [
                    {
                        "collectNa": 0,
                        "allowedNa": 1,
                        "appName": "isdp-qc-server",
                        "createdBy": 930218,
                        "creationDate": "2024-01-18T07:40:32.000+00:00",
                        "deleteFlag": 0,
                        "entityName": "TemplateItem",
                        "handlerNameInspection": null,
                        "handlerNameQualityInspection": null,
                        "identificationType": "",
                        "intelligentReviewRules": "",
                        "isExemption": 0,
                        "issueHandlerInspection": null,
                        "issueHandlerQualityInspection": null,
                        "issueTypeInspection": "",
                        "issueTypeQualityInspection": "",
                        "itemCode": null,
                        "itemId": 3587558,
                        "itemIndex": 0,
                        "itemType": 0,
                        "kcpId": 442769,
                        "kcpIndex": 0,
                        "kcpName": null,
                        "lastUpdateDate": "2024-01-18T07:40:32.000+00:00",
                        "lastUpdatedBy": 930218,
                        "name": "Item1",
                        "objectIndustryTypeId": null,
                        "objectIndustryTypeIdText": null,
                        "operationGuide": "",
                        "qualificationType": 1,
                        "qualityStandard": "",
                        "rejectionReason": null,
                        "sceneTypeName": null,
                        "severity": 1,
                        "templateId": 316491,
                        "tenantId": 886,
                        "outputList": [
                            {
                                "appName": "isdp-qc-server",
                                "audioIdentifyInfo": "",
                                "collectScene": 0,
                                "compressionRatio": 0,
                                "coordinateValue": null,
                                "createdBy": 930218,
                                "creationDate": "2024-01-18T07:40:32.000+00:00",
                                "defaultValue": "",
                                "deleteFlag": 0,
                                "demoPictureId": null,
                                "designValue": "",
                                "designValueOrder": null,
                                "deviationValue": null,
                                "entityName": "TemplateOutput",
                                "enumValue": "",
                                "intelligentAnalysisUrl": null,
                                "intelligentObject": "",
                                "isAudioIdentify": 0,
                                "isCascading": 0,
                                "isNecessary": 0,
                                "itemId": 3587558,
                                "itemType": 0,
                                "lastUpdateDate": "2024-01-18T07:40:32.000+00:00",
                                "lastUpdatedBy": 930218,
                                "maxValue": "",
                                "measurementOrder": 0,
                                "minValue": "",
                                "outputCode": null,
                                "outputId": 43984726,
                                "outputIndex": 0,
                                "outputName": "输出项",
                                "outputType": 20,
                                "parentEnum": null,
                                "parentEnumName": null,
                                "scoreIndex": null,
                                "templateId": 316491,
                                "txactValue": null,
                                "udf1": null
                            }
                        ]
                    }
                ],
                "kcpDemoVideoList": [
                    {
                        "appName": "isdp-qc-server",
                        "createdBy": 930218,
                        "createName": null,
                        "creationDate": "2024-01-18T07:40:32.000+00:00",
                        "entityName": "QcVideo",
                        "id": 18869,
                        "isExample": "1",
                        "kcpId": 442769,
                        "lastUpdateDate": "2024-01-18T07:40:32.000+00:00",
                        "lastUpdatedBy": 930218,
                        "lastUpdateName": null,
                        "projectCode": null,
                        "status": 0,
                        "templateId": 316491,
                        "tenantId": 886,
                        "thumbnailsId": "7666778",
                        "valid": null,
                        "videoId": "7666779",
                        "videoName": "20240117-165147(WeLinkPC).mp4",
                        "videoTime": null,
                        "videoWatermarkInfo": null,
                        "videoWaterMarkKey": null,
                        "vidPassMk": null
                    }
                ]
            }
        ]
    }
}
```
