Commit 8b63ad1c by linboxuan

Merge branch 'center-channel' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-channel

 Conflicts:
	center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
parents 6e741a04 487eab0b
...@@ -15,9 +15,9 @@ class OpNeed extends APIBase { ...@@ -15,9 +15,9 @@ class OpNeed extends APIBase {
* action_body 执行的参数 * action_body 执行的参数
*/ */
async springBoard(pobj, qobj, req) { async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) { // if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空"); // return system.getResult(null, "actionProcess参数不能为空");
} // }
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
} }
......
...@@ -13,15 +13,28 @@ class AccessAuthAPI extends APIBase { ...@@ -13,15 +13,28 @@ class AccessAuthAPI extends APIBase {
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve"); this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve"); this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve");
} }
/**
* 查询阿里商标优选留咨信息,定时任务调用
* @param pobj
* @param qobj
* @param req
* @return {Promise<{msg: *, data, status: number}|{msg: *, data: *, status: *}>}
* @constructor
*/
async QueryTradeIntentionUserList(pobj, qobj, req) { async QueryTradeIntentionUserList(pobj, qobj, req) {
pobj.appInfo={uapp_id:18} pobj.appInfo={uapp_id:18}
let start_time = await this.redisClient.get("start_time_18")
let endtime = Date.now(); let endtime = Date.now();
let starttime = Date.now() - 30 * 60 * 1000;//30分钟(毫秒) let starttime = start_time || (Date.now() - 30 * 60 * 1000);//30分钟(毫秒)
pobj.actionBody = { pobj.actionBody = {
Begin: starttime, Begin: starttime,
End: endtime End: endtime
}; };
return await this.utilsNeedSve.queryTradeIntentionUserList(pobj); let res = await this.utilsNeedSve.queryTradeIntentionUserList(pobj);
if (res.status === 0)
await this.redisClient.set("start_time_18",endtime+1)
return res
} }
async taskAliIcapi() { async taskAliIcapi() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi(); var rtn = await this.gatewaypushlogSve.taskAliIcapi();
......
...@@ -123,6 +123,9 @@ class Need extends APIBase { ...@@ -123,6 +123,9 @@ class Need extends APIBase {
// opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody); // opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody);
// break; // break;
break; break;
case "getOrderInfoByChannelOrderNo"://根据渠道订单订单信息
opResult = await this.utilsNeedSve.getOrderInfoByChannelOrderNo(pobj, pobj.actionBody);
break;
//-----------接入百度ICP------end---------------------------------- //-----------接入百度ICP------end----------------------------------
case "importNeeds": case "importNeeds":
opResult = await this.utilsNeedSve.importNeeds(pobj,req); opResult = await this.utilsNeedSve.importNeeds(pobj,req);
......
...@@ -654,11 +654,21 @@ class CenterorderService extends AppServiceBase { ...@@ -654,11 +654,21 @@ class CenterorderService extends AppServiceBase {
} else if (pobj.actionBody.channelItemCode == '7') { } else if (pobj.actionBody.channelItemCode == '7') {
pobj.actionBody.regType = "yiming.edi"; pobj.actionBody.regType = "yiming.edi";
} }
else if (pobj.actionBody.channelItemCode == 'icpnb') { else if (pobj.actionBody.channelItemCode == 'ICPXQ') {
pobj.actionBody.regType = "yiming.icpxq";
}else if (pobj.actionBody.channelItemCode == 'EDIXQ') {
pobj.actionBody.regType = "yiming.edixq";
}
else if (pobj.actionBody.channelItemCode == 'ICPNB') {
pobj.actionBody.regType = "yiming.icpnb"; pobj.actionBody.regType = "yiming.icpnb";
}else if (pobj.actionBody.channelItemCode == 'edinb') { }else if (pobj.actionBody.channelItemCode == 'EDINB') {
pobj.actionBody.regType = "yiming.edinb"; pobj.actionBody.regType = "yiming.edinb";
} }
else if (pobj.actionBody.channelItemCode == 'ICPWZ') {
pobj.actionBody.regType = "yiming.icpwz";
}else if (pobj.actionBody.channelItemCode == 'EDIWZ') {
pobj.actionBody.regType = "yiming.ediwz";
}
} }
var fqobj = { var fqobj = {
actionBody: { actionBody: {
...@@ -724,6 +734,7 @@ class CenterorderService extends AppServiceBase { ...@@ -724,6 +734,7 @@ class CenterorderService extends AppServiceBase {
//获取易名的icp产品信息 //获取易名的icp产品信息
async getymicpProduce(pobj) { async getymicpProduce(pobj) {
console.log('pobj.actionBody.channelItemCode--',pobj.actionBody.channelItemCode)
pobj.actionType = 'getymicpProduce' pobj.actionType = 'getymicpProduce'
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
......
...@@ -165,16 +165,16 @@ class TmqueryService { ...@@ -165,16 +165,16 @@ class TmqueryService {
//核名接口 //核名接口
async checkName(queryobj,req){ async checkName(queryobj,req){
if(!queryobj.cityname){ if(!queryobj.cityname){
return system.getResult(-1,'cityname 不能为空!'); return system.getResultFail(-1,'cityname 不能为空!');
} }
if(!queryobj.keyword){ if(!queryobj.keyword){
return system.getResult(-1,'keyword 不能为空!'); return system.getResultFail(-1,'keyword 不能为空!');
} }
if(!queryobj.btname){ if(!queryobj.btname){
return system.getResult(-1,'btname 不能为空!'); return system.getResultFail(-1,'btname 不能为空!');
} }
if(!queryobj.orgname){ if(!queryobj.orgname){
return system.getResult(-1,'orgname 不能为空!'); return system.getResultFail(-1,'orgname 不能为空!');
} }
let data = { let data = {
cityname:queryobj.cityname, cityname:queryobj.cityname,
...@@ -186,7 +186,7 @@ class TmqueryService { ...@@ -186,7 +186,7 @@ class TmqueryService {
let url = settings.icNameUrl() + 'openPlatform/ic/match' let url = settings.icNameUrl() + 'openPlatform/ic/match'
let result = await this.opReqResult(url, data, req); let result = await this.opReqResult(url, data, req);
if (result.code!=200){ if (result.code!=200){
return system.getResult(-1,result.message); return system.getResultFail(-1,result.message);
} }
return system.getResult(result); return system.getResult(result);
} }
......
...@@ -49,7 +49,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -49,7 +49,7 @@ class UtilsNeedService extends AppServiceBase {
} }
pobj.actionBody.service_product_id= data.data.service_product_id; pobj.actionBody.service_product_id= data.data.service_product_id;
pobj.actionBody.productId = data.data.service_product_id; pobj.actionBody.productId = data.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name; pobj.actionBody.appName = pobj.appInfo.app_name||pobj.actionBody.appName;
pobj.actionBody.type_code = data.data.type_code; pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name; pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code; pobj.actionBody.channel_type_code = data.data.channel_type_code;
...@@ -393,6 +393,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -393,6 +393,16 @@ class UtilsNeedService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult; return itemResult;
} }
//阿里icp退款新增
async getOrderInfoByChannelOrderNo(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,1003901");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
...@@ -534,8 +544,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -534,8 +544,10 @@ class UtilsNeedService extends AppServiceBase {
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify"); this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo; pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) { if (actionBody.status == 11) {
pobj.actionType = "delOrder";
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody); var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
console.log('状态更新---icpNotify---orderrtn---',JSON.stringify(orderrtn)) console.log('状态更新---icpNotify---orderrtn---',JSON.stringify(orderrtn))
this.execClientNew.execLogs("api-center-channel-delOrder:", pobj, "center-channel-delOrder", orderrtn, null);
if (orderrtn.status < 0) { if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败"); return system.getResultFail(-5022, "订单关闭失败");
} }
...@@ -769,6 +781,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -769,6 +781,7 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.mobile = item.Mobile ? item.Mobile : ""; pobj.actionBody.mobile = item.Mobile ? item.Mobile : "";
//pobj.actionBody.Area = item.Area || "北京" //pobj.actionBody.Area = item.Area || "北京"
pobj.actionBody.area = '大陆地区 ' pobj.actionBody.area = '大陆地区 '
pobj.actionBody.appName="阿里云商机"
pobj.actionBody.userName = item.UserName ? item.UserName : ""; pobj.actionBody.userName = item.UserName ? item.UserName : "";
pobj.actionBody.description = item.RegisterNumber pobj.actionBody.description = item.RegisterNumber
pobj.notes = `${item.RegisterNumber ? "RegisterNumber:" + item.RegisterNumber : ""}${item.Classification ? "Classification:" + item.Classification : ""}`; pobj.notes = `${item.RegisterNumber ? "RegisterNumber:" + item.RegisterNumber : ""}${item.Classification ? "Classification:" + item.Classification : ""}`;
...@@ -1493,16 +1506,36 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1493,16 +1506,36 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == 5) { if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "yiming.icp"; pobj.actionBody.type = "yiming.icp";
pobj.actionBody.idempotentSource = "yiming.icp"; pobj.actionBody.idempotentSource = "yiming.icp";
} else if (pobj.actionBody.channel_type_code == 7) { }
else if (pobj.actionBody.channel_type_code == 7) {
pobj.actionBody.type = "yiming.edi"; pobj.actionBody.type = "yiming.edi";
pobj.actionBody.idempotentSource = "yiming.edi"; pobj.actionBody.idempotentSource = "yiming.edi";
} else if (pobj.actionBody.channel_type_code == "icpnb") { }
else if (pobj.actionBody.channel_type_code == "ICPNB") {
pobj.actionBody.type = "yiming.icpnb"; pobj.actionBody.type = "yiming.icpnb";
pobj.actionBody.idempotentSource = "yiming.icpnb"; pobj.actionBody.idempotentSource = "yiming.icpnb";
} else if (pobj.actionBody.channel_type_code == "edinb") { }
else if (pobj.actionBody.channel_type_code == "EDINB") {
pobj.actionBody.type = "yiming.edinb"; pobj.actionBody.type = "yiming.edinb";
pobj.actionBody.idempotentSource = "yiming.edinb"; pobj.actionBody.idempotentSource = "yiming.edinb";
} }
else if(pobj.actionBody.channel_type_code == "ICPXQ"){
pobj.actionBody.type = "yiming.icpxq";
pobj.actionBody.idempotentSource = "yiming.icpxq";
}
else if(pobj.actionBody.channel_type_code == "EDIXQ"){
pobj.actionBody.type = "yiming.edixq";
pobj.actionBody.idempotentSource = "yiming.edixq";
}
//外资暂时产品库未上架
else if(pobj.actionBody.channel_type_code == "ICPWZ"){
pobj.actionBody.type = "yiming.icpwz";
pobj.actionBody.idempotentSource = "yiming.icpwz";
}
else if(pobj.actionBody.channel_type_code == "EDIWZ"){
pobj.actionBody.type = "yiming.ediwz";
pobj.actionBody.idempotentSource = "yiming.ediwz";
}
} }
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";
...@@ -1629,7 +1662,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1629,7 +1662,7 @@ class UtilsNeedService extends AppServiceBase {
var tmpObj2 = { var tmpObj2 = {
actionBody: { actionBody: {
orderNo: channelOrderNo, orderNo: channelOrderNo,
channelNeedNo: rtn.data.channelNeedNo, channelNeedNo: rtn.data.channelNeedNo || channelOrderNo,//做云服和企服通没有渠道需求号的兼容
needsolution: rtn.data.solutionContent needsolution: rtn.data.solutionContent
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
......
...@@ -4,6 +4,7 @@ const AppServiceBase = require("../../app.base"); ...@@ -4,6 +4,7 @@ const AppServiceBase = require("../../app.base");
const fs = require("fs"); const fs = require("fs");
const { json } = require("sequelize"); const { json } = require("sequelize");
const { getResult, getResultSuccess } = require("../../../system"); const { getResult, getResultSuccess } = require("../../../system");
const { type } = require("os");
//区分渠道的uappid //区分渠道的uappid
const uappId = { const uappId = {
'ali': 18, //(阿里icp、edi) 'ali': 18, //(阿里icp、edi)
...@@ -185,7 +186,7 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -185,7 +186,7 @@ class UtilsNeedService2 extends AppServiceBase {
if (result.data.uapp_id == uappId.ename) {// yiming / ename if (result.data.uapp_id == uappId.ename) {// yiming / ename
console.log("queryExpertApplyCommunicationLogs---ename---pobj--", pobj) console.log("queryExpertApplyCommunicationLogs---ename---pobj--", pobj)
console.log('settings.enameClientUrl()+"queryExpertApplyCommunicationLogs"----',settings.enameClientUrl()+"queryExpertApplyCommunicationLogs") console.log('settings.enameClientUrl()+"queryExpertApplyCommunicationLogs"----',settings.enameClientUrl()+"queryExpertApplyCommunicationLogs")
var res = await self.execClient.execEnamePost({ var res = await this.execClient.execEnamePost({
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "", EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.intentionBizId, BizId: pobj.actionBody.intentionBizId,
...@@ -196,11 +197,25 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -196,11 +197,25 @@ class UtilsNeedService2 extends AppServiceBase {
console.log('ename+++queryExpertApplyCommunicationLogs---res---', res) console.log('ename+++queryExpertApplyCommunicationLogs---res---', res)
} }
} }
//判断易名是否有写接口
if(res && res.data && res.data.result){ if(res && res.stdout == ""){//先判断没有写接口的情况
res.data['Data'] = res.data.result if(result && result.status == 0 && result.data && result.data.followContent){
for (let i = 0; i < result.data.followContent.length; i++) {
if(typeof(result.data.followContent[i]) == 'string'){
if(result && result.data && result.data.followContent && (JSON.parse(result.data.followContent[i])[0].content).indexOf('提交方案') > -1){
result.data.followContent.splice(i,1);
}
}
}
result.data['Data'] = result.data.followContent;
}
return getResultSuccess(result);
}else{//正常易名有查询沟通记录
if(res && res.data && res.data.result){
res.data['Data'] = res.data.result
}
return getResultSuccess(res);
} }
return getResultSuccess(res);
} }
async queryCommunicationLog(pobj) { async queryCommunicationLog(pobj) {
......
...@@ -34,7 +34,8 @@ module.exports = { ...@@ -34,7 +34,8 @@ module.exports = {
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan", "rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
//百度工商注册 //百度工商注册
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose", "regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose", // "getSolutionByChannelOrderNo",
"regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess", "regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename //yiming/ename
"eNameCloseOrder", "eNameCloseOrder",
......
...@@ -243,7 +243,7 @@ module.exports = function (app) { ...@@ -243,7 +243,7 @@ module.exports = function (app) {
return; return;
} }
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉 // 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
if (["getAppTokenByHosts", "getAppTokenByAppKey", "test", "getIndustries", "getSecondIndustries", "getQualificationByIndustry", "counselling", "queryTradeProduceList"].indexOf(req.body.actionType) >= 0) { if (["getAppTokenByHosts", "getAppTokenByAppKey", "test", "getIndustries", "getSecondIndustries", "getQualificationByIndustry", "counselling", "queryTradeProduceList","getNeedComparisonList"].indexOf(req.body.actionType) >= 0) {
req.body.actionBody.appHosts = req.host; req.body.actionBody.appHosts = req.host;
next(); next();
return; return;
......
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