Commit d6502125 by 任晓松

Merge remote-tracking branch 'origin/center-order' into center-order

parents d9d47b7f 9bc59bc7
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class IcpAPI extends APIBase {
constructor() {
super();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
if (pobj.actionType == 'getPolicyNeedList' || pobj.actionType == 'submitPolicyNeedNotes') {
if (!pobj.userInfo) {
return system.getResult(system.noLogin, "user no login!");
}
if (!pobj.appInfo) {
return system.getResult(system.noLogin, "app is null!");
}
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
// case "submitIcpProgramme"://icp方案提交
// opResult = await this.needsolutionSve.submitIcpProgramme(pobj);
// break;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.needsolutionSve.submitIcpMaterial(pobj);
// break;
// case "acceptIcpPartnerNotification"://icp通知状态变更
// opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj);
// break;
// case "abolishIcpProgramme"://服务商icp方案关闭
// opResult = await this.needsolutionSve.abolishIcpProgramme(pobj);
// break;
// case "getIcpProgrammeDetail"://获取icp方案
// opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
// break;
// case "getNeedSolutionDetailByUser"://获取方案详情
// opResult = await this.needsolutionSve.getNeedSolutionDetailByUser(pobj);
// break;
// case "receiveIcpStatusNotify"://接收渠道方案状态变更通知
// opResult = await this.needsolutionSve.receiveIcpStatusNotify(pobj);
// break;
// case "receiveIcpFeedback"://接收icp用户方案反馈
// opResult = await this.needsolutionSve.receiveIcpFeedback(pobj);
// break;
// case "getIcpProgrammeDetail"://获取方案详情(内部调用)
// opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
// break;
// case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
// opResult = await this.needsolutionSve.getProgrammeInfoByChannelNeedNo(pobj);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = IcpAPI;
\ No newline at end of file
......@@ -43,7 +43,7 @@ class IcAPI extends APIBase {
opResult = await this.opNeedInfoSve.opNeedClose(pobj, pobj.actionBody, req);
break;
case "opGetItemByNeedNo"://获取需求详情
opResult = await this.needinfoSve.getItemByNeedNo(pobj);
opResult = await this.opNeedInfoSve.getItemByNeedNo(pobj);
break;
case "getStatisticsByUappId":
opResult = await this.opNeedInfoSve.getStatisticsByUappId(pobj);
......
......@@ -63,9 +63,9 @@ class QcAPI extends APIBase {
case "receiveIcpFeedback"://接收icp用户方案反馈2.2
opResult = await this.aliyunqcSve.receiveIcpFeedback(pobj);
break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用)
opResult = await this.aliyunqcSve.getIcpProgrammeDetail(pobj);
break;
// case "getIcpProgrammeDetail"://获取方案详情(内部调用)
// opResult = await this.aliyunqcSve.getIcpProgrammeDetail(pobj);
// break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj);
break;
......
......@@ -237,53 +237,6 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item);
}
async writeCommunicationLog(pobj, actionBody) {
// 查询需求沟通记录
// 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.intentionBizId
};
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
return system.getResultSuccess();
}
return system.getResult("添加记录失败");
// 有需求单有沟通记录 json_array_append
} else {
var sql = "update n_need_info set followContent=json_array_append(followContent, '$', JSON_OBJECT(:Note)) where channelNeedNo=:BizId"
// 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.intentionBizId
};
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
return system.getResultSuccess();
}
return system.getResult("添加记录失败");
}
}
async submitIcpIntention(pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
var nobj = {
......
......@@ -7,7 +7,6 @@ class NeedinfoService extends ServiceBase {
constructor () {
super("dbneed", ServiceBase.getDaoName(NeedinfoService));
this.execlient = system.getObject("util.execClient");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
this.needinfofqDao = system.getObject("db.dbneed.needinfofqDao");
......
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