Commit e08a9709 by 宋毅

tj

parent f8c0d6e6
...@@ -59,6 +59,9 @@ class TmOrderAPI extends APIBase { ...@@ -59,6 +59,9 @@ class TmOrderAPI extends APIBase {
} }
switch (action_type) { switch (action_type) {
// sy // sy
case "againPushFqBusiness"://再次推送商机
opResult = await this.orderSve.againPushFqBusiness(pobj, req);
break;
case "updateOrderStatus"://更新订单状态 case "updateOrderStatus"://更新订单状态
opResult = await this.orderSve.updateOrderStatus(action_body, pobj, req); opResult = await this.orderSve.updateOrderStatus(action_body, pobj, req);
break; break;
...@@ -145,6 +148,10 @@ class TmOrderAPI extends APIBase { ...@@ -145,6 +148,10 @@ class TmOrderAPI extends APIBase {
case "getTmOrderList"://商标交付列表 case "getTmOrderList"://商标交付列表
opResult = await this.ordertmproductSve.getTmOrderList(action_body, pobj, req); opResult = await this.ordertmproductSve.getTmOrderList(action_body, pobj, req);
break; break;
case "getTmOrderListAdmin"://商标交付列表
action_body.getListType = "getTmOrderListAdmin";
opResult = await this.ordertmproductSve.getTmOrderList(action_body, pobj, req);
break;
case "getTmOrderInfo"://商标交付信息 case "getTmOrderInfo"://商标交付信息
opResult = await this.ordertmproductSve.getTmOrder(action_body); opResult = await this.ordertmproductSve.getTmOrder(action_body);
break; break;
......
...@@ -12,6 +12,8 @@ class OrderService extends ServiceBase { ...@@ -12,6 +12,8 @@ class OrderService extends ServiceBase {
this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao"); this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao");
this.customercontactsDao = system.getObject("db.dborder.customercontactsDao"); this.customercontactsDao = system.getObject("db.dborder.customercontactsDao");
this.execClient = system.getObject("util.execClient"); 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域名
} }
async addOrderAndDelivery(action_body, pobj, req) { async addOrderAndDelivery(action_body, pobj, req) {
...@@ -635,8 +637,7 @@ class OrderService extends ServiceBase { ...@@ -635,8 +637,7 @@ class OrderService extends ServiceBase {
async pushFqBusiness(pushType, item, pushServiceItemCode, pobj, req) {//推送商机 async pushFqBusiness(pushType, item, pushServiceItemCode, pobj, req) {//推送商机
var rc = system.getObject("util.aliyunClient"); var rc = system.getObject("util.aliyunClient");
var rtn = null; var rtn = null;
var reqUrl = "https://yunfuapi.gongsibao.com/crm/order/submit";//线上域名 var reqUrl = this.fqReqUrl;
// var reqUrl = "https://yunfuapi-dev.gongsibao.com/crm/order/submit";//域名
try { try {
var body = { var body = {
...@@ -678,5 +679,39 @@ class OrderService extends ServiceBase { ...@@ -678,5 +679,39 @@ class OrderService extends ServiceBase {
}); });
} }
} }
async againPushFqBusiness(pobj, req) {//再次推送商机
var rc = system.getObject("util.aliyunClient");
var rtn = null;
var reqUrl = this.fqReqUrl;
var body = pobj.actionBody;
try {
rtn = await rc.post(reqUrl, body);
this.logCtl.info({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
content: "请求地址:" + reqUrl + ",参数:" + JSON.stringify(body) + ",返回结果:" + JSON.stringify(rtn),
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ信息--again",
});
if (rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + req.requestId + ",requestId=" + rtn.requestId);
}
return system.getResultSuccess(null, "推送成功");
} catch (e) {
//日志记录
this.logCtl.error({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
content: "error:" + e.stack,
clientIp: pobj.clientIp,
optitle: "推送订单商机到FQ出错--again",
});
}
}
} }
module.exports = OrderService; module.exports = OrderService;
...@@ -574,8 +574,14 @@ class OrderTmProductService extends ServiceBase { ...@@ -574,8 +574,14 @@ class OrderTmProductService extends ServiceBase {
sqlCount += " and o.orderPayStatus=:orderPayStatus";; sqlCount += " and o.orderPayStatus=:orderPayStatus";;
paramWhere.orderPayStatus = "yfk"; paramWhere.orderPayStatus = "yfk";
} }
if (["syaify", "jd_613f2fd04340f"].indexOf(req.user.channelUserId) < 0) { if (req.user) {
if (req.user) { if (action_body.getListType && action_body.getListType == "getTmOrderListAdmin") {
if (["syaify", "jd_613f2fd04340f"].indexOf(req.user.channelUserId) < 0) {
sql += " and tm.createuser_id=:createuser_id";
sqlCount += " and tm.createuser_id=:createuser_id";
paramWhere.createuser_id = req.user.id;
}
} else {
sql += " and tm.createuser_id=:createuser_id"; sql += " and tm.createuser_id=:createuser_id";
sqlCount += " and tm.createuser_id=:createuser_id"; sqlCount += " and tm.createuser_id=:createuser_id";
paramWhere.createuser_id = req.user.id; paramWhere.createuser_id = req.user.id;
......
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