Skip to content

Commit

Permalink
feat: 添加 科创板项目动态 RSS (DIYgod#3229)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeason0228 authored and DIYgod committed Oct 12, 2019
1 parent 2a27d95 commit dcb0fc0
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ type 为 all 时,category 参数不支持 cost 和 free

<Route author="kt286" example="/sse/convert/beginDate=2018-08-18&endDate=2019-08-18&companyCode=603283&title=股份" path="/sse/convert/:query?" :paramsDesc="['筛选条件,见示例']"/>

### 科创板项目动态

<Route author="Jeason0228" example="/sse/renewal" path="/sse/renewal"/>

## 深圳证券交易所

### 上市公告-可转换债券
Expand Down
1 change: 1 addition & 0 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
61 changes: 61 additions & 0 deletions lib/routes/sse/renewal.js
Original file line number Diff line number Diff line change
@@ -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=&registeResult=&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:
`<table>
<tr><th id="stockIssuer" desc="发行人全称">发行人全称</th><td>${item.stockAuditName}</td> </tr>
<tr><th id="currStatus" desc="审核状态">审核状态</th><td>` +
currStatus(item.currStatus) +
`</td> </tr>
<tr><th desc="注册地">注册地</th><td>${item.stockIssuer[0].s_province}</td> </tr>
<tr><th desc="证监会行业">证监会行业</th><td>${item.stockIssuer[0].s_csrcCodeDesc}</td> </tr>
<tr><th id="updateDate" desc="更新日期">更新日期</th><td>` +
new Date(sortDate(item.updateDate)).toLocaleString() +
`</td> </tr>
<tr><th id="auditApplyDate" desc="受理日期">受理日期</th><td>` +
new Date(sortDate(item.auditApplyDate)).toLocaleString() +
`</td> </tr>
<tr><th >详细链接</th><td><a href="http://kcb.sse.com.cn/renewal/xmxq/index.shtml?auditId=${item.stockAuditNum}">查看详情</a></td> </tr>
</table>`,
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,
};
};

0 comments on commit dcb0fc0

Please sign in to comment.