Commit 39812357 by linboxuan

update reqCenterOrderQcApi. if the order has been closed, inform fq

parent 40411fb0
...@@ -2,6 +2,7 @@ var system = require("../../../system"); ...@@ -2,6 +2,7 @@ var system = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base"); const AppServiceBase = require("../../app.base");
const fs = require("fs"); const fs = require("fs");
const { json } = require("sequelize");
//需求操作类 //需求操作类
class UtilsNeedService extends AppServiceBase { class UtilsNeedService extends AppServiceBase {
constructor() { constructor() {
...@@ -64,6 +65,13 @@ class UtilsNeedService extends AppServiceBase { ...@@ -64,6 +65,13 @@ class UtilsNeedService extends AppServiceBase {
var url = this.centerOrderUrl + reqUrl; var url = this.centerOrderUrl + reqUrl;
} }
pobj.actionType = "receiveIcpFeedback"; pobj.actionType = "receiveIcpFeedback";
// 2020 0803 lin 修改;
if(pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
if(pobj.intentionStatus == 5) {
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
}
}
var rtn = await this.execClient.execPost(pobj, url); var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout); var data = JSON.parse(rtn.stdout);
return data; return data;
...@@ -286,6 +294,14 @@ class UtilsNeedService extends AppServiceBase { ...@@ -286,6 +294,14 @@ class UtilsNeedService extends AppServiceBase {
try { try {
var tmpFileName = docUrl.substring(0, docUrl.lastIndexOf("?")); var tmpFileName = docUrl.substring(0, docUrl.lastIndexOf("?"));
var fileName = tmpFileName.substr(tmpFileName.lastIndexOf("/") + 1, tmpFileName.lenght); var fileName = tmpFileName.substr(tmpFileName.lastIndexOf("/") + 1, tmpFileName.lenght);
// 2020 0803 lin 修改;
var urlJson = this.urlSplit(docUrl);
if(urlJson["Expires"]){
// url中过期时间与服务器时间对比结果为已过期
if(urlJson["Expires"] < new Date().getTime()) {
return ""+fileName;
}
}
//解码后的文件全名:xxx.pdf //解码后的文件全名:xxx.pdf
var fileAllName = decodeURIComponent(fileName);//为xxx.pdf var fileAllName = decodeURIComponent(fileName);//为xxx.pdf
var saveFilePath = '/tmp/' + fileAllName; var saveFilePath = '/tmp/' + fileAllName;
...@@ -373,6 +389,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -373,6 +389,16 @@ class UtilsNeedService extends AppServiceBase {
return res; return res;
} }
urlSplit(url) {
var arr=url.split("?")[1]; //根据?跟个url
var arr2=arr[1].split("&"); //根据&重新分割参数
var jsonarr={}; //定义一个json对象放置url 参数
for(var i=0;i<arr2.length;i++){ //循环将参数放到json里面
jsonarr[arr2[i].substring(0,1)]=arr2[i].substring(2,3);
}
return jsonarr;
}
// async test1() { // async test1() {
// var a = await this.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: "20200416125415000001", Note: "测试需求关闭" }, apiVersion: "2019-05-08" }); // var a = await this.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: "20200416125415000001", Note: "测试需求关闭" }, apiVersion: "2019-05-08" });
......
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