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 {
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
// if (!pobj.actionProcess) {
// return system.getResult(null, "actionProcess参数不能为空");
// }
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
......
......@@ -13,15 +13,28 @@ class AccessAuthAPI extends APIBase {
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
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) {
pobj.appInfo={uapp_id:18}
let start_time = await this.redisClient.get("start_time_18")
let endtime = Date.now();
let starttime = Date.now() - 30 * 60 * 1000;//30分钟(毫秒)
let starttime = start_time || (Date.now() - 30 * 60 * 1000);//30分钟(毫秒)
pobj.actionBody = {
Begin: starttime,
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() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi();
......
......@@ -123,6 +123,9 @@ class Need extends APIBase {
// opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody);
// break;
break;
case "getOrderInfoByChannelOrderNo"://根据渠道订单订单信息
opResult = await this.utilsNeedSve.getOrderInfoByChannelOrderNo(pobj, pobj.actionBody);
break;
//-----------接入百度ICP------end----------------------------------
case "importNeeds":
opResult = await this.utilsNeedSve.importNeeds(pobj,req);
......
......@@ -654,11 +654,21 @@ class CenterorderService extends AppServiceBase {
} else if (pobj.actionBody.channelItemCode == '7') {
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";
}else if (pobj.actionBody.channelItemCode == 'edinb') {
}else if (pobj.actionBody.channelItemCode == '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 = {
actionBody: {
......@@ -724,6 +734,7 @@ class CenterorderService extends AppServiceBase {
//获取易名的icp产品信息
async getymicpProduce(pobj) {
console.log('pobj.actionBody.channelItemCode--',pobj.actionBody.channelItemCode)
pobj.actionType = 'getymicpProduce'
let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url);
......
......@@ -165,16 +165,16 @@ class TmqueryService {
//核名接口
async checkName(queryobj,req){
if(!queryobj.cityname){
return system.getResult(-1,'cityname 不能为空!');
return system.getResultFail(-1,'cityname 不能为空!');
}
if(!queryobj.keyword){
return system.getResult(-1,'keyword 不能为空!');
return system.getResultFail(-1,'keyword 不能为空!');
}
if(!queryobj.btname){
return system.getResult(-1,'btname 不能为空!');
return system.getResultFail(-1,'btname 不能为空!');
}
if(!queryobj.orgname){
return system.getResult(-1,'orgname 不能为空!');
return system.getResultFail(-1,'orgname 不能为空!');
}
let data = {
cityname:queryobj.cityname,
......@@ -186,7 +186,7 @@ class TmqueryService {
let url = settings.icNameUrl() + 'openPlatform/ic/match'
let result = await this.opReqResult(url, data, req);
if (result.code!=200){
return system.getResult(-1,result.message);
return system.getResultFail(-1,result.message);
}
return system.getResult(result);
}
......
......@@ -49,7 +49,7 @@ class UtilsNeedService extends AppServiceBase {
}
pobj.actionBody.service_product_id= 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_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -393,6 +393,16 @@ class UtilsNeedService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl);
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
......@@ -534,8 +544,10 @@ class UtilsNeedService extends AppServiceBase {
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
pobj.actionType = "delOrder";
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
console.log('状态更新---icpNotify---orderrtn---',JSON.stringify(orderrtn))
this.execClientNew.execLogs("api-center-channel-delOrder:", pobj, "center-channel-delOrder", orderrtn, null);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
......@@ -769,6 +781,7 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.mobile = item.Mobile ? item.Mobile : "";
//pobj.actionBody.Area = item.Area || "北京"
pobj.actionBody.area = '大陆地区 '
pobj.actionBody.appName="阿里云商机"
pobj.actionBody.userName = item.UserName ? item.UserName : "";
pobj.actionBody.description = item.RegisterNumber
pobj.notes = `${item.RegisterNumber ? "RegisterNumber:" + item.RegisterNumber : ""}${item.Classification ? "Classification:" + item.Classification : ""}`;
......@@ -1493,16 +1506,36 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "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.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.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.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) {
pobj.actionBody.level = "A";
......@@ -1629,7 +1662,7 @@ class UtilsNeedService extends AppServiceBase {
var tmpObj2 = {
actionBody: {
orderNo: channelOrderNo,
channelNeedNo: rtn.data.channelNeedNo,
channelNeedNo: rtn.data.channelNeedNo || channelOrderNo,//做云服和企服通没有渠道需求号的兼容
needsolution: rtn.data.solutionContent
},
appInfo: pobj.appInfo
......
......@@ -4,6 +4,7 @@ const AppServiceBase = require("../../app.base");
const fs = require("fs");
const { json } = require("sequelize");
const { getResult, getResultSuccess } = require("../../../system");
const { type } = require("os");
//区分渠道的uappid
const uappId = {
'ali': 18, //(阿里icp、edi)
......@@ -185,7 +186,7 @@ class UtilsNeedService2 extends AppServiceBase {
if (result.data.uapp_id == uappId.ename) {// yiming / ename
console.log("queryExpertApplyCommunicationLogs---ename---pobj--", pobj)
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 : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.intentionBizId,
......@@ -196,11 +197,25 @@ class UtilsNeedService2 extends AppServiceBase {
console.log('ename+++queryExpertApplyCommunicationLogs---res---', res)
}
}
if(res && res.data && res.data.result){
res.data['Data'] = res.data.result
//判断易名是否有写接口
if(res && res.stdout == ""){//先判断没有写接口的情况
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) {
......
......@@ -34,7 +34,8 @@ module.exports = {
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
//百度工商注册
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
// "getSolutionByChannelOrderNo",
"regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename
"eNameCloseOrder",
......
......@@ -243,7 +243,7 @@ module.exports = function (app) {
return;
}
// 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;
next();
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