You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
const moment = require('moment')
|
|
|
|
let isDev = false
|
|
isDev = true
|
|
|
|
module.exports = function (app, opts) {
|
|
const notice = app.fs.scheduleInit(
|
|
{
|
|
interval: '0 9 */1 * * *',
|
|
immediate: isDev && opts.dev,
|
|
proRun: !isDev,
|
|
disabled: false
|
|
},
|
|
|
|
async () => {
|
|
try {
|
|
const { models, ORM: sequelize } = app.fs.dc
|
|
console.log(123123);
|
|
const anomalyList = await models.Report.findAll({
|
|
where: {
|
|
handleState: null,
|
|
reportType: 'anomaly',
|
|
time: {
|
|
[sequelize.Op.lt]: moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm:ss')
|
|
}
|
|
},
|
|
include: [{
|
|
model: models.User,
|
|
}, {
|
|
model: models.Road,
|
|
as: 'road_'
|
|
}]
|
|
})
|
|
|
|
for (let i = 0; i < anomalyList.length; i++) {
|
|
const anomaly = anomalyList[i]
|
|
/**
|
|
* 通过XX(反馈类型)反馈,XX(所道路)的XX(所属路段)路段,具体位置于XX,XXXX(反馈内容)。XXX(上报人)上报时间:XX。您已超过3天未处理,请至平台尽快处理。
|
|
*/
|
|
|
|
|
|
}
|
|
|
|
console.log(anomalyList);
|
|
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
}
|
|
)
|
|
|
|
return {
|
|
notice,
|
|
}
|
|
}
|