Commit 133705b4 by linboxuan

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

parents 07965134 ae75d03e
......@@ -34,7 +34,7 @@ class APIBase {
return JSON.parse(cacheRes);
}
var result = await this[methodname](pobj, query, req);
if (!result.requestId) {
if (result && !result.requestId) {
result.requestId = pobj.RequestId ? pobj.RequestId : pobj.requestId || req.requestId;
}
this.logCtl.createDb({
......
......@@ -6,6 +6,7 @@ class RegAPI extends APIBase {
constructor() {
super();
this.regCenterOrderSve = system.getObject("service.common.regCenterOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
}
/**
* 接口跳转-POST请求
......@@ -76,6 +77,9 @@ class RegAPI extends APIBase {
// opResult = await this.regCenterOrderSve.closeOrderDelivery(pobj);
// break;
case "againPushYf"://单独重新推送数据到云服
opResult = await this.utilsPushSve.business2Channel(pobj, pobj.opType);
break;
//-----------接入百度reg------end----------------------------
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -27,7 +27,7 @@ class AccessAuthAPI extends APIBase {
var rtn = await this.gatewaypushlogSve.taskAliIcapi();
return rtn;
}
async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送蜂擎业务数据
async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送渠道业务数据
var rtn = await this.utilsPushSve.business2Channel(pobj, pobj.opType);
this.pushlogSve.delDbPushfaillogById(Number(pobj.id || 0));
return rtn;
......@@ -71,7 +71,7 @@ class AccessAuthAPI extends APIBase {
self.taskAgainPushOneNewBusInfo(contentData);
} else if (element.failType == 4) {
self.taskAgainFqPushInfo(contentData);
}//FQ
}//推送渠道(如:FQ)
}
}
return system.getResultSuccess();
......
......@@ -109,7 +109,8 @@ var regCfg = {
'COLLECTING': 'COLLECTING',//材料收集环节
'AUDITING': 'AUDITING',//工商审核环节
'ENGRAVING': 'ENGRAVING',//刻章环节
'SUCCESS': 'SUCCESS' //已完成
'SUCCESS': 'SUCCESS', //已完成
'ACTIVE': 'ACTIVE' //服务中
},
//交付状态
deliverStatus:{
......@@ -117,7 +118,8 @@ var regCfg = {
'COLLECTING': '材料收集环节',//
'AUDITING': '工商审核环节',//
'ENGRAVING': '刻章环节',//
'SUCCESS': '已完成' //
'SUCCESS': '已完成', //
'ACTIVE': '服务中' //
},
//返回结果配置
getUUID() {
......
......@@ -102,6 +102,9 @@ class ProductAPI extends WEBBase {
case "receiveAliTmOrder"://接收阿里商标订单
opResult = await this.utilsOrderSve.receiveAliTmOrder(pobj, pobj.actionBody);
break;
case "receiveFqbossTmOrder"://接收阿里商标订单
opResult = await this.utilsOrderSve.receiveFqbossTmOrder(pobj, pobj.actionBody);
break;
case "receiveAliTmStatus"://接收阿里商标状态
opResult = await this.utilsOrderSve.receiveAliTmStatus(pobj, pobj.actionBody);
break;
......
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class PushAliInfo extends APIBase {
constructor() {
super();
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
}
/**
* 推送阿里商标跟进信息
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async tmNote(pobj, qobj, req) {
var reqPushParams = {
reqbody: {
BizId: pobj.intentionBizId,
Note: pobj.note.replace(/<[^>]+>/g, "")
},
appInfo: {uapp_id: 18}
};
let result = await this.utilsPushSve.business2Channel(reqPushParams, "pushAliTmNote");
if (result && result.data) {
return result.data;
}
return result;
}
/**
* 推送阿里工商跟进信息
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async icNote(pobj, qobj, req) {
var reqPushParams = {
reqbody: {
IntentionBizId: pobj.intentionBizId,
Type: 1,// 1需求,2订单
Note: pobj.note.replace(/<[^>]+>/g, "")
},
appInfo: {uapp_id: 18}
};
let result = await this.utilsPushSve.business2Channel(reqPushParams, "pushAliIcNote");
if (result && result.data) {
return result.data;
}
return result;
}
}
module.exports = PushAliInfo;
\ No newline at end of file
......@@ -13,7 +13,7 @@ class AppServiceBase {
this.execClient = system.getObject('util.execClient');
this.cacheManager = system.getObject("db.common.cacheManager");
this.pushlogSve = system.getObject("service.common.pushlogSve");
this.pushlogFailType = {OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4};
this.pushlogFailType = {OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4};//1老的rpc调用,2新的rpc调用-需配置,3错误日志,4推送峰擎,5直接调用-无需配置
this.logCtl = system.getObject("service.common.oplogSve");
}
......
......@@ -237,6 +237,12 @@ class NcService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('nc closeNeed+++',a)
}
if(result.data && result.data.uapp_id == 44){
pobj.appInfo.uapp_id = 44
if(pobj && pobj.actionBody && pobj.actionBody.note){
pobj.actionBody['description'] = pobj.actionBody.note
}
}
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
......
......@@ -27,7 +27,7 @@ class PushlogService extends ServiceBase {
}
async createFailLogDb(qobj) {
try {
qobj.optitle = (new Date()).Format("yyyy-MM-dd hh:mm:ss") + ":" + qobj.optitle;
qobj.opTitle = (new Date()).Format("yyyy-MM-dd hh:mm:ss") + ":" + qobj.opTitle;
this.pushfaillogDao.create(qobj);
} catch (e) {
//日志记录
......
......@@ -16,6 +16,7 @@ class RegCenterOrderService extends AppServiceBase {
this.baiduRegClient = system.getObject("util.baiduRegClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
};
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/regapi/springBoard";
......@@ -37,20 +38,21 @@ class RegCenterOrderService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
async regPaySuccess(pobj) {
console.log('regPaySuccess++++pobj----',pobj)
console.log('regPaySuccess++++pobj----', pobj)
var sobj = {
actionType: "getRegProducePrice",
actionBody: {
typeCode: pobj.actionBody.consultType,
city: pobj.actionBody.area,
taxpayerType:pobj.actionBody.taxpayerType,
companyProperties:pobj.actionBody.companyProperties
taxpayerType: pobj.actionBody.taxpayerType,
companyProperties: pobj.actionBody.companyProperties
},
appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess
}
console.log('regPaySuccess++++sobj----',sobj)
console.log('regPaySuccess++++sobj----', sobj)
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
......@@ -60,7 +62,7 @@ class RegCenterOrderService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5010, "产品查询失败");
}
console.log('data----data----',data)
console.log('data----data----', data)
// pobj.actionBody = data.data;
// pobj.actionBody.orderNo = pobj.actionBody.bizId;
pobj.actionBody.totalSum = data.data.price;
......@@ -68,7 +70,7 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionBody.payTotalSum = data.data.price;
pobj.actionBody.payCode = data.data.payCode;
pobj.actionBody.channelItemCode = data.data.channelItemCode;
pobj.actionBody.channelNeedNo = data.data.channelNeedNo || data.data.bizId ;
pobj.actionBody.channelNeedNo = data.data.channelNeedNo || data.data.bizId;
pobj.actionBody.needNo = data.data.needNo;
pobj.actionBody.quantity = 1;
pobj.actionBody.channelOrder = {
......@@ -76,10 +78,10 @@ class RegCenterOrderService extends AppServiceBase {
channelOrderNo: pobj.actionBody.orderNo,
orderStatus: 2
}
console.log('pobj.actionBody------',pobj.actionBody)
console.log('pobj.actionBody------', pobj.actionBody)
var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
console.log('orderrtn----',orderrtn)
console.log('orderrtn----', orderrtn)
if (orderrtn.status != 0 && orderrtn.status != -1) {
return system.getResultFail(-5012, "订单创建失败");
}
......@@ -95,7 +97,7 @@ class RegCenterOrderService extends AppServiceBase {
return system.getResultFail(-5011, "方案查询失败");
}
var solutiondata = JSON.parse(solutionrtn.stdout);
console.log('solutiondata----',solutiondata)
console.log('solutiondata----', solutiondata)
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
......@@ -116,16 +118,16 @@ class RegCenterOrderService extends AppServiceBase {
orderPrice: Number(pobj.actionBody.orderPrice / 100),
phone: pobj.actionBody.publishMobile,
needId: solutiondata.data.channelNeedNo,
price_desc : pobj.actionBody.taxpayerType,
additions_desc : pobj.actionBody.companyProperties,
price_desc: pobj.actionBody.taxpayerType,
additions_desc: pobj.actionBody.companyProperties,
// companyName:solutiondata.data.solutionContent.CompanyName || ''
//2021-1-21 laolan add new
appName:pobj.appInfo.app_name || '',
sku:data.data.service_code || ''
appName: pobj.appInfo.app_name || '',
sku: data.data.service_code || ''
},
appInfo: pobj.appInfo
}
console.log('fqobj----',fqobj)
console.log('fqobj----', fqobj)
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = {
actionBody: {
......@@ -141,18 +143,18 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
};
if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy==1){//直接下单需执行添加订单业务员操作
if(baiduPushRes && baiduPushRes.status==0){
if(baiduPushRes.data && baiduPushRes.data.data){
if (pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy == 1) {//直接下单需执行添加订单业务员操作
if (baiduPushRes && baiduPushRes.status == 0) {
if (baiduPushRes.data && baiduPushRes.data.data) {
var resData = baiduPushRes.data.data;
var salesmanInfo = {
salesmanName:resData.orderList && resData.orderList.length>0?resData.orderList[0].operatorName:"",
salesmanChannelId:resData.orderList && resData.orderList.length>0?resData.orderList[0].operator:"",
salesmanName: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operatorName : "",
salesmanChannelId: resData.orderList && resData.orderList.length > 0 ? resData.orderList[0].operator : "",
};
var salesmanObj={
appInfo:pobj.appInfo,
actionType:"addRegSalesmanInfo",//添加业务员信息
actionBody:{salesmanInfo:salesmanInfo,orderNo:orderrtn.data.orderNo}
var salesmanObj = {
appInfo: pobj.appInfo,
actionType: "addRegSalesmanInfo",//添加业务员信息
actionBody: {salesmanInfo: salesmanInfo, orderNo: orderrtn.data.orderNo}
};
var url = settings.centerOrderUrl() + "action/regapi/springBoard";
var addRes = await this.execClient.execPost(salesmanObj, url);
......@@ -166,14 +168,14 @@ class RegCenterOrderService extends AppServiceBase {
}
}
}else{
} else {
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
// channelNeedNo获取需求详情
async selectNeedInfo(pobj){
async selectNeedInfo(pobj) {
var reqUrl = this.centerOrderUrl + "action/regapi/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
......@@ -189,6 +191,7 @@ class RegCenterOrderService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/**
* 提交需求
* @param {*} pobj
......@@ -210,7 +213,7 @@ class RegCenterOrderService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5016, "需求类型查询失败");
}
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.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = data.data.type_code;
......@@ -279,6 +282,7 @@ class RegCenterOrderService extends AppServiceBase {
var data = JSON.parse(rtn.stdout);
return data;
}
//状态更新
async regOrderStatus(pobj) {
var actionBody = pobj.actionBody;
......@@ -296,7 +300,7 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionType = "regOrderStatus";
var url = settings.centerOrderUrl() + "action/regapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
console.log('公司宝--rtn---',rtn)
console.log('公司宝--rtn---', rtn)
if (actionBody.status == 2) {
var deliveryObj = {
actionBody: {
......@@ -377,57 +381,58 @@ class RegCenterOrderService extends AppServiceBase {
//--------------3.
//提交reg注册方案
async regSubmitSolution(pobj) {
console.log('reg --- pobj -----',pobj)
console.log('reg --- pobj -----', pobj)
var s
var subSnLength
if(pobj.actionBody.solutionList){
var res
if (pobj.actionBody.solutionList) {
subSnLength = pobj.actionBody.solutionList.length
for(s = 0; s < subSnLength; s++){
if(!pobj.actionBody.solutionList[s].solutionContent.solution.channelSolutionNo){
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
}else{
for (s = 0; s < subSnLength; s++) {
if (!pobj.actionBody.solutionList[s].solutionContent.solution.channelSolutionNo) {
res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
} else {
pobj.actionType = "updateSolution"
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
}
}
}
console.log('reg -----res -----', res)
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolutions) {
console.log('reg --- res -----',res)
console.log('reg --- res -----', res)
var needinfo = res.data.needinfo;//需求信息
var needsolutions = res.data.needsolutions;//方案信息
var self = this;
var bizTypes;
var solutionList = [];
if(needinfo.uapp_id == regCfg.uappId.baidu){
if (needinfo.uapp_id == regCfg.uappId.baidu) {
//推送数据至baidu
var i=0;
var i = 0;
var needsolutionsLength = needsolutions.length;
var channelSolutionNo;
for(i=0;i<needsolutionsLength;i++){
for (i = 0; i < needsolutionsLength; i++) {
bizTypes = needsolutions[i].solutionContent;
console.log('bizTypes-----',bizTypes)
console.log('bizTypes type-----',typeof(bizTypes))
if(typeof(bizTypes) == 'string'){
console.log('bizTypes-----', bizTypes)
console.log('bizTypes type-----', typeof (bizTypes))
if (typeof (bizTypes) == 'string') {
bizTypes = JSON.parse(bizTypes)
}
bizTypes.solution.area = regCfg.baiduAreaCode[bizTypes.solution.area]
bizTypes.solution.serviceArea = bizTypes.solution.area
bizTypes.solution.isWhether = true//是否刻章,必带刻章true
//根据前端传参channelSolutionNo判断是新建方案还是修改方案
if(pobj.actionBody.solutionList[i].solutionContent.solution.channelSolutionNo){
if (pobj.actionBody.solutionList[i].solutionContent.solution.channelSolutionNo) {
channelSolutionNo = pobj.actionBody.solutionList[i].solutionContent.solution.channelSolutionNo
var list = {
bizId:channelSolutionNo,
gsbBizId:needsolutions[i].solutionNo,
bizType:bizTypes.bizType,
solutionContent:bizTypes.solution
bizId: channelSolutionNo,
gsbBizId: needsolutions[i].solutionNo,
bizType: bizTypes.bizType,
solutionContent: bizTypes.solution
}
}else{
} else {
var list = {
gsbBizId:needsolutions[i].solutionNo,
bizType:bizTypes.bizType,
solutionContent:bizTypes.solution
gsbBizId: needsolutions[i].solutionNo,
bizType: bizTypes.bizType,
solutionContent: bizTypes.solution
}
}
solutionList.push(list)
......@@ -435,13 +440,13 @@ class RegCenterOrderService extends AppServiceBase {
var pushObj = {
intentionBizId: needinfo.channelNeedNo,
solutionList:solutionList
solutionList: solutionList
};
console.log('pushObj---pushObj---',pushObj)
console.log('pushObj---pushObj---', pushObj)
var pushBaiduRegSolution = await this.pushBaiduRegSolution(pushObj, pobj.appInfo, self);
console.log('pushBaiduRegSolution+++',pushBaiduRegSolution)
if(pushBaiduRegSolution.status != 0 ){
return system.getResultFail(-101,pushBaiduRegSolution.msg)
console.log('pushBaiduRegSolution+++', pushBaiduRegSolution)
if (pushBaiduRegSolution.status != 0) {
return system.getResultFail(-101, pushBaiduRegSolution.msg)
}
}
this.logCtl.info({
......@@ -468,10 +473,13 @@ class RegCenterOrderService extends AppServiceBase {
//推送reg方案
async pushBaiduRegSolution(pushObj, appInfo, self) {
console.log('pushObj++baidu+++',pushObj)
console.log('pushObj++baidu+++', pushObj)
//推送方案信息
var pushRes = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?submitSolutions=", reqbody: pushObj });
console.log("pushRes----",pushRes)
var pushRes = await self.baiduRegClient.baiduReqbyget({
path: "/v1/provider/demand?submitSolutions=",
reqbody: pushObj
});
console.log("pushRes----", pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data && pushRes.data.data && pushRes.data.data.infos) {
var reqObj2 = {
actionType: "saveReginfo",
......@@ -481,7 +489,7 @@ class RegCenterOrderService extends AppServiceBase {
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id,用户确认方案url
console.log("保存渠道方案id,用户确认方案url aaaa++ ",a)
console.log("保存渠道方案id,用户确认方案url aaaa++ ", a)
}
return pushRes.data;
}
......@@ -519,20 +527,24 @@ class RegCenterOrderService extends AppServiceBase {
intentionBizId: pobj.actionBody.channelNeedNo,
note: pobj.actionBody.note
}
console.log('pushObj----/////',pushObj)
// 推送baidu
var a = await this.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?close=", reqbody:pushObj});
console.log('regNeedClose+++a----', a)
var tmpResult = await this.baiduRegClient.baiduReqbyget({path: "/v1/provider/demand?close=", reqbody: pushObj});
//查看日志
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/common/regCenterOrderSve.js/regNeedClose",
content: JSON.stringify(a),
resultInfo: "",
optitle: "推送baidu-reg关闭需求->closeNeed",
content: JSON.stringify(pushObj),
resultInfo: JSON.stringify(tmpResult),
optitle: "推送baidu-reg关闭需求返回结果->closeNeed",
});
if(result.data && result.data.uapp_id == 44){
pobj.appInfo.uapp_id = 44
if(pobj && pobj.actionBody && pobj.actionBody.note){
pobj.actionBody['description'] = pobj.actionBody.note
}
}
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
......@@ -543,37 +555,74 @@ class RegCenterOrderService extends AppServiceBase {
//提交交付信息/修改订单状态
async regUpdateOrderStatus(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/regapi/springBoard");
console.log('推送交付信息/修改订单状态res+++++',res)
console.log('推送交付信息/修改订单状态++pobj+++',pobj)
console.log('推送交付信息/修改订单状态res+++++', res)
console.log('推送交付信息/修改订单状态++pobj+++', pobj)
var deliverContent = {}
var pushObj = {}
if (res && res.status == 0 && res.data) {
var deliverContent
if( pobj.actionBody.deliverContent){
if(pobj.actionBody.deliverContent.companyInfo && pobj.actionBody.deliverContent.companyInfo.serviceArea){
if (pobj.actionBody.deliverContent) {
if (pobj.actionBody.deliverContent.companyInfo && pobj.actionBody.deliverContent.companyInfo.serviceArea) {
pobj.actionBody.deliverContent.companyInfo.serviceArea = regCfg.baiduAreaCode[pobj.actionBody.deliverContent.companyInfo.serviceArea]
}
deliverContent = {
applicationFormUrl:pobj.actionBody.deliverContent.applicationFormUrl || "",//公司注册申请登记表文件
registDocumentsUrl:pobj.actionBody.deliverContent.registDocumentsUrl || "",//注册文件
baseInfo:pobj.actionBody.deliverContent.baseInfo || {},//基本信息
companyInfo:pobj.actionBody.deliverContent.companyInfo || {}//公司信息
applicationFormUrl: pobj.actionBody.deliverContent.applicationFormUrl || "",//公司注册申请登记表文件
registDocumentsUrl: pobj.actionBody.deliverContent.registDocumentsUrl || "",//注册文件
baseInfo: pobj.actionBody.deliverContent.baseInfo || {},//基本信息
companyInfo: pobj.actionBody.deliverContent.companyInfo || {}//公司信息
}
}
if(res.data.uapp_id == regCfg.uappId.baidu){
//推送数据至百度
var pushObj = {
orderNo:res.data.bizId,
status :res.data.deliveryContent.status,
deliverContent :deliverContent
if (res.data.uapp_id == regCfg.uappId.baidu) {
//2021-5-18新增套餐公司注册与正常公司注册区分
if(pobj.actionBody.consultType && pobj.actionBody.consultType == "GSREG" ){
//推送正常公司注册数据至百度
pushObj = {
orderNo: res.data.bizId,
status: res.data.deliveryContent.status,
deliverContent: deliverContent
};
}
if(pobj.actionBody.consultType && pobj.actionBody.consultType == "QYJYTC1"){
//推送套餐1公司注册数据至百度
pushObj = {
orderNo: res.data.bizId,
status: res.data.deliveryContent.status,
deliverContent: deliverContent,
consultType:pobj.actionBody.consultType, //需求类型: GSREG:正常原始公司注册; QYJYTC1:企业经营套餐1; QYJYTC2:企业经营套餐2;
productType:pobj.actionBody.productType //套餐包含业的务类型: 不传为原始公司注册
};
}
if(pobj.actionBody.consultType && pobj.actionBody.consultType == "QYJYTC2"){
//推送套餐2公司注册数据至百度
//代理记账和地址服务需要单独的开始和结束时间
//地址服务:时间截止到天, 代理记账:时间截止到月, 时间字段都是秒
if(pobj.actionBody.productType == "DLJZ" || pobj.actionBody.productType == "DZFW"){
pushObj = {
orderNo: res.data.bizId,
status: res.data.deliveryContent.status,
deliverContent: deliverContent,
consultType:pobj.actionBody.consultType, //需求类型: GSREG:正常原始公司注册; QYJYTC1:企业经营套餐1; QYJYTC2:企业经营套餐2;
productType:pobj.actionBody.productType, //套餐包含业的务类型: 不传为原始公司注册
startTime:pobj.actionBody.startTime, //开始时间
endTime:pobj.actionBody.endTime //结束时间
};
}else{
pushObj = {
orderNo: res.data.bizId,
status: res.data.deliveryContent.status,
deliverContent: deliverContent,
consultType:pobj.actionBody.consultType, //需求类型: GSREG:正常原始公司注册; QYJYTC1:企业经营套餐1; QYJYTC2:企业经营套餐2;
productType:pobj.actionBody.productType //套餐包含业的务类型: 不传为原始公司注册
};
}
}
var self = this;
//推送交付信息/修改订单状态
var baidu = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/comreg", reqbody: pushObj });
console.log('推送交付信息/修改订单状态baidu+++',baidu)
console.log('推送交付信息/修改订单状态pushObj+++',pushObj)
var baidu = await self.baiduRegClient.baiduReqbyget({path: "/v1/provider/comreg", reqbody: pushObj});
console.log('推送交付信息/修改订单状态baidu+++', baidu)
console.log('推送交付信息/修改订单状态pushObj+++', pushObj)
return baidu.data
}
console.log('rsrsr++++------------++++',res)
console.log('rsrsr++++------------++++', res)
}
return res
}
......@@ -581,11 +630,11 @@ class RegCenterOrderService extends AppServiceBase {
//reg回写沟通记录
async regWriteCommunicationLog(pobj) {
console.log('reg回写沟通记录---',pobj)
console.log('reg回写沟通记录---', pobj)
var self = this;
var reqUrl = this.centerOrderUrl + "action/regapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('reg回写沟通记录--result---',result)
console.log('reg回写沟通记录--result---', result)
var pushObj = {}
if (result && result.status == 0 && result.data) {
pushObj = {
......@@ -593,8 +642,11 @@ class RegCenterOrderService extends AppServiceBase {
note: pobj.actionBody.note
}
if (result.data == regCfg.uappId.baidu) {
var ress = await self.baiduRegClient.baiduReqbyget({ path: "/v1/provider/demand?addCommRecord=", reqbody: pushObj });
if(ress.data.status != 0 ){
var ress = await self.baiduRegClient.baiduReqbyget({
path: "/v1/provider/demand?addCommRecord=",
reqbody: pushObj
});
if (ress.data.status != 0) {
return system.getResultFail(ress.data.msg)
}
console.log("regWriteCommunicationLog---------", ress)
......@@ -639,12 +691,13 @@ class RegCenterOrderService extends AppServiceBase {
intentionBizId: pobj.actionBody.intentionBizId
}
var res = await this.baiduRegClient.baiduReqbyget({
path: "/v1/provider/demand?listCommRecords=", reqbody: pushObj });
path: "/v1/provider/demand?listCommRecords=", reqbody: pushObj
});
console.log('xxcc+++', res)
}
}
if(res && res.data && res.data.infos){
if (res && res.data && res.data.infos) {
res.data['Data'] = res.data.infos
}
return system.getResultSuccess(res);
......@@ -654,4 +707,5 @@ class RegCenterOrderService extends AppServiceBase {
//-----------接入百度reg------end----------------------------------
}
module.exports = RegCenterOrderService;
\ No newline at end of file
......@@ -240,6 +240,12 @@ class RtService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('rt closeNeed+++',a)
}
if(result.data && result.data.uapp_id == 44){
pobj.appInfo.uapp_id = 44
if(pobj && pobj.actionBody && pobj.actionBody.note){
pobj.actionBody['description'] = pobj.actionBody.note
}
}
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
......
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
const system = require("../../../system");
class UtilsAliyunInfoService extends AppServiceBase {
constructor() {
super();
}
async sendAliyunInfoByNeedId(pobj) {
let verifyResult = await this.opAliyunRpcVerifyParam(pobj);
if (verifyResult.status != 0) {
return verifyResult;
}
let interface_params = verifyResult.data;
let params = {
action: interface_params.action,
reqbody: pobj.reqbody,
rpcParam: {}
}
if (interface_params.accessKeyId) {
params.rpcParam.accessKeyId = interface_params.accessKeyId;
}
if (interface_params.accessKeySecret) {
params.rpcParam.accessKeySecret = interface_params.accessKeySecret;
}
if (interface_params.endpoint) {
params.rpcParam.endpoint = interface_params.endpoint;
}
if (interface_params.apiVersion) {
params.rpcParam.apiVersion = interface_params.apiVersion;
}
let aliResult = await this.opAliyunRpcReq(pobj, params);
return await this.disposePushResult(pobj, aliResult, "ali->sendAliyunInfoByNeedId->aliResult", this.pushlogFailType.FQ);
}
}
module.exports = UtilsAliyunInfoService;
......@@ -1729,6 +1729,16 @@ class UtilsOrderService extends AppServiceBase {
* @param {*} actionBody
*/
async receiveAliTmOrder(pobj, actionBody) {
var res = await this.receiveFqbossTmOrder(pobj, actionBody);
return res;
}
/**
* 接收蜂擎boss商标订单
* @param {*} pobj
* @param {*} actionBody
*/
async receiveFqbossTmOrder(pobj, actionBody) {
if (!actionBody.channelItemCode) {
return system.getResult(null, "产品编码有误,100010");
}
......@@ -1743,12 +1753,58 @@ class UtilsOrderService extends AppServiceBase {
}
pobj.productInfo = productItemResult.data.data;
pobj.productInfo.price_item = pobj.productInfo.price_list[0];
pobj.actionType = "receiveAliTmOrder";
pobj.actionType = "receiveFqbossTmOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if(result && result.status==0){
if(pobj.appInfo && pobj.appInfo.uapp_id!=18 && !pobj.actionBody.serviceOrderNo){//京东云自助商标注册
await this.pushChannelOrder2fq(pobj);
}
}
return result;
}
async pushChannelOrder2fq(pobj) {
try {
var yfobj = {
actionBody: {
idempotentSource: pobj.productInfo.service_business_code || '' , //渠道来源 N
quantity:1,//数量 N
needId: pobj.actionBody.needNo || '',//需求id N
contactsName:pobj.actionBody.contactsName || '',//联系人名称 N
companyName:pobj.actionBody.applyName || '',//公司名称 N
scope:"商标自助订单进行备案,不用做任何处理",// N
orderNo: pobj.actionBody.channelOrderNo,
orderPrice: 300,//写死 自助300
phone: pobj.actionBody.contactsMobile,
appName:pobj.appInfo.app_name || '',
sku:'125855508212158464' //写死 自助一个
},
appInfo: pobj.appInfo
};
//yfPushRes.data.data
// {"contractNo":null,"orderNos":["20010618850"],"orderList":[{"operator_name":"系统用户","operatorName":"系统用户","operator":"124496450905186304","order_id":"20010618850","order_no":"20010618850","orderNo":"20010618850","message":"success","contractNo":null}]}
var yfPushRes = await this.utilsPushSve.business2Channel(yfobj, "pushOrderICPBusinessNew");
//日志记录
this.logCtl.info({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "企服通渠道订单推送至蜂擎:,method=pushChannelOrder2fq",
op: "service/impl/utilsSve/utilsOrderSve.js/pushChannelOrder2fq",
content: "参数:"+JSON.stringify(pobj)+";返回结果:"+JSON.stringify(yfPushRes),
clientIp: ""
});
} catch (e) {
//日志记录
this.logCtl.error({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "企服通渠道订单推送至蜂擎异常:,method=pushChannelOrder2fq",
op: "service/impl/utilsSve/utilsOrderSve.js/pushChannelOrder2fq---error",
content: "参数:"+JSON.stringify(pobj)+";异常信息:"+JSON.stringify(e.stack),
clientIp: ""
});
console.log("service/impl/utilsSve/utilsOrderSve.js/pushChannelOrder2fq推送异常",e.stack);
}
}
/**
* 接收阿里订单退款信息git
* @param {*} pobj
......
......@@ -14,7 +14,7 @@ class UtilsPushService extends AppServiceBase {
let productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.execClientNew.execLogs(`${pobj.opType}推送蜂擎获取的接口信息->business2Channel->app(getAppInterface)`, pobj, "center-channel-utilsPushSve-business2Channel", productItemInterfaceResult.data, null);
this.execClientNew.execLogs(`${opType}推送蜂擎获取的接口信息->business2Channel->app(getAppInterface)`, pobj, "center-channel-utilsPushSve-business2Channel", productItemInterfaceResult.data, null);
if (pobj.interface_info && pobj.interface_info.length > 0) {
let tmpResult = await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess(tmpResult);
......@@ -73,11 +73,11 @@ class UtilsPushService extends AppServiceBase {
try {
if (interface_info.interface_type == "bd") {
if (!interface_info.method_name) {
return system.getResult(null, "产品接口参数信息有误,100350");
return system.getResult(null, "接口对应的method_name参数信息为空,100350");
}//操作的方法名称
var invokeObj = system.getObject(interface_info.interface_url);
if (!invokeObj[interface_info.method_name]) {
return system.getResult(null, "产品接口参数方法信息有误,100360");
return system.getResult(null, "接口对应的method_name参数方法信息有误,100360");
}
pobj.interface_params = interface_info.params;
var params = [pobj];
......
......@@ -18,7 +18,7 @@ module.exports = {
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
"getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"putUserPwdByMobile", "icpNotifyNew", "getOrderStatisticsByUappId", "getOrderStatisticsByProduct", "getOrdersComparison", "getOrdersComparisonList",
"importOrders", "importNeeds", "receiveAliTmOrder", "receiveAliTmOrderRefund","receiveAliTmStatus",
"importOrders", "importNeeds", "receiveAliTmOrder","receiveFqbossTmOrder", "receiveAliTmOrderRefund","receiveAliTmStatus",
//百度工商注册
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
......@@ -58,6 +58,10 @@ module.exports = {
"/api/tm/status/notify",
"/api/tm/tmcase/nbtzreceiveAssistTmData",
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
],
apiAliSendKeyPathList: [
"/api/opreceive/pushAliInfo/tmNote",
"/api/opreceive/pushAliInfo/icNote",
]
},
AREACOMM: {
......
......@@ -6,7 +6,7 @@ const utilsFeishuSve = system.getObject("service.utilsSve.utilsFeishuSve");
const signSve = system.getObject("service.common.signSve");
const xml2js = require('xml2js');
const jwt = require('jsonwebtoken');
const { PDICT } = require("../../config/businessConfig");
const {PDICT} = require("../../config/businessConfig");
const settings = require("../../config/settings");
module.exports = function (app) {
......@@ -175,7 +175,11 @@ module.exports = function (app) {
body += data;
});
req.on('end', async function () {
xml2js.parseString(body, { trim: true, explicitArray: false, explicitRoot: false }, async function (err, json) {
xml2js.parseString(body, {
trim: true,
explicitArray: false,
explicitRoot: false
}, async function (err, json) {
var client_ip = system.get_client_ip(req);
var result = await utilsOrderSve.wxPayNotify(json);
logCtl.info({
......@@ -338,7 +342,8 @@ module.exports = function (app) {
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp; req
req.clientIp = tClientIp;
req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
......@@ -411,8 +416,27 @@ module.exports = function (app) {
res.end(JSON.stringify(result));
return;
}
console.log(req.originalUrl,"sy-------------------------------00001");
if (PDICT.apiAliSendKeyPathList.indexOf(req.originalUrl) >= 0) {
//验证数据key
var appkey = req.headers["appkey"] || "";
if (!appkey) {
result.msg = "req headers appkey can not be empty";
result.data = null;
res.end(JSON.stringify(result));
return;
}
if (appkey != "201912031344") {
result.msg = "req appkey verify error";
result.data = null;
res.end(JSON.stringify(result));
return;
}
next();
return;
}
if (PDICT.apiSecretPathList.indexOf(req.originalUrl) >= 0) {
//TODO:验证数据签名
//验证数据签名
var appkey = req.headers["appkey"] || "";
if (!appkey) {
result.msg = "req headers appkey can not be empty";
......@@ -551,7 +575,8 @@ module.exports = function (app) {
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp; req
req.clientIp = tClientIp;
req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
......
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