Commit 8be567a5 by linboxuan

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

parents 53883a73 52885c31
node_modules/
.idea
.history/
.vscode
\ No newline at end of file
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/zhichan.iml" filepath="$PROJECT_DIR$/.idea/zhichan.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/bigdata/main.js"
}
]
}
\ No newline at end of file
node_modules/
.idea
.history/
.vscode
\ No newline at end of file
......@@ -53,7 +53,7 @@ class APIBase {
await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600);
}
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClientNew.execLogs("center-channel-doexecMethod-reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
this.execClientNew.execLogs("api-center-channel-doexecMethod-reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
return result;
} catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e);
......
......@@ -36,8 +36,11 @@ class IcbcToolsAPI extends WEBBase {
case "getCompanyIcpByName"://工商icp证照查询
opResult = await this.icbcSve.getCompanyIcpByName(action_body, req);
break;
case "searchCertification"://企业证书查询
opResult = await this.icbcSve.searchCertification(action_body,req);
// case "searchCertification"://企业证书查询
// opResult = await this.icbcSve.searchCertification(action_body,req);
// break;
case "searchCertification"://企业证书查询(综合)
opResult = await this.icbcSve.getLicenseList(action_body,req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -5,6 +5,7 @@ const logCtl = system.getObject("service.common.oplogSve");
class opLog extends WEBBase {
constructor() {
super();
this.pushlogSve = system.getObject("service.common.pushlogSve");
}
async info(pobj, qobj, req) {
this.logCtl.info(pobj);
......@@ -12,5 +13,29 @@ class opLog extends WEBBase {
async error(pobj, qobj, req) {
this.logCtl.error(pobj);
}
/**
* 获取推送失败日志列表
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async getPushFailLogList(pobj,qobj,req){
let list = await this.pushlogSve.getPushFailLogList(pobj.actionBody);
return list;
}
/**
* 重新推送
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async rePush(pobj,qobj,req){
let result = await this.pushlogSve.rePush(pobj.actionBody);
return result;
}
}
module.exports = opLog;
\ No newline at end of file
......@@ -60,6 +60,9 @@ class OpNeed extends APIBase {
case "getStatisticsByProduct":
opResult = await this.utilsOpNeedSve.getStatisticsByProduct(pobj);
break;
case "getNeedProductType":
opResult = await this.utilsOpNeedSve.getNeedProductType(pobj);
break;
case "getStatisticsByArea":
opResult = await this.utilsOpNeedSve.getStatisticsByArea(pobj);
break;
......
......@@ -56,6 +56,10 @@ class QcAPI extends APIBase {
opResult = await this.qcCenterOrderSve.closeOrderDelivery(pobj);
break;
// 2021-3-23 laolan 易名退款
case "eNameCloseOrder":
opResult = await this.baseOrderSve.eNameCloseOrder(pobj);
break;
// --------- 网文 ---------
case "ncSubmitMaterial"://交付材料提交(网文)2020-11-11
......
......@@ -92,7 +92,6 @@ class TradetransferAPI extends WEBBase {
//阿里网关
async aliclienttransfer(p, obj) {
console.log("----------------sssssssssssssssssss-------------------------------------------")
console.log(p.actionBody)
if (p.actionBody) {
console.log(p.actionBody)
......
......@@ -11,6 +11,7 @@ class AccessAuthAPI extends APIBase {
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");
this.utilsTmOrderCallService = system.getObject("service.utilsSve.utilsTmOrderCallSve");
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
this.utilsOpOrderSve = system.getObject("service.utilsSve.utilsOpOrderSve");
}
async QueryTradeIntentionUserList(pobj, qobj, req) {
pobj.appInfo={uapp_id:18}
......@@ -27,7 +28,7 @@ class AccessAuthAPI extends APIBase {
return rtn;
}
async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送蜂擎业务数据
var rtn = await this.utilsPushSve.aliBusiness2Fq(pobj, pobj.opType);
var rtn = await this.utilsPushSve.business2Channel(pobj, pobj.opType);
this.pushlogSve.delDbPushfaillogById(Number(pobj.id || 0));
return rtn;
}
......@@ -116,5 +117,29 @@ class AccessAuthAPI extends APIBase {
return system.getResultSuccess();
}
/**
* 需求商机同步任务
* @param pobj
* @param qobj
* @param req
* @returns {Promise<{msg: *, data, bizmsg: (*|string), status: number}>}
*/
async taskSyncNeedBusiness(pobj,qobj,req){
let result = await this.utilsNeedSve.syncNeedBusiness();
return result;
}
/**
* 订单商机同步任务
* @param pobj
* @param qobj
* @param req
* @returns {Promise<{msg: *, data, bizmsg: (*|string), status: number}>}
*/
async taskSyncOrderBusiness(pobj,qobj,req){
let result = await this.utilsOpOrderSve.syncOrderBusiness();
return result;
}
}
module.exports = AccessAuthAPI;
\ No newline at end of file
var WEBBase = require("../../web.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class ProductAPI extends WEBBase {
constructor() {
super();
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
......@@ -22,19 +25,26 @@ class ProductAPI extends WEBBase {
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId;
var opResult = null;
switch (action_type) {
case "addOrder"://创建订单
opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
//处理推送到峰擎
// opType:值为query、add
this.pushNewFq(pobj, opResult);
break;
case "addOrderWeb"://创建订单 官网
opResult = await this.utilsOrderSve.addOrderWeb(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.addOrderWeb(pobj, pobj.actionBody);
break;
case "getOrderInfo"://获取订单列表信息
opResult = await this.utilsOrderSve.getOrderInfo(pobj, pobj.actionBody);
break;
case "getPathName":
opResult = await this.utilsProductSve.getAllPathName(pobj);
break;
case "getOrderStatisticsByUappId":
opResult = await this.utilsOrderSve.getOrdersStatisticsByUappId(pobj);
break;
......@@ -69,19 +79,31 @@ class ProductAPI extends WEBBase {
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// break;
case "addUsuallyContacts"://添加常用联系人、申请人
opResult = await this.utilsOrderSve.addUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.addUsuallyContacts(pobj, pobj.actionBody);
break;
case "delUsuallyContacts"://删除常用联系人、申请人
opResult = await this.utilsOrderSve.delUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.delUsuallyContacts(pobj, pobj.actionBody);
break;
case "updateUsuallyContacts"://修改常用联系人、申请人
opResult = await this.utilsOrderSve.updateUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.updateUsuallyContacts(pobj, pobj.actionBody);
break;
case "getUsuallyContacts"://查询常用联系人、申请人
opResult = await this.utilsOrderSve.getUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.getUsuallyContacts(pobj, pobj.actionBody);
break;
case "importOrders":
opResult = await this.utilsOrderSve.importOrders(pobj, req);
break;
case "pushTest":
opResult = await this.utilsOrderSve.pushTest(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.pushTest(pobj, pobj.actionBody);
break;
case "receiveAliTmOrder"://接收阿里商标订单
opResult = await this.utilsOrderSve.receiveAliTmOrder(pobj, pobj.actionBody);
break;
case "receiveAliTmStatus"://接收阿里商标状态
opResult = await this.utilsOrderSve.receiveAliTmStatus(pobj, pobj.actionBody);
break;
case "receiveAliTmOrderRefund"://接收阿里商标订单退款信息
opResult = await this.utilsOrderSve.receiveAliTmOrderRefund(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......@@ -90,5 +112,19 @@ class ProductAPI extends WEBBase {
return opResult;
}
async pushNewFq(pobj, result) {
this.execClientNew.execLogs("pushNewFq-1", pobj, "center-channel-order-pushNewFq", result, null);
if (result.status == 0 && result.data && result.data.channelOrderNo) {
try {
pobj.actionType = "getOrderInfoByChannelOrderNo";
pobj.actionBody.channelOrderNo = result.data.channelOrderNo;
await this.utilsOrderSve.pushNewFqByChannelOrderNo(pobj);
} catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs("pushNewFq异常:", pobj, "center-channel-pushNewFq", null, stackStr);
}
}
}
}
module.exports = ProductAPI;
......@@ -50,9 +50,6 @@ class Need extends APIBase {
opResult = await this.utilsNeedSve.getItemByChannelNeedNo(pobj,pobj.actionBody);
break;
case "getSolutionByChannelSolutionNo":
opResult = await this.utilsNeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
break
case "getSolutionByChannelSolutionNo":
opResult = await this.utilsNeedSve.getSolutionByChannelSolutionNo(pobj, pobj.actionBody);
break;
case "getItemByNeedNo":
......@@ -124,6 +121,22 @@ class Need extends APIBase {
// break;
break;
//-----------接入百度ICP------end----------------------------------
case "importNeeds":
opResult = await this.utilsNeedSve.importNeeds(pobj,req);
break;
case "getymicpProduce"://获取易名的icp产品信息
opResult = await this.centerorderSve.getymicpProduce(pobj);
break;
//百度商标接入
case "submitTmNeed"://提交需求
opResult = await this.utilsNeedSve.submitTmNeed(pobj, pobj.actionBody);
break;
case "tmFeedbackSubmit"://商标用户反馈
opResult = await this.utilsNeedSve.tmFeedbackSubmit(pobj);
break;
case "tmStatusNotify"://商标状态通知
opResult = await this.utilsNeedSve.tmStatusNotify(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
/**
* 商标需求
* 庄冰 2021.03.17
*/
class Consultation extends APIBase {
constructor() {
super();
this.gatewaypushlogSve = system.getObject("service.common.gatewaypushlogSve");
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
getResultSuccess(requestId) {
return {
"status": 0,
"msg": "success",
"data":null,
"requestId": requestId
};
}
getResultFail(errmsg) {
var self = this;
return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(),
"data":null,
"bizmsg":"empty"
};
}
//需求提交
async submit(pobj,obj,req) {
var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){
return self.getResultFail("未知应用或应用未启用");
}
if (!pobj.intentionBizId) {
return self.getResultFail("intentionBizId不能为空");
}
if (!pobj.phone) {
return self.getResultFail("phone不能为空");
}
if (!pobj.consultType) {
return self.getResultFail("consultType不能为空");
}
pobj.type = pobj.consultType;
pobj.mobile = pobj.phone;
pobj.action_type = "submitTmNeed";
var param = {
requestId: req.requestId || self.getUUID(),
requestUrl: pobj.appInfo.app_code+"/tm/consultation/submit",
requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "submitTmNeed",//调用参数
pushtimes: 0,//推送次数
pushStatus: "wts",//推送状态
}
await self.gatewaypushlogSve.create(param);
return self.getResultSuccess(param.requestId);
}
/**
* 需求关闭CloseTradeMarkProduct
* @param {*} pobj
* @param {*} obj
* @param {*} req
*/
async close(pobj,obj,req){
if (!pobj.IntentionBizId) {
return self.getResultFail("IntentionBizId不能为空");
}
var reqUrl = settings.centerOrderUrl() + "action/opNeed/springBoard";
var reqObj={
actionType:"opNeedClose",
actionBody:{needNo:pobj.IntentionBizId},
appInfo:pobj.appInfo
}
var result = await this.utilsNeedSve.restPostUrl(reqObj,reqUrl);
return result;
}
}
module.exports = Consultation;
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
/**
* 商标通知接口
* 庄冰 2021.03.17
*/
class Feedback extends APIBase {
constructor() {
super();
this.gatewaypushlogSve = system.getObject("service.common.gatewaypushlogSve");
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
getResultSuccess(requestId) {
return {
"status": 0,
"msg": "success",
"data":null,
"requestId": requestId
};
}
getResultFail(errmsg) {
var self = this;
return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(),
"data":null,
"bizmsg":"empty"
};
}
//需求反馈
async submit(pobj,obj,req) {
var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){
return self.getResultFail("未知应用或应用未启用");
}
if (!pobj.intentionBizId) {
return self.getResultFail("intentionBizId不能为空");
}
if (!pobj.description) {
return self.getResultFail("description不能为空");
}
pobj.action_type = "tmFeedbackSubmit";
var param = {
requestId: req.requestId || self.getUUID(),
requestUrl: pobj.appInfo.app_code+"/tm/feedback/submit",
requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "tmFeedbackSubmit",//调用参数
pushtimes: 0,//推送次数
pushStatus: "wts",//推送状态
}
await self.gatewaypushlogSve.create(param);
return self.getResultSuccess(param.requestId);
}
}
module.exports = Feedback;
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
/**
* tm通知接口
* 庄冰 2021.03.18
*/
class Order extends APIBase {
constructor() {
super();
this.gatewaypushlogSve = system.getObject("service.common.gatewaypushlogSve");
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
getResultSuccess(requestId) {
return {
"status": 0,
"msg": "success",
"data":null,
"requestId": requestId
};
}
getResultFail(errmsg) {
var self = this;
return {
"status":-1,
"msg": errmsg,
"requestId": self.getUUID(),
"data":null,
"bizmsg":"empty"
};
}
//状态变更
async notify(pobj,obj,req) {
var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){
return self.getResultFail("未知应用或应用未启用");
}
if (!pobj.bizId) {
return self.getResultFail("bizId不能为空");
}
if (!pobj.status) {
return self.getResultFail("status不能为空");
}
pobj.action_type = "tmStatusNotify";
var param = {
requestId: req.requestId || self.getUUID(),
requestUrl: pobj.appInfo.app_code+"/tm/status/notify",
requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "tmStatusNotify",//调用参数
pushtimes: 0,//推送次数
pushStatus: "wts",//推送状态
}
await self.gatewaypushlogSve.create(param);
return self.getResultSuccess(param.requestId);
}
}
module.exports = Order;
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
/**
* 商标方案信息(接收fqboss推送的商标方案信息,并推送至渠道)
* 庄冰 2021.03.18
*/
class Tmcase extends APIBase {
constructor() {
super();
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
this.baseUrl = settings.centerOrderUrl()+"notifyaction/opNeedSolution/"
}
async updateTmStatus(pobj, qobj, req) {
var reqUrl = this.baseUrl + "updateTmStatus";
var result = await this.utilsNeedSve.restPostUrl(pobj,reqUrl);
return result;
}
//接收辅助、担保商标注册信息
async nbtzreceiveAssistTmData(pobj, qobj, req) {
var reqUrl = this.baseUrl + "nbtzreceiveAssistTmData";
var result = await this.utilsNeedSve.restPostUrl(pobj,reqUrl);
if(result && result.status==0){
await this.pushData2Platform()
}
return result;
}
//接收辅助、担保商标注册修改信息
async nbtzreceiveEditAssistTmData(pobj, qobj, req) {
var reqUrl = this.baseUrl + "nbtzreceiveEditAssistTmData";
var result = await this.utilsNeedSve.restPostUrl(pobj,reqUrl);
return result;
}
//提交方案确认
async submitTmConfirm(pobj, qobj, req) {
if (!pobj.IntentionBizId) {
return self.getResultFail("IntentionBizId不能为空");
}
var reqUrl = this.baseUrl + "nbtzreceiveEditAssistTmData";
var result = await this.utilsNeedSve.restPostUrl(pobj,reqUrl);
return result;
}
/**
* 关闭注册⽅案
* @param {*} pobj
* @param {*} obj
* @param {*} req
*/
async closeSolution(pobj,obj,req){
if (!pobj.BizId) {
return self.getResultFail("BizId不能为空");
}
if (!pobj.IntentionBizId) {
return self.getResultFail("IntentionBizId不能为空");
}
var reqUrl = this.baseUrl + "closeSolution";
var result = await this.utilsNeedSve.restPostUrl(pobj,reqUrl);
return result;
}
/**
* 推送数据至平台方(百度、阿里)
* needSolution 需求方案
* appInfo app
* opflag 操作标志:QueryTradeIntentionUserList:查询需求列表,SaveTradeMarkProductSolution:提交注册⽅案-商标信息
* SaveTradeMarkMaterialDetail:补全注册⽅案-申请⼈信息 ConfirmTradeIntention:确认注册⽅案
*
*/
async pushData2Platform(needSolution,appInfo,opflag){
if(appInfo.uapp_id==18){//阿里云商机
}
if(appInfo.uapp_id==44){//百度云商机
}
}
}
module.exports = Tmcase;
\ No newline at end of file
......@@ -38,7 +38,7 @@ class WEBBase {
opTitle: "api服务提供方appKey:" + settings.appKey,
});
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClientNew.execLogs("reqPath:" + req.path, pobj, "center-channel-doexecMethod-web", tmpResult, null);
this.execClientNew.execLogs("web-center-channel--reqPath:" + req.path, pobj, "center-channel-doexecMethod-web", tmpResult, null);
return result;
} catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........")
......@@ -53,16 +53,16 @@ class WEBBase {
agent: req.uagent,
opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey,
});
this.logCtl.error({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId,
op: req.classname + "/" + methodname,
content: e.stack,
clientIp: pobj.clientIp,
agent: req.uagent,
optitle: "api调用出现异常,请联系管理员",
});
// this.logCtl.error({
// appid: req.app.id,
// appkey: req.app.uappKey,
// requestId: req.requestId,
// op: req.classname + "/" + methodname,
// content: e.stack,
// clientIp: pobj.clientIp,
// agent: req.uagent,
// optitle: "api调用出现异常,请联系管理员",
// });
var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack);
rtnerror.requestId = req.requestId;
return rtnerror;
......
......@@ -10,6 +10,7 @@ module.exports = (db, DataTypes) => {
pushActionType: DataTypes.STRING,//调用参数
pushtimes:DataTypes.INTEGER,//推送次数
pushStatus:DataTypes.STRING,//推送状态
error:DataTypes.STRING(5000),//错误信息
}, {
paranoid: false,//假的删除
underscored: true,
......
......@@ -7,14 +7,16 @@ const cryptoJS = require('crypto-js');
class AppServiceBase {
constructor() {
this.dingClient = system.getObject("util.dingClient");
this.restClient = system.getObject("util.restClient");
this.execClientNew = system.getObject("util.execClientNew");
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};
this.logCtl = system.getObject("service.common.oplogSve");
}
/**
* 验证签名
* @param {*} params 要验证的参数
......@@ -48,6 +50,7 @@ class AppServiceBase {
}
return system.getResultSuccess();
}
async restPostUrl(pobj, url) {
try {
var rtn = await this.restClient.execPost(pobj, url);
......@@ -57,20 +60,12 @@ class AppServiceBase {
var result = JSON.parse(rtn.stdout);
return result;
} catch (e) {
var errorMsg = "error:" + e.stack;
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/app.base.js/restPostUrl",
content: errorMsg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->restPostUrl",
});
return system.getResult(null, errorMsg);
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`推送操作异常-api-center-channel-url:${url}`, pobj, "center-channel-restPostUrl", null, stackStr);
return system.getResult(null, stackStr);
}
}
async restPostWithHValueUrl(pobj, url, hValue) {//curl请求带请求头信息
try {
if (!hValue) {
......@@ -83,20 +78,12 @@ class AppServiceBase {
var result = JSON.parse(rtn.stdout);
return result;
} catch (e) {
var errorMsg = "error:" + e.stack;
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/app.base.js/restPostWithHValueUrl",
content: errorMsg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->restPostWithHValueUrl",
});
return system.getResult(null, errorMsg);
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`操作异常-api-center-channel-url:${url}`, pobj, "center-channel-restPostWithHValueUrl", null, stackStr);
return system.getResult(null, stackStr);
}
}
async restPostWithHAuthorizationUrl(pobj, userToken, url) {//curl请求带请求头信息
try {
var rtn = await this.restClient.restPostWithHAuthorizationUrl(userToken, url);
......@@ -106,20 +93,12 @@ class AppServiceBase {
var result = JSON.parse(rtn.stdout);
return result;
} catch (e) {
var errorMsg = "error:" + e.stack;
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/app.base.js/restPostWithHAuthorizationUrl",
content: errorMsg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->restPostWithHAuthorizationUrl",
});
return system.getResult(null, errorMsg);
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`操作异常-api-center-channel-url:${url}`, pobj, "center-channel-restPostWithHAuthorizationUrl", null, stackStr);
return system.getResult(null, stackStr);
}
}
async execPostUrl(pobj, url) {
try {
var rtn = await this.execClient.execPost(pobj, url);
......@@ -129,20 +108,12 @@ class AppServiceBase {
var result = JSON.parse(rtn.stdout);
return result;
} catch (e) {
var errorMsg = "error:" + e.stack;
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/app.base.js/execPostUrl",
content: errorMsg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "基类操作异常->execPostUrl",
});
return system.getResult(null, errorMsg);
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`操作异常-api-center-channel-url:${url}`, pobj, "center-channel-restPostWithHAuthorizationUrl", null, stackStr);
return system.getResult(null, stackStr);
}
}
async opAliyunRpcVerifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
......@@ -155,6 +126,7 @@ class AppServiceBase {
verify.data = interface_params_info;
return verify;
}
/**
* 阿里RPC调用
* @param {*} pobj {action: rpcParam.action,reqbody: pobj.actionBody,rpcParam: rpcParam}
......@@ -169,48 +141,13 @@ class AppServiceBase {
var rtn = await aliyunClient.reqCustomByGet(params);
return rtn;
} catch (e) {
var errorMsg = "error:" + e.stack;
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunRpcReq",
content: errorMsg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->opAliyunRpcReq",
});
return system.getResult(null, errorMsg);
}
}
// /**
// * 阿里RPC调用-post请求
// * @param {*} pobj {action: rpcParam.action,reqbody: pobj.actionBody,rpcParam: rpcParam}
// * @param {*} params {为阿里的接口参数}
// */
// async opAliyunRpcReqByPost(pobj, params) {
// try {
// // var action = obj.action;
// // var reqbody = obj.reqbody;
// // var rpcParam = obj.rpcParam;
// var aliyunClient = system.getObject("util.aliyunClient");
// var rtn = await aliyunClient.reqCustomByPost(params);
// return rtn;
// } catch (e) {
// var errorMsg = "error:" + e.stack;
// //日志记录
// this.logCtl.error({
// appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
// appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
// requestId: pobj.requestId || "",
// op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunRpcReqByPost",
// content: errorMsg,
// // clientIp: pobj.clientIp,
// optitle: pobj.opType + "推送操作异常->opAliyunRpcReqByPost",
// });
// return system.getResult(null, errorMsg);
// }
// }
params.appInfo = pobj.appInfo;
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`推送操作异常-api-center-channel`, params, "center-channel-opAliyunRpcReq", null, stackStr);
return system.getResult(null, stackStr);
}
}
/**
* 处理成功后的信息
* @param {*} pobj
......@@ -219,35 +156,35 @@ class AppServiceBase {
* @param {*} failType this.pushlogFailType
*/
async disposePushResult(pobj, result, opTitleDesc, failType) {//处理结果信息--内部使用
var opType = pobj.opType || "";
let opType = pobj.opType || "";
let content = JSON.stringify(pobj);
if (result.status != 0) {
this.pushlogSve.createFailLogDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result),
clientIp: pobj.clientIp || "",
failType: failType || 3,
opTitle: opType + "推送操作失败->" + opTitleDesc,
pushNumber: pobj.pushNumber || 1
});
result.data = null;
return result;
return this.disposePushResultFail(pobj, result, opTitleDesc, failType);
}
this.pushlogSve.createDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "推送业务类型:" + opType,
content: JSON.stringify(pobj),//推送的参数信息
content: content,//推送的参数信息
resultInfo: JSON.stringify(result),
returnType: '1',
opTitle: opType + "数据推送成功->" + opTitleDesc
});
// result.data = null;
// 更改需求推送状态
if (opType.indexOf('Need') >= 0 && opType.indexOf('Business') >= 0) {
pobj.actionType = 'updateNeedPushStatus';
let url = settings.centerOrderUrl() + 'action/opNeed/springBoard';
this.execPostByTimeOut(null, pobj, url, null, null, 60);
}
if (["pushOrder", "pushOrderBusiness", "pushOrderICPBusiness", "pushOrderICPBusinessNew"].includes(opType) && pobj.actionBody && pobj.actionBody.orderNo) {
pobj.actionBody.pushNumber = pobj.pushNumber || 1;
pobj.actionBody.pushStatus = 3;//推送状态0待推送2推送失败3已成功推送
this.disposeOrderPush(pobj);
}
return result;
}
/**
* 处理失败的结果信息--内部使用
* @param {*} pobj
......@@ -257,26 +194,56 @@ class AppServiceBase {
*/
async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用
var opType = pobj.opType || "";
let pushNumber = pobj.pushNumber || 1;
if (pushNumber == 10) {
pobj.actionBody.pushNumber = pushNumber;
pobj.actionBody.pushStatus = 2;//推送状态0待推送2推送失败3已成功推送
this.disposeOrderPush(pobj);
if (result.errorMsg && result.errorMsg == "订单产品查询出来产品与传递得产品数量不一致") {
this.disposeOrderPushFailSendDing(pobj);
}
}
let resultInfo = JSON.stringify(result);
this.pushlogSve.createFailLogDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
content: JSON.stringify(pobj),//推送的参数信息
resultInfo: JSON.stringify(result),
resultInfo: resultInfo,
clientIp: pobj.clientIp || "",
failType: failType || 3,
opTitle: opType + "推送操作失败->" + opTitleDesc,
pushNumber: pobj.pushNumber || 1
pushNumber: pushNumber
});
result.data = null;
return result;
}
async disposeOrderPushFailSendDing(pobj) {
let params = {
orderNo: pobj.actionBody.orderNo,
city: pobj.actionBody.city,
area: pobj.actionBody.area,
companyCategory: pobj.actionBody.companyCategory,
appName: pobj.actionBody.appName,
sku: pobj.actionBody.sku,
error: "订单产品查询出来产品与传递得产品数量不一致,请重新选择!"
}
this.dingClient.businessPushFqByChannel(params);
}
async disposeOrderPush(pobj) {
pobj.actionType = 'updateOrderPushStatus';
let url = settings.centerOrderUrl() + 'action/order/springBoard';
this.execPostByTimeOut(null, pobj, url, null, null, 60);
}
async getAliossjavaFileUrl(pobj, params) {//上传ali oss 文件调用
var opType = pobj.opType || "";
let opType = pobj.opType || "";
try {
var aliOssFileInfo = await this.execPostUrl(params, settings.aliossjavaUrl());
let aliOssFileInfo = await this.execPostUrl(params, settings.aliossjavaUrl());
if (aliOssFileInfo == true) {
var fileUrl = params.filedir + "/" + params.objectName;
let fileUrl = params.filedir + "/" + params.objectName;
return system.getResultSuccess(fileUrl);
}
this.pushlogSve.createFailLogDb({
......@@ -292,15 +259,9 @@ class AppServiceBase {
});
return system.getResult(null, "java ali oss upload fail");
} catch (e) {
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/app.base.js/getAliossjavaFileUrl",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType || "" + "aliossjava-upload阿里上传文件操作异常->getAliossjavaFileUrl",
});
params.appInfo = pobj.appInfo;
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`aliossjava-upload阿里上传文件操作异常-api-center-channel`, params, "center-channel-getAliossjavaFileUrl", null, stackStr);
return system.getResult(-200, "java ali oss upload error");
}
}
......@@ -323,7 +284,8 @@ class AppServiceBase {
var rtn = await this.ossClient.upfile(upFileName, saveFilePath);
result.data = rtn;
//删除本地文件
fs.unlink(saveFilePath, function (err) { });
fs.unlink(saveFilePath, function (err) {
});
} catch (e) {
result.code = -200;
result.message = "通过flowId获取到的文件url下载操作异常异常error";
......@@ -344,7 +306,7 @@ class AppServiceBase {
var getProductInterfaceObj = {
"actionType": "getProductInterface",
"appInfo": appInfo,
"actionBody": { "product_id": product_id }
"actionBody": {"product_id": product_id}
};
var productItemInterfaceResult = await this.restPostUrl(getProductInterfaceObj, getProductInterfaceUrl);
return productItemInterfaceResult;
......@@ -364,6 +326,7 @@ class AppServiceBase {
}
return result;
}
/*
返回20位业务订单号
prefix:业务前缀
......@@ -382,6 +345,7 @@ class AppServiceBase {
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
......@@ -405,11 +369,13 @@ class AppServiceBase {
}
return uuid.join('');
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
/**
* 加密信息
* @param {*} encrypt_key
......@@ -422,9 +388,10 @@ class AppServiceBase {
}
let keyHex = cryptoJS.enc.Utf8.parse(encrypt_key);
let ivHex = cryptoJS.enc.Utf8.parse(encrypt_secret.substring(0, 8));
var cipherStr = cryptoJS.TripleDES.encrypt(opStr, keyHex, { iv: ivHex }).toString();
var cipherStr = cryptoJS.TripleDES.encrypt(opStr, keyHex, {iv: ivHex}).toString();
return cipherStr;
}
/**
* 解密信息
* @param {*} encrypt_key
......@@ -450,6 +417,7 @@ class AppServiceBase {
return system.getResultFail(-200, "解密异常:" + opStr);
}
}
/**
* 带超时时间的post请求
* @param {*} req 请求信息
......@@ -463,11 +431,12 @@ class AppServiceBase {
const result = await this.execClientNew.execPostTimeOutByBusiness('sve.base', params, url, ContentType, headData, timeOut, req);
return result;
}
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_secret 应用的校验key
*/
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_secret 应用的校验key
*/
async verifySign(params, app_secret) {
if (!params) {
return system.getResult(null, "请求参数为空");
......@@ -500,7 +469,8 @@ class AppServiceBase {
}
return system.getResultSuccess();
}
async getFQbossSign(pobj){
async getFQbossSign(pobj) {
var signArr = [];
var keys = Object.keys(pobj).sort();
for (let k = 0; k < keys.length; k++) {
......@@ -513,4 +483,5 @@ class AppServiceBase {
return md5(resultSignStr).toUpperCase();
}
}
module.exports = AppServiceBase;
......@@ -5,7 +5,8 @@ const AppServiceBase = require("../../app.base");
const uappId = {
'ali':"18", //(阿里icp、edi)
'baidu':"44", //(百度icp、edi)
'zc360':"50" //360icp、edi
'zc360':"50", //360icp、edi
"ename":"52" //易名
}
//tui song baidu zhuanyong pinyin 2020-11-6
const cityLetter = {
......@@ -85,6 +86,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交Icp注册方案
async submitIcpProgramme(pobj) {
console.log('提交Icp注册方案---',pobj)
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data && res.data.needinfo && res.data.needsolution) {
var needinfo = res.data.needinfo;//需求信息
......@@ -154,6 +156,25 @@ class BaseCenterOrderService extends AppServiceBase {
console.log('pushObj++',pushObj)
var pushIcpSolutionRes = await this.pushBaiduIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
if(needinfo.uapp_id == uappId.ename){
//推送数据至易名
// var bizType = needinfo.channelTypeCode;//业务类型里
// solution.Area = cityLetter[solution.Area]
console.log('solution.Area++',solution.Area)
console.log('solution++',solution)
var pushObj = {
IntentionBizId: needinfo.channelNeedNo,
CompanyName: solution.CompanyName,
CompanyAddress: solution.CompanyAddress,
Area: solution.Area,
IcpType:solution.IcpType
};
if (needsolution.channelSolutionNo) {
pushObj["BizId"] = needsolution.channelSolutionNo;
}
console.log('pushObj++',pushObj);
var pushIcpSolutionRes = await this.pushEnameIcpSolution(pushObj, needsolution.solutionNo, pobj.appInfo, self);
}
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
......@@ -172,7 +193,7 @@ class BaseCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
await this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
await this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
}
return res;
}
......@@ -275,6 +296,46 @@ class BaseCenterOrderService extends AppServiceBase {
return pushRes;
}
//推送ICP方案易名 2021-02-25 庄冰
async pushEnameIcpSolution(pushObj, solutionNo, appInfo, self) {
console.log('pushObj++Ename+++',pushObj);
//推送方案信息
var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"SubmitIcpSolution");
console.log("url+++++",settings.enameClientUrl()+"SubmitIcpSolution")
console.log("rtn+++++",rtn)
if (!rtn || !rtn.stdout) {
return system.getResult(null, "execPost data is empty");
}
var pushRes = JSON.parse(rtn.stdout);
// var pushRes = await self.baiduclient.baiduReqbyget({ path: "/api/bla/provider/plan", reqbody: pushObj });
console.log("pushRes++++",pushRes)
if (pushRes && pushRes.ErrorCode == "200" && pushRes.Success==true && pushRes.BizId) {
var reqObj2 = {
actionType: "receiveProgrammeNo",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
solutionBizId: pushRes.BizId
}
};
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
console.log("保存渠道方案id aaaa++ ",a)
if (a && a.status == 0 && pushRes.ConfirmUrl) {
var reqObj3 = {
actionType: "receiveIcpConfirmUrl",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
confirmUrl: pushRes.ConfirmUrl
}
};
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
console.log('save confirmUrl ++ ',url)
}
}
return pushRes;
}
//推送ICP方案baidu 2020-10-26 laolan
async pushBaiduIcpSolution(pushObj, solutionNo, appInfo, self) {
console.log('pushObj++baidu+++',pushObj)
......@@ -579,6 +640,57 @@ class BaseCenterOrderService extends AppServiceBase {
var baiduFlag = -200
}
}
if(res.data.uapp_id == uappId.ename){
var aliFlag = -200;
//推送数据至易名
var BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = {
"CompanyName":material.CompanyName,
// "BizId": BizId,
"OrderNo": BizId,
"Domain": material.Domain,
"CorporateName": material.CorporateName,
"IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || [],
"BusinessLicense" : {
"CreatedAt" : material.BusinessLicense.CreatedAt || "",
"EnterpriseCode" :material.BusinessLicense.EnterpriseCode || "",
"LegalRepresentative" :material.BusinessLicense.LegalRepresentative || "",
"Address" :material.BusinessLicense.Address || "",
"RegisteredCapital" : material.BusinessLicense.RegisteredCapital || "",
"Name" :material.BusinessLicense.Name || "",
"BusinessTerm" :material.BusinessLicense.BusinessTerm || "",
"Type" : material.BusinessLicense.Type || "",
"ScopeBusiness" :material.BusinessLicense.ScopeBusiness || ""
},
};
var self = this;
//推送方案材料
var rtn = await self.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"SavePartnerSubmitMaterial");
console.log("url+++++",settings.enameClientUrl()+"SavePartnerSubmitMaterial")
console.log("rtn+++++",rtn)
if (!rtn || !rtn.stdout) {
aliFlag = -200;
}else{
var pushRes = JSON.parse(rtn.stdout);
if(pushRes && pushRes.Success && pushRes.Success==true){
aliFlag == 200;
}else{
aliFlag == -200;
}
}
}
if(aliFlag == 200 || baiduFlag == 200){
return system.getResultSuccess();
}
......@@ -586,9 +698,10 @@ class BaseCenterOrderService extends AppServiceBase {
console.log('rsrsr++++------------++++',res)
return res
}
return res
}
//队列通知交付状态变更
async serviceProvider2Notification(pobj){
console.log("serviceProvider2Notification+++++pobj+++",pobj)
......@@ -688,7 +801,11 @@ class BaseCenterOrderService extends AppServiceBase {
var pushObj = {
BizId: res.data.BizId,
OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus
ApplicationStatus: res.data.ApplicationStatus,
//2021-3-18 addNew
CertificateNumber:res.data.CertificateNumber || "",//证书编号
CertificateStartTime:res.data.CertificateStartTime || "",//证书有效期 开始时间
CertificateEndTime:res.data.CertificateEndTime || ""//证书有效期 结束时间
};
//推送状态变更
var ali = await this.aliclient.reqbyget({ action: "AcceptPartnerNotification", reqbody: pushObj, apiVersion: "2019-05-08" });
......@@ -699,6 +816,29 @@ class BaseCenterOrderService extends AppServiceBase {
}
}
if(res.data.uapp_id == uappId.ename){
var enameFlag =-200;
//推送数据至易名
var pushObj = {
OrderNo: res.data.channelOrderNo,
OfficialFileURL: res.data.OfficialFileURL,
ApplicationStatus: res.data.ApplicationStatus
};
var rtn = await this.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"AcceptPartnerNotification");
console.log("url+++++",settings.enameClientUrl()+"AcceptPartnerNotification")
console.log("rtn+++++",rtn)
if (!rtn || !rtn.stdout) {
enameFlag = -200;
}else{
var pushRes = JSON.parse(rtn.stdout);
if(pushRes && pushRes.Success && pushRes.Success==true){
enameFlag == 200;
}else{
enameFlag == -200;
}
}
}
if(res.data.uapp_id == uappId.baidu){
res.data.ApplicationStatus = baiduIcpStatus[res.data.ApplicationStatus];
console.log('res.data.channelOrderNo',res.data.channelOrderNo)
......@@ -727,13 +867,14 @@ class BaseCenterOrderService extends AppServiceBase {
}
}
if(aliFlag == 200 || baiduFlag == 200 || zc360Flag == 200){
if(aliFlag == 200 || baiduFlag == 200 || zc360Flag == 200 || enameFlag == 200){
return system.getResultSuccess();
}
}
return res;
}
return res;
}
//交付单关闭
async closeOrderDelivery(pobj) {
......@@ -751,5 +892,38 @@ class BaseCenterOrderService extends AppServiceBase {
}
return res;
}
//易名退款,关闭订单 2021-3-23
async eNameCloseOrder(pobj){
console.log("eNameCloseOrder+++",pobj)
var pushObj = {}
var orderNo
var note
orderNo = pobj.actionBody.orderNo
note = pobj.actionBody.note
pobj.actionType = "delENameOrder"
var res = await this.utilsOrderSve.delENameOrder(pobj, pobj.actionBody);
if (res.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
console.log('delOrder---',res)
if (res && res.status == 0 && res.data && res.data.channelOrderNo) {
pushObj = {
OrderNo:res.data.channelOrderNo,
Note:note
}
console.log('eNameCloseOrder+++pushObj----',pushObj)
var rtn = await this.execClient.execEnamePost(pushObj, settings.enameClientUrl()+"CloseOrder");
console.log('eNameCloseOrder+++rtn----',rtn)
if(rtn && rtn.stdout){
var pushRes = JSON.parse(rtn.stdout);
if(pushRes && pushRes.Success && pushRes.Success==true){
console.log('ename----',pushRes)
return pushRes
}
}
}
return res
}
}
module.exports = BaseCenterOrderService;
\ No newline at end of file
......@@ -198,7 +198,7 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.appName = pobj.appInfo.app_name;
if (solutiondata.status == 0) {
pobj.actionBody.orderNo = pobj.actionBody.channelOrder.channelOrderNo;
this.utilsPushSve.aliBusiness2Fq(pobj, "pushOrderBusiness");
this.utilsPushSve.business2Channel(pobj, "pushOrderBusiness");
}
return system.getResultSuccess();
}
......@@ -337,7 +337,7 @@ class CenterorderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
let aliPushRes = await this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
let aliPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusiness");
if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy=="true"){//直接下单需执行添加订单业务员操作
if(aliPushRes && aliPushRes.status==0){
if(aliPushRes.data && aliPushRes.data.data){
......@@ -357,14 +357,14 @@ class CenterorderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else {
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
......@@ -648,6 +648,18 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.regType = "baidu.radiotv";
}
if(pobj && pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id=='52'){
if (pobj.actionBody.channelItemCode == '5') {
pobj.actionBody.regType = "yiming.icp";
} else if (pobj.actionBody.channelItemCode == '7') {
pobj.actionBody.regType = "yiming.edi";
}
else if (pobj.actionBody.channelItemCode == 'icpnb') {
pobj.actionBody.regType = "yiming.icpnb";
}else if (pobj.actionBody.channelItemCode == 'edinb') {
pobj.actionBody.regType = "yiming.edinb";
}
}
var fqobj = {
actionBody: {
area: pobj.actionBody.province,
......@@ -663,7 +675,7 @@ class CenterorderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = {
actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
......@@ -697,20 +709,169 @@ class CenterorderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
//获取易名的icp产品信息
async getymicpProduce(pobj) {
pobj.actionType = 'getymicpProduce'
let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url);
}
async tmPaySuccess(pobj) {
// var sobj = {
// actionType: "getProduceByChannelItemCode",
// actionBody: { typeCode: pobj.actionBody.channelTypeCode},
// appInfo: pobj.appInfo,
// actionProcess: pobj.actionProcess
// }
// var url = settings.centerAppUrl() + "action/opProduct/springBoard";
// var rtn = await this.execClient.execPost(sobj, url);
// if (!rtn || !rtn.stdout) {
// return system.getResultFail(-5010, "产品查询失败");
// }
// var data = JSON.parse(rtn.stdout);
// if (data.status != 0) {
// return system.getResultFail(-5010, "产品查询失败");
// }
// pobj.actionBody.orderNo = pobj.actionBody.bizId;
// pobj.actionBody.totalSum = data.data.price;
// pobj.actionBody.orderPrice = data.data.price;
// pobj.actionBody.payTotalSum = data.data.price;
// pobj.actionBody.payCode = data.data.payCode;
// pobj.actionBody.channelItemCode = data.data.channelItemCode;
// pobj.actionBody.channelNeedNo = data.data.channelNeedNo;
// pobj.actionBody.needNo = data.data.needNo;
// pobj.actionBody.quantity = 1;
// pobj.actionBody.channelOrder = {
// channelServiceNo: pobj.actionBody.orderNo,
// channelOrderNo: pobj.actionBody.orderNo,
// orderStatus: 2
// }
// var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// if (orderrtn.status != 0 && orderrtn.status != -1) {
// return system.getResultFail(-5012, "订单创建失败");
// }
// if (orderrtn.data) {
// pobj.actionBody.orderNo = orderrtn.data.orderNo;
// }
// pobj.actionBody.channelSolutionNo = pobj.actionBody.bizId;
// pobj.actionType = "receiveSolutionPayInfoNew";
// var url = settings.centerOrderUrl() + "action/icapi/springBoard";
// var solutionrtn = await this.execClient.execPost(pobj, url);
// if (!solutionrtn || !solutionrtn.stdout) {
// return system.getResultFail(-5011, "方案查询失败");
// }
// var solutiondata = JSON.parse(solutionrtn.stdout);
// if (solutiondata.status != 0) {
// return system.getResultFail(-5011, "方案查询失败");
// }
// if (!solutiondata.data) {
// return system.getResultFail(-5012, "方案查询数据为空");
// }
// if (solutiondata.data && solutiondata.data.channelNeedNo) {
// pobj.actionBody.needId = solutiondata.data.channelNeedNo;
// }
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "baidu.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "baidu.edi";
// }
// else if (pobj.actionBody.channelItemCode == 'NC') {
// pobj.actionBody.regType = "baidu.wangwen";
// }
// else if (pobj.actionBody.channelItemCode == 'RT') {
// pobj.actionBody.regType = "baidu.radiotv";
// }
// if(pobj && pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id=='52'){
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "yiming.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "yiming.edi";
// }
// else if (pobj.actionBody.channelItemCode == 'icpnb') {
// pobj.actionBody.regType = "yiming.icpnb";
// }else if (pobj.actionBody.channelItemCode == 'edinb') {
// pobj.actionBody.regType = "yiming.edinb";
// }
// }
// var fqobj = {
// actionBody: {
// area: pobj.actionBody.province,
// idempotentSource: pobj.actionBody.regType,
// orderNo: pobj.actionBody.channelOrder.channelOrderNo,
// orderPrice: Number(pobj.actionBody.orderPrice / 100),
// phone: pobj.actionBody.publishMobile,
// needId: solutiondata.data.channelNeedNo,
// companyName:solutiondata.data.solutionContent.solution.CompanyName || '',
// //2021-1-21 laolan add new
// appName:pobj.appInfo.app_name || '',
// sku:data.data.service_code || ''
// },
// appInfo: pobj.appInfo
// }
// var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
// var deliveryObj = {
// actionBody: {
// orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
// needsolution: solutiondata.data.solutionContent,
// channelNeedNo: solutiondata.data.channelNeedNo,
// channelSolutionNo: solutiondata.data.channelSolutionNo,
// skuCode: data.data.payCode,
// servicer: {
// code: 'gsb',
// name: '公司宝'
// }
// },
// appInfo: pobj.appInfo
// };
// 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:"",
// };
// var salesmanObj={
// appInfo:pobj.appInfo,
// actionType:"addIcpSalesmanInfo",//添加业务员信息
// actionBody:{salesmanInfo:salesmanInfo,orderNo:orderrtn.data.orderNo}
// };
// var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
// var addRes = await this.execClient.execPost(salesmanObj, url);
// if (addRes && addRes.stdout) {
// var salesmanRes = JSON.parse(addRes.stdout);
// if (salesmanRes.status == 0) {
// deliveryObj.actionBody.needsolution = salesmanRes.data;
// await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
// }
// }
// }
// }
// }else{
// this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
// }
return system.getResultSuccess();
}
}
module.exports = CenterorderService;
// var task = new CenterorderService();
// var pobj={
// "actionType":"submitProgramme",
// "actionBody":{
......
......@@ -3,6 +3,7 @@ const ServiceBase = require("../../sve.base");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
const getRawBody = require('raw-body');
class GatewaypushlogService extends ServiceBase {
constructor() {
super("common", ServiceBase.getDaoName(GatewaypushlogService));
......@@ -21,6 +22,7 @@ class GatewaypushlogService extends ServiceBase {
}
var self = this;
for (var i = 0; i < count; i++) {
try {
var icloginfo = icloginfos[i];
var requestdata = null;
if (icloginfo && icloginfo.requestjson) {
......@@ -28,29 +30,43 @@ class GatewaypushlogService extends ServiceBase {
}
var url = settings.gatewayUrl() + "action/intentionapi/springBoard";
var rtn = await self.execClient.execPost(requestdata, url);
var data = JSON.parse(rtn.stdout);
var data = rtn
data = JSON.parse(rtn.stdout);
if (data.success) {
icloginfo.pushStatus = "yts";
} else {
if (data.errorMsg!="状态错误") {//除1 2 4 11其它状态没处理、返回的状态错误
data.push_url = url
data.api = "center-channel/taskAliIcapi"
this.dingClient.gatewayPushError(data)
if (data.errorMsg != "状态错误") {//除1 2 4 11其它状态没处理、返回的状态错误
data.push_url = url;
data.api = "center-channel/taskAliIcapi-for";
data.requestdata = requestdata;
data.message = "error info";
this.dingClient.gatewayPushError(data);
}
icloginfo.error = JSON.stringify(data);
icloginfo.pushtimes += 1;
}
await this.update(icloginfo);
this.update(icloginfo);
} catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e);
icloginfo.error = stackStr;
this.update(icloginfo);
this.dingClient.gatewayPushError({
message: "Exception info",
api: "center-channel/taskAliIcapi-for",
e
})
}
}
}
return system.getResultSuccess();
} catch (error) {
this.dingClient.gatewayPushError({message:"Exception",api:"center-channel/taskAliIcapi"})
return system.getResultFail(-1,error);
this.dingClient.gatewayPushError({message: "Exception", api: "center-channel/taskAliIcapi", error})
return system.getResultFail(-1, error);
}
}
}
module.exports = GatewaypushlogService;
......@@ -123,7 +123,7 @@ class NcService extends AppServiceBase {
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -206,16 +206,7 @@ class NcService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('nc 关闭需求result-----',result)
if (result.status == 0) {
if (result.data && result.data.orderNo) {
pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await this.utilsOrderSve.delOrder(pobj, pobj.actionBody);
console.log("orderrtn +++ +++ ++",orderrtn)
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
if (result && result.status == 0) {
//推送交付系统
var reqParams = {
actionBody: {
......@@ -225,7 +216,7 @@ class NcService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -246,7 +237,7 @@ class NcService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('nc closeNeed+++',a)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......
......@@ -51,6 +51,45 @@ class PushlogService extends ServiceBase {
return result;
}
async getPushFailLogList(actionBody) {
var sql = "SELECT id,appid,`content`,failType,pushNumber,opTitle,resultInfo,created_at FROM `center_channel_pushfaillog` WHERE pushNumber=10 ";
let whereParams = {};
if(actionBody.appid){
sql += " and appid = :appid";
whereParams.appid = actionBody.appid;
}
if(actionBody.likeStr){
sql += " and content like :likeStr";
whereParams.likeStr = "%"+ actionBody.likeStr +"%";
}
sql += " order by created_at desc"
var list = await this.pushfaillogDao.customQuery(sql,whereParams);
var result = system.getResultSuccess(list);
return result;
}
/**
* 重新推送
* @param actionBody
* @returns {Promise<void>}
*/
async rePush(actionBody){
let content = actionBody.content;
let sql = 'update `center_channel_pushfaillog` set pushNumber = :pushNumber';
let params = {
pushNumber: actionBody.pushNumber || 9
}
if(Object.keys(content).length>0){
sql += ',content=:content';
params.content = JSON.stringify(actionBody.content);
}
sql += ' where id = :id';
params.id = actionBody.id;
let result = await this.customUpdate(sql,params);
return system.getResult(result);
}
async addPublicServiceLog(pobj, req) {
var sql = "INSERT INTO `igirl_api`.`center_channel_public_servicelog` (`appkey`,`pushUrl`,`pushContent`,`resultInfo`,`pushNumber`,`clientIp`,created_at)" +
"VALUES(:appkey,:pushUrl,:pushContent,:resultInfo,:pushNumber,:clientIp,:created_at)";
......
......@@ -74,7 +74,7 @@ class QcCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//
return system.getResultSuccess(pushIcpSolutionRes);
}
......
......@@ -126,7 +126,7 @@ class RegCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log('fqobj----',fqobj)
var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = {
actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
......@@ -160,14 +160,14 @@ class RegCenterOrderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
......@@ -217,13 +217,15 @@ class RegCenterOrderService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5016, "需求型查询失败");
return system.getResultFail(-5016, "需求型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -263,9 +265,7 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj.actionBody.customerName = pobj.actionBody.userName;
//2021-1-21 laolan add new
pobj.actionBody.appName = pobj.appInfo.app_name || '',
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushNeedICPBusinessNew");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusinessNew");
}
return result;
}
......@@ -286,7 +286,7 @@ class RegCenterOrderService extends AppServiceBase {
if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) {
self.utilsPushSve.baiduBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
}
var data = JSON.parse(rtn.stdout);
......@@ -324,7 +324,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -335,7 +335,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -343,7 +343,7 @@ class RegCenterOrderService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.baiduBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -352,18 +352,18 @@ class RegCenterOrderService extends AppServiceBase {
//关闭reg订单
async regOrderClose(pobj) {
var actionBody = pobj.actionBody;
// var actionBody = pobj.actionBody;
var self = this;
var url = settings.centerOrderUrl() + "action/regapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
if (rtn.status == 0 && rtn.data) {
var channelOrderNo = pobj.actionBody.orderNo;
pobj.actionBody.orderNo = rtn.data.orderNo;
pobj.actionType="delOrder";
var orderrtn = await self.utilsOrderSve.delOrder(pobj, actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
// pobj.actionBody.orderNo = rtn.data.orderNo;
// pobj.actionType="delOrder";
// var orderrtn = await self.utilsOrderSve.delOrder(pobj, actionBody);
// if (orderrtn.status < 0) {
// return system.getResultFail(-5022, "订单关闭失败");
// }
var tmpObj = {
actionBody: {
orderNo: rtn.data.orderNo,
......@@ -372,7 +372,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
// tmpObj.actionBody.orderNo = channelOrderNo;
var tmpObj2 = {
actionBody: {
......@@ -382,7 +382,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
};
self.utilsPushSve.baiduBusiness2Fq(tmpObj2, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj2, "pushOrderICPClose");
}//通知更新状态
return rtn;
}
......@@ -474,7 +474,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
await this.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
await this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
}
return res;
}
......@@ -506,23 +506,8 @@ class RegCenterOrderService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/regapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('regNeedClose+++result', result)
var i;
var len;
if(result && result.data ){
len = result.data.length
}
var orders = []
if (result.status == 0) {
for(i=0;i<len;i++){
if (result.data && result.data[i].orderNo) {
orders.push(result.data[i].orderNo)
pobj.actionBody.orderNo = orders;
var orderrtn = await this.utilsOrderSve.delOrders(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
}
if (result && result.status == 0) {
//推送交付系统
var reqParams = {
actionBody: {
......@@ -532,7 +517,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -561,7 +546,7 @@ class RegCenterOrderService extends AppServiceBase {
resultInfo: "",
optitle: "推送baidu-reg关闭需求->closeNeed",
});
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
......@@ -638,7 +623,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
var fqobj = {
actionBody: {
"bizId": pobj.actionBody.intentionBizId,
......@@ -648,7 +633,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "aliFollowup",
appInfo: pobj.appInfo
}
self.utilsPushSve.baiduBusiness2Fq(fqobj, "aliFollowup");
self.utilsPushSve.business2Channel(fqobj, "aliFollowup");
return result
}
......
......@@ -126,7 +126,7 @@ class RtService extends AppServiceBase {
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -209,16 +209,7 @@ class RtService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('rt 关闭需求result-----',result)
if (result.status == 0) {
if (result.data && result.data.orderNo) {
pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await this.utilsOrderSve.delOrder(pobj, pobj.actionBody);
console.log("orderrtn +++ +++ ++",orderrtn)
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
if (result && result.status == 0) {
//推送交付系统
var reqParams = {
actionBody: {
......@@ -228,7 +219,7 @@ class RtService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -249,7 +240,7 @@ class RtService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('rt closeNeed+++',a)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......
......@@ -176,6 +176,29 @@ module.exports = SignService;
// }
// }
// task.createSign(obj,"7cbb892450174167b5c7e01we4717z51").then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!");
//订单
// var obj={
// "isDirectBuy":"1",
// "orderNo":"CR-9T8MhbouU8J-test0001",
// "phone":"15732031337",
// "area":"110100",
// "companyProperties":"有限公司",
// "taxpayerType":"一般纳税人",
// "consultType":"GSREG",
// "companyName":"公司名称",
// "engagedIndustry":"从事行业",
// "bizScope":"经营范围",
// "hasAddress":true
// };
//需求
// var obj={
// "intentionBizId": "baidu_test_000101",
// "phone": "18506013355",
// "userName": "测试03",
// "description": "测试03描述",
// "area": "上海",
// "consultType": "GSREG"
// };
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(sign=>{
// console.log(sign,"..............Sign");
// });
\ No newline at end of file
......@@ -12,6 +12,8 @@ class IcbcService extends AppServiceBase {
this.disposeCertificationData = "disposeCertificationData";
//企业资质证书查询
this.searchCertificationData = "searchCertificationData";
//result工具类
this.utilsResultSve = system.getObject("service.utilsSve.utilsResultSve");
}
//企业模糊查询
async getCompanyListByVague(obj, req) {
......@@ -80,24 +82,28 @@ class IcbcService extends AppServiceBase {
//获取token
let url = settings.icNameUrl() + 'openPlatform/platform/getToken';
let params = {
"accessKey":"111",
"accessSecret":"222"
"accessKey": "111",
"accessSecret": "222"
}
let ret = await this.opReqResult(url,params,req);
if(ret.status != 1){
system.getResultFail(-1,'获取开放平台token失败');
req.headers.token='sss'
let ret = await this.opReqResult(url, params, req);
if (ret.status != 1) {
return system.getResultFail(-1, '获取开放平台token失败');
}
let token = ret.data;
url = settings.icNameUrl() + "openPlatform/busenterprise/cloudapi";
//资质查询
let data = {
"path":"/apis/dst/patents/certificate",
"name": queryobj.companyName
}
let rtn = await this.execClient.restGetWithHAuthorizationUrl(token,url, data);
// "path": "/apis/dst/patents/getLicense",
"path": "/apis/dst/patents/certificate",
"name": queryobj.companyName,
"pageNum":1
};
let rtn = await this.execClient.restGetWithHAuthorizationUrl(token, url, data);
if (!rtn || !rtn.stdout) {
return system.getResult(null, "restPostWithHAuthorizationUrl data is empty");
}
};
var result = JSON.parse(rtn.stdout);
if (!result) {
return system.getResultFail(-1, '查询失败!!!');
......@@ -118,6 +124,94 @@ class IcbcService extends AppServiceBase {
}
/**
* 获取资质证书(集合)
* @param obj
* @param req
* @returns {Promise<void>}
*/
async getLicenseList(obj,req){
let companyName = obj.companyName;
let url = settings.icNameUrl() + 'openPlatform/platform/getToken';
let params = {
"accessKey": "111",
"accessSecret": "222"
}
req.headers.token='sss'
let ret = await this.opReqResult(url, params, req);
if (ret.status != 1) {
return system.getResultFail(-1, '获取开放平台token失败');
}
let token = ret.data;
let url2 = settings.icNameUrl() + "/openPlatform/busenterprise/cloudapi";
let params1 = {
"path": "/apis/dst/patents/certificate",
"name": companyName,
"pageNum":1
}
let params2 = {
"path": "/apis/dst/patents/getLicense",
"name": companyName,
"pageNum":1
}
let params3 = {
"companyName":companyName
}
let funcs = [];
funcs.push(this.execClient.restGetWithHAuthorizationUrl(token, url2, params1));
funcs.push(this.execClient.restGetWithHAuthorizationUrl(token, url2, params2));
funcs.push(this.getCompanyIcpByName(params3,req));
let results = await Promise.all(funcs);
if(results.length==0){
return system.getResultFail(-1,'查询失败,请稍后再试');
}
let ret1 = JSON.parse(results[0].stdout);
let ret2 = JSON.parse(results[1].stdout);
let ret3 = results[2];
let resultData = [];
if(ret1.error_code == 0 && ret1.result.items.length >0){
for(let i =0;i<ret1.result.items.length;i++){
let d = ret1.result.items[i];
let obj = {
licencenumber:d.certNo,
licencename:d.certificateName,
startDate:d.startDate,
endDate:d.endDate,
detail:d.detail
};
resultData.push(obj);
}
}
if(ret2.error_code == 0 && ret2.result.items.length >0){
for(let i =0;i<ret2.result.items.length;i++){
let d = ret2.result.items[i];
let obj = {
licencenumber:d.licencenumber,
licencename:d.licencename,
startDate:d.fromdate,
endDate:d.todate,
detail:d.detail
};
if(!resultData.includes(obj)){
resultData.push(obj);
}
}
}
if(ret3.status == 0 && ret3.data.list.length>0){
for(let i =0;i<ret3.data.list.length;i++){
let d = ret3.data.list[i];
let obj = {
licencenumber:d.liscense,
licencename:"icp备案",
examine_date:d.examine_date
};
resultData.push(obj);
}
}
return system.getResultSuccess(resultData);
}
......@@ -128,4 +222,3 @@ class IcbcService extends AppServiceBase {
}
}
module.exports = IcbcService;
\ No newline at end of file
......@@ -82,7 +82,7 @@ class utils360Sve extends AppServiceBase {
content: JSON.stringify(pushObj),//推送的参数信息
resultInfo: JSON.stringify(result),
returnType: '1',
logLevel: '1',
logLevel: 1,
opTitle: "推送360信息返回成功"
});
} else {
......
......@@ -21,7 +21,7 @@ class utilsDeliverSve extends AppServiceBase{
return system.getResultFail();
}
pobj.actionBody = verifyResult.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushTmReDeliver");
this.utilsPushSve.business2Channel(pobj, "pushTmReDeliver");
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
......@@ -123,7 +123,7 @@ class utilsDeliverSve extends AppServiceBase{
if(orderResult.data && orderResult.data.orderStatus === 2){
// 推送交付中心
pobj.actionBody = verifyResult.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushTmReDeliver");
this.utilsPushSve.business2Channel(pobj, "pushTmReDeliver");
}
return result;
}catch (e) {
......
......@@ -45,7 +45,7 @@ class UtilsFgbusinesschancService extends AppServiceBase {
}
var tmpResult = await self.restPostUrl(tmpPobj, reqUrl);
if (tmpResult.status == 0) {
self.utilsPushSve.aliBusiness2Fq(tmpPobj, "pushRePurchaseBusiness");
self.utilsPushSve.business2Channel(tmpPobj, "pushRePurchaseBusiness");
}
}
}
......
var system = require("../../../system");
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
const { json } = require("sequelize");
const {json} = require("sequelize");
const {AREACOMM} = require("../../../../config/businessConfig");
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
class UtilsFqAliyunService extends AppServiceBase {
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.ucommuneOperatorPhone = settings.ucommuneOperatorPhone()
}
async pushOrderBusinessByProductCode2Fq(pobj) {//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console.log(JSON.stringify(pobj), ".................pushOrderBusinessByProductCode2Fq...............pobj");
var verifyResult = await this.verifyParam(pobj);
......@@ -47,7 +50,7 @@ class UtilsFqAliyunService extends AppServiceBase {
phone: orderContact.mobile,// 是 手机号
userId: orderInfo.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称
orderNo:orderInfo.orderNo,
orderNo: orderInfo.orderNo,
orderPrice: orderInfo.totalSum,// 是 订单金额
productId: productInfo.price_item.service_code,// 是 产品 ID
productQuantity: orderInfo.quantity,// 是 产品数量
......@@ -77,84 +80,60 @@ class UtilsFqAliyunService extends AppServiceBase {
return await this.disposePushResultFail(pobj, verifyResult, "fq->pushAliBusiness2Fq->verifyResult", this.pushlogFailType.FQ);
}
var interface_params_info = verifyResult.data;
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
if (interface_params_info.opUrl.indexOf("/cts-open-agency/crm/opportunity/submit") >= 0) {
await this.transformNeedActionBody(pobj);
}
let result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result", this.pushlogFailType.FQ);
}
async transformNeedActionBody(pobj) {
if (!pobj.actionBody.area || pobj.actionBody.area === "null") {
pobj.actionBody.area = "全国";
}
if (pobj.actionBody.area != "全国" && pobj.actionBody.area.indexOf("市") < 0 && pobj.actionBody.area.indexOf("省") < 0) {
pobj.actionBody.area = AREACOMM.areaTransform[pobj.actionBody.area] || pobj.actionBody.area;
}
if (pobj.actionBody.intentionBizId && (!pobj.actionBody.appName || !pobj.actionBody.productId)) {
//获取需求信息
let tmpActionBody = {
actionBody: {needNo: pobj.actionBody.intentionBizId}
}
var reqUrl = this.centerOrderUrl + "action/need/getNeedItemByChannelNeedNo";
var itemResult = await this.restPostUrl(tmpActionBody, reqUrl);
if (itemResult.status == 0 && itemResult.data) {
pobj.actionBody.appName = itemResult.data.appName;
pobj.actionBody.productId = itemResult.data.serviceProductId;
}
}
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
async opAliyunClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果1->fq->opAliyunClientPost",
});
// typeof element === 'string' || typeof element === 'number'
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因11:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因12:" + JSON.stringify(rtn));
if (typeof (rtn) == "string") {
rtn = JSON.parse(rtn);
}
this.execClientNew.execLogs(`utilsFqAliyunSve-opAliyunClientPost-result:url=${url}`, pobj, "center-channel-opAliyunClientPost", rtn, null);
if (rtn.success && rtn.code == 200) {
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
} else {
let errorMsg = "";
if (rtn.errorMessage && rtn.errorMessage.indexOf("订单产品查询出来产品与传递得产品数量不一致") >= 0) {
errorMsg = "订单产品查询出来产品与传递得产品数量不一致";
}
return system.getResultNewFail(-1, `推送失败,失败原因11:${JSON.stringify(rtn)}`, null, errorMsg);
}
async opICClientPost(pobj, url, key, secret, params) {
try {
var rc = system.getObject("util.aliyunClient");
var rtn = await rc.post(url, key, secret, params);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: rtn,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送结果2->fq->opAliyunClientPost",
});
if (typeof rtn.code === 'number' && rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因21:" + JSON.stringify(rtn));
}
if (typeof rtn.code === 'string' && rtn.code != "200" && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因22:" + JSON.stringify(rtn));
}
return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常->fq->opAliyunClientPost",
});
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs(`utilsFqAliyunSve-opAliyunClientPost-error:url=${url}`, pobj, "center-channel-opAliyunClientPost", null, stackStr);
return system.getResult(null, "推送操作异常->fq->opAliyunClientPost->error:" + e.stack);
}
}
async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
......@@ -200,10 +179,38 @@ class UtilsFqAliyunService extends AppServiceBase {
"device_token": pobj.actionBody.device_token //设备编号参数
}
pobj.params = icOrderParams;
var result = await this.opICClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, icOrderParams);
return await this.disposePushResult(pobj, result, "fq->pushOrder2IC->result", this.pushlogFailType.FQ);
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
// async tttt(){
// let rtn={
// "requestId":null,
// "code":"200",
// "data":{
// "_id":"261931196584429568",
// "operator":"null",
// "operator_name":null,
// "customer":"261918243919368192"
// },
// "success":true,
// "errorCode":"OK",
// "errorMessage":"操作成功",
// "timestamp":"2021-03-30T16:45:15.730+0800"
// }
// if (rtn.success && rtn.code == 200) {
// console.log(11111)
// } else {
// console.log(22222)
// }
//
// }
}
module.exports = UtilsFqAliyunService;
// let tmp=new UtilsFqAliyunService();
// tmp.tttt();
\ No newline at end of file
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const fs = require("fs");
const {json} = require("sequelize");
const {getResult, getResultSuccess} = require("../../../system");
//需求操作类----操作类型-公用的
class UtilsNeedCommService extends AppServiceBase {
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl();
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.aliclient = system.getObject("util.aliyunClient");
this.ossClient = system.getObject("util.ossClient");
this.restClient = system.getObject("util.restClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.opPushQueueUrl = settings.opPushQueueUrl();
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async submitNeed(pobj, actionBody) {
if (actionBody.type == "esp.wangwen" || actionBody.type == "esp.food") {
actionBody.area = this.wangwenAreaChange(actionBody.area)
}
if (!actionBody.type && actionBody.consultType)
actionBody.type = actionBody.consultType
if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
}
var sobj = pobj;
sobj.actionType = "getProductTypeInfo";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求类型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
pobj.actionType = "submitNeed";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
//做推送信息
}
return result;
}
}
module.exports = UtilsNeedCommService;
......@@ -39,19 +39,21 @@ class UtilsNeedService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
......@@ -101,28 +103,109 @@ class UtilsNeedService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
} else {
if (["ali.tm","ali.tmd"].includes(pobj.actionBody.type)){
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedTMBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedTMBusiness");
}else {
var reqParams = {
actionBody: pobj.actionBody,
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "addChance");
this.utilsPushSve.business2Channel(reqParams, "addChance");
pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level
if (pobj.actionBody.probability) {
pobj.actionBody.description = pobj.actionBody.description + "(" + pobj.actionBody.probability + ") "
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusiness");
}
}
}
return result;
}
/**
* 提交商标需求,对接百度云商标
* @param {*} pobj
* @param {*} actionBody
*/
async submitTmNeed(pobj, actionBody) {
if(!actionBody.type && actionBody.consultType)
actionBody.type = actionBody.consultType
if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
}
var sobj = pobj;
sobj.actionType = "getProductTypeInfo";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求类型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.phone = pobj.actionBody.phone || pobj.actionBody.mobile;
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
pobj.actionBody.idempotentSourceName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
pobj.actionBody.idempotentSource = "icp_ali";
} else if (pobj.actionBody.channel_type_code == 7) {
pobj.actionBody.type = "ali.edi";
pobj.actionBody.idempotentSource = "edi_ali";
} else if (pobj.actionBody.channel_type_code == "tmjy") {
pobj.actionBody.type = "ali.tmd";
pobj.actionBody.idempotentSource = "tmd_ali";
}else if (pobj.actionBody.channel_type_code == 1) {
pobj.actionBody.type = "ali.tmd";
pobj.actionBody.idempotentSource = "tmd_ali";
}else if (pobj.actionBody.channel_type_code == 2) {
pobj.actionBody.type = "ali.tm";
pobj.actionBody.idempotentSource = "tm_ali";
}else if (pobj.actionBody.channel_type_code == 'esp.companyreg'){
pobj.actionBody.type = "ali.ic";
pobj.actionBody.idempotentSource = "ic_ali";
}else if (pobj.actionBody.channel_type_code == 'esp.companyreg_cloud'){
pobj.actionBody.type = "ali.ic";
pobj.actionBody.idempotentSource = "ic_ali";
}
if(pobj.appInfo.uapp_id=='44'){//百度云
if (pobj.actionBody.channel_type_code == 1) {
pobj.actionBody.type = "baidu.tmd";
pobj.actionBody.idempotentSource = "tmd_baidu";
}else if (pobj.actionBody.channel_type_code == 2) {
pobj.actionBody.type = "baidu.tm";
pobj.actionBody.idempotentSource = "tm_baidu";
}
}
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A";
} else {
pobj.actionBody.level = "C"
}
if (pobj.actionBody.phone == "17319425791") {
pobj.actionBody.level = "F";
}
pobj.actionType = "submitNeed";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
this.utilsPushSve.business2Channel(pobj, "pushNeedTMBusiness");
}
return result;
}
//调用center-order icp需求反馈
async reqCenterOrderQcApi(pobj, reqUrl) {
......@@ -145,18 +228,59 @@ class UtilsNeedService extends AppServiceBase {
"sign": await this.getFQbossSign(pobj.actionBody),
actionBody: pobj.actionBody
}, settings.fqbossTmUrl())
self.utilsPushSve.aliBusiness2Fq(pobj, "pushTMFeedback");
self.utilsPushSve.business2Channel(pobj, "pushTMFeedback");
}else
// 2020 0803 lin 修改;
if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
}
return data;
}
//商标需求反馈
async tmFeedbackSubmit(pobj) {
var url = this.centerOrderUrl + "action/qcapi/springBoard";
var self = this;
pobj.actionType = "tmFeedbackSubmit";
if (pobj.actionBody && pobj.actionBody.intentionStatus) {
pobj.intentionStatus = pobj.actionBody.intentionStatus;
}
var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
if (data.data && (data.data.channelTypeCode == 1||data.data.channelTypeCode == 2)) {//商标
pobj.actionBody.status = "888"
this.execPostUrl({
"actionProcess": "AliTm",
"appCode": "100099",
"sign": await this.getFQbossSign(pobj.actionBody),
actionBody: pobj.actionBody
}, settings.fqbossTmUrl())
self.utilsPushSve.business2Channel(pobj, "pushTMFeedback");
}
return data;
}
//商标状态通知
async tmStatusNotify(pobj) {
var self = this;
// 引用属性,channel依赖bizId order依赖intentionBizId
pobj.intentionBizId = pobj.bizId
var sobj = {
"actionType": "getItemByChannelSolutionNo",
"actionBody": pobj
}
var result = this.getItemByChannelSolutionNo(sobj,sobj.actionBody);
if (result.status == 0) {
let pushres = await this.execPostUrl({ "actionProcess": "AliTm", "appCode": "100099", "sign": await this.getFQbossSign(pobj), actionBody: pobj },settings.fqbossTmUrl())
console.log("推送fqboos----->",pushres)
return this.getResult(result.requestId, pushres.message);
}
return this.getResult(result.requestId)
}
/**
* 提交需求-----del
* @param {*} pobj
......@@ -174,6 +298,9 @@ class UtilsNeedService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -183,7 +310,7 @@ class UtilsNeedService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
}
// else{
// if(pobj.actionBody.channel_type_code==5){
......@@ -286,14 +413,6 @@ class UtilsNeedService extends AppServiceBase {
// 明天找栋源确认 如果需要增加 在这个文件搜索updateChanceStatus
// 2020 1016 lin 新增 需求关闭时判断 方案状态 订单状态,打个比方如果已经生成订单了 那么肯定不能直接关闭需求
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
//推送交付系统
var reqParams = {
actionBody: {
......@@ -303,8 +422,8 @@ class UtilsNeedService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......@@ -353,7 +472,7 @@ class UtilsNeedService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -367,7 +486,7 @@ class UtilsNeedService extends AppServiceBase {
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
console.log(a);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result
}
......@@ -469,7 +588,7 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -480,7 +599,7 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -488,7 +607,7 @@ class UtilsNeedService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
}
......@@ -589,7 +708,7 @@ class UtilsNeedService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
var fqobj = {
actionBody: {
"bizId": pobj.actionBody.intentionBizId,
......@@ -599,7 +718,7 @@ class UtilsNeedService extends AppServiceBase {
opType: "aliFollowup",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Fq(fqobj, "aliFollowup");
self.utilsPushSve.business2Channel(fqobj, "aliFollowup");
return system.getResultSuccess();
}
......@@ -689,7 +808,7 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "推送失敗 100388");
......@@ -858,7 +977,7 @@ class UtilsNeedService extends AppServiceBase {
async testsymq(pobj) {
var a = null;
try {
a = await this.utilsPushSve.aliBusiness2Delivery(pobj.actionBody, pobj.actionBody.pushtype);
a = await this.utilsPushSve.business2Channel(pobj.actionBody, pobj.actionBody.pushtype);
return system.getResultSuccess(a);
} catch (error) {
return system.getResultSuccess(error);
......@@ -1270,8 +1389,8 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusiness");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
break;
case "USER_CONFIRM_PRODUCE":
break;
......@@ -1343,7 +1462,7 @@ class UtilsNeedService extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log(deliveryObj)
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.operationType != "USER_PAY_PRODUCE" && actionBody.operationType != "USER_UPLOAD_PRODUCE" && rtn.data) {
console.log("pushDeliveryStatusNotify start ------")
......@@ -1356,7 +1475,7 @@ class UtilsNeedService extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log(tmpObj)
var res = await this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
var res = await this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
console.log("res")
console.log(res);
console.log("pushDeliveryStatusNotify end ------")
......@@ -1367,7 +1486,7 @@ class UtilsNeedService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -1413,6 +1532,9 @@ class UtilsNeedService extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求類型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -1433,6 +1555,22 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.type = "baidu.radiotv";
pobj.actionBody.idempotentSource = "baidu_radiotv";
}
if(pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id=="52"){
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) {
pobj.actionBody.type = "yiming.edi";
pobj.actionBody.idempotentSource = "yiming.edi";
} 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") {
pobj.actionBody.type = "yiming.edinb";
pobj.actionBody.idempotentSource = "yiming.edinb";
}
}
if (pobj.actionBody.description && pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A";
} else {
......@@ -1471,9 +1609,7 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj.actionBody.customerName = pobj.actionBody.userName;
//2021-1-21 laolan add new
pobj.actionBody.appName = pobj.appInfo.app_name || '',
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushNeedICPBusinessNew");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusinessNew");
}
}
return result;
......@@ -1509,7 +1645,7 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -1520,7 +1656,7 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -1528,7 +1664,7 @@ class UtilsNeedService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.baiduBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -1555,7 +1691,7 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
// tmpObj.actionBody.orderNo = channelOrderNo;
var tmpObj2 = {
actionBody: {
......@@ -1565,11 +1701,45 @@ class UtilsNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
};
self.utilsPushSve.baiduBusiness2Fq(tmpObj2, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj2, "pushOrderICPClose");
}//通知更新状态
return rtn;
}
//-----------接入百度ICP------end----------------------------------
//需求导入
async importNeeds(pobj,req){
let url = this.centerOrderUrl + 'action/need/springBoard';
if(!pobj.actionBody.needsArr){
return system.getResultFail(-1,'导入数据不能为空');
}
if(!pobj.actionBody.uapp_id){
return system.getResultFail(-1,'渠道id 不能为空');
}
pobj.actionType = 'bulkCreateNeeds';
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 同步需求商机
* @param pobj
* @param qobj
* @param req
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/
async syncNeedBusiness(pobj,qobj,req){
let url = this.centerOrderUrl + 'task/taskAction/taskNeed';
let data = {identifyCode : 'syncNeed'}
let result = await this.execPostByTimeOut(req,data,url,"json",null,60)
if (!result || result.status != 0) {
return system.getResult(null, result.msg);
}
if (!result.data || result.data.status != 0) {
return system.getResult(null, result.data.msg);
}
return system.getResult(result.data.data);
}
}
module.exports = UtilsNeedService;
......
......@@ -6,8 +6,9 @@ const { json } = require("sequelize");
const { getResult, getResultSuccess } = require("../../../system");
//区分渠道的uappid
const uappId = {
'ali': "18", //(阿里icp、edi)
'baidu': "44" //(百度icp、edi)
'ali': 18, //(阿里icp、edi)
'baidu': 44, //(百度icp、edi)
'ename':52
}
//需求操作类----ali对接的需求
class UtilsNeedService2 extends AppServiceBase {
......@@ -52,12 +53,14 @@ class UtilsNeedService2 extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求類型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.appName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else if (pobj.actionBody.channel_type_code == 7) {
......@@ -90,19 +93,19 @@ class UtilsNeedService2 extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
} else {
var reqParams = {
actionBody: pobj.actionBody,
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "addChance");
this.utilsPushSve.business2Channel(reqParams, "addChance");
pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level
if (pobj.actionBody.probability) {
pobj.actionBody.description = pobj.actionBody.description + "(" + pobj.actionBody.probability + ") "
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusiness");
}
}
return result;
......@@ -121,7 +124,7 @@ class UtilsNeedService2 extends AppServiceBase {
if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
}
var rtn = await this.execClient.execPost(pobj, url);
......@@ -146,6 +149,9 @@ class UtilsNeedService2 extends AppServiceBase {
if (data.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
......@@ -157,7 +163,7 @@ class UtilsNeedService2 extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
}
// else{
// if(pobj.actionBody.channel_type_code==5){
......@@ -249,8 +255,8 @@ class UtilsNeedService2 extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result
}
......@@ -303,7 +309,7 @@ class UtilsNeedService2 extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -323,7 +329,7 @@ class UtilsNeedService2 extends AppServiceBase {
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);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......@@ -399,7 +405,7 @@ class UtilsNeedService2 extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -410,7 +416,7 @@ class UtilsNeedService2 extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -418,7 +424,7 @@ class UtilsNeedService2 extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -517,6 +523,11 @@ class UtilsNeedService2 extends AppServiceBase {
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)
}
if (result.data == uappId.ename) {
console.log('settings.enameClientUrl()+"WriteCommunicationLog"----',settings.enameClientUrl()+"WriteCommunicationLog")
var resss = await self.execClient.execEnamePost({ IntentionBizId: pobj.actionBody.intentionBizId, Note: pobj.actionBody.note }, settings.enameClientUrl()+"WriteCommunicationLog");
console.log("ename+resss", resss)
}
}
//推送交付系统
......@@ -528,7 +539,7 @@ class UtilsNeedService2 extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
var fqobj = {
actionBody: {
"bizId": pobj.actionBody.intentionBizId,
......@@ -538,7 +549,7 @@ class UtilsNeedService2 extends AppServiceBase {
opType: "aliFollowup",
appInfo: pobj.appInfo
}
self.utilsPushSve.aliBusiness2Fq(fqobj, "aliFollowup");
self.utilsPushSve.business2Channel(fqobj, "aliFollowup");
return system.getResultSuccess();
}
......@@ -546,7 +557,7 @@ class UtilsNeedService2 extends AppServiceBase {
async queryExpertApplyCommunicationLogs(pobj) {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
console.log('jilu+++result++++', result)
console.log('jilu+++result++++1--', result)
if (result && result.status == 0 && result.data && result.data.uapp_id) {
if (result.data.uapp_id == uappId.ali) {
var res = await this.aliclient.reqbyget({
......@@ -576,6 +587,20 @@ class UtilsNeedService2 extends AppServiceBase {
});
console.log('xxcc+++', res)
}
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({
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "",
BizId: pobj.actionBody.intentionBizId,
UserFeedBack: pobj.actionBody.userFeedBack || true,
PageNum: pobj.actionBody.pageNum || 1,
PageSize: pobj.actionBody.pageSize || 10,
}, settings.enameClientUrl()+"queryExpertApplyCommunicationLogs");
console.log('ename+++queryExpertApplyCommunicationLogs---res---', res)
}
}
if(res && res.data && res.data.result){
......@@ -645,7 +670,7 @@ class UtilsNeedService2 extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "推送失敗 100388");
......@@ -815,7 +840,7 @@ class UtilsNeedService2 extends AppServiceBase {
async testsymq(pobj) {
var a = null;
try {
a = await this.utilsPushSve.aliBusiness2Delivery(pobj.actionBody, pobj.actionBody.pushtype);
a = await this.utilsPushSve.business2Channel(pobj.actionBody, pobj.actionBody.pushtype);
return system.getResultSuccess(a);
} catch (error) {
return system.getResultSuccess(error);
......@@ -1245,8 +1270,8 @@ class UtilsNeedService2 extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusiness");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
break;
case "USER_CONFIRM_PRODUCE":
break;
......@@ -1317,7 +1342,7 @@ class UtilsNeedService2 extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log(deliveryObj)
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.operationType != "USER_PAY_PRODUCE" && actionBody.operationType != "USER_UPLOAD_PRODUCE" && rtn.data) {
console.log("pushDeliveryStatusNotify start ------")
......@@ -1330,10 +1355,8 @@ class UtilsNeedService2 extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log(tmpObj)
var res = await this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
console.log("res")
console.log(res);
console.log("pushDeliveryStatusNotify end ------")
var res = await this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
console.log(res,"res-------pushDeliveryStatusNotify end ------")
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.operationType == "ABC_CLOSE_PRODUCE") {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -1341,7 +1364,7 @@ class UtilsNeedService2 extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -1381,18 +1404,20 @@ class UtilsNeedService2 extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求型查询失败");
return system.getResultFail(-5015, "需求型查询失败");
}
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;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionBody.type = pobj.actionBody.channel_type_code;
pobj.actionBody.appName = pobj.appInfo.app_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "baidu.icp";
} else if (pobj.actionBody.channel_type_code == 7) {
......@@ -1423,19 +1448,19 @@ class UtilsNeedService2 extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
} else {
var reqParams = {
actionBody: pobj.actionBody,
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "addChance");
this.utilsPushSve.business2Channel(reqParams, "addChance");
pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level
if (pobj.actionBody.probability) {
pobj.actionBody.description = pobj.actionBody.description + "(" + pobj.actionBody.probability + ") "
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusiness");
}
}
return result;
......@@ -1471,7 +1496,7 @@ class UtilsNeedService2 extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -1482,7 +1507,7 @@ class UtilsNeedService2 extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -1490,7 +1515,7 @@ class UtilsNeedService2 extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......
......@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 提交需求 h5/pc 通用
* 提交需求 h5/pc 通用提交需求接口
* @param {*} pobj
* @param {*} actionBody
*/
......@@ -32,19 +32,21 @@ class UtilsOpNeedService extends AppServiceBase {
if (opResult.status != 0) {
return system.getResultFail(-5015, "需求类型查询失败");
}
pobj.actionBody.service_product_id= opResult.data.service_product_id;
pobj.actionBody.productId = opResult.data.service_product_id;
pobj.actionBody.appName = pobj.appInfo.app_name;
pobj.actionBody.type_code = opResult.data.type_code;
pobj.actionBody.type_name = opResult.data.type_name;
pobj.actionBody.channel_type_code = opResult.data.channel_type_code;
pobj.actionBody.channel_type_name = opResult.data.channel_type_name;
pobj.actionBody.appName = pobj.appInfo.app_name;
}
// 提交需求 暂未做推送
pobj.actionType = "opSubmitNeed";
var reqUrl = this.centerOrderUrl + "action/opNeed/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
if (pobj.actionBody.channel_type_code == "esp.companyreg" || pobj.actionBody.channel_type_code == "esp.companyreg_cloud") {
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
}
}
return result;
......@@ -166,7 +168,7 @@ class UtilsOpNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
......@@ -174,7 +176,7 @@ class UtilsOpNeedService extends AppServiceBase {
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -407,6 +409,20 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 获取需求 的产品类型
* @param pobj
* @returns {Promise<void>}
*/
async getNeedProductType(pobj){
let url = this.centerOrderUrl + "action/opNeed/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
return system.getResultFail(-1);
}
return result;
}
/**
* 需求量对比
* @param pobj
* @returns {Promise<void>}
......
......@@ -115,5 +115,25 @@ class UtilsOpOrderService extends AppServiceBase {
}
}
}
/**
* 同步订单商机
* @param pobj
* @param qobj
* @param req
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/
async syncOrderBusiness(pobj,qobj,req){
let url = this.centerOrderUrl + 'task/taskAction/taskOrder';
let data = {identifyCode : 'syncOrder'}
let result = await this.execPostByTimeOut(req,data,url,"json",null,60)
if (!result || result.status != 0) {
return system.getResult(null, result.msg);
}
if (!result.data || result.data.status != 0) {
return system.getResult(null, result.data.msg);
}
return system.getResult(result.data.data);
}
}
module.exports = UtilsOpOrderService;
......@@ -4,6 +4,7 @@ const querystring = require('querystring');
const AppServiceBase = require("../../app.base");
const axios = require('axios')
const md5 = require('md5')
class UtilsOrderService extends AppServiceBase {
constructor() {
super();
......@@ -20,9 +21,69 @@ class UtilsOrderService extends AppServiceBase {
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve");
this.dingClient = system.getObject("util.dingClient");
};
async pushNewFqByChannelOrderNo(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let opResult = await this.restPostUrl(pobj, url);
this.execClientNew.execLogs("pushNewFq-2", pobj, "center-channel-utilsOrderSve-pushNewFqByChannelOrderNo", opResult, null);
if (opResult.status == 0) {
opResult.data.appInfo = {
uapp_id: pobj.appInfo.uapp_id,
uapp_key: pobj.appInfo.uapp_key,
app_code: pobj.appInfo.app_code,
contact_mobile: pobj.appInfo.contact_mobile,
app_name: pobj.appInfo.app_name
};
opResult.data.userInfo = {
channel_userid: opResult.data.order_info.channelUserId,
channel_username: opResult.data.order_info.channelUserId,
channel_nickname: opResult.data.order_info.channelUserId
};
let tmpPobj = {
appInfo: opResult.data.appInfo,
actionBody: opResult.data
}
tmpPobj.actionBody.appName = pobj.appInfo.app_name;
if (opResult.data && opResult.data.product_info && opResult.data.product_info.price_item) {
tmpPobj.actionBody.sku = opResult.data.product_info.price_item.service_code;
}
//接收方要求
// Assert.notNull(request.get("appName"), "渠道名称不能为空");
// Assert.notNull(request.get("sku"), "sku不能为空");
// Assert.notNull(request.get("orderNo"), "渠道订单号不能为空");
// Assert.notNull(request.get("orderPrice"), "订单金额不能为空");
// Assert.notNull(request.get("phone"), "手机号不能为空");
var fqobj = {
actionBody: {
area: opResult.data.product_info.item_name,
idempotentSource: opResult.data.product_info.service_business_code,
orderNo: opResult.data.order_info.channelOrderNo,
orderPrice: Number(opResult.data.order_info.payTotalSum / 100),
quantity: 1,
// phone: opResult.data.order_info,
// needId: solutiondata.data.channelNeedNo,
// price_desc : pobj.actionBody.taxpayerType,
// additions_desc: pobj.actionBody.companyProperties,
// companyName:solutiondata.data.solutionContent.CompanyName || ''
},
appInfo: pobj.appInfo
}
fqobj.actionBody.appName = pobj.appInfo.app_name;
if (opResult.data && opResult.data.delivery_content && opResult.data.delivery_content.orderContact) {
fqobj.actionBody.phone = opResult.data.delivery_content.orderContact.mobile;
}
if (opResult.data && opResult.data.product_info && opResult.data.product_info.price_item) {
fqobj.actionBody.sku = opResult.data.product_info.price_item.service_code;
fqobj.actionBody.price_desc = opResult.data.product_info.price_item.price_desc;
}
this.execClientNew.execLogs("pushNewFq-3", fqobj, "center-channel-utilsOrderSve-pushNewFqByChannelOrderNo-pushBusInfo", "pushOrder", null);
this.utilsPushSve.business2Channel(fqobj, "pushOrderBusiness");
}
}
/*
* 订单验证
*/
* 订单验证
*/
async isOrderVerify(pobj, actionBody) {
var price_list = actionBody.product_info.price_list;
if (!price_list) {
......@@ -42,14 +103,17 @@ class UtilsOrderService extends AppServiceBase {
}
var buyTotalSum = Number(actionBody.totalSum || 0);
var buyPayTotalSum = Number(actionBody.payTotalSum || 0);
if (buyTotalSum == 0) {
this.execClientNew.execLogs("isOrderVerify-5", actionBody, "center-channel-utilsOrderSve-isOrderVerify", null, null);
if (buyTotalSum === 0) {
buyTotalSum = totalSum;
actionBody.totalSum = totalSum;
}
if (buyPayTotalSum == 0) {
if (buyPayTotalSum === 0) {
buyPayTotalSum = totalSum;
actionBody.payTotalSum = totalSum;
}
console.log("buyTotalSum", buyTotalSum)
console.log("totalSum", totalSum)
// console.log("buyTotalSum", buyTotalSum)
// console.log("totalSum", totalSum)
if (buyTotalSum < totalSum) {
return system.getResult(null, "订单金额有误,100060");
}
......@@ -63,6 +127,7 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionBody.product_info.price_list = tmpPriceList;
return system.getResultSuccess();
}
/**
* 创建订单
* @param {*} pobj
......@@ -110,6 +175,7 @@ class UtilsOrderService extends AppServiceBase {
result.data.totalSum = actionBody.totalSum;
return result.data;
}
async delOrder(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100025");
......@@ -119,7 +185,7 @@ class UtilsOrderService extends AppServiceBase {
return result;
}
//reg关闭订单2020-12-20
//reg关闭订单2020-12-20-暂时没有用到
async delOrders(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100025");
......@@ -128,6 +194,16 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async delENameOrder(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100025");
}
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async getOrderInfo(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
......@@ -139,47 +215,47 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
async getOrdersStatisticsByUappId(pobj){
async getOrdersStatisticsByUappId(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
if (result.status != 0) {
return system.getResultFail(-1);
}
let data = result.data;
let temp=0;
let temp = 0;
let arr = [];
let reArr = [];
for(let i=0;i<data.length;i++){
if((temp != data[i].uapp_id && temp !=0)){
for (let i = 0; i < data.length; i++) {
if ((temp != data[i].uapp_id && temp != 0)) {
let obj = {
uapp_id:temp,
data:arr
uapp_id: temp,
data: arr
}
reArr.push(obj);
arr =[];
arr = [];
}
let dArr = {
time:data[i].time,
count:data[i].count
time: data[i].time,
count: data[i].count
}
arr.push(dArr);
temp = data[i].uapp_id;
if (i == data.length-1){
if (i == data.length - 1) {
let obj = {
uapp_id:temp,
data:arr
uapp_id: temp,
data: arr
}
reArr.push(obj);
}
}
reArr.sort((a,b) =>{
reArr.sort((a, b) => {
return a.uapp_id - b.uapp_id;
})
let temp2 = 0;
let arr2=[];
let arr2 = [];
let final = [];
for(let i =0;i<reArr.length;i++){
if((temp2 != reArr[i].uapp_id && temp2 !=0)){
for (let i = 0; i < reArr.length; i++) {
if ((temp2 != reArr[i].uapp_id && temp2 != 0)) {
let o = {
uapp_id: temp2,
data: arr2
......@@ -190,10 +266,10 @@ class UtilsOrderService extends AppServiceBase {
console.log(reArr[i].data)
arr2 = arr2.concat(reArr[i].data);
temp2 = reArr[i].uapp_id;
if (i == reArr.length-1){
if (i == reArr.length - 1) {
let obj = {
uapp_id:temp2,
data:arr2
uapp_id: temp2,
data: arr2
}
final.push(obj);
}
......@@ -206,50 +282,35 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
async getOrdersStatisticsByProduct(pobj){
async getOrdersStatisticsByProduct(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
if (result.status != 0) {
return system.getResultFail(-1);
}
let data = result.data;
let temp="";
let temp = "";
let arr = [];
let reArr = [];
for(let i=0;i<data.length;i++){
if (data[i].typeCode == '10202010202001'){
data[i].typeCode = 'zzsbzc';
}
if (data[i].typeCode == '10202010202002'){
data[i].typeCode = 'fzsbzc';
}
if (data[i].typeCode == '10202010202003'){
data[i].typeCode = 'dbsbzc';
}
if (data[i].typeCode == '10202010204002'){
data[i].typeCode = 'icpsq';
}
if (data[i].typeCode == '10202010204001'){
data[i].typeCode = 'edisq';
}
if((temp != data[i].typeCode && temp !="")){
for (let i = 0; i < data.length; i++) {
if ((temp != data[i].pathName && temp != "")) {
let obj = {
type_code:temp,
data:arr
pathName: temp,
data: arr
}
reArr.push(obj);
arr =[];
arr = [];
}
let dArr = {
uapp_id:data[i].uapp_id,
count:data[i].count
uapp_id: data[i].uapp_id,
count: data[i].count
}
arr.push(dArr);
temp = data[i].typeCode;
if (i == data.length-1){
temp = data[i].pathName;
if (i == data.length - 1) {
let obj = {
type_code:temp,
data:arr
pathName: temp,
data: arr
}
reArr.push(obj);
}
......@@ -262,10 +323,10 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
async getOrdersComparison(pobj){
async getOrdersComparison(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
if (result.status != 0) {
return system.getResultFail(-1);
}
return result;
......@@ -276,20 +337,40 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
async getOrdersComparisonList(pobj){
async getOrdersComparisonList(pobj) {
let url = this.centerOrderUrl + "action/order/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
if (result.status != 0) {
return system.getResultFail(-1);
}
return result;
}
/**
* 腾讯订单导入
* @param pobj
* @param req
* @returns {Promise<void>}
*/
async importOrders(pobj, req) {
let url = this.centerOrderUrl + 'action/order/springBoard';
if (!pobj.actionBody.ordersArr) {
return system.getResultFail(-1, '导入数据不能为空');
}
if (!pobj.actionBody.uapp_id) {
return system.getResultFail(-1, '渠道id 不能为空');
}
pobj.actionType = 'bulkCreateOrders';
let result = await this.restPostUrl(pobj, url);
return result;
}
async getOrderDetails(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async getOrderDeliveryInfo(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100290");
......@@ -298,6 +379,7 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async getOrderDeliveryFlowInfo(pobj, actionBody) {
if (!actionBody.sourceOrderNo) {
return system.getResult(null, "actionBody.sourceOrderNo can not be empty,100300");
......@@ -306,6 +388,7 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async getOrderDeliveryFlowList(pobj, actionBody) {
if (!actionBody.sourceOrderNoList) {
return system.getResult(null, "actionBody.sourceOrderNoList can not be empty,100070");
......@@ -317,6 +400,7 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async getOrderLogInfo(pobj, actionBody) {
if (!actionBody.sourceOrderNo) {
return system.getResult(null, "actionBody.sourceOrderNo can not be empty,100090");
......@@ -325,6 +409,7 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async icOrderStatusNotify(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100100");
......@@ -333,6 +418,7 @@ class UtilsOrderService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
/**
* 获取H5支付地址
* @param {*} pobj
......@@ -362,6 +448,7 @@ class UtilsOrderService extends AppServiceBase {
await this.cacheManager["TlPayLocker"].init(orderResult.data.receiptVoucher.sourceOrderNo);
return result;
}
/**
* 获取二维码
* @param {*} pobj
......@@ -440,6 +527,7 @@ class UtilsOrderService extends AppServiceBase {
result.aliPayOrderCode = receiptVoucher.aliPayOrderCode;
return result;
}
/**
* 查询订单状态
* @param {*} pobj
......@@ -472,12 +560,12 @@ class UtilsOrderService extends AppServiceBase {
this.opPayStatusSuccess(payStatus.data, pobj.appInfo, null);
// return system.getResultFail(-100130,'订单已支付,请勿重复付款,100130')
return system.getResultSuccess(payStatus.data, '订单已支付,请勿重复付款,100130');
}
else if (payStatus.data && payStatus.data.trxstatus == "3045") {
} else if (payStatus.data && payStatus.data.trxstatus == "3045") {
return system.getResultFail(-100170, "超时未支付,请刷新页面,100170");
}
return system.getResultFail(-100180, "请及时支付,100180");
}
async opPayStatusSuccess(parmas, appInfo, client_ip) { //操作回调业务逻辑---查询支付状态为已支付时进行调用
try {
//日志记录
......@@ -544,6 +632,7 @@ class UtilsOrderService extends AppServiceBase {
return system.getResultFail(-200, e.stack);
}
}
/**
* 获取pc端支付二维码--不跟订单关联
* @param {*} pobj
......@@ -574,6 +663,7 @@ class UtilsOrderService extends AppServiceBase {
return await this.restPostUrl(pobj, this.centerAppPayUrl);
}
/**
* 只是检查支付状态--不跟订单关联
* @param {*} pobj
......@@ -586,6 +676,7 @@ class UtilsOrderService extends AppServiceBase {
return await this.restPostUrl(pobj, this.centerAppPayUrl);
}
async receiveCallBackNotify(parmas, client_ip) {
try {
if (!parmas || !parmas.trxcode) {
......@@ -599,7 +690,7 @@ class UtilsOrderService extends AppServiceBase {
clientIp: client_ip || ""
});
var param = {
"actionBody": { parmas: parmas },
"actionBody": {parmas: parmas},
"client_ip": client_ip
};
var qftstr = await this.restClient.execPost(param, this.centerAppUrl + "payment/paymentApi/receiveCallBackNotify");
......@@ -633,7 +724,7 @@ class UtilsOrderService extends AppServiceBase {
});
var url = this.centerAppUrl + "payment/paymentApi/getAppInfo";
var opResult = await this.restPostUrl({ uappId: parmas.uappid }, url);
var opResult = await this.restPostUrl({uappId: parmas.uappid}, url);
if (opResult.status != 0) {
opResult.msg = opResult.msg + ",100270";
return opResult;
......@@ -701,7 +792,8 @@ class UtilsOrderService extends AppServiceBase {
return system.getResultFail(-200, e.stack);
}
}
async opH5AliDingPayBackNotify(parmas, client_ip) { //操作回调业务逻辑
async opH5AliDingPayBackNotify(parmas, client_ip) { //操作回调业务逻辑-钉钉接入的搁浅
try {
//日志记录
this.logCtl.info({
......@@ -747,7 +839,7 @@ class UtilsOrderService extends AppServiceBase {
});
return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
}
parmas.appInfo = { appInfo: { uapp_id: opResult.data.uappId } };
parmas.appInfo = {appInfo: {uapp_id: opResult.data.uappId}};
parmas.orderNo = opResult.data.orderNo;
parmas.pay_type = "alipay";
//修改并返回订单支付状态,创建收款单
......@@ -784,6 +876,7 @@ class UtilsOrderService extends AppServiceBase {
return system.getResultFail(-200, e.stack);
}
}
async orderClose(pobj) {//阿里退款
if (!pobj.actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty");
......@@ -794,7 +887,7 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "updateStausByRefundOrder";
var url = settings.centerOrderUrl() + "action/icapi/springBoard";
await this.execClient.execPost(pobj, url);
this.utilsPushSve.aliBusiness2Fq(pobj, "pushRefundIC");
this.utilsPushSve.business2Channel(pobj, "pushRefundIC");
return system.getResultSuccess();
} catch (e) {
return system.getResultFail(-200, e.stack);
......@@ -862,7 +955,7 @@ class UtilsOrderService extends AppServiceBase {
}
// 2020 07.03 lin 修改 获取app信息 推送蜂擎使用
var url = this.centerAppUrl + "payment/paymentApi/getAppInfo";
var appInfoResult = await this.restPostUrl({ uappId: opResult.data.uappId }, url);
var appInfoResult = await this.restPostUrl({uappId: opResult.data.uappId}, url);
if (appInfoResult.status != 0) {
appInfoResult.msg = appInfoResult.msg + ",100270";
return appInfoResult;
......@@ -882,7 +975,7 @@ class UtilsOrderService extends AppServiceBase {
});
return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
}
parmas.appInfo = { appInfo: { uapp_id: opResult.data.uappId } };
parmas.appInfo = {appInfo: {uapp_id: opResult.data.uappId}};
parmas.orderNo = opResult.data.orderNo;
parmas.pay_type = "alipay";
//修改并返回订单支付状态,创建收款单
......@@ -990,7 +1083,7 @@ class UtilsOrderService extends AppServiceBase {
});
return system.getResultFail(-200, "微信回调操作频繁---太频繁了,太频繁了");
}
parmas.appInfo = { appInfo: { uapp_id: opResult.data.uappId } };
parmas.appInfo = {appInfo: {uapp_id: opResult.data.uappId}};
parmas.orderNo = opResult.data.orderNo;
// 注意 微信支付要写wx 不要wxpay等其他。c_order_receiptvoucher收款单的accountType会对应wx:微信"alipay":"支付宝","other":"其它"等其他方式
parmas.pay_type = "wx";
......@@ -1058,7 +1151,7 @@ class UtilsOrderService extends AppServiceBase {
return system.getResult(null, 'payOrderNo can be not null')
}
let url = this.centerAppUrl + 'payment/paymentApi/getAppInfoByAppKey';
let appInfoRt = await this.restPostUrl({ appKey: params.appkey }, url);
let appInfoRt = await this.restPostUrl({appKey: params.appkey}, url);
if (appInfoRt.status != 0) {
appInfoRt.msg = appInfoRt.msg + ",100270";
return appInfoRt;
......@@ -1083,7 +1176,7 @@ class UtilsOrderService extends AppServiceBase {
// });
// return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
// }
params.appInfo = { uapp_id: appInfo.uapp_id };
params.appInfo = {uapp_id: appInfo.uapp_id};
params.pay_type = params.payType;
params.time_end = params.payTime;
//修改并返回订单支付状态,创建收款单
......@@ -1102,7 +1195,7 @@ class UtilsOrderService extends AppServiceBase {
uapp_key: appInfo.uapp_key,
app_code: appInfo.app_code,
app_name: appInfo.app_name,
contact_mobile:appInfo.contact_mobile
contact_mobile: appInfo.contact_mobile
};
opOrderResult.data.userInfo = {
channel_userid: opOrderResult.data.order_info.channelUserId,
......@@ -1121,33 +1214,33 @@ class UtilsOrderService extends AppServiceBase {
}
// 推送
let yfRet = await this.utilsPushSve.pushBusInfo(pobj, "pushOrder", 0);
if(yfRet.status !=0){
if (yfRet.status != 0) {
return yfRet;
}
if (['icpsq', 'edisq'].includes(opOrderResult.data.product_info.channel_item_code)) {
//创建方案
pobj.salesmanInfo ={
"salesmanId":yfRet.data.orderList[0].operator || "",
"salesmanName":yfRet.data.orderList[0].operatorName || "",
"salesmanMobile":yfRet.data.orderList[0].phone ||"",
"salesmanChannelId":yfRet.data.orderList[0].channelUserId || ""
pobj.salesmanInfo = {
"salesmanId": yfRet.data.orderList[0].operator || "",
"salesmanName": yfRet.data.orderList[0].operatorName || "",
"salesmanMobile": yfRet.data.orderList[0].phone || "",
"salesmanChannelId": yfRet.data.orderList[0].channelUserId || ""
}
let pushRet = await this.packagingPushData(pobj);
if (pushRet.status != 0) {
throw new Error('推送失败')
}
pobj.actionBody = pushRet.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(pobj, "pushDeliveryOrder");
}
//订单状态 已接单 目前360在用
if(pobj.appInfo.uapp_id == '50'){
if (pobj.appInfo.uapp_id == '50') {
pobj.actionBody.orderNo = params.orderNo;
let ApplicationStatus = 30;
if(opOrderResult.data.product_info.channel_item_code == 'zzsbzc'){
if (opOrderResult.data.product_info.channel_item_code == 'zzsbzc') {
ApplicationStatus = 2;
}
if(opOrderResult.data.product_info.channel_item_code == 'fzsbzc' || opOrderResult.data.product_info.channel_item_code == 'dbsbzc'){
if (opOrderResult.data.product_info.channel_item_code == 'fzsbzc' || opOrderResult.data.product_info.channel_item_code == 'dbsbzc') {
ApplicationStatus = 1;
}
pobj.pushObj = {
......@@ -1155,7 +1248,7 @@ class UtilsOrderService extends AppServiceBase {
};
this.utils360Sve.pushOrderStatus(pobj);
//钉钉机器人
this.dingClient.gatewayPushByChannel(params.orderNo,pobj.appInfo);
this.dingClient.gatewayPushTo360(params.orderNo);
}
opOrderResult.data = null;
return opOrderResult;
......@@ -1190,7 +1283,7 @@ class UtilsOrderService extends AppServiceBase {
"CompanyName": "",
"licenseType": "",
"solutionCity": ab.product_info.price_item.price_desc,
"solutionPrice": Number(ab.order_info.totalSum)*100,
"solutionPrice": Number(ab.order_info.totalSum) * 100,
"channelTypeCode": ab.product_info.service_business_code,
"companyLocation": ab.product_info.price_item.price_desc
}
......@@ -1198,7 +1291,7 @@ class UtilsOrderService extends AppServiceBase {
"status": "USER_PAY_PRODUCE",
"bizType": ab.product_info.channel_item_code,
"solution": solution,
"totalSum": Number(ab.order_info.totalSum)*100,
"totalSum": Number(ab.order_info.totalSum) * 100,
"typeCode": ab.product_info.channel_item_code,
"typeName": ab.product_info.channel_item_name,
"statusName": "⽤户⽀付",
......@@ -1206,7 +1299,7 @@ class UtilsOrderService extends AppServiceBase {
"publishName": ab.order_contact.contactName || "",
"publishMobile": ab.order_contact.mobile || ""
},
"salesmanInfo":pobj.salesmanInfo
"salesmanInfo": pobj.salesmanInfo
}
//推送数据
let pushObj = {
......@@ -1251,7 +1344,7 @@ class UtilsOrderService extends AppServiceBase {
return system.getResult(null, 'payOrderNo can be not null')
}
let url = this.centerAppUrl + 'payment/paymentApi/getAppInfoByAppKey';
let appInfoRt = await this.restPostUrl({ appKey: params.appkey }, url);
let appInfoRt = await this.restPostUrl({appKey: params.appkey}, url);
if (appInfoRt.status != 0) {
appInfoRt.msg = appInfoRt.msg + ",100270";
return appInfoRt;
......@@ -1262,7 +1355,7 @@ class UtilsOrderService extends AppServiceBase {
return system.getResultFail(-1, '验证签名失败')
}
var appInfo = appInfoRt.data;
params.appInfo = { uapp_id: appInfo.uapp_id };
params.appInfo = {uapp_id: appInfo.uapp_id};
params.pay_type = params.payType;
params.time_end = params.payTime;
// 修改并返回订单支付状 态,创建收款单
......@@ -1341,7 +1434,7 @@ class UtilsOrderService extends AppServiceBase {
var result = {
"errorCode": "error",
"errorMsg": "标源状态不符合",
"module": { "orderNumber": "" },
"module": {"orderNumber": ""},
"requestId": pobj.requestId,
"success": false
}
......@@ -1351,7 +1444,7 @@ class UtilsOrderService extends AppServiceBase {
var result = {
"errorCode": "error",
"errorMsg": "标源状态不符合",
"module": { "orderNumber": "" },
"module": {"orderNumber": ""},
"requestId": pobj.requestId,
"success": false
}
......@@ -1392,7 +1485,7 @@ class UtilsOrderService extends AppServiceBase {
var tmResult = {
"errorCode": "OK",
"errorMsg": "操作成功",
"module": { "orderNumber": result.data.orderNo },
"module": {"orderNumber": result.data.orderNo},
"requestId": pobj.requestId,
"success": true
}
......@@ -1403,7 +1496,7 @@ class UtilsOrderService extends AppServiceBase {
var result = {
"errorCode": "error",
"errorMsg": e,
"module": { "orderNumber": "" },
"module": {"orderNumber": ""},
"requestId": pobj.requestId,
"success": false
}
......@@ -1436,7 +1529,7 @@ class UtilsOrderService extends AppServiceBase {
var result = {
"ErrorCode": "error",
"ErrorMsg": e,
"Module": { "orderNumber": "" },
"Module": {"orderNumber": ""},
"RequestId": pobj.requestId,
"Success": false
}
......@@ -1523,7 +1616,7 @@ class UtilsOrderService extends AppServiceBase {
"payCode": "zzsbzc-2", // Y 支付价格code
"quantity": nclone.nclThree.length - 10// Y 购买数量
}
totalSum += (nclone.nclThree.length-10)*30
totalSum += (nclone.nclThree.length - 10) * 30
}
actionBody.totalSum = totalSum;
actionBody.quantity = 1;
......@@ -1582,10 +1675,53 @@ class UtilsOrderService extends AppServiceBase {
}
//测试
async pushTest(pobj,actionBody){
async pushTest(pobj, actionBody) {
let url = this.centerOrderUrl + "notifyaction/internalCallsNotify/updateTmStatus";
let result = await this.restPostUrl(actionBody,url);
let result = await this.restPostUrl(actionBody, url);
return result
}
/**
* 接收阿里商标订单
* @param {*} pobj
* @param {*} actionBody
*/
async receiveAliTmOrder(pobj, actionBody) {
if (!actionBody.channelItemCode) {
return system.getResult(null, "产品编码有误,100010");
}
pobj.actionType = "getProductDetail";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemResult = await this.execPostByTimeOut(null, pobj, url);
if (productItemResult.status != 0) {
return productItemResult;
}
if (productItemResult.data.status != 0) {
return productItemResult.data;
}
pobj.productInfo = productItemResult.data.data;
pobj.productInfo.price_item = pobj.productInfo.price_list[0];
pobj.actionType = "receiveAliTmOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
/**
* 接收阿里订单退款信息git
* @param {*} pobj
* @param {*} actionBody
*/
async receiveAliTmOrderRefund(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
async receiveAliTmStatus(pobj, actionBody) {
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
}
module.exports = UtilsOrderService;
......@@ -153,6 +153,44 @@ class UtilsProductService extends AppServiceBase {
let result = await this.restPostUrl(pobj,url);
return result;
}
/**
* 根据path_name 聚合
* @param pobj
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async getAllPathName(pobj){
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'getAllPathName';
let result = await this.restPostUrl(pobj,url);
if(result.status !=0){
return system.getResultFail(-1,'获取数据失败,请稍后再试!');
}
let data = result.data;
let map = new Map();
for(let i =0;i<data.length;i++){
let item = data[i];
let strs = item.path_name.split('/');
let classOne = strs[1];
let classTwo = strs[2];
if(map.has(classOne)){
let val = map.get(classOne);
val.push(classTwo)
map.set(classOne,val);
}else{
let arr = [];
arr.push(classTwo)
map.set(classOne,arr);
}
}
let resultData = [];
map.forEach((v,k) =>{
let obj = {};
obj['key'] = k;
obj['data'] = v;
resultData.push(obj)
})
return system.getResult(resultData);
}
}
module.exports = UtilsProductService;
\ No newline at end of file
const system = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
const settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//不要在此类中增加新的方法
class UtilsPushService extends AppServiceBase {
constructor() {
super();
};
async aliBusiness2Delivery(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/aliBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
console.log("business2Channel++++++++start++++++++++");
console.log(pobj,"business2Channel++++++++++++++++++");
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用,适用所有渠道推送
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
let reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
let productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/business2Channel",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送获取的接口信息->business2Channel",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async aliBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/aliBusiness2Fq",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->aliBusiness2Fq",
});
if (pobj.interface_info) {
this.execClientNew.execLogs(`${pobj.opType}推送蜂擎获取的接口信息->business2Channel->app(getAppInterface)`, pobj, "center-channel-utilsPushSve-business2Channel", productItemInterfaceResult.data, null);
if (pobj.interface_info && pobj.interface_info.length > 0) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
......@@ -77,13 +23,13 @@ class UtilsPushService extends AppServiceBase {
}
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口,不在db中做配置进行调用
console.log(JSON.stringify(pobj), ".......pushBusInfo........................."+opType);
console.log(JSON.stringify(pobj), ".......pushBusInfo........................." + opType);
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType);
console.log(interface_list_temp,"interface_list_temp+++++++++++++++");
// console.log(interface_list_temp, "interface_list_temp+++++++++++++++");
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
......@@ -92,13 +38,13 @@ class UtilsPushService extends AppServiceBase {
if (interface_list_temp && interface_list_temp.length == 1) {
const element = interface_list_temp[0];
let reflexActionRes = await self.reflexAction(element, opType, pobj, isDelProductInfo);
self.execClientNew.execLogs("pushBusInfo-reflexAction-result:", pobj, "center-channel-reflexAction", reflexActionRes, null);
self.execClientNew.execLogs("utilsPushSve-pushBusInfo-result11:", pobj, "center-channel-reflexAction", reflexActionRes, null);
return reflexActionRes;
} else {
for (let index = 0; index < interface_list_temp.length; index++) {
const element = interface_list_temp[index];
result = await self.reflexAction(element, opType, pobj, isDelProductInfo);
self.execClientNew.execLogs("pushBusInfo-for---reflexAction-result:", pobj, "center-channel-reflexAction", result, null);
self.execClientNew.execLogs("utilsPushSve-pushBusInfo-result22:", pobj, "center-channel-reflexAction", result, null);
}
return result;
}
......@@ -119,8 +65,7 @@ class UtilsPushService extends AppServiceBase {
}
async reflexAction(interface_info, opType, pobj, isDelProductInfo) {
console.log(interface_info,"reflexAction+++++++++++++++"+opType);
console.log(pobj,"reflexAction++++++2+++++++++"+opType);
console.log(`pobj=${JSON.stringify(pobj)},interface_info=${JSON.stringify(interface_info)}`, `reflexAction.......opType=${opType}`);
var refResult = null;
pobj.interface_info = interface_info;
pobj.opType = opType;
......@@ -138,8 +83,7 @@ class UtilsPushService extends AppServiceBase {
var params = [pobj];
var doRes = await invokeObj[interface_info.method_name].apply(invokeObj, params);
return doRes;
}
else if (interface_info.interface_type == "yc") {
} else if (interface_info.interface_type == "yc") {
var actionBody = pobj.actionBody;
if (!interface_info.interface_url) {
return system.getResult(null, "产品接口interface_url参数不能为空,100370");
......@@ -165,53 +109,7 @@ class UtilsPushService extends AppServiceBase {
return await this.disposePushResultFail(pobj, errorResult, "数据推送异常-->reflexAction-->errorResult", this.pushlogFailType.FAILLOG);
}
}
//---------百度---zhuangbing--2020.10.28------start--------------------------------------------
async baiduBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/baiduBusiness2Fq",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->baiduBusiness2Fq",
pobj:pobj
});
if (pobj.interface_info) {
var pushBusInfo = await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess(pushBusInfo);
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async baiduBusiness2Delivery(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
console.log(pobj,"baiduBusiness2Delivery-zhuangbing------------------------------"+opType);
console.log(productItemInterfaceResult);
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/baiduBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送蜂擎获取的接口信息->baiduBusiness2Delivery",
pobj:pobj
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
//---------百度---zhuangbing--2020.10.28------end--------------------------------------------
}
module.exports = UtilsPushService;
var system = require("../../../system");
const AppServiceBase = require("../../app.base");
//外部请求结果校验以及相应工具处理类
class utilsTlBankSve extends AppServiceBase {
constructor() {
super();
}
//格式化时间
convertDate(time) {
if (time == null) {
return "";
}
var date = new Date(Number(time * 1000));
var y = 1900 + date.getYear();
var m = "0" + (date.getMonth() + 1);
var d = "0" + date.getDate();
return y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length);
}
//计算并返回指定字段
formulaContinued(tms) {
let result = [];
for (let i = 0; i < tms.length; i++) {
let tmInfo = tms[i];
let tm_expiry = '';
if (!tmInfo.MARKNAME) { //REGDATE注册公告日期
continue;
}
if (tmInfo.REGDATE) {
let zcrqFormat = new Date(tmInfo.REGDATE * 1000); //注册日期
zcrqFormat.setFullYear(zcrqFormat.getFullYear() + 10); //专用起始日期计算
zcrqFormat.setMonth(zcrqFormat.getMonth()); //专用起始日期计算
zcrqFormat.setDate(zcrqFormat.getDate()); //专用起始日期计算
tm_expiry = this.convertDate(zcrqFormat); //计算商标到期日
}
let tmObject = {
"tm_comName": tmInfo.AGENTNAME, //代理机构
"tm_img": tmInfo.MARKIMAGE, //商标图片
"tm_name": tmInfo.MARKNAME, //商标名称
"tm_appDate": tmInfo.APPDATE, //申请日期
"tm_isInvalid": tmInfo.ISINVALID, //状态
"tm_expiry": tm_expiry //商标到期日
}
result.push(tmObject);
}
return result;
}
}
module.exports = utilsTlBankSve;
\ No newline at end of file
......@@ -102,7 +102,7 @@ class utils360Sve extends AppServiceBase {
appInfo: pobj.appInfo
}
// 还需要推送fq 需要提醒会计。目前没有
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "submitService");
this.utilsPushSve.business2Channel(deliveryObj, "submitService");
return system.getResultSuccess({orderNo:pobj.actionBody.orderNo});
}
......@@ -160,7 +160,7 @@ class utils360Sve extends AppServiceBase {
deliveryObj.actionBody.serviceStartTime = actionBody.serviceStartTime,
deliveryObj.actionBody.serviceEndTime = actionBody.serviceEndTime
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "notifyService");
this.utilsPushSve.business2Channel(deliveryObj, "notifyService");
return system.getResultSuccess();
}
......
......@@ -613,7 +613,7 @@ class UtilsTmAliyunService extends AppServiceBase {
return result;
}
async taskAliTmUpdate() {//操作阿里商标更新任务---外部调用
async taskAliTmUpdate() {//操作阿里商标(钉钉自主注册,没有上线)更新任务---外部调用
var pobj = { actionBody: {} };
var dbAliAllTmListResult = await this.getAllAliChannelTmDelivery(pobj);
if (dbAliAllTmListResult.status != 0) {
......
......@@ -140,8 +140,8 @@ class UtilsTmOrderCallService extends AppServiceBase {
}
var getjsonurl=settings.tmtransactionUrl()+"/tmtransaction/action/trademarktransaction/springBoard"
var jsonurl=await this.restPostUrl(obj,getjsonurl);
if(!jsonurl){
console.log(jsonurl);
if(!jsonurl || !jsonurl.data){
console.log(`createjsonfile返回错误,返回值:${jsonurl}`);
return system.getResultSuccess();
}
var upobj={
......
......@@ -169,6 +169,9 @@ class ServiceBase {
async customQuery(sql, paras, t) {
return this.dao.customQuery(sql, paras, t);
}
async customUpdate(sql, paras, t) {
return this.dao.customUpdate(sql, paras, t);
}
async findCount(whereObj = null) {
return this.dao.findCount(whereObj);
}
......
var fs = require("fs");
var objsettings = require("../config/objsettings");
var settings = require("../config/settings");
class System {
static declare(ns) {
var ar = ns.split('.');
......@@ -15,6 +16,7 @@ class System {
}
}
}
static register(key, ClassObj) {
if (System.objTable[key] != null) {
throw new Error("相同key的对象已经存在");
......@@ -25,6 +27,7 @@ class System {
return System.objTable[key];
}
static getResult(data, opmsg = "操作成功", req) {
return {
status: !data ? -1 : 0,
......@@ -33,9 +36,11 @@ class System {
bizmsg: req && req.session && req.session.bizmsg ? req.session.bizmsg : "empty"
};
}
static getErrResult2(errmsg) {
return this.getResult2(null, null, null, errmsg);
}
static getResult2(data, req, okmsg = "操作成功", errmsg = "操作失败") {
var result = {
status: 0,
......@@ -54,6 +59,7 @@ class System {
}
return result;
}
static getResult3(data, req, okmsg = "操作成功", errmsg = "操作失败") {
var total = data.total;
data = data.hits;
......@@ -80,6 +86,7 @@ class System {
}
return result;
}
static getResult4(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations;
......@@ -115,6 +122,7 @@ class System {
}
return result;
}
static getResultjuhe4(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations;
......@@ -135,6 +143,7 @@ class System {
}
return result;
}
static getResultjuhetwo(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations;
var notice_count = aggs.notice_count;
......@@ -160,6 +169,7 @@ class System {
}
return result;
}
/**
* 请求返回成功
* @param {*} data 操作成功返回的数据
......@@ -172,6 +182,7 @@ class System {
data: data || "成功"
};
}
// 2020 0916 lin 新增返回格式 成功status为1
static getResultRedisQueueSuccess(data, okmsg = "success") {
return {
......@@ -207,6 +218,24 @@ class System {
data: data,
};
}
/**
* 请求返回失败
* @param status
* @param errmsg
* @param data
* @param errorMsg
* @returns {{msg: string, data: string, status: number, errorMsg: *}}
*/
static getResultNewFail(status = -1, errmsg = "fail", data = "", errorMsg) {
return {
status: status,
msg: errmsg,
errorMsg: errorMsg,
data: data,
};
}
static getObject(objpath) {
var pathArray = objpath.split(".");
var packageName = pathArray[0];
......@@ -230,6 +259,7 @@ class System {
return System.register(objabspath, ClassObj);
}
}
static getUiConfig(appid) {
var configPath = settings.basepath + "/app/base/db/metadata/" + appid + "/index.js";
if (settings.env == "dev") {
......@@ -238,6 +268,7 @@ class System {
var configValue = require(configPath);
return configValue;
}
static getUiConfig2(appid) {
var configPath = settings.basepath + "/app/base/db/metadata/index.js";
// if(settings.env=="dev"){
......@@ -248,6 +279,7 @@ class System {
var configValue = require(configPath);
return configValue[appid];
}
static get_client_ip(req) {
var ip = req.headers['x-forwarded-for'] ||
req.ip ||
......@@ -296,6 +328,7 @@ class System {
}
}
}
Date.prototype.Format = function (fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
......@@ -313,7 +346,7 @@ Date.prototype.Format = function (fmt) { //author: meizz
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
System.exTime = 4 * 3600;//缓存过期时间,4小时
System.exTime = 4 * 3600; //缓存过期时间,4小时
System.objTable = {};
......
const system = require("../system");
class dingClient {
constructor() {
this.execClient = system.getObject('util.execClient');
this.gatewayurl = "https://oapi.dingtalk.com/robot/send?access_token=2f1ada261ea84f6c621db487ac18d11eba8984202bd82adda8810770a8240572"
this.businessToFqUrl = "https://oapi.dingtalk.com/robot/send?access_token=9e215f0f1d77980ee6b39e88a82a7c6e5d290775f76d9a8346e97697f8df9788"
this.businessTo360Url = "https://oapi.dingtalk.com/robot/send?access_token=2947bdf6163288a5a5c654640e78ea718d21fcae6601efbb4edd53209abc1c45";
}
//推送峰擎异常提醒
async gatewayPushError(err) {
if (process.env.APP_ENV === "prod") {
......@@ -19,18 +23,35 @@ class dingClient {
}
//渠道钉钉提醒
async gatewayPushByChannel(orderNo,appInfo){
let gatewayUrl = setttings.dingRobotUrl(appInfo.uapp_id);
if (process.env.APP_ENV != "dev" && gatewayUrl) {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!`
async gatewayPushTo360(orderNo) {
if (process.env.APP_ENV != "dev") {
let c = `注意提醒:360云商机->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, gatewayUrl).catch(err => {
}, this.businessTo360Url).catch(err => {
console.log(err)
});
}
}
//渠道订单到峰擎--sku没有查询到
async businessPushFqByChannel(params) {
if (process.env.APP_ENV != "dev") {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,渠道下sku查询不到,参数:${JSON.stringify(params)},老板们加油,加油,加油 !!!`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c},
at: {
atMobiles: ["13051727697", "13453222948", "18201231253"]//孟令强、王斌、郭峰
},
}, this.businessToFqUrl).catch(err => {
console.log(err)
});
}
}
}
module.exports = dingClient;
......@@ -18,6 +18,10 @@ class ExecClient {
this.cmdBaiduPostPattern = "curl -k -H 'Content-type: application/json' -H 'Authorization: {Authorization}' -d '{data}' {url}";
this.cmdGetpatternToken = "curl -G -k -H 'authorization:{token}' -d '{data}' {url}";
//易名
this.cmdEnamePostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
}
getUUID() {
var uuid = uuidv4();
......@@ -60,6 +64,14 @@ class ExecClient {
console.log(cmd);
return cmd;
}
FetchEnamePostCmd(subData, url) {
var data = JSON.stringify(subData);
var cmd = this.cmdEnamePostPattern.replace(/\{data\}/g,
data).replace(/\{url\}/g, url);
console.log(cmd);
return cmd;
}
FetchPushDataPostCmd(subData, url, token, requestId) {
var requestId = requestId || this.getUUID();
var data = JSON.stringify(subData);
......@@ -90,6 +102,11 @@ class ExecClient {
var result = await this.exec(cmd);
return result;
}
async execEnamePost(subData, url) {
let cmd = this.FetchEnamePostCmd(subData, url);
var result = await this.exec(cmd);
return result;
}
async execPushDataPost(subData, url, token, requestId) {
if(settings.env == 'dev'){
axios.defaults.headers['token'] = token;
......
......@@ -6,12 +6,14 @@ const settings = require("../../../app/config/settings");
const axios = require('axios');
const moment = require('moment');
const uuid = require('uuid');
class ExecClientNew {
constructor() {
this.cmdGetPattern = "curl -G -X GET '{url}'";
this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
// this.cmdPushDataPostPattern = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'appkey:{appkey}' -d '{data}' {url}";
}
/**
* 带超时时间的post请求
* @param {*} execFile 执行文件
......@@ -99,6 +101,7 @@ class ExecClientNew {
return reqResult;
}
}
/**
* 记录日志信息
* @param {*} opTitle 操作的标题
......@@ -109,21 +112,22 @@ class ExecClientNew {
*/
async execLogs(opTitle, params, identifyCode, resultInfo, errorInfo) {
var reqUrl = settings.opNewLogUrl();
params = typeof params === 'object' ? JSON.stringify(params) : params || "";
resultInfo = typeof resultInfo === 'object' ? JSON.stringify(resultInfo) : resultInfo || "";
errorInfo = typeof errorInfo === 'object' ? JSON.stringify(errorInfo) : errorInfo || "";
let tmpParams1 = typeof params === 'object' ? JSON.stringify(params) : params || "";
let tmpResultInfo = typeof resultInfo === 'object' ? JSON.stringify(resultInfo) : resultInfo || "";
let tmpErrorInfo = typeof errorInfo === 'object' ? JSON.stringify(errorInfo) : errorInfo || "";
var tmpParams = {
opTitle: opTitle || "",
identifyCode: identifyCode || "",
messageBody: params,
resultInfo: resultInfo || "",
errorInfo: errorInfo || "",
messageBody: tmpParams1,
resultInfo: tmpResultInfo || "",
errorInfo: tmpErrorInfo || "",
requestId: resultInfo ? resultInfo.requestId || "" : "",
created_at: moment().format("YYYY-MM-DD HH:mm:ss:SSS"),
timestamp: Date.now()
}
this.execPostTimeOut(tmpParams, reqUrl, 'application/json', null, 20);
}
/**
* get请求
* @param {*} params 提交的数据-格式JSON
......@@ -135,6 +139,7 @@ class ExecClientNew {
var result = await this.exec(cmd);
return result;
}
/**
*
* @param {*} params 提交的数据JSON格式
......@@ -148,9 +153,10 @@ class ExecClientNew {
var options = {
timeout: timeOut,
};
const { stdout, stderr } = await exec(cmd, options);
return { stdout, stderr };
const {stdout, stderr} = await exec(cmd, options);
return {stdout, stderr};
}
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
......@@ -169,6 +175,7 @@ class ExecClientNew {
var result = await this.exec(cmd, options, headData);
return result;
}
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
......@@ -195,14 +202,16 @@ class ExecClientNew {
async exec(cmd) {
//await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
//异常需要try/catch自己捕获或外部catch捕获
const { stdout, stderr } = await exec(cmd);
return { stdout, stderr };
const {stdout, stderr} = await exec(cmd);
return {stdout, stderr};
}
FetchGetCmd(params, url, headData) {
var cmd = this.cmdGetPattern.replace(
/\{data\}/g, params).replace(/\{url\}/g, url);
return cmd;
}
FetchPostCmd(params, url, ContentType, headData) {
if (!ContentType) {
ContentType = "application/json";
......@@ -262,6 +271,7 @@ class ExecClientNew {
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/**
* 返回指定长度的字符串
* @param {*} len 返回长度
......@@ -286,6 +296,7 @@ class ExecClientNew {
}
return uuid.join('');
}
//--------------------------------------------------辅助方法end-----------------
}
......
......@@ -17,22 +17,27 @@ module.exports = {
"ncSubmitMaterial", "ncNotification", "ncSubmitSolution", "ncCloseNeed", "ncClosePlan",
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
"getParamsFor360", "addOrderWeb", "getPayRecords", "getLoginInfo", "putUserMobileByVcode",
"putUserPwdByMobile", "icpNotifyNew","getOrderStatisticsByUappId","getOrderStatisticsByProduct","getOrdersComparison","getOrdersComparisonList",
"putUserPwdByMobile", "icpNotifyNew", "getOrderStatisticsByUappId", "getOrderStatisticsByProduct", "getOrdersComparison", "getOrdersComparisonList",
"importOrders", "importNeeds", "receiveAliTmOrder", "receiveAliTmOrderRefund","receiveAliTmStatus",
//百度工商注册
"regGetInfoByChannelNeedNo","submitRegNeed","regFeedbackSubmit","regOrderStatus","regOrderClose",
"getSolutionByChannelOrderNo","regSubmitSolution","regNeedClose",
"regWriteCommunicationLog","regQueryExpertCommunicationLogs","regUpdateOrderStatus","regPaySuccess"
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename
"eNameCloseOrder",
],
apiMustUserpinList: [
"icpOrderClose",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme",
"submitService","serviceProviderNotification",
"ncSubmitMaterial","ncNotification","ncSubmitSolution","ncCloseNeed","ncClosePlan",
"rtSubmitMaterial","rtNotification","rtSubmitSolution","rtCloseNeed","rtClosePlan",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme", "serviceProviderSubmitMaterial", "abolishIcpProgramme",
"submitService", "serviceProviderNotification",
"ncSubmitMaterial", "ncNotification", "ncSubmitSolution", "ncCloseNeed", "ncClosePlan",
"rtSubmitMaterial", "rtNotification", "rtSubmitSolution", "rtCloseNeed", "rtClosePlan",
//百度工商注册
"regGetInfoByChannelNeedNo","submitRegNeed","regFeedbackSubmit","regOrderStatus","regOrderClose",
"getSolutionByChannelOrderNo","regSubmitSolution","regNeedClose",
"regWriteCommunicationLog","regQueryExpertCommunicationLogs","regUpdateOrderStatus","regPaySuccess"
"regGetInfoByChannelNeedNo", "submitRegNeed", "regFeedbackSubmit", "regOrderStatus", "regOrderClose",
"getSolutionByChannelOrderNo", "regSubmitSolution", "regNeedClose",
"regWriteCommunicationLog", "regQueryExpertCommunicationLogs", "regUpdateOrderStatus", "regPaySuccess",
//yiming/ename
"eNameCloseOrder",
],
apiSecretPathList: [
"/api/icp/consultation/submit",
......@@ -47,7 +52,88 @@ module.exports = {
"/api/ic/feedback/submit",
"/api/ic/order/notify",
"/api/ic/order/close",
"/api/ic/tool/icname"
"/api/ic/tool/icname",
"/api/tm/consultation/submit",
"/api/tm/feedback/submit",
"/api/tm/status/notify",
"/api/tm/tmcase/nbtzreceiveAssistTmData",
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
]
},
AREACOMM: {
areaTransform: {
"上海": "上海市",
"东莞": "东莞市",
"佛山": "佛山市",
"北京": "北京市",
"南京": "南京市",
"南昌": "南昌市",
"南通": "南通市",
"台州": "台州市",
"合肥": "合肥市",
"嘉兴": "嘉兴市",
"大连": "大连市",
"天津": "天津市",
"太原": "太原市",
"宁波": "宁波市",
"常州": "常州市",
"广州": "广州市",
"徐州": "徐州市",
"成都": "成都市",
"扬州": "扬州市",
"无锡": "无锡市",
"昆明": "昆明市",
"杭州": "杭州市",
"武汉": "武汉市",
"沈阳": "沈阳市",
"济南": "济南市",
"深圳": "深圳市",
"温州": "温州市",
"烟台": "烟台市",
"福州": "福州市",
"绍兴": "绍兴市",
"苏州": "苏州市",
"西安": "西安市",
"贵阳": "贵阳市",
"郑州": "郑州市",
"重庆": "重庆市",
"金华": "金华市",
"长春": "长春市",
"长沙": "长沙市",
"青岛": "青岛市",
"开封": "开封市",
"哈尔滨": "哈尔滨市",
"石家庄": "石家庄市",
"福建": "福建省",
"广西": "广西",
"广东": "广东省",
"安徽": "安徽省",
"河南": "河南省",
"湖北": "湖北省",
"浙江": "浙江省",
"江苏": "江苏省",
"山东": "山东省",
"陕西": "陕西省",
"宁夏": "宁夏",
"甘肃": "甘肃省",
"新疆": "新疆",
"青海": "青海省",
"河北": "河北省",
"山西": "山西省",
"辽宁": "辽宁省",
"吉林": "吉林省",
"黑龙江": "黑龙江省",
"江西": "江西省",
"湖南": "湖南省",
"四川": "四川省",
"贵州": "贵州省",
"云南": "云南省",
"内蒙古": "内蒙古",
"西藏": "西藏",
"含外资": "含外资",
"全外资": "全外资",
"香港": "香港",
"海南": "海南省",
}
}
}
var settings = {
redis: {
host: "39.107.234.14",
port: 6379,
password: "123123",
host: "59.110.125.77",
port: 30479,
password: "havzMSYc3aBZXOjpG3",
db: 5,
},
database: {
......
......@@ -12,7 +12,7 @@ const settings = require("../../config/settings");
module.exports = function (app) {
//-----------------------新的模式---------web---------开始
app.use('/tlpay/aliPayNotify', async function (req, res) {
app.use('/tlpay/aliPayNotify', async function (req, res) {//钉钉接入的搁浅
try {
var client_ip = system.get_client_ip(req);
var result = await utilsOrderSve.opH5AliDingPayBackNotify(req.body, client_ip);
......
......@@ -30,6 +30,13 @@ var settings = {
}
return "http://43.247.184.94:7200/center_channel_req_log/_doc?pretty";
},
enameClientUrl:function(){
if (this.env == 'dev') {
return "https://ote.ename.com/icp/";//开发
}else{
return "https://api.ename.com/icp/";//线上
}
},
//百度icp、edi、nc、rt
baiduClientParams: function () {
if (this.env == 'dev') {
......@@ -443,12 +450,6 @@ var settings = {
// 2020 1119 lin 正式环境已经给出,鲁班发的ip
return "http://139.196.159.202:8980/"
}
},
dingRobotUrl: function(uapp_id) {
if(uapp_id == 50){//360云商机
return "https://oapi.dingtalk.com/robot/send?access_token=2947bdf6163288a5a5c654640e78ea718d21fcae6601efbb4edd53209abc1c45";
}
return "";
}
};
module.exports = settings;
# <a name="menu" href="">企业服务信息查询</a>
1. [获取token](#getToken)
5. [企业基本信息](#getRegisterInfo)
5. [企业股东及出资信息](#getShareHolderInfo)
5. [企业变更信息](#getRegisterChangeInfo)
5. [企业主要管理人员](#getMainManagerInfo)
5. [企业专利详情](#getPatentDetailInfo)
5. [企业专利列表](#getPatentInfo)
7. [企业商标列表](#getTrademarkInfo)
5. [企业软件著作权信息](#getSoftwareCopyrightInfo)
5. [企业作品著作权信息](#getWorksCopyrightInfo)
5. [企业LOGO](#getEntLogoInfo)
11. [企业年报社保信息](#getEntAnnReportSocialSecurityInfo)
5. [上市公司基本信息](#getListedCompanyBaseMessageInfoV2)
5. [上市公司十大股东](#getListedCompanyShareHolderInfoV2)
5. [企业实缴风险预警](#getEntPaidInRiskWarmInfo)
5. [企业数据发现](#getDataExploreInfo)
5. [企业基因标签](#getEntLable)
17. [企业联系方式汇总](#getEntContactInfo)
11. [企业/农专年报列表](#getEntSFCAnnreportList)
5. [企业年报基本信息](#getEntAnnReportInfo)
5. [企业年报网站网店信息](#getEntAnnReportWebSiteInfo)
5. [企业年报股东及出资信息](#getEntAnnReportInvInfo)
5. [企业年报资产状况](#getEntAnnReportAssetsInfo)
5. [企业年报对外担保信息](#getEntAnnReportForGuaranteeInfo)
11. [农专年报基本信息](#getSfcAnnReportInfo)
5. [农专年报网站网店信息](#getSfcAnnReportWebSiteInfo)
5. [农专年报资产状况](#getSfcAnnReportAssetsInfo)
5. [企业商标详情](#getTrademarkDetailInfo)
5. [企业年报对外投资](#getEntAnnReportToInvInfo)
5. [企业年报股权变更信息](#getEntAnnReportStockChanageInfo)
## **<a name=""> 域名</a>**
##### URL
https://fqdev.gongsibao.com 测试
## **<a name="getToken"> 获取token</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/platform/getToken]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"accessKey":"111",
"accessSecret":"222"
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6MSwiZXhwIjoxNjEzNjMzMTk0LCJpYXQiOjE2MTM2MzEzOTQsImNoYW5uZWxJZCI6MX0.MQoqGHwcXVrRfbftlxgY3-o6uCi6V2jQJL5z_chLHq4",
"msg": "success"
}
```
## **<a name="getRegisterInfo"> 获取企业基本信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getRegisterInfo",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ENTSTATUS": "在营(开业)企业", //经营状态
"INDUSTRY_CODE": "M", //行业领域代码
"CANDATE": "", //注销日期
"REGORG": "北京市海淀区市场监督管理局", //登记机关
"OLDNAME": "", //曾用名
"JWD": "东经:116.171798 北纬:40.067381", //地理坐标
"APPRDATE": "2021-01-07", //核准日期
"OPFROM": "2014-08-07", //经营期限自
"SHXYDM": "911101083066224948", //统一社会信用代码
"ORGID": "306622494", //组织机构代码
"DOM": "北京市海淀区北清路164号28-38号院1003号", //地址
"INDUSTRY": "科学研究和技术服务业", //行业领域
"REGCAP": 100.0, //注册资本
"REGCAPCUR": "人民币", //注册资本币种
"REVDATE": "", //吊销日期
"ENTTYPE": "有限责任公司(法人独资)", //企业类型
"FRDB": "李丽", //法定代表人
"ENDDATE": "", //死亡日期
"OPSCOPE": "技术开发、技术推广、技术转让、技术咨询、技术服务;计算机系统服务。。。", //经营业务范围
"ESDATE": "2014-08-07", //成立日期
"OPTO": "2034-08-06", //经营期限至
"ENTNAME": "汉唐信通(北京)科技有限公司", //企业名称
"PROVINCE": "北京市", //登记地省份
"ENGNAME": "Hantang Xintong (Beijing) Technology Co., Ltd.", //企业英文名
"WEBSITE": "http://www.gongsibao.com" //企业官网
}
],
"msg": "success"
}
```
## **<a name="getShareHolderInfo"> 企业股东及出资信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getShareHolderInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"INV": "汉唐信通(北京)咨询股份有限公司", //股东名称
"SUBCONAM": 100.0, //认缴出资额
"CONDATE": "2014-09-07", //出资时间
"CONCUR": "人民币", //出资币种
"SHXYDM": "911101057889696760", //统一社会信用代码
"CONRATIO": 1.0, //出资比例
"INVTYPE": "法人股东" //股东类型
}
],
"msg": "success"
}
```
## **<a name="getRegisterChangeInfo"> 企业变更信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getRegisterChangeInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ALTDATE": "2020-11-23", //变更时间
"ALTAF": "北京市海淀区北清路164号28-38号院1003号", //变更后内容
"ALTITEM": "住所", //变更事项
"ALTBE": "北京市海淀区温泉镇创客小镇社区配套商业楼15#楼一层118室" //变更前内容
}
],
"msg": "success"
}
```
## **<a name="getMainManagerInfo"> 企业主要管理人员</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getMainManagerInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ISFRDB": "是", //是否法定代表人
"POSITION": "执行董事,经理", //职务
"NAME": "李丽" //姓名
}
],
"msg": "success"
}
```
## **<a name="getPatentDetailInfo"> 企业专利详情</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/postApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"path":"getPatentDetailInfo",
"rowKey":"a8a5d4f45975af887565e5ef209bfc73|9b75ce7f30c1d9024bfb0a2e6d802593" //专利列表接口返回的rowKey
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"FZL_MC": "一种基于知识图谱的企业商机挖掘方法和装置", //专利名称
"FZL_SQH": "CN202011090162.0", //申请号
"FZL_SQR": "2020-10-13", //申请日期
"FZL_ZLLX": "发明专利", //专利类型
"FZL_ZFLH": "G06F16/2458(2019.01)I", //主分类号
"FZL_FLH": "G06F16/2458(2019.01)I;G06F16/36(2019.01)I;G06Q30/02(2012.01)I", //分类号
"FZL_GKGGH": "CN112231350A", //公开(公告)号
"FZL_GKGGR": "2021-01-15", //公开(公告)日
"FZL_ZFLH_3CN": "计算;推算;计数", //专利技术领域
"FZL_SQZLQR": "汉唐信通(北京)科技有限公司", //申请(专利权)人
"FZL_FMSJR": "任智军;李丽;樊辉;高宇强;黄静;胥辛雨", //发明(设计)人
"FZL_FLZT": "实质审查的生效", //法律状态
"FZL_VALIDITY": "公开", //专利有效性
"FZL_ZLDLJG": "北京易知宝知识产权代理事务所(普通合伙) 11875", //专利代理机构
"FZL_DLR": "史琳琳", //代理人
"FZL_ZY": "本公开提供一种基于知识图谱的企业商机挖掘方法及装置、计算设备及存储介。。。" //摘要
}
],
"msg": "success"
}
```
## **<a name="getPatentInfo"> 企业专利列表</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getPatentInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ROWKEY": "a8a5d4f45975af887565e5ef209bfc73|9b75ce7f30c1d9024bfb0a2e6d802593", //rowkey,查询专利详情使用
"FZL_MC": "一种基于知识图谱的企业商机挖掘方法和装置", //专利名称
"FZL_SQH": "CN202011090162.0", //申请号
"FZL_SQR": "2020-10-13", //申请日期
"FZL_ZLLX": "发明专利", //专利类型
"FZL_ZFLH": "G06F16/2458(2019.01)I", //主分类号
"FZL_FLH": "G06F16/2458(2019.01)I;G06F16/36(2019.01)I;G06Q30/02(2012.01)I", //分类号
"FZL_GKGGH": "CN112231350A", //公开(公告)号
"FZL_GKGGR": "2021-01-15", //公开(公告)日
"FZL_ZFLH_3CN": "计算;推算;计数", //专利技术领域
"FZL_SQZLQR": "汉唐信通(北京)科技有限公司", //申请(专利权)人
"FZL_FMSJR": "任智军;李丽;樊辉;高宇强;黄静;胥辛雨", //发明(设计)人
"FZL_FLZT": "实质审查的生效", //法律状态
"FZL_VALIDITY": "公开", //专利有效性
"FZL_ZLDLJG": "北京易知宝知识产权代理事务所(普通合伙) 11875", //专利代理机构
"FZL_DLR": "史琳琳", //代理人
"FZL_DZ": "100089 北京市海淀区温泉镇创客小镇社区配套商业楼15#楼一层118室", //详细地址
"FZL_YXQ": "", //优先权
"FFL_SQGGH": "" //授权号
}
],
"msg": "success"
}
```
## **<a name="getTrademarkInfo"> 企业商标列表</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getTrademarkInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ROWKEY": "a8a5d4f45975af887565e5ef209bfc73|f91096e4db8cc9d1a130064ca7537ee8", //Rowkey,查询商标详情使用
"MARKNAME": "公司宝", //商标名称
"APPDATE": "2019-11-27", //申请日期
"UNIONTYPE": "45", //国际分类
"UNIONTYPENAME": "社会服务", //国际分类名称
"TYPEDETAILDES": "计算机软件许可(法律服务);域名注册(法律服务);知识产权代理。。。法律研究;诉讼服务", //商品服务列表
"BEGINDATE": "", //专用期起
"ENDDATE": "", //专用期止
"CHECKDATE": "", //初审公告日期
"REGDATE": "", //注册公告日期
"MARKTYPE": "一般", //商标类型
"MARKIMAGE": "/9j/4QCpRXhpZgAASUkqAAgAAAAFABIBAwABAAAAA", //商标图片
"NOTE": "否", //是否共有商标
"TYPEDETAIL": "4506;4505", //类似群
"MARKCODE_KEY": "42645186", //注册号
"ISINVALID": "有效", //状态
"ISCOLOR": "", //指定颜色
"AGENTNAME": "汉唐信通(北京)咨询股份有限公司", //代理机构
"REGVOLUMN": "", //注册公告期
"CHECKVOLUMN": "", //初审公告期
"LIUCHENG": "商标注册申请", //商标流程
"LIUCHENGDATE": "2020-06-13", //流程日期
"ADDR": "北京市海淀区北清路164号17-27号院813号", //申请人中文地址
"FSTAPPDATE": "" //优先权时间
}
],
"msg": "success"
}
```
## **<a name="getSoftwareCopyrightInfo"> 企业软件著作权信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getSoftwareCopyrightInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"FRJ_HYFLH": "其他行业", //行业领域
"FRJ_DJH": "2019SR1110958", //登记号
"FRJ_RJQC": "蜂擎云服CRM系统", //软件全称
"FRJ_DJDATE": "2019-11-01", //登记日期
"FRJ_SCFBDATE": "2019-01-28", //首次发表日期
"FRJ_BBH": "V1.0", //版本号
"FRJ_ZZQR_GJ": "汉唐信通(北京)科技有限公司:中国", //著作权人
"FRJ_RJJC": "蜂擎云服CRM", //软件简称
"FRJ_RJFLH": "行业应用软件" //软件分类
}
],
"msg": "success"
}
```
## **<a name="getWorksCopyrightInfo"> 企业作品著作权信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getWorksCopyrightInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"FZD_SCFBDATE": "2015-08-20", //首次发表日期
"FZD_DJH": "国作登字-2016-F-00297528", //登记号
"FZD_DJDATE": "2016-08-19", //登记日期
"FZD_CZWCDATE": "2015-08-20", //创作完成日期
"FZD_ZPMC": "表情小蜜蜂", //作品名称
"FZD_ZPLB": "美术", //作品类别
"FZD_ZZNAME": "" //著作权人
}
],
"msg": "success"
}
```
## **<a name="getEntLogoInfo"> 企业LOGO</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntLogoInfo",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"LOGO": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAA/wD/qDQzy5/" //企业LOGO,Base64编码格式
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportSocialSecurityInfo"> 企业年报社保信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportSocialSecurityInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"D1": "", //单位参加城镇职工基本养老保险累计欠缴金额
"C1": "", //参加城镇职工基本养老保险本期实际缴费基数
"D2": "", //单位参加失业保险累计欠缴金额
"B1": "", //单位参加城镇职工基本养老保险缴费基数
"C2": "", //参加失业保险本期实际缴费基数
"D3": "", //单位参加职工基本医疗保险累计欠缴金额
"A1": "279", //城镇职工基本养老保险
"B2": "", //单位参加失业保险缴费基数
"C3": "", //参加职工基本医疗保险本期实际缴费基数
"D4": "", //单位参加工伤保险累计欠缴金额
"A2": "279", //失业保险
"B3": "", //单位参加职工基本医疗保险缴费基数
"C4": "", //参加工伤保险本期实际缴费基数
"D5": "", //单位参加生育保险累计欠缴金额
"A3": "279", //职工基本医疗保险
"C5": "", //参加生育保险本期实际缴费基数
"A4": "279", //工伤保险
"B5": "", //单位参加生育保险缴费基数
"A5": "279" //生育保险
}
],
"msg": "success"
}
```
## **<a name="getListedCompanyBaseMessageInfoV2"> 上市公司基本信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getListedCompanyBaseMessageInfoV2",
"entName":"汉唐信通(北京)科技有限公司"
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ENAME": "Fengqing Network Technology Co.,Ltd.", //英文全称
"BUILD_DATE": "1995-01-18", //成立日期
"DECLAREDATE": "2021-01-14", //信息发布日期
"LIST_ENDDATE": "", //退市日期
"STAFF_NUM": "1780", //员工人数
"WEB_SITE": "www.Fengqing.com", //公司网址
"PRI_BIZ": "以蜂擎企业云服务为核心为客户提供企业云服务与解决方案。", //主营业务
"CURNCY": "人民币", //币种
"ESNAME": "Fengqing", //英文简称
"ISIN": "CNE0001017Y6", //ISIN代码
"TRADE_MKT_REF": "上海证券交易所", //市场代码
"REGI_CAP": "328082.98", //注册资本
"CSNAME": "蜂擎网络", //中文简称
"LIST_DATE": "2001-05-18", //上市日期
"STK_TYPE_REF": "国内A股", //证券类别
"COM_BRIEF": "公司是根据《中华人民共和国公司法》于1983年12月6日注册成立的股份有限公司。本公司根据2004年4月29日股东大会决议,公司名称。。。", //公司简介
"STOCKCODE": "600588", //证券代码
"REGI_ADDR": "北京市朝阳区", //注册地址
"OFFICE_ADDR": "北京市朝阳区", //办公地址
"CNAME": "蜂擎网络科技股份有限公司", //中文全称
"STOCKSNAME": "蜂擎网络", //股票简称
"STATUS_TYPE_REF": "上市" //上市状态
}
],
"msg": "success"
}
```
## **<a name="getListedCompanyShareHolderInfoV2"> 上市公司十大股东</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getListedCompanyShareHolderInfoV2",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ORGCODE": "73209192", //股东代码
"ADD_NUM": "-1,964,765", //本期变动数量
"DECLAREDATE": "2020-10-31", //信息发布日期
"FROZEN_PLEDGE_NUM": "0", //质押或冻结的股份数量
"RANK": "10", //股东排名
"HOLD_PCT": "1.693", //持股数量占总股本比例
"SHR_HLD_TYPE": "境内法人股", //股东股权性质
"HOLD_NUM": "55000000", //持股数量
"ENDDATE": "2020-09-30", //截止日期
"NAME": "上海合道资产管理有限公司-合道科创1期私募证券投资基金" //股东名称
}
],
"msg": "success"
}
```
## **<a name="getEntPaidInRiskWarmInfo"> 企业实缴风险预警</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntPaidInRiskWarmInfo",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ACCONAM": 100.0, //实缴出资额
"RATE": 1.0, //实缴比例
"ENTNAME": "汉唐信通(北京)科技有限公司" //企业名称
}
],
"msg": "success"
}
```
## **<a name="getDataExploreInfo"> 企业数据发现</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getDataExploreInfo",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"DESCRIPTION": "企业2009年07月19日在上海证券交易所主板上市。", //认定依据
"SOURCE": "中国证券监督管理委员会", //信息来源
"LEVEL": "2", //影响程度,1=提示,2=中性
"EVENT": "A股 | 蜂擎云服 710577.SH", //发现内容
"MONITORTIME": "2007-04-20" //发现时间
}
],
"msg": "success"
}
```
## **<a name="getEntLable"> 企业基因标签</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntLable",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"TAG": "域名备案企业" //标签名称
},
{
"TAG": "高新企业" //标签名称
}
],
"msg": "success"
}
```
## **<a name="getEntContactInfo"> 企业联系方式汇总</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntContactInfo",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"CONTACT": "010-84927588", //联系方式
"CONTACT_TYPE": "固话", //联系方式类型
"UPDATE": "2019-03-29" //更新时间
}
],
"msg": "success"
}
```
## **<a name="getEntSFCAnnreportList"> 企业/农专年报列表</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntSFCAnnreportList",
"entName":"汉唐信通(北京)科技有限公司" //企业名称
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"NBYEAR": "2018", //年报年份
"NBDATE": "2019-03-29", //年报时间
"ENTTYPE": "企业" //企业类型
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportInfo"> 企业年报基本信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2019 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ISWEB": "是", //是否有网站或网店
"ENTSTATUS": "开业", //企业经营状态
"POSTCODE": "100000", //邮政编码
"ISGQZR": "否", //有限责任公司本年度是否发生股东股权转让
"ENTNAME": "汉唐信通(北京)科技有限公司", //企业名称
"TEL": "010-8492788", //企业联系电话
"EMAIL": "lisa@gongsibao.com", //电子邮箱
"SHXYDM": "911101083066224948", //统一社会信用代码
"ISGMGQ": "是", //企业是否有投资信息或购买其他公司股权
"ADDR": "北京市海淀区北清路164号17-27号院813号", //企业通信地址
"EMPNUM": "10000" //从业人数
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportWebSiteInfo"> 企业年报网站网店信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportWebSiteInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2019 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"WEBTYPE": "网站", //网站网店类型
"WEBURL": "www.callcentermkt.com", //网站(网店)网址
"WEBNAME": "汉唐信通(北京)科技有限公司" //网站(网店)名称
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportInvInfo"> 企业年报股东及出资信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportInvInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2019 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ACCONAM": 100.0, //实缴出资额
"ACCCUR": "人民币", //实缴币种
"ACCDATE": "2015-05-23", //实缴出资时间
"CONFORM": "货币", //认缴出资方式
"CONAM": 100.0, //认缴出资额
"CONDATE": "2015-05-23", //认缴出资时间
"CONCUR": "人民币", //认缴出资币种
"SHANAME": "汉唐信通(北京)咨询股份有限公司", //股东名称
"ACCFORM": "货币" //实缴出资方式
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportAssetsInfo"> 企业年报资产状况</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportAssetsInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2019 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ASSGRO": "10", //资产总额
"LIAGRO": "0", //负债总额
"RATGRO": "0", //纳税总额
"TOTEQU": "10", //所有者权益合计
"VENDINC": "0", //营业总收入
"PROGRO": "0", //利润总额
"NETINC": "0", //净利润
"MAIBUSINC": "0" //其中主营业务收入
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportForGuaranteeInfo"> 企业年报对外担保信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportForGuaranteeInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2019 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"ZQZL": "合同", //主债权种类
"ZQSE": 400.0, //主债权数额
"ZWR": "沂南县佳乐食品有限公司", //债务人
"ZQQXTO": "2016-08-19", //履行债务的期限至
"ZQR": "沂南县城区信用社", //债权人
"BZFS": "一般保证", //保证的方式
"ZQQXFROM": "2016-08-28", //履行债务的期限自
"BZQJ": "期限" //保证的期间
},
],
"msg": "success"
}
```
## **<a name="getSfcAnnReportInfo"> 农专年报基本信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getSfcAnnReportInfo",
"entName":"榆中丰瑞祥养殖专业合作社", //企业名称
"reportDate": 2014 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"MEMNUM_XZ": 0.0, //本年度新增成员人数
"MEMNUM": 5.0, //成员人数
"REGNO": "620123NA000885X", //注册号
"FARSPEARTNAME": "榆中丰瑞祥养殖专业合作社", //合作社名称
"TEL": "13919486253", //联系电话
"EMAIL": "941743007@qq.com", //电子邮箱
"MEMNUM_NM": 5.0, //成员人数中农民人数
"MEMNUM_TC": 0.0 //本年度退出成员人数
}
],
"msg": "success"
}
```
## **<a name="getSfcAnnReportWebSiteInfo"> 农专年报网站网店信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getSfcAnnReportWebSiteInfo",
"entName":"阿克苏天山雪润果业农民专业合作社", //企业名称
"reportDate": 2014 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"WEBTYPE": "网店", //网站网店类型
"WEBURL": "http://tsaksgnlm.taobao.com", //网站(网店)网址
"WEBNAME": "天山阿克苏果农联盟" //网站(网店)名称
},
],
"msg": "success"
}
```
## **<a name="getSfcAnnReportAssetsInfo"> 农专年报资产状况</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getSfcAnnReportAssetsInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate": 2014 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"PRIYEAPROFIT": "5", //盈余总额
"PRIYEASUB": "0", //获得政府扶持资金、补助
"RATGRO": "0", //纳税金额
"PRIYEALOAN": "0", //金融贷款
"PRIYEASALES": "50" //销售额或营业收入
}
],
"msg": "success"
}
```
## **<a name="getTrademarkDetailInfo"> 企业商标详情</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/postApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"path":"getTrademarkDetailInfo",
"rowKey": "a8a5d4f45975af887565e5ef209bfc73|f91096e4db8cc9d1a130064ca7537ee8" //商标列表接口返回的rowKey
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"MARKTYPE": "一般", //商标类型
"REGVOLUMN": "", //注册公告期
"TYPEDETAILDES": "计算机软件许可(法律服务);域名注册(法律服务)。。。法律研究;诉讼服务", //商品服务列表
"REGDATE": "", //注册公告日期
"TYPEDETAIL": "4506;4505", //类似群
"ISCOLOR": "", //指定颜色
"MARKIMAGE": "/9j/4QCpRXhpZgAASUkqAAgAAAAFABIAAADIBAgAUAA", //商标图片
"MARKCODE_KEY": "42645186", //注册号
"UNIONTYPENAME": "社会服务", //国际分类名称
"LIUCHENGDATE": "2020-06-13", //流程日期
"ISINVALID": "有效", //状态
"ENDDATE": "", //专用期止
"AGENTNAME": "汉唐信通(北京)咨询股份有限公司", //代理机构
"FSTAPPDATE": "", //优先权时间
"ADDR": "北京市海淀区北清路164号17-27号院813号", //申请人中文地址
"APPDATE": "2019-11-27", //申请日期
"UNIONTYPE": "45", //国际分类
"NOTE": "否", //是否共有商标
"CHECKDATE": "", //初审公告日期
"MARKNAME": "公司宝", //商标名称
"BEGINDATE": "", //专用期起
"LIUCHENG": "商标注册申请", //商标流程
"CHECKVOLUMN": "" //初审公告期
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportToInvInfo"> 企业年报对外投资</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportToInvInfo",
"entName":"汉唐信通(北京)科技有限公司", //企业名称
"reportDate":2014 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"REGNO": "91370102MA3QXNA", //投资设立企业或购买股权企业名称
"ENTNAME": "汉唐信通(山东)科技有限公司" //注册号/统一社会信用代码
},
{
"REGNO": "91410204MA47HAC", //投资设立企业或购买股权企业名称
"ENTNAME": "开封市智程锦云人力资源服务有限公司" //注册号/统一社会信用代码
}
],
"msg": "success"
}
```
## **<a name="getEntAnnReportStockChanageInfo"> 企业年报股权变更信息</a>**
[返回到目录](#menu)
##### URL
[/openPlatform/busservices/cloudApi]
#### 参数格式 `JSON`
#### HTTP请求方式 `GET`
``` javascript
{
"path":"getEntAnnReportStockChanageInfo",
"entName":"阿里巴巴(中国)网络技术有限公司", //企业名称
"reportDate":2018 //年报年份
}
```
#### 返回结果
```javascript
{
"status": 1,
"data": [
{
"INV": "淘宝(中国)软件有限公司", //股东名称
"TRANSAMPR": 0.0, //变更前股权比例
"ALTDATE": "2018-11-27", //股权变更日期
"TRANSAMAFT": 78.4 //变更后股权比例
},
{
"INV": "Alibaba.com China Limited", //股东名称
"TRANSAMPR": 100.0, //变更前股权比例
"ALTDATE": "2018-11-27", //股权变更日期
"TRANSAMAFT": 21.6 //变更后股权比例
}
],
"msg": "success"
}
```
\ No newline at end of file
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