Commit 0a3cbbec by linboxuan

utilsOrderSve add tmAccept,tmRefuse

parent 6aadfce9
......@@ -25,6 +25,7 @@ class ProductAPI extends WEBBase {
async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId;
var opResult = null;
console.log("11111",opResult)
switch (action_type) {
case "tmAccept"://2020 0828 lin 新增 ali商标交易 创建订单接口
opResult = await this.utilsOrderSve.tmAccept(pobj, pobj.actionBody);
......@@ -39,6 +40,7 @@ class ProductAPI extends WEBBase {
opResult = system.getResult(null, "action_type参数错误");
break;
}
console.log(opResult)
return opResult;
}
......
......@@ -800,15 +800,13 @@ class UtilsOrderService extends AppServiceBase {
async tmAccept(pobj) {// 2020 0828 lin 新增 ali商标交易 创建订单接口
try {
var actionBody = pobj.actionBody;
actionBody.channelItemCode = "sbjy"
actionBody.quantity = 1;
pobj.actionType = "getProductDetail";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemResult = await this.restPostUrl(pobj, url);
if (productItemResult.status != 0) {
return productItemResult;
}
productItemResult.data.price_list[0]["price"] = actionBody.price;
pobj.actionBody.product_info = productItemResult.data;
var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody);
if (verifyResult.status != 0) {
......@@ -821,32 +819,61 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "addOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard";
// console.log(pobj);
var result = await this.restPostUrl(pobj, reqUrl);
result.totalSum = actionBody.totalSum;
return result;
if(result) {
var result = {
"errorCode": "error",
"errorMsg": orderinfo.msg,
"module": { "orderId": "" },
"requestId": req.requestId,
"success": false
var tmResult = {
"errorCode": "OK",
"errorMsg": "操作成功",
"module": { "orderNumber": result.data.orderNo },
"requestId": pobj.requestId,
"success": true
}
return result;
console.log("utils",tmResult)
return tmResult;
}
} catch (e) {
var result = {
"errorCode": "error",
"errorMsg": e,
"module": { "orderNumber": "" },
"requestId": req.requestId,
"requestId": pobj.requestId,
"success": false
}
return result;
}
}
async tmRefuse(pobj) {// 2020 0828 lin 新增 ali商标交易 关闭订单接口
try {
var reqUrl = this.centerOrderUrl + "action/tmOrder/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
// 如果返回值正常
if(result.status == 0) {
var tmResult = {
"errorCode": "OK",
"errorMsg": "操作成功",
"requestId": pobj.requestId,
"success": true
}
return tmResult;
}
var tmResult = {
"errorCode": "error",
"errorMsg": result.msg,
"requestId": pobj.requestId,
"success": false
}
return tmResult;
} catch (e) {
var result = {
"ErrorCode": "error",
"ErrorMsg": e,
"Module": { "orderNumber": "" },
"RequestId": pobj.requestId,
"Success": false
}
return result;
}
}
}
module.exports = UtilsOrderService;
......@@ -248,7 +248,7 @@ module.exports = function (app) {
"getNeedListUser",
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention",
"tmAccept", "tmRefuse", "tmStatus"
"tmAccept", "tmStatus"
];
if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || "";
......
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