Commit 91263a4c by linboxuan

writeCommunicationLog update status ook

parent fd549e65
......@@ -177,18 +177,29 @@ class NeedinfoService extends ServiceBase {
async writeCommunicationLog(pobj, actionBody) {
// 查询需求沟通记录
actionBody.Note = ["noteTime", moment().format("YYYY-MM-DD HH:mm:ss"), "note", actionBody.Note];
let needRes = await this.findOne({ channelNeedNo: actionBody.BizId });
// 2020 0820 lin 修改channel传过来的参数 为 note/intentionBizId
actionBody.Note = ["noteTime", moment().format("YYYY-MM-DD HH:mm:ss"), "note", actionBody.note];
let needRes = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
// 没有需求单直接返回
if (!needRes) {
return system.getResult("没有这个需求单");
}
// 如果未推送/以推送 修改为已跟进
if(needRes.status == "wts" || needRes.status == "yts") {
var sql = "update n_need_info set status=:status, statusName=:statusName where channelNeedNo=:BizId"
var paramWhere = {
statusName: '已跟进',
status: 'ygj',
BizId: actionBody.intentionBizId
};
var updateRes = await this.customUpdate(sql, paramWhere);
}
// 有需求单但没有沟通记录 直接set
if (!needRes.followContent) {
var sql = "update n_need_info set followContent=JSON_OBJECT(:followContent) where channelNeedNo=:BizId"
var paramWhere = {
followContent: actionBody.Note,
BizId: actionBody.BizId
BizId: actionBody.intentionBizId
};
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
......@@ -201,7 +212,7 @@ class NeedinfoService extends ServiceBase {
// var sql = "update n_need_info set followContent=json_array_append(followContent, '$', "+ "\"" + JSON.stringify(actionBody.Note) + "\""+") where channelNeedNo="+ "\"" +actionBody.BizId +"\"" +" "
var paramWhere = {
Note: actionBody.Note,
BizId: actionBody.BizId
BizId: actionBody.intentionBizId
};
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment