Commit 3e17e4e2 by linboxuan

submitIcpIntention,queryIntentionList,confirmIcpIntention add

parent d12bcb68
...@@ -51,6 +51,15 @@ class IcAPI extends APIBase { ...@@ -51,6 +51,15 @@ class IcAPI extends APIBase {
case "writeCommunicationLog"://渠道方案号获取需求详情 case "writeCommunicationLog"://渠道方案号获取需求详情
opResult = await this.needinfoSve.writeCommunicationLog(pobj, pobj.actionBody, req); opResult = await this.needinfoSve.writeCommunicationLog(pobj, pobj.actionBody, req);
break; break;
case "submitIcpIntention":// 2020 0827 lin 新增 4.1 提交需求
opResult = await this.needinfoSve.submitIcpIntention(pobj, pobj.actionBody, req);
break;
case "queryIntentionList":// 2020 0827 lin 新增 4.2 需求列表查询
opResult = await this.needinfoSve.queryIntentionList(pobj, pobj.actionBody, req);
break;
case "confirmIcpIntention":// 2020 0827 lin 新增 4.3 用户需求确认
opResult = await this.needinfoSve.confirmIcpIntention(pobj, pobj.actionBody, req);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -224,6 +224,74 @@ class NeedinfoService extends ServiceBase { ...@@ -224,6 +224,74 @@ class NeedinfoService extends ServiceBase {
return system.getResult("添加记录失败"); return system.getResult("添加记录失败");
} }
} }
async submitIcpIntention(pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
var nobj = {
uapp_id: pobj.appInfo.uapp_id,
needNo: needNo,
channelUserId: pobj.userInfo.channel_userid,
publishName: actionBody.UserName,
publishContent: actionBody.Description,
publishMobile: actionBody.Mobile,
city: actionBody.Area,
typeCode: actionBody.type_code,
typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code,
channelTypeName: actionBody.channel_type_name,
status: "wts"
}
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
nobj.province = nobj.city,
nobj.city = "";
}
await this.dao.create(nobj);
return system.getResultSuccess();
}
async queryIntentionList(pobj, actionBody, req) {
if (!actionBody.intentionBizId) {
return system.getResultFail(-5005, "intentionBizId不能为空");
}
var needinfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
if (!needinfo) {
return system.getResultFail(-5004, "需求不存在");
}
if (needinfo.status == "ygb" || needinfo.status == "ycd") {
return system.getResultSuccess();
} else {
needinfo.status = "ygb";
// 2020 0821 lin 新增 修改增加 跟进者唯一码(非必填),跟进者手机号(必填)
needinfo.followManMobile = actionBody.followManMobile;
needinfo.followManUserId = actionBody.followManUserId;
var self = this;
await self.update(needinfo.dataValues);
await self.needsolutionSve.abolishProgrammeByNeed(pobj);
return system.getResultSuccess();
}
}
async confirmIcpIntention(pobj, actionBody, req) {
if (!actionBody.intentionBizId) {
return system.getResultFail(-5005, "intentionBizId不能为空");
}
var needinfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
if (!needinfo) {
return system.getResultFail(-5004, "需求不存在");
}
if (needinfo.status == "ygb" || needinfo.status == "ycd") {
return system.getResultSuccess();
} else {
needinfo.status = "ygb";
// 2020 0821 lin 新增 修改增加 跟进者唯一码(非必填),跟进者手机号(必填)
needinfo.followManMobile = actionBody.followManMobile;
needinfo.followManUserId = actionBody.followManUserId;
var self = this;
await self.update(needinfo.dataValues);
await self.needsolutionSve.abolishProgrammeByNeed(pobj);
return system.getResultSuccess();
}
}
} }
module.exports = NeedinfoService; module.exports = NeedinfoService;
......
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