|
|
@ -90,7 +90,7 @@ module.exports = function (app, opts) { |
|
|
|
processingPersonnelPhone: user && user.length && user[0].phone, |
|
|
|
isSend: false, |
|
|
|
haveDone: parseData.solution_status.value ? (parseData.solution_status.value === '否' ? false : true) : false, |
|
|
|
createTime: moment(f.createTime).format('YYYY-MM-DD'), |
|
|
|
createTime: moment(f.createTime).format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
@ -106,7 +106,7 @@ module.exports = function (app, opts) { |
|
|
|
//数据全部插入完成之后(筛选数据进行发送企业微信通知)
|
|
|
|
// 获取当前时间
|
|
|
|
// 计算当前时间之后一天的日期
|
|
|
|
const lastDay = moment().subtract(1, 'days') |
|
|
|
const lastDay = moment().add(1, 'days') |
|
|
|
//需要发送提醒的数据
|
|
|
|
const sendRslt = await models.WorkOrderNotice.findAll({ |
|
|
|
where: { |
|
|
@ -114,7 +114,7 @@ module.exports = function (app, opts) { |
|
|
|
haveDone: false,//未完成
|
|
|
|
|
|
|
|
planTime: { |
|
|
|
$gte: lastDay |
|
|
|
$between: [moment().format('YYYY-MM-DD HH:mm:ss'), moment(lastDay).format('YYYY-MM-DD HH:mm:ss')] |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
@ -133,7 +133,19 @@ module.exports = function (app, opts) { |
|
|
|
if (userId) { |
|
|
|
const res = await sendWechat({ |
|
|
|
opts, msgtype: sendType["mini"], |
|
|
|
data: { userId: userId, touser: [userId],content:`你有一个表单《运维中台售后工单问题处理工单 ${c.createTime}》,修复时间即将超期,请尽快处理` } |
|
|
|
data: { |
|
|
|
userId: userId, touser: [userId], content: [{ |
|
|
|
"key": "工单类型", |
|
|
|
"value": "运维中台售后工单问题处理工单" |
|
|
|
}, { |
|
|
|
"key": "发起时间", |
|
|
|
"value": c.createTime |
|
|
|
}, { |
|
|
|
"key": "计划修复时间", |
|
|
|
"value": c.planTime |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}) |
|
|
|
if (res.body.errmsg === 'ok') { |
|
|
|
//将已发送的记录的isSend修改为true(已发送)
|
|
|
@ -147,7 +159,20 @@ module.exports = function (app, opts) { |
|
|
|
if (manager) { |
|
|
|
const res = await sendWechat({ |
|
|
|
opts, msgtype: sendType["mini"], |
|
|
|
data: { userId: manager, touser: [manager],content:`你有一个表单《运维中台售后工单问题处理工单 ${c.createTime}》,修复时间即将超期,请尽快处理` } |
|
|
|
data: { userId: manager, touser: [manager], |
|
|
|
content: [{ |
|
|
|
"key": "工单类型", |
|
|
|
"value": "运维中台售后工单问题处理工单" |
|
|
|
}, { |
|
|
|
"key": "发起时间", |
|
|
|
"value": c.createTime |
|
|
|
}, { |
|
|
|
"key": "计划修复时间", |
|
|
|
"value": c.planTime |
|
|
|
} |
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
if (res.body.errmsg === 'ok') { |
|
|
|
//将已发送的记录的isSend修改为true(已发送)
|
|
|
|