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/
\ No newline at end of file
.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;
......
......@@ -55,7 +55,11 @@ class QcAPI extends APIBase {
case "closeOrderDelivery"://交付商关闭交付单
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 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
......@@ -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;
......
......@@ -55,4 +55,4 @@ class PaymentAPI extends WEBBase {
return opResult;
}
}
module.exports = PaymentAPI;
\ No newline at end of file
module.exports = PaymentAPI;
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,
......
......@@ -3,54 +3,70 @@ 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));
this.execClient = system.getObject("util.execClient");
this.dingClient = system.getObject("util.dingClient");
}
constructor() {
super("common", ServiceBase.getDaoName(GatewaypushlogService));
this.execClient = system.getObject("util.execClient");
this.dingClient = system.getObject("util.dingClient");
}
async taskAliIcapi() {
try {
var sql = "select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var icloginfos = await this.customQuery(sql);
if (icloginfos.length > 0) {
var count = 100;
if (icloginfos.length < count) {
count = icloginfos.length;
}
var self = this;
for (var i = 0; i < count; i++) {
var icloginfo = icloginfos[i];
var requestdata = null;
if (icloginfo && icloginfo.requestjson) {
requestdata = JSON.parse(icloginfo.requestjson);
}
var url = settings.gatewayUrl() + "action/intentionapi/springBoard";
var rtn = await self.execClient.execPost(requestdata, url);
var 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)
async taskAliIcapi() {
try {
var sql = "select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var icloginfos = await this.customQuery(sql);
if (icloginfos.length > 0) {
var count = 100;
if (icloginfos.length < count) {
count = icloginfos.length;
}
var self = this;
for (var i = 0; i < count; i++) {
try {
var icloginfo = icloginfos[i];
var requestdata = null;
if (icloginfo && icloginfo.requestjson) {
requestdata = JSON.parse(icloginfo.requestjson);
}
var url = settings.gatewayUrl() + "action/intentionapi/springBoard";
var rtn = await self.execClient.execPost(requestdata, url);
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-for";
data.requestdata = requestdata;
data.message = "error info";
this.dingClient.gatewayPushError(data);
}
icloginfo.error = JSON.stringify(data);
icloginfo.pushtimes += 1;
}
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
})
}
}
}
icloginfo.pushtimes += 1;
}
await this.update(icloginfo);
}
}
return system.getResultSuccess();
return system.getResultSuccess();
} catch (error) {
this.dingClient.gatewayPushError({message:"Exception",api:"center-channel/taskAliIcapi"})
return system.getResultFail(-1,error);
} catch (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
......@@ -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");
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;
......@@ -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;
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -153,6 +153,44 @@ class UtilsProductService extends AppServiceBase {
let result = await this.restPostUrl(pobj,url);
return result;
}
}
module.exports = UtilsProductService;
/**
* 根据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
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);
}
......
const system = require("../system");
class dingClient {
constructor() {
this.execClient = system.getObject('util.execClient');
this.gatewayurl = "https://oapi.dingtalk.com/robot/send?access_token=2f1ada261ea84f6c621db487ac18d11eba8984202bd82adda8810770a8240572"
}
//推送峰擎异常提醒
async gatewayPushError(err) {
if (process.env.APP_ENV === "prod") {
let c = `注意提醒:阿里->推送峰擎异常,老板们加油,加油,加油 !!!${JSON.stringify(err)}`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, this.gatewayurl).catch(alierr => {
console.log(alierr)
});
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") {
let c = `注意提醒:阿里->推送峰擎异常,老板们加油,加油,加油 !!!${JSON.stringify(err)}`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, this.gatewayurl).catch(alierr => {
console.log(alierr)
});
}
}
}
//渠道钉钉提醒
async gatewayPushByChannel(orderNo,appInfo){
let gatewayUrl = setttings.dingRobotUrl(appInfo.uapp_id);
if (process.env.APP_ENV != "dev" && gatewayUrl) {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, gatewayUrl).catch(err => {
console.log(err)
});
//渠道钉钉提醒
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}
}, 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,22 +6,24 @@ 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 执行文件
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间设置,单位秒
* @param {*} req 请求信息
*/
* 带超时时间的post请求
* @param {*} execFile 执行文件
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间设置,单位秒
* @param {*} req 请求信息
*/
async execPostTimeOutByBusiness(execFile, params, url, ContentType, headData, timeOut = 60, req) {
var rtn = null;
var reqResult = null;
......@@ -99,6 +101,7 @@ class ExecClientNew {
return reqResult;
}
}
/**
* 记录日志信息
* @param {*} opTitle 操作的标题
......@@ -109,37 +112,39 @@ 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
* @param {*} url
* @param {*} headData 请求信息,JSON格式
* @param {*} url
* @param {*} headData 请求信息,JSON格式
*/
async execGet(params, url, headData) {
let cmd = this.FetchGetCmd(params, url, headData);
var result = await this.exec(cmd);
return result;
}
/**
*
*
* @param {*} params 提交的数据JSON格式
* @param {*} url
* @param {*} headData 请求信息,JSON格式
* @param {*} url
* @param {*} headData 请求信息,JSON格式
* @param {*} timeOut 超时时间
*/
async execGetTimeOut(params, url, headData, timeOut = 5000) {
......@@ -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";
......@@ -245,9 +254,9 @@ class ExecClientNew {
}
/**
* 返回20位业务订单号
* @param {*} prefix 业务前缀
*/
* 返回20位业务订单号
* @param {*} prefix 业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
......@@ -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;
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