拿到初始化环境信息:1.登录测试环境根据基础设置,进行添加组织用户,授权;(星瀚发票云_基础配置_培训)2.切换用户,进行引入组织,维护企业信息,许可授权API授权,业务系统编码设置(星瀚发票云_基础配置_培训)3.将接口案列导入到测试工具(星瀚请求.postman_collection.json)4.http://www.jsons.cn/base64/线上加密解密对请求参数根据自己业务需要进行调整星瀚请求.postman_collection.json文件内容如下,可复制下面信息保存为“星瀚请求.postman_collection.json文件”{-info-:{-_postman_id-:-9452b7f1-8161-40e7-8dc3-70a8f307e7cc-,-name-:-星瀚请求-,-schema-:-https://schema.getpostman.com/json/collection/v2.1.0/collection.json-,-_exporter_id-:-26158231-},-item-:[{-name-:-获取token-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-varclient_id=pm.environment.get('client_id');\r-,-varclient_sec=pm.environment.get('client_secret');\r-,-varencrypt_key=pm.environment.get('aes_key');\r-,-varsaler_company=pm.environment.get('saler_company');\r-,-varsaler_frevenueNumber=pm.environment.get('saler_frevenueNumber');\r-,-vartm=\-0\-;\r-,-\r-,-varuser_name='18681537039';\r-,-varuser_pwd='654321@qaz';\r-,-\r-,-varuser_date={\r-,-\-userName\-:user_name,\r-,-\-userPwd\-:user_pwd\r-,-};\r-,-\r-,-\r-,-varCryptoJS=require(\-crypto-js\-);\r-,-\r-,-constsignature=CryptoJS.MD5(client_id+client_sec+tm).toString();\r-,-\r-,-\r-,-constkey=CryptoJS.enc.Utf8.parse(encrypt_key);\r-,-\r-,-constcipher=CryptoJS.AES.encrypt(JSON.stringify(user_date),key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7,iv:''});\r-,-\r-,-constuser_base64_cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);\r-,-\r-,-\r-,-varplain_text={\r-,-\-client_id\-:client_id,\r-,-\-timestamp\-:tm,\r-,-\-sign\-:signature,\r-,-\-taxNo\-:saler_frevenueNumber,\r-,-\-data\-:user_base64_cipher\r-,-};\r-,-\r-,-console.log(plain_text);\r-,-\r-,-pm.variables.set('encrypt_body',JSON.stringify(plain_text));-],-type-:-text/javascript-}},{-listen-:-test-,-script-:{-exec-:[-//1.验证返回状态码是否是200\r-,-pm.test(\-Statuscodeis200\-,function(){\r-,-pm.response.to.have.status(200);\r-,-});\r-,-\r-,-//提取数据\r-,-//1.获取返回数据,JSON格式\r-,-vardata=JSON.parse(responseBody);\r-,-//2.设置成环境变量\r-,-pm.environment.set(\-app_token\-,data.app_token)\r-,--],-type-:-text/javascript-}}],-request-:{-method-:-POST-,-header-:[{-key-:-Content-Type-,-name-:-Content-Type-,-type-:-text-,-value-:-application/json-}],-body-:{-mode-:-raw-,-raw-:-{\r\n\-appId\-:\-{{appId}}\-,\r\n\-appSecuret\-:\-{{appSecuret}}\-,\r\n\-tenantid\-:\-\-,\r\n\-accountId\-:\-{{accountId}}\-,\r\n\-language\-:\-\-\r\n}-},-url-:{-raw-:-{{method}}://{{url}}api/getAppToken.do-,-protocol-:-{{method}}-,-host-:[-{{url}}api-],-path-:[-getAppToken.do-]},-description-:-获取token-},-response-:[]},{-name-:-登录login-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-varclient_id=pm.environment.get('client_id');\r-,-varclient_sec=pm.environment.get('client_secret');\r-,-varencrypt_key=pm.environment.get('aes_key');\r-,-varsaler_company=pm.environment.get('saler_company');\r-,-varsaler_frevenueNumber=pm.environment.get('saler_frevenueNumber');\r-,-vartm=\-0\-;\r-,-\r-,-varuser_name='18681537039';\r-,-varuser_pwd='654321@qaz';\r-,-\r-,-varuser_date={\r-,-\-userName\-:user_name,\r-,-\-userPwd\-:user_pwd\r-,-};\r-,-\r-,-\r-,-varCryptoJS=require(\-crypto-js\-);\r-,-\r-,-constsignature=CryptoJS.MD5(client_id+client_sec+tm).toString();\r-,-\r-,-\r-,-constkey=CryptoJS.enc.Utf8.parse(encrypt_key);\r-,-\r-,-constcipher=CryptoJS.AES.encrypt(JSON.stringify(user_date),key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7,iv:''});\r-,-\r-,-constuser_base64_cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);\r-,-\r-,-\r-,-varplain_text={\r-,-\-client_id\-:client_id,\r-,-\-timestamp\-:tm,\r-,-\-sign\-:signature,\r-,-\-taxNo\-:saler_frevenueNumber,\r-,-\-data\-:user_base64_cipher\r-,-};\r-,-\r-,-console.log(plain_text);\r-,-\r-,-pm.variables.set('encrypt_body',JSON.stringify(plain_text));-],-type-:-text/javascript-}},{-listen-:-test-,-script-:{-exec-:[-//1.验证返回状态码是否是200\r-,-pm.test(\-Statuscodeis200\-,function(){\r-,-pm.response.to.have.status(200);\r-,-});\r-,-\r-,-//提取数据\r-,-//1.获取返回数据,JSON格式\r-,-vardata1=JSON.parse(responseBody);\r-,-//2.设置成环境变量\r-,-pm.environment.set(\-access_token\-,data1.data.access_token)\r-,--],-type-:-text/javascript-}}],-request-:{-method-:-POST-,-header-:[{-key-:-Content-Type-,-name-:-Content-Type-,-type-:-text-,-value-:-application/json-}],-body-:{-mode-:-raw-,-raw-:-{\r\n\-user\-:\-{{username}}\-,\r\n\-apptoken\-:\-{{app_token}}\-,\r\n\-tenantid\-:\-\-,\r\n\-accountId\-:\-{{accountId}}\-,\r\n\-usertype\-:\-UserName\-\r\n}-},-url-:{-raw-:-{{method}}://{{url}}api/login.do-,-protocol-:-{{method}}-,-host-:[-{{url}}api-],-path-:[-login.do-]},-description-:-获取token-},-response-:[]},{-name-:-直接开票-蓝票-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-vartimestamp=(newDate()).getTime();\r-,-pm.variables.set('timestamp',timestamp);\r-,-\r-,-varBase64={\r-,-//privateproperty\r-,-_keyStr:\-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\-,\r-,-//publicmethodforencoding\r-,-encode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3,enc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=this._utf8_encode(input);\r-,-while(i<input.length){\r-,-chr1=input.charCodeAt(i++);\r-,-chr2=input.charCodeAt(i++);\r-,-chr3=input.charCodeAt(i++);\r-,-enc1=chr1>>2;\r-,-enc2=((chr1&3)<<4)|(chr2>>4);\r-,-enc3=((chr2&15)<<2)|(chr3>>6);\r-,-enc4=chr3&63;\r-,-if(isNaN(chr2)){\r-,-enc3=enc4=64;\r-,-}elseif(isNaN(chr3)){\r-,-enc4=64;\r-,-}\r-,-output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);\r-,-}\r-,-returnoutput;\r-,-},\r-,-//publicmethodfordecoding\r-,-decode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3;\r-,-varenc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\-\-);\r-,-while(i<input.length){\r-,-enc1=this._keyStr.indexOf(input.charAt(i++));\r-,-enc2=this._keyStr.indexOf(input.charAt(i++));\r-,-enc3=this._keyStr.indexOf(input.charAt(i++));\r-,-enc4=this._keyStr.indexOf(input.charAt(i++));\r-,-chr1=(enc1<<2)|(enc2>>4);\r-,-chr2=((enc2&15)<<4)|(enc3>>2);\r-,-chr3=((enc3&3)<<6)|enc4;\r-,-output=output+String.fromCharCode(chr1);\r-,-if(enc3!=64){\r-,-output=output+String.fromCharCode(chr2);\r-,-}\r-,-if(enc4!=64){\r-,-output=output+String.fromCharCode(chr3);\r-,-}\r-,-}\r-,-output=_utf8_decode(output);\r-,-returnoutput;\r-,-},\r-,-//privatemethodforUTF-8encoding\r-,-_utf8_encode:function(string){\r-,-string=string.replace(/\\r\\n/g,\-\\n\-);\r-,-varutftext=\-\-;\r-,-for(varn=0;n<string.length;n++){\r-,-varc=string.charCodeAt(n);\r-,-if(c<128){\r-,-utftext+=String.fromCharCode(c);\r-,-}elseif((c>127)&&(c<2048)){\r-,-utftext+=String.fromCharCode((c>>6)|192);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}else{\r-,-utftext+=String.fromCharCode((c>>12)|224);\r-,-utftext+=String.fromCharCode(((c>>6)&63)|128);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}\r-,-}\r-,-returnutftext;\r-,-},\r-,-//privatemethodforUTF-8decoding\r-,-_utf8_decode:function(utftext){\r-,-varstring=\-\-;\r-,-vari=0;\r-,-varc=c1=c2=0;\r-,-while(i<utftext.length){\r-,-c=utftext.charCodeAt(i);\r-,-if(c<128){\r-,-string+=String.fromCharCode(c);\r-,-i++;\r-,-}elseif((c>191)&&(c<224)){\r-,-c2=utftext.charCodeAt(i+1);\r-,-string+=String.fromCharCode(((c&31)<<6)|(c2&63));\r-,-i+=2;\r-,-}else{\r-,-c2=utftext.charCodeAt(i+1);\r-,-c3=utftext.charCodeAt(i+2);\r-,-string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));\r-,-i+=3;\r-,-}\r-,-}\r-,-returnstring;\r-,-}\r-,-};\r-,-\r-,-varlen=timestamp.toString().length-6;\r-,-varserialId=timestamp.toString().substr(len);\r-,-varmyDate=newDate();\r-,-varyear=myDate.getFullYear();\r-,-varmonth=(myDate.getMonth()+1)<10?\-0\-+(myDate.getMonth()+1):myDate.getMonth()+1;\r-,-varday=myDate.getDate()<10?\-0\-+myDate.getDate():myDate.getDate();\r-,-vardate1=year+\-\-+month+\-\-+day;\r-,-vardate2=year+\--\-+month+\--\-+day;\r-,-vartime1=date2+\-\-+myDate.getHours()+\-:\-+myDate.getMinutes()+\-:\-+myDate.getSeconds();\r-,-\r-,-push_bill_param=[{\r-,-\-serialNo\-:\-34234FPY12345611\-,\r-,-\-deviceNo\-:\-\-,\r-,-\-terminalNo\-:\-\-,\r-,-\-orgCode\-:\-\-,\r-,-\-invoiceProperty\-:\-0\-,\r-,-\-invoiceType\-:\-007\-,\r-,-\-sellerName\-:\-广东足迹鞋业有限公司\-,\r-,-\-sellerTaxpayerId\-:\-914406056615322311\-,\r-,-\-sellerBankAndAccount\-:\-深圳市福田区梅景123456789\-,\r-,-\-sellerAddressAndTel\-:\-中国银行123456789\-,\r-,-\-buyerName\-:\-深圳市顺丰快运有限公司\-,\r-,-\-buyerTaxpayerId\-:\-91440300MA5FNT4Y8U\-,\r-,-\-buyerBankAndAccount\-:\-壹贰叁肆伍陆柒扒九十1234567890123\-,\r-,-\-buyerAddressAndTel\-:\-壹贰叁肆伍陆柒扒九十34567890\-,\r-,-\-buyerProperty\-:\-0\-,\r-,-\-includeTaxFlag\-:\-1\-,\r-,-\-buyerRecipientPhone\-:\-\-,\r-,-\-buyerRecipientMail\-:\-10086@Kingdee.com\-,\r-,-\-remark\-:\-测试备注\-,\r-,-\-deduction\-:0,\r-,-\-taxedType\-:\-0\-,\r-,-\-drawer\-:\-开票人1\-,\r-,-\-reviewer\-:\-复核人\-,\r-,-\-payee\-:\-\-,\r-,-\-redInfoBillNo\-:\-\-,\r-,-\-originalInvoiceCode\-:\-\-,\r-,-\-originalInvoiceNumber\-:\-\-,\r-,-\-originalIssueTime\-:\-\-,\r-,-\-originalInvoiceType\-:\-007\-,\r-,-\-redReason\-:\-\-,\r-,-\-specialType\-:\-00\-,\r-,-\-invoiceDetail\-:[\r-,-{\r-,-\-billSourceId\-:\-202211130001202011130001\-,\r-,-\-goodsCode\-:\-AGS202011130001\-,\r-,-\-goodsName\-:\-测试非卷烟-烟丝\-,\r-,-\-specification\-:\-按克计算\-,\r-,-\-units\-:\-克\-,\r-,-\-quantity\-:1,\r-,-\-price\-:1000,\r-,-\-amount\-:1000,\r-,-\-taxRate\-:\-0.13\-,\r-,-\-taxAmount\-:0,\r-,-\-discountAmount\-:0,\r-,-\-discountRate\-:\-\-,\r-,-\-revenueCode\-:\-1030404000000000000\-,\r-,-\-privilegeFlag\-:\-0\-,\r-,-\-privilegeContent\-:\-\-,\r-,-\-zeroTaxRateFlag\-:\-\-,\r-,-\-lineProperty\-:\-0\-\r-,-}\r-,-]\r-,-}]\r-,-\r-,-varpushParamStr=JSON.stringify(push_bill_param);\r-,-varencryptStr=Base64.encode(pushParamStr);\r-,-pm.variables.set(\-encryptStr\-,encryptStr);\r-,-console.log(encryptStr);-],-type-:-text/javascript-}},{-listen-:-test-,-script-:{-exec-:[-//1.验证返回状态码是否是200\r-,-pm.test(\-Statuscodeis200\-,function(){\r-,-pm.response.to.have.status(200);\r-,-});-],-type-:-text/javascript-}}],-request-:{-method-:-POST-,-header-:[{-key-:-Content-Type-,-name-:-Content-Type-,-type-:-text-,-value-:-application/json-}],-body-:{-mode-:-raw-,-raw-:-{\r\n\t\-requestId\-:\-{{timestamp}}\-,\r\n\t\-interfaceCode\-:\-INVOICE.OPEN\-,\r\n\t\-businessSystemCode\-:\-BUSINESS_SYSTEM\-,\r\n\-data\-:\-{{encryptStr}}\-\r\n}-},-url-:{-raw-:-{{method}}://{{url}}kapi/app/sim/openApi?access_token={{access_token}}-,-protocol-:-{{method}}-,-host-:[-{{url}}kapi-],-path-:[-app-,-sim-,-openApi-],-query-:[{-key-:-access_token-,-value-:-{{access_token}}-}]},-description-:-获取token-},-response-:[]},{-name-:-直接收票-进项发票查询-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-vartimestamp=(newDate()).getTime();\r-,-pm.variables.set('timestamp',timestamp);\r-,-\r-,-varBase64={\r-,-//privateproperty\r-,-_keyStr:\-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\-,\r-,-//publicmethodforencoding\r-,-encode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3,enc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=this._utf8_encode(input);\r-,-while(i<input.length){\r-,-chr1=input.charCodeAt(i++);\r-,-chr2=input.charCodeAt(i++);\r-,-chr3=input.charCodeAt(i++);\r-,-enc1=chr1>>2;\r-,-enc2=((chr1&3)<<4)|(chr2>>4);\r-,-enc3=((chr2&15)<<2)|(chr3>>6);\r-,-enc4=chr3&63;\r-,-if(isNaN(chr2)){\r-,-enc3=enc4=64;\r-,-}elseif(isNaN(chr3)){\r-,-enc4=64;\r-,-}\r-,-output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);\r-,-}\r-,-returnoutput;\r-,-},\r-,-//publicmethodfordecoding\r-,-decode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3;\r-,-varenc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\-\-);\r-,-while(i<input.length){\r-,-enc1=this._keyStr.indexOf(input.charAt(i++));\r-,-enc2=this._keyStr.indexOf(input.charAt(i++));\r-,-enc3=this._keyStr.indexOf(input.charAt(i++));\r-,-enc4=this._keyStr.indexOf(input.charAt(i++));\r-,-chr1=(enc1<<2)|(enc2>>4);\r-,-chr2=((enc2&15)<<4)|(enc3>>2);\r-,-chr3=((enc3&3)<<6)|enc4;\r-,-output=output+String.fromCharCode(chr1);\r-,-if(enc3!=64){\r-,-output=output+String.fromCharCode(chr2);\r-,-}\r-,-if(enc4!=64){\r-,-output=output+String.fromCharCode(chr3);\r-,-}\r-,-}\r-,-output=_utf8_decode(output);\r-,-returnoutput;\r-,-},\r-,-//privatemethodforUTF-8encoding\r-,-_utf8_encode:function(string){\r-,-string=string.replace(/\\r\\n/g,\-\\n\-);\r-,-varutftext=\-\-;\r-,-for(varn=0;n<string.length;n++){\r-,-varc=string.charCodeAt(n);\r-,-if(c<128){\r-,-utftext+=String.fromCharCode(c);\r-,-}elseif((c>127)&&(c<2048)){\r-,-utftext+=String.fromCharCode((c>>6)|192);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}else{\r-,-utftext+=String.fromCharCode((c>>12)|224);\r-,-utftext+=String.fromCharCode(((c>>6)&63)|128);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}\r-,-}\r-,-returnutftext;\r-,-},\r-,-//privatemethodforUTF-8decoding\r-,-_utf8_decode:function(utftext){\r-,-varstring=\-\-;\r-,-vari=0;\r-,-varc=c1=c2=0;\r-,-while(i<utftext.length){\r-,-c=utftext.charCodeAt(i);\r-,-if(c<128){\r-,-string+=String.fromCharCode(c);\r-,-i++;\r-,-}elseif((c>191)&&(c<224)){\r-,-c2=utftext.charCodeAt(i+1);\r-,-string+=String.fromCharCode(((c&31)<<6)|(c2&63));\r-,-i+=2;\r-,-}else{\r-,-c2=utftext.charCodeAt(i+1);\r-,-c3=utftext.charCodeAt(i+2);\r-,-string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));\r-,-i+=3;\r-,-}\r-,-}\r-,-returnstring;\r-,-}\r-,-};\r-,-\r-,-varlen=timestamp.toString().length-6;\r-,-varserialId=timestamp.toString().substr(len);\r-,-varmyDate=newDate();\r-,-varyear=myDate.getFullYear();\r-,-varmonth=(myDate.getMonth()+1)<10?\-0\-+(myDate.getMonth()+1):myDate.getMonth()+1;\r-,-varday=myDate.getDate()<10?\-0\-+myDate.getDate():myDate.getDate();\r-,-vardate1=year+\-\-+month+\-\-+day;\r-,-vardate2=year+\--\-+month+\--\-+day;\r-,-vartime1=date2+\-\-+myDate.getHours()+\-:\-+myDate.getMinutes()+\-:\-+myDate.getSeconds();\r-,-\r-,-push_bill_param=[{\r-,-\-serialNo\-:\-34234FPY12345611\-,\r-,-\-deviceNo\-:\-\-,\r-,-\-terminalNo\-:\-\-,\r-,-\-orgCode\-:\-\-,\r-,-\-invoiceProperty\-:\-0\-,\r-,-\-invoiceType\-:\-007\-,\r-,-\-sellerName\-:\-金蝶软件(中国)有限公司\-,\r-,-\-sellerTaxpayerId\-:\-915003006188392540\-,\r-,-\-sellerBankAndAccount\-:\-深圳市福田区梅景123456789\-,\r-,-\-sellerAddressAndTel\-:\-中国银行123456789\-,\r-,-\-buyerName\-:\-深圳市顺丰快运有限公司\-,\r-,-\-buyerTaxpayerId\-:\-91440300MA5FNT4Y8U\-,\r-,-\-buyerBankAndAccount\-:\-壹贰叁肆伍陆柒扒九十1234567890123\-,\r-,-\-buyerAddressAndTel\-:\-壹贰叁肆伍陆柒扒九十34567890\-,\r-,-\-buyerProperty\-:\-0\-,\r-,-\-includeTaxFlag\-:\-1\-,\r-,-\-buyerRecipientPhone\-:\-\-,\r-,-\-buyerRecipientMail\-:\-10086@Kingdee.com\-,\r-,-\-remark\-:\-测试备注\-,\r-,-\-deduction\-:0,\r-,-\-taxedType\-:\-0\-,\r-,-\-drawer\-:\-开票人1\-,\r-,-\-reviewer\-:\-复核人\-,\r-,-\-payee\-:\-\-,\r-,-\-redInfoBillNo\-:\-\-,\r-,-\-originalInvoiceCode\-:\-\-,\r-,-\-originalInvoiceNumber\-:\-\-,\r-,-\-originalIssueTime\-:\-\-,\r-,-\-originalInvoiceType\-:\-007\-,\r-,-\-redReason\-:\-\-,\r-,-\-specialType\-:\-00\-,\r-,-\-invoiceDetail\-:[\r-,-{\r-,-\-billSourceId\-:\-202211130001202011130001\-,\r-,-\-goodsCode\-:\-AGS202011130001\-,\r-,-\-goodsName\-:\-测试非卷烟-烟丝\-,\r-,-\-specification\-:\-按克计算\-,\r-,-\-units\-:\-克\-,\r-,-\-quantity\-:1,\r-,-\-price\-:1000,\r-,-\-amount\-:1000,\r-,-\-taxRate\-:\-0.13\-,\r-,-\-taxAmount\-:0,\r-,-\-discountAmount\-:0,\r-,-\-discountRate\-:\-\-,\r-,-\-revenueCode\-:\-1030404000000000000\-,\r-,-\-privilegeFlag\-:\-0\-,\r-,-\-privilegeContent\-:\-\-,\r-,-\-zeroTaxRateFlag\-:\-\-,\r-,-\-lineProperty\-:\-0\-\r-,-}\r-,-]\r-,-}]\r-,-\r-,-varpushParamStr=JSON.stringify(push_bill_param);\r-,-varencryptStr=Base64.encode(pushParamStr);\r-,-pm.variables.set(\-encryptStr\-,encryptStr);\r-,-console.log(encryptStr);-],-type-:-text/javascript-}},{-listen-:-test-,-script-:{-exec-:[-//1.验证返回状态码是否是200\r-,-pm.test(\-Statuscodeis200\-,function(){\r-,-pm.response.to.have.status(200);\r-,-});-],-type-:-text/javascript-}}],-request-:{-method-:-POST-,-header-:[{-key-:-Content-Type-,-name-:-Content-Type-,-type-:-text-,-value-:-application/json-}],-body-:{-mode-:-raw-,-raw-:-{\r\n\-pageNo\-:1,\r\n\-pageSize\-:20,\r\n\-invoiceDateStart\-:\-\-,\r\n\-invoiceDateEnd\-:\-\-,\r\n\-invoiceType\-:\-10\-,\r\n\-invoiceStatus\-:\-\-,\r\n\-authenticateFlag\-:\-\-,\r\n\-updateTime\-:\-\-,\r\n\-orgNumber\-:[\-Org-00004\-],\r\n\-createTimeStart\-:\-2022-09-01\-,\r\n\-creatTimeEnd\-:\-2023-09-01\-\r\n}-},-url-:{-raw-:-{{method}}://{{url}}/kapi/app/rim/inputquery?access_token={{access_token}}-,-protocol-:-{{method}}-,-host-:[-{{url}}-],-path-:[-kapi-,-app-,-rim-,-inputquery-],-query-:[{-key-:-access_token-,-value-:-{{access_token}}-}]},-description-:-获取token-},-response-:[]},{-name-:-直接开票-蓝票-验证抬头匹配-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-vartimestamp=(newDate()).getTime();\r-,-pm.variables.set('timestamp',timestamp);\r-,-\r-,-varBase64={\r-,-//privateproperty\r-,-_keyStr:\-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\-,\r-,-//publicmethodforencoding\r-,-encode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3,enc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=this._utf8_encode(input);\r-,-while(i<input.length){\r-,-chr1=input.charCodeAt(i++);\r-,-chr2=input.charCodeAt(i++);\r-,-chr3=input.charCodeAt(i++);\r-,-enc1=chr1>>2;\r-,-enc2=((chr1&3)<<4)|(chr2>>4);\r-,-enc3=((chr2&15)<<2)|(chr3>>6);\r-,-enc4=chr3&63;\r-,-if(isNaN(chr2)){\r-,-enc3=enc4=64;\r-,-}elseif(isNaN(chr3)){\r-,-enc4=64;\r-,-}\r-,-output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);\r-,-}\r-,-returnoutput;\r-,-},\r-,-//publicmethodfordecoding\r-,-decode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3;\r-,-varenc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\-\-);\r-,-while(i<input.length){\r-,-enc1=this._keyStr.indexOf(input.charAt(i++));\r-,-enc2=this._keyStr.indexOf(input.charAt(i++));\r-,-enc3=this._keyStr.indexOf(input.charAt(i++));\r-,-enc4=this._keyStr.indexOf(input.charAt(i++));\r-,-chr1=(enc1<<2)|(enc2>>4);\r-,-chr2=((enc2&15)<<4)|(enc3>>2);\r-,-chr3=((enc3&3)<<6)|enc4;\r-,-output=output+String.fromCharCode(chr1);\r-,-if(enc3!=64){\r-,-output=output+String.fromCharCode(chr2);\r-,-}\r-,-if(enc4!=64){\r-,-output=output+String.fromCharCode(chr3);\r-,-}\r-,-}\r-,-output=_utf8_decode(output);\r-,-returnoutput;\r-,-},\r-,-//privatemethodforUTF-8encoding\r-,-_utf8_encode:function(string){\r-,-string=string.replace(/\\r\\n/g,\-\\n\-);\r-,-varutftext=\-\-;\r-,-for(varn=0;n<string.length;n++){\r-,-varc=string.charCodeAt(n);\r-,-if(c<128){\r-,-utftext+=String.fromCharCode(c);\r-,-}elseif((c>127)&&(c<2048)){\r-,-utftext+=String.fromCharCode((c>>6)|192);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}else{\r-,-utftext+=String.fromCharCode((c>>12)|224);\r-,-utftext+=String.fromCharCode(((c>>6)&63)|128);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}\r-,-}\r-,-returnutftext;\r-,-},\r-,-//privatemethodforUTF-8decoding\r-,-_utf8_decode:function(utftext){\r-,-varstring=\-\-;\r-,-vari=0;\r-,-varc=c1=c2=0;\r-,-while(i<utftext.length){\r-,-c=utftext.charCodeAt(i);\r-,-if(c<128){\r-,-string+=String.fromCharCode(c);\r-,-i++;\r-,-}elseif((c>191)&&(c<224)){\r-,-c2=utftext.charCodeAt(i+1);\r-,-string+=String.fromCharCode(((c&31)<<6)|(c2&63));\r-,-i+=2;\r-,-}else{\r-,-c2=utftext.charCodeAt(i+1);\r-,-c3=utftext.charCodeAt(i+2);\r-,-string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));\r-,-i+=3;\r-,-}\r-,-}\r-,-returnstring;\r-,-}\r-,-};\r-,-\r-,-varlen=timestamp.toString().length-6;\r-,-varserialId=timestamp.toString().substr(len);\r-,-varmyDate=newDate();\r-,-varyear=myDate.getFullYear();\r-,-varmonth=(myDate.getMonth()+1)<10?\-0\-+(myDate.getMonth()+1):myDate.getMonth()+1;\r-,-varday=myDate.getDate()<10?\-0\-+myDate.getDate():myDate.getDate();\r-,-vardate1=year+\-\-+month+\-\-+day;\r-,-vardate2=year+\--\-+month+\--\-+day;\r-,-vartime1=date2+\-\-+myDate.getHours()+\-:\-+myDate.getMinutes()+\-:\-+myDate.getSeconds();\r-,-\r-,-push_bill_param=[{\r-,-\-serialNo\-:\-34234FPY123456112\-,\r-,-\-deviceNo\-:\-\-,\r-,-\-terminalNo\-:\-\-,\r-,-\-orgCode\-:\-\-,\r-,-\-invoiceProperty\-:\-0\-,\r-,-\-invoiceType\-:\-004\-,\r-,-\-sellerName\-:\-金蝶软件(中国)有限公司\-,\r-,-\-sellerTaxpayerId\-:\-915003006188392540\-,\r-,-\-sellerBankAndAccount\-:\-深圳市福田区梅景123456789\-,\r-,-\-sellerAddressAndTel\-:\-中国银行123456789\-,\r-,-\-buyerName\-:\-深圳市顺丰快运有限公司\-,\r-,-\-buyerTaxpayerId\-:\-\-,\r-,-\-buyerBankAndAccount\-:\-\-,\r-,-\-buyerAddressAndTel\-:\-\-,\r-,-\-buyerProperty\-:\-0\-,\r-,-\-includeTaxFlag\-:\-1\-,\r-,-\-buyerRecipientPhone\-:\-\-,\r-,-\-buyerRecipientMail\-:\-10086@Kingdee.com\-,\r-,-\-remark\-:\-测试备注\-,\r-,-\-deduction\-:0,\r-,-\-taxedType\-:\-0\-,\r-,-\-drawer\-:\-开票人1\-,\r-,-\-reviewer\-:\-复核人\-,\r-,-\-payee\-:\-\-,\r-,-\-redInfoBillNo\-:\-\-,\r-,-\-originalInvoiceCode\-:\-\-,\r-,-\-originalInvoiceNumber\-:\-\-,\r-,-\-originalIssueTime\-:\-\-,\r-,-\-originalInvoiceType\-:\-007\-,\r-,-\-redReason\-:\-\-,\r-,-\-specialType\-:\-00\-,\r-,-\-invoiceDetail\-:[\r-,-{\r-,-\-billSourceId\-:\-202211130001202011130003\-,\r-,-\-goodsCode\-:\-AGS202011130001\-,\r-,-\-goodsName\-:\-测试非卷烟-烟丝\-,\r-,-\-specification\-:\-按克计算\-,\r-,-\-units\-:\-克\-,\r-,-\-quantity\-:1,\r-,-\-price\-:1000,\r-,-\-amount\-:1000,\r-,-\-taxRate\-:\-0.13\-,\r-,-\-taxAmount\-:0,\r-,-\-discountAmount\-:0,\r-,-\-discountRate\-:\-\-,\r-,-\-revenueCode\-:\-1030404000000000000\-,\r-,-\-privilegeFlag\-:\-0\-,\r-,-\-privilegeContent\-:\-\-,\r-,-\-zeroTaxRateFlag\-:\-\-,\r-,-\-lineProperty\-:\-0\-\r-,-}\r-,-]\r-,-}]\r-,-\r-,-varpushParamStr=JSON.stringify(push_bill_param);\r-,-varencryptStr=Base64.encode(pushParamStr);\r-,-pm.variables.set(\-encryptStr\-,encryptStr);\r-,-console.log(encryptStr);-],-type-:-text/javascript-}},{-listen-:-test-,-script-:{-exec-:[-//1.验证返回状态码是否是200\r-,-pm.test(\-Statuscodeis200\-,function(){\r-,-pm.response.to.have.status(200);\r-,-});-],-type-:-text/javascript-}}],-request-:{-method-:-POST-,-header-:[{-key-:-Content-Type-,-name-:-Content-Type-,-type-:-text-,-value-:-application/json-}],-body-:{-mode-:-raw-,-raw-:-{\r\n\t\-requestId\-:\-{{timestamp}}\-,\r\n\t\-interfaceCode\-:\-INVOICE.OPEN\-,\r\n\t\-businessSystemCode\-:\-BUSINESS_SYSTEM\-,\r\n\-data\-:\-{{encryptStr}}\-\r\n}-},-url-:{-raw-:-{{method}}://{{url}}kapi/app/sim/openApi?access_token={{access_token}}-,-protocol-:-{{method}}-,-host-:[-{{url}}kapi-],-path-:[-app-,-sim-,-openApi-],-query-:[{-key-:-access_token-,-value-:-{{access_token}}-}]},-description-:-获取token-},-response-:[]},{-name-:-直接开票-蓝票-验证开票项匹配-,-event-:[{-listen-:-prerequest-,-script-:{-exec-:[-vartimestamp=(newDate()).getTime();\r-,-pm.variables.set('timestamp',timestamp);\r-,-\r-,-varBase64={\r-,-//privateproperty\r-,-_keyStr:\-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\-,\r-,-//publicmethodforencoding\r-,-encode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3,enc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=this._utf8_encode(input);\r-,-while(i<input.length){\r-,-chr1=input.charCodeAt(i++);\r-,-chr2=input.charCodeAt(i++);\r-,-chr3=input.charCodeAt(i++);\r-,-enc1=chr1>>2;\r-,-enc2=((chr1&3)<<4)|(chr2>>4);\r-,-enc3=((chr2&15)<<2)|(chr3>>6);\r-,-enc4=chr3&63;\r-,-if(isNaN(chr2)){\r-,-enc3=enc4=64;\r-,-}elseif(isNaN(chr3)){\r-,-enc4=64;\r-,-}\r-,-output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);\r-,-}\r-,-returnoutput;\r-,-},\r-,-//publicmethodfordecoding\r-,-decode:function(input){\r-,-varoutput=\-\-;\r-,-varchr1,chr2,chr3;\r-,-varenc1,enc2,enc3,enc4;\r-,-vari=0;\r-,-input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\-\-);\r-,-while(i<input.length){\r-,-enc1=this._keyStr.indexOf(input.charAt(i++));\r-,-enc2=this._keyStr.indexOf(input.charAt(i++));\r-,-enc3=this._keyStr.indexOf(input.charAt(i++));\r-,-enc4=this._keyStr.indexOf(input.charAt(i++));\r-,-chr1=(enc1<<2)|(enc2>>4);\r-,-chr2=((enc2&15)<<4)|(enc3>>2);\r-,-chr3=((enc3&3)<<6)|enc4;\r-,-output=output+String.fromCharCode(chr1);\r-,-if(enc3!=64){\r-,-output=output+String.fromCharCode(chr2);\r-,-}\r-,-if(enc4!=64){\r-,-output=output+String.fromCharCode(chr3);\r-,-}\r-,-}\r-,-output=_utf8_decode(output);\r-,-returnoutput;\r-,-},\r-,-//privatemethodforUTF-8encoding\r-,-_utf8_encode:function(string){\r-,-string=string.replace(/\\r\\n/g,\-\\n\-);\r-,-varutftext=\-\-;\r-,-for(varn=0;n<string.length;n++){\r-,-varc=string.charCodeAt(n);\r-,-if(c<128){\r-,-utftext+=String.fromCharCode(c);\r-,-}elseif((c>127)&&(c<2048)){\r-,-utftext+=String.fromCharCode((c>>6)|192);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}else{\r-,-utftext+=String.fromCharCode((c>>12)|224);\r-,-utftext+=String.fromCharCode(((c>>6)&63)|128);\r-,-utftext+=String.fromCharCode((c&63)|128);\r-,-}\r-,-}\r-,-returnutftext;\r-,-},\r-,-//privatemethodforUTF-8decoding\r-,-_utf8_decode:function(utftext){\r-,-varstring=\-\-;\r-,-vari=0;\r-,-varc=c1=c2=0;\r-,-while(i<utftext.length){\r-,-c=utftext.charCodeAt(i);\r-,-if(c<128){\r-,-string+=String.fromCharCode(c);\r-,-i++;\r-,-}elseif((c>191)&&(c<224)){\r-,-c2=utftext.charCodeAt(i+1);\r-,-string+=String.fromCharCode(((c&31)<<6)|(c2&63));\r-,-i+=2;\r-,-}else{\r-,-c2=utftext.charCodeAt(i+1);\r-,-c3=utftext.charCodeAt(i+2);\r-,-string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));\r-,-i+=3;\r-,-}\r-,-}\r-,-returnstring;\r-,-}\r-,-};\r-,-\r-,-varlen=timestamp.toString().length-6;\r-,-varserialId=timestamp.toString().substr(len);\r-,-varmyDate=newDate();\r-,-varyear=myDate.getFullYear();\r-,-varmonth=(myDate.getMonth()+1)<10?\-0\-+(myDate.getMonth()+1):myDate.getMonth()+1;\r-,-varday=myDate.getDate()<10?\-0\-+myDate.getDate():myDate.getDate();\r-,-vardate1=year+\-\-+month+\-\-+day;\r-,-vardate2=year+\--\-+month+\--\-+day;\r-,-vartime1=date2+\-\-+myDate.getHours()+\-:\-+myDate.getMinutes()+\-:\-+myDate.getSeconds();\r-,-\r-,-push_bill_param=[{\r-,-\-serialNo\-:\-34234FPY123456111\-,\r-,-\-deviceNo\-:\-\-,\r-,-\-terminalNo\-:\-\-,\r-,-\-orgCode\-:\-\-,\r-,-\-invoiceProperty\-:\-0\-,\r-,-\-invoiceType\-:\-007\-,\r-,-\-sellerName\-:\-金蝶软件(中国)有限公司\-,\r-,-\-sellerTaxpayerId\-:\-915003006188392540\-,\r-,-\-sellerBankAndAccount\-:\-深圳市福田区梅景123456789\-,\r-,-\-sellerAddressAndTel\-:\-中国银行123456789\-,\r-,-\-buyerName\-:\-深圳市顺丰快运有限公司\-,\r-,-\-buyerTaxpayerId\-:\-91440300MA5FNT.