Commit 00a677ec by 王悦

查询咨询客户列表

parent 5dd8ee5d
...@@ -60,6 +60,9 @@ class IcAPI extends APIBase { ...@@ -60,6 +60,9 @@ class IcAPI extends APIBase {
case "confirmIcpIntention":// 2020 0827 lin 新增 4.3 用户需求确认 case "confirmIcpIntention":// 2020 0827 lin 新增 4.3 用户需求确认
opResult = await this.needinfoSve.confirmIcpIntention(pobj, pobj.actionBody, req); opResult = await this.needinfoSve.confirmIcpIntention(pobj, pobj.actionBody, req);
break; break;
case "getUnCreated":// 获取需求列表
opResult = await this.needinfoSve.getUnCreated(pobj, pobj.actionBody, req);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -86,7 +86,8 @@ class NeedinfoService extends ServiceBase { ...@@ -86,7 +86,8 @@ class NeedinfoService extends ServiceBase {
typeName: actionBody.type_name, typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code, channelTypeCode: actionBody.channel_type_code,
channelTypeName: actionBody.channel_type_name, channelTypeName: actionBody.channel_type_name,
status: "wts" status: "wts",
notes: actionBody.notes
} }
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
nobj.province = nobj.city, nobj.province = nobj.city,
...@@ -292,6 +293,20 @@ class NeedinfoService extends ServiceBase { ...@@ -292,6 +293,20 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
} }
async getUnCreated (pobj, data, req) {
let stdate = new Date(pobj.actionBody.Begin);
let enddate = new Date(pobj.actionBody.End );
let query = {where:{}};
query.where["created_at"] = { [this.db.Op.between]: [stdate, enddate] };
try {
let res = await this.dao.model.findAndCountAll(query);
res = res.rows.map(n=>n.channelNeedNo);
res = pobj.actionBody.data.filter(ali=>!res.includes(ali.BizId));
return system.getResultSuccess(res)
} catch (error) {
return system.getResultFail(-1, error.message)
}
}
} }
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