Commit e905c679 by 宋毅

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

parents cb7a1291 8c639c74
......@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase {
this.pushlogSve = system.getObject("service.common.pushlogSve");
this.aliclient = system.getObject("util.aliyunClient");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");
}
async taskAliIcapi() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi();
......@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase {
return rtn;
}
async taskAlijsonfile(pobj, qobj, req) {//操作阿里商标交易上架
var rtn = await this.UtilsTmOrderCallService.createjsonfile();
return rtn;
}
async taskAliRpcAgainPush(pobj, qobj, req) {
var result = await this.pushlogSve.getFailLogList();
if (result.status != 0 || !result.data || result.data.length == 0) {
......
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");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId;
var opResult = null;
console.log("11111",opResult)
switch (action_type) {
case "queryTradeProduceList"://2020 0907 lin 新增 ali查询 用户确认资料支付尾款,并更新订单状态
opResult = await this.utilsTmOrderCallSve.queryTradeProduceList(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
console.log(opResult)
return opResult;
}
}
module.exports = ProductAPI;
......@@ -41,13 +41,16 @@ class UtilsNeedService extends AppServiceBase {
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;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else {
} else if (pobj.actionBody.channel_type_code == 7){
pobj.actionBody.type = "ali.edi";
}
} else if (pobj.actionBody.channel_type_code == "tmjy"){
pobj.actionBody.type = "ali.tmd";
}
if (pobj.actionBody.description.indexOf("#备#") < 0) {
if (pobj.actionBody.description.indexOf("备#") < 0) {
pobj.actionBody.level = "A";
} else {
var levelurl = "http://106.13.228.212:8000/recProbability";
......@@ -67,7 +70,6 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
} else {
var reqParams = {
actionBody: pobj.actionBody,
appInfo: pobj.appInfo
......
const system = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
const AppServiceBase = require("../../app.base");
//订单操作类
class UtilsTmOrderCallService extends AppServiceBase {
constructor() {
super();
this.aliclient = system.getObject("util.aliyunClient");
}
async queryTradeProduceList(pobj, actionBody) {//修改联系人
return system.getResultSuccess();
}
async createjsonfile() {
var self = this;;
var gobj = {
action: "GenerateUploadFilePolicy",
reqbody: { FileType: "PARTNER_SYNC_FILE" },
type: 'TM'
}
var rst = await self.aliclient.reqbyget(gobj);
console.log(rst);
var obj={
actionType:"createjsonfile",
actionBody:{}
}
var getjsonurl=settings.tmtransactionUrl()+"/api/action/trademarktransaction"
var jsonurl=await this.restPostUrl(obj,getjsonurl);
if(!jsonurl){
return system.getResultSuccess();
}
var upobj={
ossurl:jsonurl.data.url,
filedir:rst.data.FileDir,
objectName:jsonurl.data.name,
encodePolicy:rst.data.EncodedPolicy,
endpoint:"http://partner-sync-file.oss-cn-beijing.aliyuncs.com",
accessKeyId:rst.data.AccessId,
bucketName:"partner-sync-file"
}
var aliOssFileInfo = await this.execPostUrl(upobj, settings.aliossjavaUrl());
if (aliOssFileInfo == true) {
var fileUrl = params.filedir + "/" + params.objectName;
return system.getResultSuccess(fileUrl);
}
}
}
module.exports = UtilsTmOrderCallService;
// var a=new UtilsTmOrderCallService();
// a.createjsonfile();
......@@ -14,6 +14,15 @@ class aliyunClient {
apiVersion: "2020-03-06"
});
}
getAliTMClient() {
return new RPCClient({
accessKeyId: 'LTAI4FmyipY1wuLHjLhMWiPa',
accessKeySecret: 'hp4FF18IDCSym1prqzxrAjnnhNH3ju',
endpoint: 'https://trademark.aliyuncs.com',
apiVersion: '2018-07-24'
}
);
}
async post(aliReqUrl, key, secret, actionBody) {
const client = new Client(key, secret);
var param = {
......@@ -32,8 +41,14 @@ class aliyunClient {
async reqbyget(obj, cbk) {
var action = obj.action;
var reqbody = obj.reqbody;
var self=this;
try {
var reqAliclient = this.getAliClient();// { ... this.aliclient };
var reqAliclient = null;// { ... this.aliclient };
if(obj.type && obj.type =="TM"){
reqAliclient=self.getAliTMClient();
}else{
reqAliclient=self.getAliClient();
}
if (obj.apiVersion) {
reqAliclient.apiVersion = obj.apiVersion;
}
......
var settings = {
redis: {
host: "43.247.184.32",
host: "121.36.3.35",
port: 8967,
password: "Gongsibao2018",
db: 5,
......
......@@ -51,6 +51,14 @@ var settings = {
return "http://aliossjava-service/uploadfile";
}
},
tmtransactionUrl: function () {
if (this.env == "dev") {
return "http://192.168.2.109:8080/uploadfile";
} else {
return "http://center-tmtransaction-service";
}
},
qifuPayAfterH5JumpUrl: function () {
if (this.env == "dev") {
return "http://tm.qifu.gongsibao.com:4012/#/home/indent_list";
......
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