feat: remove 停电通知-国家电网, close #2266

This commit is contained in:
DIYgod
2019-12-13 17:22:20 +08:00
parent 4ee95d9dcf
commit d6aff27419
3 changed files with 0 additions and 64 deletions

View File

@@ -34,14 +34,6 @@ pageClass: routes
## 停电通知
获取未来一天的停电通知
### 国家电网
<Route author="xyqfer moonbegonia" example="/tingdiantz/95598/36401/36101" path="/tingdiantz/95598/:orgNo/:provinceNo/:scope?" :paramsDesc="['所属省供电公司编码', '所属地市供电公司编码', '停电范围关键字']"/>
> 以上参数可从[查询页面](http://www.95598.cn/95598/outageNotice/initOutageNotice)打开控制台抓包获得
### 南京市
<Route author="ocleo1" example="/tingdiantz/nanjing" path="/tingdiantz/nanjing"/>

View File

@@ -1030,8 +1030,6 @@ router.get('/facebook/page/:id', require('./routes/facebook/page'));
router.get('/bihu/activaties/:id', require('./routes/bihu/activaties'));
// 停电通知
router.get('/tingdiantz/95598/:orgNo/:provinceNo/:outageStartTime/:outageEndTime/:scope?', require('./routes/tingdiantz/95598'));
router.get('/tingdiantz/95598/:orgNo/:provinceNo/:scope?', require('./routes/tingdiantz/95598'));
router.get('/tingdiantz/nanjing', require('./routes/tingdiantz/nanjing'));
// 36kr

View File

@@ -1,54 +0,0 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const { orgNo, provinceNo, scope = '', typeCode = '', lineName = '' } = ctx.params;
let { outageStartTime, outageEndTime } = ctx.params;
if (!outageStartTime) {
outageStartTime = new Date(Date.now()).toISOString().slice(0, 10);
}
if (!outageEndTime) {
outageEndTime = new Date(Date.now() + 86400000).toISOString().slice(0, 10);
}
const anHui = provinceNo === '34101' ? '01' : '02';
const response = await got({
method: 'post',
url: 'http://www.95598.cn/95598/outageNotice/queryOutageNoticeList',
form: true,
data: {
orgNo,
outageStartTime,
outageEndTime,
scope,
provinceNo,
typeCode,
lineName,
anHui,
},
});
const items = (response.data.seleList || []).map((item) => {
const title = `${item.subsName} | ${item.typeCode || ''}`;
const description = `
<strong>停电时间:</strong>${item.startTime} - ${item.stopTime} <br>
<strong>停电范围:</strong>${item.scope} <br>
<strong>停电线路:</strong>${item.lineName} <br>
<strong>公变名称:</strong>${item.pubTranName} <br>
<strong>停电原因:</strong>${item.poweroffReason} <br>
`;
const guid = item.powerOffId;
const pubDate = new Date(item.startTime).toUTCString();
return {
title,
description,
guid,
pubDate,
};
});
ctx.state.data = {
title: '国家电网停电通知',
link: 'http://www.95598.cn/95598/outageNotice/initOutageNotice',
item: items,
};
};