征抄报税的日期各有不同,要在自己的应用中获取12366提供的办税日历数据,可以打开开发者模式,对页面源码进行分析。
办税日历链接:https://12366.chinatax.gov.cn/bsfw/calendar/getCalendarListForDay
这段源码的含义是,根据不同的区域,获得相应的代码:
var headerTargetAreaMap = { "111000000": "北京市", "112000000": "天津市", "113000000": "河北省", "114000000": "山西省", "115000000": "内蒙古自治区", "121000000": "辽宁省", "122000000": "吉林省", "123000000": "黑龙江省", "131000000": "上海市", "132000000": "江苏省", "133000000": "浙江省", "134000000": "安徽省", "135000000": "福建省", "136000000": "江西省", "137000000": "山东省", "141000000": "河南省", "142000000": "湖北省", "143000000": "湖南省", "144000000": "广东省", "145000000": "广西壮族自治区", "146000000": "海南省", "150000000": "重庆市", "151000000": "四川省", "152000000": "贵州省", "153000000": "云南省", "154000000": "西藏自治区", "161000000": "陕西省", "162000000": "甘肃省", "163000000": "青海省", "164000000": "宁夏回族自治区", "165000000": "新疆维吾尔自治区", "121020000": "大连市", "133020000": "宁波市", "135020000": "厦门市", "137020000": "青岛市", "144030000": "深圳市" }
需要关注的是, if(city_=='宁波市'||city_=='青岛市'||city_=='深圳市'||city_=='厦门市'||city_=='大连市') 这五个区域的代码是单列的。
我们将上述12366-省份代码存储至表格,通过数据选择器确定省份,再利用对应代码查询数据。
观察源码可知,根据月份查询办税日历的API调用方式如下:
$.ajax({ url: "/bsfw/calendar/getCalendarListForMonth", type: "post", dataType: "json", data: param, success: function (res) { //…… }
在ApiFox中的调用结果如下:
成功时返回200,返回的数据格式如下:
{ "zrarData": { "select": {}, "form": {}, "grid": {}, "tree": {}, "checkbox": {}, "asyncTree": {}, "radio": {} }, "warn": "", "json": { "list": [ { "bbh": "", "bsjssj": "2024-03-31 00:00:00", "bskssj": "2024-01-01 00:00:00", "bssz": "核事故应急准备专项收入(按年)", "bz": "", "cjr": "d3965a0d32d749c28e2c26e41f61e1d9", "cjrbm": "2055", "cjrbmmc": "纳服中心", "cjrjg": "133000000", "cjrjgmc": "浙江省税务局", "cjrmc": "123662", "cjsj": "2023-12-29 15:42:31", "gdsbz": "", "gxsj": "", "jhzt": "", "rlid": "b813f509819c48e1bafe7ebcc5f373bd", "sfsc": "0", "sftb": "", "sfyx": "1", "ssjg": "133000000", "ssjgmc": "浙江省税务局", "xzqhbm": "" }, { ……(略) } ] }, "message": "", "statusCode": "200" }
list各元素含义(猜测):
办税结束时间(bsjssj)
办税开始时间(bskssj)
办税税种(bssz)
区域代码(cjrjg)
部门名称(cjrjgmc)