获取码号是否写卡功能

获取 access_token

实现方式,芯片管理平台分配 access_token 给 M2M 使用,
当 access_token 存在问题时,M2M 联系芯片管理平台管理员重新获取最新的 access_token,
暂不提供动态获取 access_token 的方式。

查询 missdns 是否已写卡

请求 URL:
请求方式:
  • GET/POST
参数形式:
  • form-data
参数:
参数名位置类型说明是否必填
access_tokenheaderString用户 token
missdnsurlStringmissdns 由 missdn 逗号分隔后组成字符串
missdnTypeurlInteger码号的类型,1 正式号、2 临时号,3 正式号和临时号,默认 3
返回:
参数名类型说明是否必填
eidString客户 id
oldMissdnString原号码
newMissdnString新号码
oldIccidString原 iccid
newIccidString新 iccid
provinceString新号码对应省公司编码
timeString写卡申请时间 yyyyMMddHHmmss
dataFromString数据来源 (1 芯片管理平台、2 联调测试平台)
systemnameString调用的写卡平台(cmiot、pboss)
statusString状态 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:
请求方式:
  • GET/POST
参数形式:
  • form-data
参数:
参数名位置类型说明是否必填
access_tokenheaderString用户 token
iccidsurlStringiccids 由 iccid 逗号分隔后组成字符串
missdnTypeurlInteger码号的类型,1 正式号、2 临时号,3 正式号和临时号,默认 3
返回:
参数名类型说明是否必填
iccidStringiccid
eidString客户 id
oldMissdnString原号码
newMissdnString新号码
oldIccidString原 iccid
newIccidString新 iccid
provinceString新号码对应省公司编码
timeString写卡申请时间 yyyyMMddHHmmss
dataFromString数据来源 (1 芯片管理平台、2 联调测试平台)
systemnameString调用的写卡平台(cmiot、pboss)
statusString状态 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:
请求方式:
  • GET/POST
参数形式:
  • form-data
参数:
参数名位置类型说明是否必填
access_tokenheaderString用户 token
missdnsurlStringmissdns 由 missdn 逗号分隔后组成字符串
iccidsurlStringiccids 由 iccid 逗号分隔后组成字符串
返回:
参数名类型说明是否必填
eidString客户 id
oldMissdnString原号码
newMissdnString新号码
oldIccidString原 iccid
newIccidString新 iccid
provinceString新号码对应省公司编码
timeString写卡申请时间 yyyyMMddHHmmss
dataFromString数据来源 (1 芯片管理平台、2 联调测试平台)
systemnameString调用的写卡平台(cmiot、pboss)
statusString状态 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:
请求方式:
  • GET/POST
参数形式:
  • form-data
参数:
参数名位置类型说明是否必填
access_tokenheaderString用户 token
startTimeurlString开始时间(20191001010001)
endTimeurlString结束时间(20191015240001)
pageSizeurlInteger每页的数据条数
pageNumurlInteger当前页码
返回:
参数名类型说明是否必填
eidString客户 id
oldMissdnString原号码
newMissdnString新号码
oldIccidString原 iccid
newIccidString新 iccid
provinceString新号码对应省公司编码
timeString写卡申请时间 yyyyMMddHHmmss
dataFromString数据来源 (1 芯片管理平台、2 联调测试平台)
systemnameString调用的写卡平台(cmiot、pboss)
statusString2-- 已发起写卡,等待反馈 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
迁移写卡记录
删除重复的写卡记录

上一篇 芯片管理平台数据统计(七)
芯片管理平台接口目录
下一篇 多次写卡时码号和各种参数的对应关系