Commit f91114fe by 宋毅

tj

parent 9fb13662
......@@ -223,6 +223,9 @@ class TmOrderAPI extends APIBase {
case "getProductListByTypeCode"://获取产品列表(根据父类产品编码获取)
opResult = await this.appProductSve.findByProductTypeCode(action_body);
break;
case "subGsbOrderInfo"://提交公司宝订单信息
opResult = await this.orderSve.gsbOrderInfo(pobj, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -12,8 +12,8 @@ class OrderService extends ServiceBase {
this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao");
this.customercontactsDao = system.getObject("db.dborder.customercontactsDao");
this.execClient = system.getObject("util.execClient");
this.fqReqUrl = "https://yunfuapi.gongsibao.com/crm/order/submit";//线上域名
// this.fqReqUrl = "https://yunfuapi-dev.gongsibao.com/crm/order/submit";//dev域名
this.fqReqUrl = "https://yunfuapi.gongsibao.com";//线上域名
// this.fqReqUrl = "https://yunfuapi-dev.gongsibao.com";//dev域名
}
async addOrderAndDelivery(action_body, pobj, req) {
......@@ -637,7 +637,7 @@ class OrderService extends ServiceBase {
async pushFqBusiness(pushType, item, pushServiceItemCode, pobj, req) {//推送商机
var rc = system.getObject("util.aliyunClient");
var rtn = null;
var reqUrl = this.fqReqUrl;
var reqUrl = this.fqReqUrl + "/crm/order/submit";
try {
var body = {
......@@ -657,7 +657,7 @@ class OrderService extends ServiceBase {
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/pushFqBusiness",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/pushFqBusiness",
content: "请求地址:" + reqUrl + ",参数:" + JSON.stringify(body) + ",返回结果:" + JSON.stringify(rtn),
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ信息",
......@@ -672,7 +672,7 @@ class OrderService extends ServiceBase {
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/pushFqBusiness",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/pushFqBusiness",
content: "error:" + e.stack,
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ出错",
......@@ -682,7 +682,7 @@ class OrderService extends ServiceBase {
async againPushFqBusiness(pobj, req) {//再次推送商机
var rc = system.getObject("util.aliyunClient");
var rtn = null;
var reqUrl = this.fqReqUrl;
var reqUrl = this.fqReqUrl + "/crm/order/submit";
var body = pobj.actionBody;
try {
......@@ -691,7 +691,7 @@ class OrderService extends ServiceBase {
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
content: "请求地址:" + reqUrl + ",参数:" + JSON.stringify(body) + ",返回结果:" + JSON.stringify(rtn),
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ信息--again",
......@@ -706,12 +706,49 @@ class OrderService extends ServiceBase {
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
content: "error:" + e.stack,
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ出错--again",
});
}
}
async gsbOrderInfo(pobj, req) {//公司宝官网订单
var rc = system.getObject("util.aliyunClient");
var rtn = null;
var reqUrl = this.fqReqUrl + "/dsc/order/add";
var body = pobj.actionBody.order_param || "";
if (!body) {
return system.getResult(null, "order_param is empty");
}
try {
rtn = await rc.post(reqUrl, body);
this.logCtl.info({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/gsbOrderInfo",
content: "请求地址:" + reqUrl + ",参数:" + JSON.stringify(body) + ",返回结果:" + JSON.stringify(rtn),
clientIp: pobj.clientIp,
optitle: "公司宝官网订单--gsbOrderInfo",
});
if (rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "公司宝官网订单失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + req.requestId + ",requestId=" + rtn.requestId);
}
return system.getResultSuccess(rtn.data, "订单下单成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
content: "error:" + e.stack,
clientIp: pobj.clientIp,
optitle: "公司宝官网订单出错--gsbOrderInfo",
});
}
}
}
module.exports = OrderService;
......@@ -556,8 +556,8 @@ class OrderTmProductService extends ServiceBase {
*/
async getTmOrderList(params, pobj, req) {//商标交付列表
var pageSize = Number(params.pageSize || 20);
var pageInde = Number(params.pageInde || 1);
var from = pageInde == 1 ? 0 : Number((pageInde - 1) * pageSize);
var pageIndex = Number(params.pageIndex || 1);
var from = pageIndex == 1 ? 0 : Number((pageIndex - 1) * pageSize);
if (pageSize > 50) {
pageSize = 50;
}
......
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