获取 access_token
实现方式,芯片管理平台分配 access_token 给 M2M 使用,
当 access_token 存在问题时,M2M 联系芯片管理平台管理员重新获取最新的 access_token,
暂不提供动态获取 access_token 的方式。
查询 missdns 是否已写卡
请求 URL:
请求方式:
参数形式:
参数:
参数名 | 位置 | 类型 | 说明 | 是否必填 |
access_token | header | String | 用户 token | 是 |
missdns | url | String | missdns 由 missdn 逗号分隔后组成字符串 | 是 |
missdnType | url | Integer | 码号的类型,1 正式号、2 临时号,3 正式号和临时号,默认 3 | 否 |
返回:
参数名 | 类型 | 说明 | 是否必填 |
eid | String | 客户 id | 是 |
oldMissdn | String | 原号码 | 是 |
newMissdn | String | 新号码 | 是 |
oldIccid | String | 原 iccid | 是 |
newIccid | String | 新 iccid | 是 |
province | String | 新号码对应省公司编码 | 是 |
time | String | 写卡申请时间 yyyyMMddHHmmss | 是 |
dataFrom | String | 数据来源 (1 芯片管理平台、2 联调测试平台) | 是 |
systemname | String | 调用的写卡平台(cmiot、pboss) | 是 |
status | String | 状态 0:失败 ;1:成功 | 是 |
返回示例
{
"code": "200",
"cnmessage": "操作成功",
"data": [
{
"eid":"221805FFFFF140735773",
"oldMissdn":"1440179535671",
"newMissdn":"1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"province":"230",
"time":"20191015191346",
"dataFrom":"2",
"systemName":"cmiot",
"status":"0",
}
...
]
}
查询 sql
missdnType=1
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
<if test="missdns != null and missdns != ''">
and new_missdn in
<foreach item="newMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{newMissdn}
</foreach>
</if>
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
<if test="missdns != null and missdns != ''">
and new_missdn in
<foreach item="newMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{newMissdn}
</foreach>
</if>
missdnType=2
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
<if test="missdns != null and missdns != ''">
and old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
</if>
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
<if test="missdns != null and missdns != ''">
and old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
</if>
missdnType=3 默认
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
<if test="missdns != null and missdns != ''">
and
(old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
or
new_missdn in
<foreach item="newMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{newMissdn}
</foreach>
)
</if>
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
<if test="missdns != null and missdns != ''">
and
(old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
or
new_missdn in
<foreach item="newMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{newMissdn}
</foreach>
)
</if>
查询 iccids 对应的码号是否已写卡
请求 URL:
请求方式:
参数形式:
参数:
参数名 | 位置 | 类型 | 说明 | 是否必填 |
access_token | header | String | 用户 token | 是 |
iccids | url | String | iccids 由 iccid 逗号分隔后组成字符串 | 是 |
missdnType | url | Integer | 码号的类型,1 正式号、2 临时号,3 正式号和临时号,默认 3 | 否 |
返回:
参数名 | 类型 | 说明 | 是否必填 |
iccid | String | iccid | 是 |
eid | String | 客户 id | 是 |
oldMissdn | String | 原号码 | 是 |
newMissdn | String | 新号码 | 是 |
oldIccid | String | 原 iccid | 是 |
newIccid | String | 新 iccid | 是 |
province | String | 新号码对应省公司编码 | 是 |
time | String | 写卡申请时间 yyyyMMddHHmmss | 是 |
dataFrom | String | 数据来源 (1 芯片管理平台、2 联调测试平台) | 是 |
systemname | String | 调用的写卡平台(cmiot、pboss) | 是 |
status | String | 状态 0:失败 ;1:成功 | 是 |
返回示例
{
"code": "200",
"cnmessage": "操作成功",
"data": [
{
"iccid":"898602C99916C0350087",
"eid":"221805FFFFF140735773",
"oldMissdn":"1440179535671",
"newMissdn":"1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"province":"230",
"time":"20191015191346",
"dataFrom":"2",
"systemName":"cmiot",
"status":"0"
}
...
]
}
调用联调平台获取 iccid 和码号的对应关系
联调平台对外开放获取码号信息接口
获取到 iccid、msisdn、opentime
查询 sql
missdnType=1
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
and new_missdn =#{msisdn}
and time>=#{opentime}
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
and new_missdn =#{msisdn}
and time>=#{opentime}
missdnType=2
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
and old_missdn=#{msisdn}
and time>=#{opentime}
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
and old_missdn=#{msisdn}
and time>=#{opentime}
missdnType=3 默认
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
and
((old_missdn=#{msisdn} and time>=#{opentime})
or
(new_missdn =#{msisdn} and time>=#{opentime})
)
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
and
((old_missdn=#{msisdn} and time>=#{opentime})
or
(new_missdn =#{msisdn} and time>=#{opentime})
)
返回示例
{
"code": 200,
"data": [
{
"89860417221840135661": [
{
"eid": "221805FFFFF140735773",
"oldMissdn": "1440179535671",
"newMissdn": "1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"status": null,
"province": null,
"time": "20191015191346",
"dataFrom": 2,
"systemname": "pboss"
},
...
]
},
{
"89860417221840135671": [
{
"eid": "221805FFFFF140735773",
"oldMissdn": "1440179535671",
"newMissdn": "1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"status": null,
"province": null,
"time": "20191015191346",
"dataFrom": 2,
"systemname": "cmiot"
},
...
]
}
],
"cnmessage": "操作成功"
}
备注
没有返回的那些 iccid 没找到;返回 iccid,但是没有写卡结果的,就是没有写卡;返回了 iccid,并且存在写卡记录的才是真正写过卡的。
查询 missdns 和 iccids 是否已写卡
请求 URL:
请求方式:
参数形式:
参数:
参数名 | 位置 | 类型 | 说明 | 是否必填 |
access_token | header | String | 用户 token | 是 |
missdns | url | String | missdns 由 missdn 逗号分隔后组成字符串 | 是 |
iccids | url | String | iccids 由 iccid 逗号分隔后组成字符串 | 是 |
返回:
参数名 | 类型 | 说明 | 是否必填 |
eid | String | 客户 id | 是 |
oldMissdn | String | 原号码 | 是 |
newMissdn | String | 新号码 | 是 |
oldIccid | String | 原 iccid | 是 |
newIccid | String | 新 iccid | 是 |
province | String | 新号码对应省公司编码 | 是 |
time | String | 写卡申请时间 yyyyMMddHHmmss | 是 |
dataFrom | String | 数据来源 (1 芯片管理平台、2 联调测试平台) | 是 |
systemname | String | 调用的写卡平台(cmiot、pboss) | 是 |
status | String | 状态 0:失败 ;1:成功 | 是 |
返回示例
{
"code": "200",
"cnmessage": "操作成功",
"data": [
{
"eid":"221805FFFFF140735773",
"oldMissdn":"1440179535671",
"newMissdn":"1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"province":"230",
"time":"20191015191346",
"dataFrom":"2",
"systemName":"cmiot",
"status":"0",
}
...
]
}
查询 sql
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records
where 1=1
<if test="missdns != null and missdns != ''">
and old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
</if>
<if test="iccids != null and iccids != ''">
and old_iccid in
<foreach item="oldIccid" index="index" collection="iccids.split(',')" open="(" separator="," close=")">
#{oldIccid}
</foreach>
</if>
union
select eid,old_missdn,new_missdn,province,time,data_from,systemName,status,old_iccid,new_iccid from write_card_records_history
where 1=1
<if test="missdns != null and missdns != ''">
and old_missdn in
<foreach item="oldMissdn" index="index" collection="missdns.split(',')" open="(" separator="," close=")">
#{oldMissdn}
</foreach>
</if>
<if test="iccids != null and iccids != ''">
and old_iccid in
<foreach item="oldIccid" index="index" collection="iccids.split(',')" open="(" separator="," close=")">
#{oldIccid}
</foreach>
</if>
查询指定时间范围内写卡未完成的写卡记录
请求 URL:
请求方式:
参数形式:
参数:
参数名 | 位置 | 类型 | 说明 | 是否必填 |
access_token | header | String | 用户 token | 是 |
startTime | url | String | 开始时间(20191001010001) | 是 |
endTime | url | String | 结束时间(20191015240001) | 是 |
pageSize | url | Integer | 每页的数据条数 | 是 |
pageNum | url | Integer | 当前页码 | 是 |
返回:
参数名 | 类型 | 说明 | 是否必填 |
eid | String | 客户 id | 是 |
oldMissdn | String | 原号码 | 是 |
newMissdn | String | 新号码 | 是 |
oldIccid | String | 原 iccid | 是 |
newIccid | String | 新 iccid | 是 |
province | String | 新号码对应省公司编码 | 是 |
time | String | 写卡申请时间 yyyyMMddHHmmss | 是 |
dataFrom | String | 数据来源 (1 芯片管理平台、2 联调测试平台) | 是 |
systemname | String | 调用的写卡平台(cmiot、pboss) | 是 |
status | String | 2-- 已发起写卡,等待反馈 3-- 等待临时号审批 4-- 等待 OneNet 通知设备上电 5-- 写卡撤销 6-- 写卡超时 | 是 |
返回示例
{
"code": "200",
"cnmessage": "操作成功",
"data": [
{
"eid":"221805FFFFF140735773",
"oldMissdn":"1440179535671",
"newMissdn":"1440179535661",
"oldIccid":"898604293619F0123437",
"newIccid":"898604200119F0001031",
"province":"230",
"time":"20191015191346",
"dataFrom":"2",
"systemName":"cmiot",
"status":"0",
}
...
]
}
查询 sql
<select id="getWriteCardNotEndByTime"
resultMap="com.chinamobile.dao.WritecardProcessRecordMapper.BaseResultMap">
SELECT
<include refid="com.chinamobile.dao.WritecardProcessRecordMapper.Base_Column_List"></include>
FROM writecard_process_record w
WHERE 1=1
and create_date<![CDATA[ >=]]>#{startTime}
and create_date<![CDATA[ <=]]>#{endTime}
and status not in ('3','4')
</select>
多次写卡时码号和各种参数的对应关系
写卡记录补全 iccid
迁移写卡记录
删除重复的写卡记录
上一篇 芯片管理平台数据统计(七)
芯片管理平台接口目录
下一篇 多次写卡时码号和各种参数的对应关系