Commit aff47d81 by 宋毅

tj

parent 3feac937
...@@ -60,15 +60,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -60,15 +60,16 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) { if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A"; pobj.actionBody.level = "A";
} else { } else {
var levelurl = "http://106.13.228.212:8000/recProbability"; // var levelurl = "http://106.13.228.212:8000/recProbability";
var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl); // var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl);
if (levelresult.status == 0) { // if (levelresult.status == 0) {
pobj.actionBody.level = levelresult.data.level; // pobj.actionBody.level = levelresult.data.level;
pobj.actionBody.probability = levelresult.data.per; // pobj.actionBody.probability = levelresult.data.per;
} else { // } else {
// pobj.actionBody.level = "C"
// }
pobj.actionBody.level = "C" pobj.actionBody.level = "C"
} }
}
if (pobj.actionBody.phone == "17319425791") { if (pobj.actionBody.phone == "17319425791") {
pobj.actionBody.level = "F"; pobj.actionBody.level = "F";
...@@ -106,7 +107,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -106,7 +107,7 @@ class UtilsNeedService extends AppServiceBase {
} }
var self = this; var self = this;
pobj.actionType = "receiveIcpFeedback"; pobj.actionType = "receiveIcpFeedback";
if(pobj.actionBody && pobj.actionBody.intentionStatus){ if (pobj.actionBody && pobj.actionBody.intentionStatus) {
pobj.intentionStatus = pobj.actionBody.intentionStatus; pobj.intentionStatus = pobj.actionBody.intentionStatus;
} }
var rtn = await this.execClient.execPost(pobj, url); var rtn = await this.execClient.execPost(pobj, url);
...@@ -1340,15 +1341,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1340,15 +1341,16 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) { if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A"; pobj.actionBody.level = "A";
} else { } else {
var levelurl = "http://106.13.228.212:8000/recProbability"; // var levelurl = "http://106.13.228.212:8000/recProbability";
var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl); // var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl);
if (levelresult.status == 0) { // if (levelresult.status == 0) {
pobj.actionBody.level = levelresult.data.level; // pobj.actionBody.level = levelresult.data.level;
pobj.actionBody.probability = levelresult.data.per; // pobj.actionBody.probability = levelresult.data.per;
} else { // } else {
// pobj.actionBody.level = "C"
// }
pobj.actionBody.level = "C" pobj.actionBody.level = "C"
} }
}
if (pobj.actionBody.phone == "17319425791") { if (pobj.actionBody.phone == "17319425791") {
pobj.actionBody.level = "F"; pobj.actionBody.level = "F";
......
...@@ -6,8 +6,8 @@ const { json } = require("sequelize"); ...@@ -6,8 +6,8 @@ const { json } = require("sequelize");
const { getResult, getResultSuccess } = require("../../../system"); const { getResult, getResultSuccess } = require("../../../system");
//区分渠道的uappid //区分渠道的uappid
const uappId = { const uappId = {
'ali':"18", //(阿里icp、edi) 'ali': "18", //(阿里icp、edi)
'baidu':"44" //(百度icp、edi) 'baidu': "44" //(百度icp、edi)
} }
//需求操作类----ali对接的需求 //需求操作类----ali对接的需求
class UtilsNeedService2 extends AppServiceBase { class UtilsNeedService2 extends AppServiceBase {
...@@ -35,7 +35,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -35,7 +35,7 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitNeed(pobj, actionBody) { async submitNeed(pobj, actionBody) {
if(actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") { if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") {
actionBody.area = this.wangwenAreaChange(actionBody.area) actionBody.area = this.wangwenAreaChange(actionBody.area)
} }
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -69,17 +69,18 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -69,17 +69,18 @@ class UtilsNeedService2 extends AppServiceBase {
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) { if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A"; pobj.actionBody.level = "A";
} else { } else {
var levelurl = "http://106.13.228.212:8000/recProbability"; // var levelurl = "http://106.13.228.212:8000/recProbability";
var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl); // var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl);
if (levelresult.status == 0) { // if (levelresult.status == 0) {
pobj.actionBody.level = levelresult.data.level; // pobj.actionBody.level = levelresult.data.level;
pobj.actionBody.probability = levelresult.data.per; // pobj.actionBody.probability = levelresult.data.per;
} else { // } else {
// pobj.actionBody.level = "C"
// }
pobj.actionBody.level = "C" pobj.actionBody.level = "C"
} }
}
if(pobj.actionBody.phone=="17319425791"){ if (pobj.actionBody.phone == "17319425791") {
pobj.actionBody.level = "F"; pobj.actionBody.level = "F";
} }
...@@ -259,8 +260,8 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -259,8 +260,8 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async needCloseIcp(pobj, actionBody) { async needCloseIcp(pobj, actionBody) {
console.log('guanbi icp xuqiu pobj+++',pobj) console.log('guanbi icp xuqiu pobj+++', pobj)
if(actionBody.uapp_id == uappId.ali){ if (actionBody.uapp_id == uappId.ali) {
if (!actionBody.channelNeedNo) { if (!actionBody.channelNeedNo) {
return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395"); return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395");
} }
...@@ -282,9 +283,9 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -282,9 +283,9 @@ class UtilsNeedService2 extends AppServiceBase {
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
console.log('result close',result) console.log('result close', result)
if (result.status == 0) { if (result.status == 0) {
if (result.data && result.data.orderNo ) { if (result.data && result.data.orderNo) {
pobj.actionBody.orderNo = result.data.orderNo; pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody); var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) { if (orderrtn.status < 0) {
...@@ -313,14 +314,14 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -313,14 +314,14 @@ class UtilsNeedService2 extends AppServiceBase {
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
// 推送ali // 推送ali
if(result.data.uapp_id == uappId.ali){ if (result.data.uapp_id == uappId.ali) {
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" }); var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
} }
// 推送baidu // 推送baidu
if(result.data.uapp_id == uappId.baidu){ if (result.data.uapp_id == uappId.baidu) {
var a = await self.baiduclient.baiduReqbyget({ path : "/api/bla/provider/requirement/update", reqbody : { requirementId : actionBody.channelNeedNo, status: "CLOSED" ,note: actionBody.note }}); var a = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: { requirementId: actionBody.channelNeedNo, status: "CLOSED", note: actionBody.note } });
} }
console.log("closed need a+++",a); console.log("closed need a+++", a);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed"); self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess(); return system.getResultSuccess();
} else { } else {
...@@ -380,7 +381,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -380,7 +381,7 @@ class UtilsNeedService2 extends AppServiceBase {
} }
actionBody.newuserOtherList = newuserOtherList; actionBody.newuserOtherList = newuserOtherList;
} }
if (actionBody.isDirectBuy === "true"&&(actionBody.status == 1||actionBody.status == 0)) {//已支付直购不调用 if (actionBody.isDirectBuy === "true" && (actionBody.status == 1 || actionBody.status == 0)) {//已支付直购不调用
return system.getResultSuccess(); return system.getResultSuccess();
} }
pobj.actionType = "receiveIcpStatusNotify"; pobj.actionType = "receiveIcpStatusNotify";
...@@ -391,7 +392,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -391,7 +392,7 @@ class UtilsNeedService2 extends AppServiceBase {
actionBody: { actionBody: {
orderNo: rtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo, orderNo: rtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
needsolution: rtn.data.solutionContent, needsolution: rtn.data.solutionContent,
channelNeedNo: rtn.data.channelNeedNo||"", channelNeedNo: rtn.data.channelNeedNo || "",
channelSolutionNo: rtn.data.channelSolutionNo, channelSolutionNo: rtn.data.channelSolutionNo,
servicer: { servicer: {
code: 'gsb', code: 'gsb',
...@@ -509,14 +510,14 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -509,14 +510,14 @@ class UtilsNeedService2 extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
//2020-10-28 laolan start //2020-10-28 laolan start
if(result && result.status == 0 && result.data){ if (result && result.status == 0 && result.data) {
if(result.data == uappId.aliConfirmResult){ if (result.data == uappId.aliConfirmResult) {
var res = await self.aliclient.reqbyget({ action: "writeCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" }); var res = await self.aliclient.reqbyget({ action: "writeCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" });
console.log("ali+res",res) console.log("ali+res", res)
} }
if(result.data == uappId.baidu){ if (result.data == uappId.baidu) {
var ress = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/communication", reqbody: { requirementId: pobj.actionBody.intentionBizId, content: pobj.actionBody.note } }); var ress = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/communication", reqbody: { requirementId: pobj.actionBody.intentionBizId, content: pobj.actionBody.note } });
console.log("baidu+res",ress) console.log("baidu+res", ress)
} }
} }
...@@ -553,9 +554,9 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -553,9 +554,9 @@ class UtilsNeedService2 extends AppServiceBase {
//2020-10-28 laolan start //2020-10-28 laolan start
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
console.log('jilu+++result++++',result) console.log('jilu+++result++++', result)
if(result && result.status == 0 && result.data && result.data.uapp_id){ if (result && result.status == 0 && result.data && result.data.uapp_id) {
if(result.data.uapp_id == uappId.ali){ if (result.data.uapp_id == uappId.ali) {
var res = await this.aliclient.reqbyget({ var res = await this.aliclient.reqbyget({
action: "QueryExpertApplyCommunicationLogs", reqbody: { action: "QueryExpertApplyCommunicationLogs", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
...@@ -568,8 +569,8 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -568,8 +569,8 @@ class UtilsNeedService2 extends AppServiceBase {
}); });
} }
if(result.data.uapp_id == uappId.baidu){ if (result.data.uapp_id == uappId.baidu) {
console.log("bbbbb++",pobj) console.log("bbbbb++", pobj)
var res = await this.baiduclient.baiduReqbyget({ var res = await this.baiduclient.baiduReqbyget({
path: "/api/bla/provider/communication/list", reqbody: { path: "/api/bla/provider/communication/list", reqbody: {
beginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", beginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
...@@ -577,7 +578,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -577,7 +578,7 @@ class UtilsNeedService2 extends AppServiceBase {
requirementId: pobj.actionBody.intentionBizId requirementId: pobj.actionBody.intentionBizId
} }
}); });
console.log('xxcc+++',res) console.log('xxcc+++', res)
} }
} }
...@@ -630,10 +631,10 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -630,10 +631,10 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async queryIntentionList(pobj, actionBody) { async queryIntentionList(pobj, actionBody) {
if(pobj.appInfo.uapp_id = uappId.ali){ if (pobj.appInfo.uapp_id = uappId.ali) {
var result = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" }); var result = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" });
} }
if(pobj.appInfo.uapp_id = uappId.baidu){ if (pobj.appInfo.uapp_id = uappId.baidu) {
var result = await self.baiduclient.baiduReqbyget({ path: "api/bla/provider/requirement/list", reqbody: actionBody }); var result = await self.baiduclient.baiduReqbyget({ path: "api/bla/provider/requirement/list", reqbody: actionBody });
} }
if (result.code == 200) { if (result.code == 200) {
...@@ -668,7 +669,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -668,7 +669,7 @@ class UtilsNeedService2 extends AppServiceBase {
// if (!pobj.actionBody.userFeedBack) { // if (!pobj.actionBody.userFeedBack) {
// return system.getResult(null, "actionBody.userFeedBack can not be empty,100494"); // return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
// } // }
console.log('xxxqqqq+++chaxun+++',pobj) console.log('xxxqqqq+++chaxun+++', pobj)
pobj.actionBody.data = []; pobj.actionBody.data = [];
await this.queryByAli(pobj, 1); await this.queryByAli(pobj, 1);
pobj.actionType = "getUnCreated"; pobj.actionType = "getUnCreated";
...@@ -715,14 +716,14 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -715,14 +716,14 @@ class UtilsNeedService2 extends AppServiceBase {
} }
// 2020 0914 lin 新增 刷单一条龙服务 // 2020 0914 lin 新增 刷单一条龙服务
async needBatchUpload(pobj,actionBody) { async needBatchUpload(pobj, actionBody) {
var BizIds=""; var BizIds = "";
var demands = []; var demands = [];
// 声明两个数组 用来走后四步用 // 声明两个数组 用来走后四步用
var npobj = []; var npobj = [];
var spobj = []; var spobj = [];
// 遍历生成阿里需求 并把bizId 填充进数组 // 遍历生成阿里需求 并把bizId 填充进数组
for(var i = 0;i < actionBody.demands.length;i++) { for (var i = 0; i < actionBody.demands.length; i++) {
// 第一步 // 第一步
// 地区转换 // 地区转换
var area = this.areaChange(actionBody.demands[i].area) var area = this.areaChange(actionBody.demands[i].area)
...@@ -731,58 +732,58 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -731,58 +732,58 @@ class UtilsNeedService2 extends AppServiceBase {
// 声明调用4.1需要的参数 // 声明调用4.1需要的参数
var obj = { var obj = {
Mobile: actionBody.demands[i].contactMobile,// 手机号 Mobile: actionBody.demands[i].contactMobile,// 手机号
UserName:actionBody.demands[i].contactName,// 用户名 UserName: actionBody.demands[i].contactName,// 用户名
Description:actionBody.demands[i].description, Description: actionBody.demands[i].description,
Area:area, Area: area,
BizType:bizType, BizType: bizType,
Channel:"gsb", Channel: "gsb",
Token:"gsb", Token: "gsb",
} }
// 4.1 提交阿里需求 // 4.1 提交阿里需求
// 2020 0924 lin 修改 reqbyget 为 reqbyLTget // 2020 0924 lin 修改 reqbyget 为 reqbyLTget
var aliResult = await this.aliclient.reqbyLTget({ action: "SubmitIcpIntention", reqbody: obj, apiVersion: "2019-05-08" }); var aliResult = await this.aliclient.reqbyLTget({ action: "SubmitIcpIntention", reqbody: obj, apiVersion: "2019-05-08" });
console.log("needBatchUpload-aliResult",aliResult) console.log("needBatchUpload-aliResult", aliResult)
// 整合前端需要的数据1 // 整合前端需要的数据1
BizIds += aliResult.data.BizId + ","; BizIds += aliResult.data.BizId + ",";
npobj.push({ npobj.push({
"intentionBizId": aliResult.data.BizId, "intentionBizId": aliResult.data.BizId,
"type": this.bizTypeChange(actionBody.demands[i].type), "type": this.bizTypeChange(actionBody.demands[i].type),
"description":actionBody.demands[i].description, "description": actionBody.demands[i].description,
"mobile":actionBody.demands[i].contactMobile "mobile": actionBody.demands[i].contactMobile
}) })
spobj.push({ spobj.push({
"needNo": aliResult.data.BizId,//渠道需求号 "needNo": aliResult.data.BizId,//渠道需求号
"solutionContent":{ "solutionContent": {
// submitIcpProgramme需要的类型转换 ICP许可证 = icpsq/EDI许可证 = edisq // submitIcpProgramme需要的类型转换 ICP许可证 = icpsq/EDI许可证 = edisq
"bizType":actionBody.demands[i].type,//产品类型 icpsq edisq "bizType": actionBody.demands[i].type,//产品类型 icpsq edisq
"solution":{ "solution": {
// "IcpType":1,//方案类型 不传默认1 1:icp 2: edi 参数无效 // "IcpType":1,//方案类型 不传默认1 1:icp 2: edi 参数无效
"CompanyName":actionBody.demands[i].companyName, "CompanyName": actionBody.demands[i].companyName,
"CompanyAddress":actionBody.demands[i].companyAddress, "CompanyAddress": actionBody.demands[i].companyAddress,
"Area":actionBody.demands[i].area + "(渠道)", "Area": actionBody.demands[i].area + "(渠道)",
"Note":actionBody.demands[i].description "Note": actionBody.demands[i].description
} }
} }
}) })
if(aliResult.status != 0) { if (aliResult.status != 0) {
// 统计失败次数 // 统计失败次数
} }
} }
// 判断数据是否符合 执行后四步 的条件 // 判断数据是否符合 执行后四步 的条件
if(npobj.length != actionBody.demands.length || spobj.length != actionBody.demands.length) { if (npobj.length != actionBody.demands.length || spobj.length != actionBody.demands.length) {
return system.getResultFail(-5018,"提交阿里需求失败"); return system.getResultFail(-5018, "提交阿里需求失败");
} }
// 睡3秒 意义:等待阿里异步分配成功。如果不等待则提交方案会失败 无法生成支付链接,需求状态错误 // 睡3秒 意义:等待阿里异步分配成功。如果不等待则提交方案会失败 无法生成支付链接,需求状态错误
await this.sleep(3000) await this.sleep(3000)
// 遍历 执行后面步骤 创建企服需求单(提交方案需要)。提交方案。需求沟通提交 // 遍历 执行后面步骤 创建企服需求单(提交方案需要)。提交方案。需求沟通提交
for(var i = 0;i < actionBody.demands.length;i++) { for (var i = 0; i < actionBody.demands.length; i++) {
// 第二步 // 第二步
// 创建企服通需求单 // 创建企服通需求单
var objString1 = JSON.stringify(pobj); var objString1 = JSON.stringify(pobj);
var obj1 = JSON.parse(objString1); var obj1 = JSON.parse(objString1);
obj1.actionBody = npobj[i]; obj1.actionBody = npobj[i];
var opResult = await this.submitNeed(obj1, obj1.actionBody); var opResult = await this.submitNeed(obj1, obj1.actionBody);
console.log("needBatchUpload-opResult",opResult) console.log("needBatchUpload-opResult", opResult)
// 第三步 // 第三步
// 提交Icp注册方案 // 提交Icp注册方案
// 程序执行比异步分配需求快,所以写成两个循环 // 程序执行比异步分配需求快,所以写成两个循环
...@@ -792,15 +793,15 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -792,15 +793,15 @@ class UtilsNeedService2 extends AppServiceBase {
obj2.actionBody = spobj[i]; obj2.actionBody = spobj[i];
var subRes = await this.qcCenterOrderSve.submitIcpProgramme(obj2); var subRes = await this.qcCenterOrderSve.submitIcpProgramme(obj2);
console.log("----------------------------------start"); console.log("----------------------------------start");
console.log("needBatchUpload-res",subRes) console.log("needBatchUpload-res", subRes)
console.log("----------------------------------end"); console.log("----------------------------------end");
// 第四步 // 第四步
// 需求沟通记录接口 // 需求沟通记录接口
var writeRes = await this.writeCommunicationLog({actionBody:{intentionBizId:npobj[i].intentionBizId,note:"测试反馈"}}); var writeRes = await this.writeCommunicationLog({ actionBody: { intentionBizId: npobj[i].intentionBizId, note: "测试反馈" } });
console.log("needBatchUpload-writeRes",writeRes) console.log("needBatchUpload-writeRes", writeRes)
// 整合前端需要的数据2 // 整合前端需要的数据2
demands.push({ demands.push({
uniqueCode:actionBody.demands[i].uniqueCode, uniqueCode: actionBody.demands[i].uniqueCode,
demandCode: npobj[i].intentionBizId demandCode: npobj[i].intentionBizId
}) })
} }
...@@ -808,16 +809,16 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -808,16 +809,16 @@ class UtilsNeedService2 extends AppServiceBase {
// 首先切割掉BizId最后一位 是, // 首先切割掉BizId最后一位 是,
BizIds = BizIds.substr(0, BizIds.length - 1); BizIds = BizIds.substr(0, BizIds.length - 1);
// 2020 0924 lin 修改 reqbyget 为 reqbyLTget // 2020 0924 lin 修改 reqbyget 为 reqbyLTget
var aliConfirmResult = await this.aliclient.reqbyLTget({ action: "ConfirmIcpIntention", reqbody: {BizIds:BizIds}, apiVersion: "2019-05-08" }); var aliConfirmResult = await this.aliclient.reqbyLTget({ action: "ConfirmIcpIntention", reqbody: { BizIds: BizIds }, apiVersion: "2019-05-08" });
console.log("needBatchUpload-aliConfirmResult",aliConfirmResult) console.log("needBatchUpload-aliConfirmResult", aliConfirmResult)
// 获取链接失败 // 获取链接失败
if(aliConfirmResult.status != 0) { if (aliConfirmResult.status != 0) {
return system.getResultFail(-5018,"confirmIcpIntention fail"); return system.getResultFail(-5018, "confirmIcpIntention fail");
} }
var res = { var res = {
paymentLink:aliConfirmResult.data.ConfirmUrl, paymentLink: aliConfirmResult.data.ConfirmUrl,
batchNumber:actionBody.batchNumber, batchNumber: actionBody.batchNumber,
demands:demands demands: demands
} }
// 2020 0916 lin 新增返回格式 成功status为1 因为queue判断成功请求的条件为status1 // 2020 0916 lin 新增返回格式 成功status为1 因为queue判断成功请求的条件为status1
return system.getResultRedisQueueSuccess(res); return system.getResultRedisQueueSuccess(res);
...@@ -983,7 +984,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -983,7 +984,7 @@ class UtilsNeedService2 extends AppServiceBase {
} }
} }
bizTypeChange(bizType) { bizTypeChange(bizType) {
switch(bizType) { switch (bizType) {
case "ICP许可证": case "ICP许可证":
return "5" return "5"
case "EDI许可证": case "EDI许可证":
...@@ -991,7 +992,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -991,7 +992,7 @@ class UtilsNeedService2 extends AppServiceBase {
} }
} }
needBizTypeChange(type) { needBizTypeChange(type) {
switch(type) { switch (type) {
case "ICP许可证": case "ICP许可证":
return "icpsq" return "icpsq"
case "EDI许可证": case "EDI许可证":
...@@ -1033,11 +1034,11 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1033,11 +1034,11 @@ class UtilsNeedService2 extends AppServiceBase {
var obj = { var obj = {
"intentionBizId": actionBody.intentionBizId, "intentionBizId": actionBody.intentionBizId,
"type": actionBody.type, "type": actionBody.type,
"description":actionBody.description, "description": actionBody.description,
"mobile":actionBody.mobile "mobile": actionBody.mobile
} }
var res = await this.submitNeed(pobj,obj); var res = await this.submitNeed(pobj, obj);
if(res.status == 0) { if (res.status == 0) {
return system.getResultSuccess(res.data); return system.getResultSuccess(res.data);
} }
return system.getResult(null, res) return system.getResult(null, res)
...@@ -1051,11 +1052,11 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1051,11 +1052,11 @@ class UtilsNeedService2 extends AppServiceBase {
async needCloseAliEsp(pobj, actionBody) { async needCloseAliEsp(pobj, actionBody) {
var obj = { var obj = {
"intentionBizId": actionBody.intentionBizId, "intentionBizId": actionBody.intentionBizId,
"mobile":actionBody.mobile "mobile": actionBody.mobile
} }
pobj.actionType = "needClose"; pobj.actionType = "needClose";
var res = await this.needClose(pobj,obj); var res = await this.needClose(pobj, obj);
if(res.status == 0) { if (res.status == 0) {
return system.getResultSuccess(res.data); return system.getResultSuccess(res.data);
} }
return system.getResult(null, res) return system.getResult(null, res)
...@@ -1100,7 +1101,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1100,7 +1101,7 @@ class UtilsNeedService2 extends AppServiceBase {
pobj.actionType = "getItemByChannelNeedNo"; pobj.actionType = "getItemByChannelNeedNo";
var url = this.centerOrderUrl + "action/need/springBoard"; var url = this.centerOrderUrl + "action/need/springBoard";
var needInfoResult = await this.restPostUrl(pobj, url); var needInfoResult = await this.restPostUrl(pobj, url);
if(needInfoResult.status != 0) { if (needInfoResult.status != 0) {
return system.getResult(null, "needInfo is empty"); return system.getResult(null, "needInfo is empty");
} }
// 第二部 询价 // 第二部 询价
...@@ -1131,7 +1132,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1131,7 +1132,7 @@ class UtilsNeedService2 extends AppServiceBase {
pobj.actionType = "getProductPrice"; pobj.actionType = "getProductPrice";
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productPriceResult = await this.restPostUrl(pobj, url); var productPriceResult = await this.restPostUrl(pobj, url);
if(productPriceResult.status != 0) { if (productPriceResult.status != 0) {
return system.getResult(null, "productPrice is empty"); return system.getResult(null, "productPrice is empty");
} }
// 获取userpin 为什么在这里获取?原因:getWay获取不到手机号 再去调用其他接口浪费资源 // 获取userpin 为什么在这里获取?原因:getWay获取不到手机号 再去调用其他接口浪费资源
...@@ -1233,7 +1234,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1233,7 +1234,7 @@ class UtilsNeedService2 extends AppServiceBase {
orderPrice: Number(pobj.actionBody.orderPrice / 100), orderPrice: Number(pobj.actionBody.orderPrice / 100),
phone: needInfoResult.data.publishMobile, phone: needInfoResult.data.publishMobile,
needId: solutiondata.data.channelNeedNo, needId: solutiondata.data.channelNeedNo,
companyName:solutiondata.data.solutionContent.solution.CompanyName || ''//1 companyName: solutiondata.data.solutionContent.solution.CompanyName || ''//1
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
...@@ -1271,23 +1272,23 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1271,23 +1272,23 @@ class UtilsNeedService2 extends AppServiceBase {
} }
// 2020 0927 lin 新增 edi状态更新 // 2020 0927 lin 新增 edi状态更新
async ediNotify(pobj,actionBody) { async ediNotify(pobj, actionBody) {
if(actionBody.operationType == "USER_UPLOAD_PRODUCE" ) { if (actionBody.operationType == "USER_UPLOAD_PRODUCE") {
if(actionBody.extInfo) { if (actionBody.extInfo) {
// businessLicense:['business_license/12195411 61213057/1599115976393/p08xo9frgzj.png'] // businessLicense:['business_license/12195411 61213057/1599115976393/p08xo9frgzj.png']
// idCardList:[' ["card/1219541161213057/1599115980036/s1nn3sozulo.png"] '] // idCardList:[' ["card/1219541161213057/1599115980036/s1nn3sozulo.png"] ']
// 注意idCardList 是二维数组 需要再转换一下 不知道为什么 // 注意idCardList 是二维数组 需要再转换一下 不知道为什么
var extJson = JSON.parse(actionBody.extInfo); var extJson = JSON.parse(actionBody.extInfo);
var businessLicenseArr = []; var businessLicenseArr = [];
if(extJson.idCardList) { if (extJson.idCardList) {
// 抽出数组 // 抽出数组
var idCardListA = extJson.idCardList; var idCardListA = extJson.idCardList;
var idCardListArr = []; var idCardListArr = [];
for(var i = 0; i < idCardListA.length; i++) { for (var i = 0; i < idCardListA.length; i++) {
idCardListArr.push(await this.opDownFileInfo(idCardListA[i])); idCardListArr.push(await this.opDownFileInfo(idCardListA[i]));
} }
} }
for(var i = 0; i < extJson.businessLicense.length; i++) { for (var i = 0; i < extJson.businessLicense.length; i++) {
businessLicenseArr.push(await this.opDownFileInfo(extJson.businessLicense[i])); businessLicenseArr.push(await this.opDownFileInfo(extJson.businessLicense[i]));
} }
actionBody.extInfo = { actionBody.extInfo = {
...@@ -1305,7 +1306,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1305,7 +1306,7 @@ class UtilsNeedService2 extends AppServiceBase {
pobj.actionType = "receiveEdiStatusNotify"; pobj.actionType = "receiveEdiStatusNotify";
var url = settings.centerOrderUrl() + "action/ediApi/springBoard"; var url = settings.centerOrderUrl() + "action/ediApi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
if(rtn.status) { if (rtn.status) {
return rtn; return rtn;
} }
// 只有上传材料才在这里推送,produceNoticeAliEsp不做关于材料上传的推送 // 只有上传材料才在这里推送,produceNoticeAliEsp不做关于材料上传的推送
...@@ -1364,7 +1365,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1364,7 +1365,7 @@ class UtilsNeedService2 extends AppServiceBase {
// 待定 // 待定
// solutionBizId // solutionBizId
// note // note
if(actionBody.operateType == "INVALID") { if (actionBody.operateType == "INVALID") {
var url = settings.centerOrderUrl() + "action/ediApi/springBoard"; var url = settings.centerOrderUrl() + "action/ediApi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
} }
...@@ -1378,7 +1379,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1378,7 +1379,7 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitNeed2(pobj, actionBody) { async submitNeed2(pobj, actionBody) {
if(actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") { if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") {
actionBody.area = this.wangwenAreaChange(actionBody.area) actionBody.area = this.wangwenAreaChange(actionBody.area)
} }
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -1410,17 +1411,18 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1410,17 +1411,18 @@ class UtilsNeedService2 extends AppServiceBase {
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) { if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A"; pobj.actionBody.level = "A";
} else { } else {
var levelurl = "http://106.13.228.212:8000/recProbability"; // var levelurl = "http://106.13.228.212:8000/recProbability";
var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl); // var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl);
if (levelresult.status == 0) { // if (levelresult.status == 0) {
pobj.actionBody.level = levelresult.data.level; // pobj.actionBody.level = levelresult.data.level;
pobj.actionBody.probability = levelresult.data.per; // pobj.actionBody.probability = levelresult.data.per;
} else { // } else {
// pobj.actionBody.level = "C"
// }
pobj.actionBody.level = "C" pobj.actionBody.level = "C"
} }
}
if(pobj.actionBody.phone=="17319425791"){ if (pobj.actionBody.phone == "17319425791") {
pobj.actionBody.level = "F"; pobj.actionBody.level = "F";
} }
...@@ -1450,7 +1452,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -1450,7 +1452,7 @@ class UtilsNeedService2 extends AppServiceBase {
async icpNotifyNew(pobj) { async icpNotifyNew(pobj) {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
var self = this; var self = this;
if(actionBody.isDirectBuy && actionBody.isDirectBuy==1){ if (actionBody.isDirectBuy && actionBody.isDirectBuy == 1) {
actionBody.bizId = actionBody.orderNo actionBody.bizId = actionBody.orderNo
} }
if (!actionBody.bizId) { if (!actionBody.bizId) {
......
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