Commit f03a67e7 by 宋毅

tj

parent 5868d6e3
...@@ -8,6 +8,7 @@ class AccessAuthAPI extends APIBase { ...@@ -8,6 +8,7 @@ class AccessAuthAPI extends APIBase {
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.aliclient = system.getObject("util.aliyunClient"); this.aliclient = system.getObject("util.aliyunClient");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");
} }
async taskAliIcapi() { async taskAliIcapi() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi(); var rtn = await this.gatewaypushlogSve.taskAliIcapi();
...@@ -28,6 +29,11 @@ class AccessAuthAPI extends APIBase { ...@@ -28,6 +29,11 @@ class AccessAuthAPI extends APIBase {
var rtn = await this.aliclient.reqbyget(pobj) var rtn = await this.aliclient.reqbyget(pobj)
return rtn; return rtn;
} }
async taskAliTmUpdate(pobj, qobj, req) {//操作阿里商标更新
var rtn = await this.utilsTmAliyunSve.taskAliTmUpdate()
return rtn;
}
// async taskAgainPushNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据 // async taskAgainPushNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据
// var rtn = await this.utilsPushSve.againPushBusInfo(pobj); // var rtn = await this.utilsPushSve.againPushBusInfo(pobj);
// return rtn; // return rtn;
......
...@@ -29,7 +29,7 @@ class ProductAPI extends WEBBase { ...@@ -29,7 +29,7 @@ class ProductAPI extends WEBBase {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "opAliDingInterfaceManage"://操作阿里钉钉接口管理---actionBody:{为阿里需要的参数} case "opAliDingInterfaceManage"://操作阿里钉钉接口管理---actionBody:{为阿里需要的参数}
var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj.appInfo, pobj.product_id); var pushInterfaceResult = await this.utilsOpOrderSve.getOpInterfaceByProductId(pobj.appInfo, pobj.product_id);
if (pushInterfaceResult.status != 0) { if (pushInterfaceResult.status != 0) {
return pushInterfaceResult; return pushInterfaceResult;
} }
...@@ -41,7 +41,7 @@ class ProductAPI extends WEBBase { ...@@ -41,7 +41,7 @@ class ProductAPI extends WEBBase {
opResult = await this.utilsTmAliyunSve.opAliDingInterfaceManage(pobj); opResult = await this.utilsTmAliyunSve.opAliDingInterfaceManage(pobj);
break; break;
// case "checkTmNameByAli"://检测商标名称是否合规 // case "checkTmNameByAli"://检测商标名称是否合规
// var pushInterfaceResult = await this.utilsOpOrderSve.getProductInterface(pobj, pobj.actionBody.product_id); // var pushInterfaceResult = await this.utilsOpOrderSve.getOpInterfaceByProductId(pobj, pobj.actionBody.product_id);
// if (pushInterfaceResult.status != 0) { // if (pushInterfaceResult.status != 0) {
// pobj.actionBody.product_info.interface_info = pushInterfaceResult.data; // pobj.actionBody.product_info.interface_info = pushInterfaceResult.data;
// this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1); // this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1);
......
...@@ -243,6 +243,51 @@ class AppServiceBase { ...@@ -243,6 +243,51 @@ class AppServiceBase {
return system.getResult(-200, "java ali oss upload error"); return system.getResult(-200, "java ali oss upload error");
} }
} }
async opDownFileInfo(docUrl, result) { //从oss下载到本地并上传到自己oss,之后删除本地文件
/*docUrl下载链接,全路径,如:https://XXXXXX.pdf?XXXXX */
try {
var tmpFileName = docUrl.substring(0, docUrl.lastIndexOf("?"));
var fileName = tmpFileName.substr(tmpFileName.lastIndexOf("/") + 1, tmpFileName.lenght);
var fileType = tmpFileName.substr(tmpFileName.lastIndexOf(".") + 1, tmpFileName.lenght);
//解码后的文件全名:xxx.pdf
var fileAllName = decodeURIComponent(fileName);//为xxx.pdf
var saveFilePath = '/tmp/' + fileAllName;
// 下载文件到指定的路径
var tmpp = await this.restClient.execDownload("'" + docUrl + "'", saveFilePath);
//上传 saveFilePath的文件 到ossClient
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
var upFileName = "alifile_" + u + "." + fileType;
var rtn = await this.ossClient.upfile(upFileName, saveFilePath);
result.data = rtn;
//删除本地文件
fs.unlink(saveFilePath, function (err) { });
} catch (e) {
result.code = -200;
result.message = "通过flowId获取到的文件url下载操作异常异常error";
console.log(e.stack);
//日志记录
logCtl.error({
optitle: "e签宝通过flowId获取到的文件url下载操作异常异常error",
op: "base/service/impl/utilesignbaoSve/opDownFileInfo",
content: "请求参数:docUrl=" + docUrl + ",异常信息error:" + e.stack,
clientIp: ""
});
}
return result;
}
async getOpInterfaceByProductId(appInfo, product_id) {//获取产品调用接口
var getProductInterfaceUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var getProductInterfaceObj = {
"actionType": "getProductInterface",
"appInfo": appInfo,
"actionBody": { "product_id": product_id }
};
var productItemInterfaceResult = await this.restPostUrl(getProductInterfaceObj, getProductInterfaceUrl);
return productItemInterfaceResult;
}
/* /*
返回20位业务订单号 返回20位业务订单号
prefix:业务前缀 prefix:业务前缀
......
...@@ -9,16 +9,7 @@ class UtilsOpOrderService extends AppServiceBase { ...@@ -9,16 +9,7 @@ class UtilsOpOrderService extends AppServiceBase {
this.centerOrderUrl = settings.centerOrderUrl(); this.centerOrderUrl = settings.centerOrderUrl();
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve"); this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
} }
async getProductInterface(appInfo, product_id) {//获取产品调用接口
var getProductInterfaceUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var getProductInterfaceObj = {
"actionType": "getProductInterface",
"appInfo": appInfo,
"actionBody": { "product_id": product_id }
};
var productItemInterfaceResult = await this.restPostUrl(getProductInterfaceObj, getProductInterfaceUrl);
return productItemInterfaceResult;
}
async updateContacts(pobj, actionBody) {//修改联系人 async updateContacts(pobj, actionBody) {//修改联系人
if (!actionBody.orderNo) { if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100310"); return system.getResult(null, "actionBody.orderNo can not be empty,100310");
...@@ -47,7 +38,10 @@ class UtilsOpOrderService extends AppServiceBase { ...@@ -47,7 +38,10 @@ class UtilsOpOrderService extends AppServiceBase {
} }
if (result.data.orderStatus == 2) { if (result.data.orderStatus == 2) {
this.opUpdatePushInfo(result, pobj, "pushUpdateOrder"); this.opUpdatePushInfo(result, pobj, "pushUpdateOrder");
this.opUpdatePushInfo(result, pobj, "updateAliTmApplicant"); if (pobj.actionBody.apply) {
pobj.actionBody.apply.gzwtsUrl = result.data.gzwtsUrl;
this.opUpdatePushInfo(result, pobj, "updateAliTmApplicant");
}//ali 只做申请人信息修改
}//状态为付款的订单进行推送 }//状态为付款的订单进行推送
result.data = null; result.data = null;
return result; return result;
...@@ -114,7 +108,7 @@ class UtilsOpOrderService extends AppServiceBase { ...@@ -114,7 +108,7 @@ class UtilsOpOrderService extends AppServiceBase {
tmpPobj.actionBody.product_info = productItemResult.data; tmpPobj.actionBody.product_info = productItemResult.data;
tmpPobj.actionBody.product_id = tmpPobj.actionBody.product_info.id; tmpPobj.actionBody.product_id = tmpPobj.actionBody.product_info.id;
//获取推送接口并推送 //获取推送接口并推送
var pushInterfaceResult = await this.getProductInterface(pobj.appInfo, tmpPobj.actionBody.product_id); var pushInterfaceResult = await this.getOpInterfaceByProductId(pobj.appInfo, tmpPobj.actionBody.product_id);
if (pushINterfaceResult.status == 0) { if (pushINterfaceResult.status == 0) {
tmpPobj.actionBody.product_info.interface_info = pushInterfaceResult.data; tmpPobj.actionBody.product_info.interface_info = pushInterfaceResult.data;
this.utilsPushSve.pushBusInfo(tmpPobj, "pushOpSolution", 1); this.utilsPushSve.pushBusInfo(tmpPobj, "pushOpSolution", 1);
......
...@@ -489,7 +489,7 @@ class UtilsOrderService extends AppServiceBase { ...@@ -489,7 +489,7 @@ class UtilsOrderService extends AppServiceBase {
// productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0 // productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0
// } // }
// opResult.data = { // opResult.data = {
// orderNo: "TM36202004150927UPmE", // orderNo: "TM36202004191028Sgir",
// uappId: 36, // uappId: 36,
// productId: 42 // productId: 42
// }; // };
......
...@@ -22,7 +22,7 @@ var settings = { ...@@ -22,7 +22,7 @@ var settings = {
port: process.env.NODE_PORT || 4012, port: process.env.NODE_PORT || 4012,
aliossjavaUrl: function () { aliossjavaUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://192.168.0.104:8080/uploadfile"; return "http://192.168.2.109:8080/uploadfile";
} else { } else {
return "http://aliossjava-service/uploadfile"; return "http://aliossjava-service/uploadfile";
} }
......
已经使用的编码汇总: 已经使用的编码汇总:
...@@ -51,4 +51,6 @@ ...@@ -51,4 +51,6 @@
100500 100500
100510 100510
100520 100520
100530 100530
\ No newline at end of file 100540
100550
\ 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