From dcb0fc0a37462e59eb84c79136b541ac4d88a582 Mon Sep 17 00:00:00 2001
From: Jeason0228 <44083849+Jeason0228@users.noreply.github.com>
Date: Sat, 12 Oct 2019 19:05:52 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20=E7=A7=91=E5=88=9B?=
=?UTF-8?q?=E6=9D=BF=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=20RSS=20(#3229)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/other.md | 4 +++
lib/router.js | 1 +
lib/routes/sse/renewal.js | 61 +++++++++++++++++++++++++++++++++++++++
3 files changed, 66 insertions(+)
create mode 100644 lib/routes/sse/renewal.js
diff --git a/docs/other.md b/docs/other.md
index 497cf5514ac1d1..0d6bb4704fdcb7 100644
--- a/docs/other.md
+++ b/docs/other.md
@@ -289,6 +289,10 @@ type 为 all 时,category 参数不支持 cost 和 free
+### 科创板项目动态
+
+
+
## 深圳证券交易所
### 上市公告-可转换债券
diff --git a/lib/router.js b/lib/router.js
index 915d692a43fc6f..c970d8392b6fbe 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1730,6 +1730,7 @@ router.get('/latexstudio/home', require('./routes/latexstudio/home'));
// 上证债券信息网 - 可转换公司债券公告
router.get('/sse/convert/:query?', require('./routes/sse/convert'));
+router.get('/sse/renewal/', require('./routes/sse/renewal'));
// 深圳证券交易所——上市公告
router.get('/szse/notice/', require('./routes/szse/notice'));
diff --git a/lib/routes/sse/renewal.js b/lib/routes/sse/renewal.js
new file mode 100644
index 00000000000000..95a6d678cb940b
--- /dev/null
+++ b/lib/routes/sse/renewal.js
@@ -0,0 +1,61 @@
+const got = require('@/utils/got');
+
+module.exports = async (ctx) => {
+ const pageUrl = 'http://kcb.sse.com.cn/renewal/';
+ const host = `http://kcb.sse.com.cn/`;
+
+ const response = await got({
+ method: 'get',
+ url: `http://query.sse.com.cn/statusAction.do?isPagination=true&sqlId=SH_XM_LB&pageHelp.pageSize=20&offerType=&commitiResult=®isteResult=&csrcCode=&currStatus=&order=updateDate%7Cdesc&keyword=&auditApplyDateBegin=&auditApplyDateEnd=&_=${new Date().getTime()}`,
+ headers: {
+ Referer: pageUrl,
+ },
+ });
+ function currStatus(e) {
+ const currStatusName = ['全部', '已受理', '已询问', '通过', '未通过', '提交注册', '补充审核', '注册结果', '中止', '终止'];
+ return currStatusName[e];
+ }
+ function sortDate(e) {
+ const pubss = e.substr(12, 2);
+ const pubmm = e.substr(10, 2);
+ const pubhh = e.substr(8, 2);
+ const pubday = e.substr(6, 2);
+ const pubmonth = e.substr(4, 2);
+ const pubyear = e.substr(0, 4);
+ const pubdateString = pubmonth + `-` + pubday + `-` + pubyear + ' ' + pubhh + `:` + pubmm + `:` + pubss;
+ // console.log(pubdateString);
+ return pubdateString;
+ }
+ // console.log(response.data.result);
+ const items = response.data.result.map((item) => {
+ const single = {
+ title: `【` + currStatus(item.currStatus) + `】${item.stockAuditName}`,
+ description:
+ `
+ 发行人全称 | ${item.stockAuditName} |
+ 审核状态 | ` +
+ currStatus(item.currStatus) +
+ ` |
+ 注册地 | ${item.stockIssuer[0].s_province} |
+ 证监会行业 | ${item.stockIssuer[0].s_csrcCodeDesc} |
+ 更新日期 | ` +
+ new Date(sortDate(item.updateDate)).toLocaleString() +
+ ` |
+ 受理日期 | ` +
+ new Date(sortDate(item.auditApplyDate)).toLocaleString() +
+ ` |
+ 详细链接 | 查看详情 |
+
`,
+ pubDate: new Date(sortDate(item.updateDate)).toLocaleString(),
+ link: `${host}/renewal/xmxq/index.shtml?auditId=${item.stockAuditNum}`,
+ author: currStatus(item.currStatus),
+ };
+ return single;
+ });
+
+ ctx.state.data = {
+ title: '上证债券信息网 - 科创板项目动态',
+ link: pageUrl,
+ item: items,
+ };
+};