Commit 40ebd94b by 宋毅

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

parents f736b3d2 3e28f572
var WEBBase = require("../../web.base");
var system = require("../../../system");
class IcbcToolsAPI extends WEBBase {
constructor() {
super();
this.icbcSve = system.getObject("service.trademark.icbcSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, pobj.actionBody, req);
return result;
}
async opActionProcess(pobj, action_type, action_body, req) {
var opResult = null;
switch (action_type) {
case "getCompanyListByVague"://企业模糊查询
opResult = await this.icbcSve.getCompanyListByVague(req.app, action_body.opStr);
break;
case "getDetailByCompanyName"://企业详情
opResult = await this.icbcSve.getDetailByCompanyName(req.app, action_body.opStr);
break;
case "getCompanyChangeByName"://企业变更记录查询
opResult = await this.icbcSve.getCompanyChangeByName(req.app, action_body.opStr);
break;
case "getCompanyIcpByName"://工商icp证照查询
opResult = await this.icbcSve.getCompanyIcpByName(req.app, action_body.opStr);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = IcbcToolsAPI;
\ No newline at end of file
......@@ -76,6 +76,9 @@ class Need extends APIBase {
case "getaliicpProduce"://方案询价
opResult = await this.centerorderSve.getaliicpProduce(pobj);
break;
case "testsymq":
opResult = await this.utilsNeedSve.testsymq(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
const system=require("../../../system");
const Dao=require("../../dao.base");
class testneedDao extends Dao{
constructor(){
super(Dao.getModelName(testneedDao));
}
}
module.exports=testneedDao;
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("testneed", {
channelNeedNo: DataTypes.STRING,
status: DataTypes.STRING,
}, {
//freezeTableName: true,
// define the table's name
tableName: 'testneed',
});
}
......@@ -203,7 +203,7 @@ class CenterorderService extends AppServiceBase {
/**
* 推送ICP交付信息至企业宝(交付系统)
*/
async pushIcpOrderDelivery2Qfb(orderNo, needsolution,status) {
async pushIcpOrderDelivery2Qfb(orderNo, needsolution, status) {
// var pushObj = {
// orderNo: orderNo,
// needsolution: needsolution.solutionContent
......@@ -214,7 +214,7 @@ class CenterorderService extends AppServiceBase {
// return system.getResultSuccess(data);
}
async getaliicpProduce(pobj){
async getaliicpProduce(pobj) {
var sobj = {
actionType: "getaliicpProduce",
// actionBody: { typeCode: itemResult.data.channelTypeCode, province: itemResult.data.province },
......@@ -304,7 +304,7 @@ class CenterorderService extends AppServiceBase {
city: pobj.actionBody.province,
regType: pobj.actionBody.regType,
orderNo: pobj.actionBody.channelOrder.channelOrderNo,
orderPrice: Number(pobj.actionBody.orderPrice/100) ,
orderPrice: Number(pobj.actionBody.orderPrice / 100),
phone: pobj.actionBody.publishMobile,
needId: solutiondata.data.channelNeedNo
},
......@@ -315,10 +315,11 @@ class CenterorderService extends AppServiceBase {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
needsolution: solutiondata.data.solutionContent,
channelNeedNo: solutiondata.data.channelNeedNo,
skuCode:data.data.payCode,
servicer:{
code:'gsb',
name:'公司宝'
channelSolutionNo: solutiondata.data.channelSolutionNo,
skuCode: data.data.payCode,
servicer: {
code: 'gsb',
name: '公司宝'
}
},
appInfo: pobj.appInfo
......
......@@ -70,6 +70,15 @@ class QcCenterOrderService extends AppServiceBase {
// requestId: pobj.requestId || "" // N 请求id
// }
// this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/common/qcCenterOrderSve.js/submitIcpProgramme",
content: JSON.stringify(pobj),
resultInfo:JSON.stringify(needinfo),
optitle:"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
var reqParams = {
actionBody: {
intentionBizId: needinfo.channelNeedNo,
......
const system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
class IcbcService extends AppServiceBase {
constructor() {
super();
this.zcApiUrl = settings.reqZcApi();
}
async getCompanyListByVague(obj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getCompanyListByVague";
return await this.opReqResult(url, obj, req);
}
//企业模糊查询
async getDetailByCompanyName(obj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getDetailByCompanyName";
return await this.opReqResult(url, queryobj, req);
}
//企业详情
async getNclByLikeNameAndNcl(queryobj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getNclByLikeNameAndNcl";
return await this.opReqResult(url, queryobj, req);
}
//企业变更记录查询
async getCompanyChangeByName(queryobj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getCompanyChangeByName";
return await this.opReqResult(url, queryobj, req);
}
//工商icp证照查询
async getCompanyIcpByName(queryobj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getCompanyIcpByName";
return await this.opReqResult(url, queryobj, req);
}
}
module.exports = IcbcService;
......@@ -3,6 +3,7 @@ var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const fs = require("fs");
const { json } = require("sequelize");
const async = require('async')
//需求操作类----ali对接的需求
class UtilsNeedService extends AppServiceBase {
constructor() {
......@@ -13,6 +14,7 @@ class UtilsNeedService extends AppServiceBase {
this.ossClient = system.getObject("util.ossClient");
this.restClient = system.getObject("util.restClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsneedSve = system.getObject("service.common.gatewaypushlogSve");
this.opPushQueueUrl = settings.opPushQueueUrl();
}
......@@ -201,6 +203,15 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsNeedSve.js/needCloseIcp",
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
......@@ -209,16 +220,27 @@ class UtilsNeedService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
}
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.channelNeedNo,
status:"closeNeed"
status: "closeNeed"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsNeedSve.js/needCloseIcp",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
console.log(a);
......@@ -284,7 +306,23 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionType = "receiveIcpStatusNotify";
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
if (rtn.status == 0 && actionBody.status != 1 && rtn.data) {
if (actionBody.status == 2) {
var deliveryObj = {
actionBody: {
orderNo: rtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
needsolution: rtn.data.solutionContent,
channelNeedNo: rtn.data.channelNeedNo,
channelSolutionNo: rtn.data.channelSolutionNo,
servicer: {
code: 'gsb',
name: '公司宝'
}
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
actionBody: {
orderNo: rtn.data.orderNo,
......@@ -391,6 +429,16 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
await self.aliclient.reqbyget({ action: "WriteCommunicationLog", reqbody: { BizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, apiVersion: "2019-05-08" });
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.intentionBizId,
status: "followingUp"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
return system.getResultSuccess();
}
......@@ -411,24 +459,50 @@ class UtilsNeedService extends AppServiceBase {
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2019-05-08"
});
// 2020 0820 lin 新增 拉去有跟进信息的需求但 并 记录
// console.log(pobj.actionBody.intentionBizId,res.data.TotalItemNum)
// if(res.data.TotalItemNum > 0) {
// var sql = "update testneed set status=1 where channelNeedNo=:channelNeedNo"
// var paramWhere = {
// channelNeedNo: pobj.actionBody.intentionBizId
// };
// var updateRes = await this.utilsneedSve.dao.customUpdate(sql, paramWhere);
// }
// func();
return system.getResultSuccess(res);
}
async test(pobj) {
async queryTradeIntentionUserList(pobj) {
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
}
if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
}
let res = await this.aliclient.reqbyget({
action: "QueryTradeIntentionUserList", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: "20200817115056000001",
Type: "5",
BizId: pobj.actionBody.intentionBizId,
UserFeedBack: pobj.actionBody.userFeedBack,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2019-05-08"
});
console.log(res)
return system.getResultSuccess(res);
}
async testsymq(pobj) {
var a = null;
try {
a = await this.utilsPushSve.aliBusiness2Delivery(pobj.actionBody, pobj.actionBody.pushtype);
return system.getResultSuccess(a);
} catch (error) {
return system.getResultSuccess(error);
}
}
urlSplit(url) {
var arr = url.split("?")[1]; //根据?跟个url
......@@ -450,14 +524,14 @@ class UtilsNeedService extends AppServiceBase {
module.exports = UtilsNeedService;
// var a=new UtilsNeedService();
// a.queryExpertApplyCommunicationLogs({actionBody:{intentionBizId:"20200803095203000001",userFeedBack:true}});
// a.queryExpertApplyCommunicationLogs({actionBody:{intentionBizId:"20200805103324000001",userFeedBack:true}});
// // var a=new UtilsNeedService();
// a.writeCommunicationLog({actionBody:{intentionBizId:"20200804200124000001",note:"测试反馈"}});
// var a=new UtilsNeedService();
// a.needCloseIcp({actionBody:{channelNeedNo:20200804200124000001,note:"ceshifankui"}},{channelNeedNo:20200803095203000001,note:"ceshifankui"});
var a=new UtilsNeedService();
a.test({actionBody:{intentionBizId:"20200803095203000001",userFeedBack:true}});
// var a = new UtilsNeedService();
// a.queryTradeIntentionUserList({ actionBody: { intentionBizId: "20200803095203000001", userFeedBack: true } });
......@@ -20,7 +20,7 @@ class UtilsPushService extends AppServiceBase {
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/aliBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->aliBusiness2Delivery",
optitle: opType + "推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
......@@ -32,7 +32,6 @@ class UtilsPushService extends AppServiceBase {
async aliBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
debugger;
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
......
......@@ -7,6 +7,8 @@
## 1. 工商检索相关接口
  1 [工商检索中心](doc/api/opTrademark/icbcSearch.md)
  2 [数据中心工商接口](doc/api/opTrademark/newicbcSearch.md)
## 2. 商标检索相关接口
  1 [商标检索中心](doc/api/opTrademark/tmSearch.md)
......
......@@ -16,6 +16,7 @@
"ali-oss": "^4.12.2",
"alipay-sdk": "^3.1.1",
"aliyun-api-gateway": "^1.1.6",
"async": "^3.2.0",
"axios": "^0.19.2",
"babel-polyfill": "^6.26.0",
"base64id": "^1.0.0",
......
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