Commit 71200297 by 宋毅

tj

parent 4093ad78
...@@ -52,7 +52,7 @@ class TmOrderAPI extends APIBase { ...@@ -52,7 +52,7 @@ class TmOrderAPI extends APIBase {
var opResult = null; var opResult = null;
if (["subTmOrder", "getTmOrderList", "getTmOrderInfo", "getTmApplyInfo", "getTmNclList", "getNeedInfo", if (["subTmOrder", "getTmOrderList", "getTmOrderInfo", "getTmApplyInfo", "getTmNclList", "getNeedInfo",
"tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts", "tmConfirm", "updateTmInfo", "updateNclInfo", "updateContacts",
"updateCustomerInfo", "addOrderAndDelivery"].indexOf(action_type) >= 0) { "updateCustomerInfo", "addOrderAndDelivery", "updateOrderPayStatus"].indexOf(action_type) >= 0) {
if (!action_body.channelUserId) { if (!action_body.channelUserId) {
return system.getResult(null, "verify channelUserId is not empty"); return system.getResult(null, "verify channelUserId is not empty");
} }
...@@ -64,6 +64,11 @@ class TmOrderAPI extends APIBase { ...@@ -64,6 +64,11 @@ class TmOrderAPI extends APIBase {
break; break;
case "updateOrderPayStatus"://更新订单付款状态 case "updateOrderPayStatus"://更新订单付款状态
opResult = await this.orderSve.updateOrderPayStatus(action_body, pobj, req); opResult = await this.orderSve.updateOrderPayStatus(action_body, pobj, req);
if (opResult.status == 0) {
pobj.actionBody["deliveryOrderNo"] = opResult.data.deliveryOrderNo;
var url = this.pushFqbossDataUrl + "api/channelaccessApi/updateChannelPayStatus";
await this.pushData2(opResult, req, pobj, url);
}
break; break;
case "addOrderAndDelivery"://创建订单和交付单 case "addOrderAndDelivery"://创建订单和交付单
opResult = await this.orderSve.addOrderAndDelivery(action_body, pobj, req); opResult = await this.orderSve.addOrderAndDelivery(action_body, pobj, req);
...@@ -250,6 +255,7 @@ class TmOrderAPI extends APIBase { ...@@ -250,6 +255,7 @@ class TmOrderAPI extends APIBase {
var user = obj.user; var user = obj.user;
obj["channelUserId"] = obj.channelUserId; obj["channelUserId"] = obj.channelUserId;
obj["channelCode"] = pobj.actionProcess; obj["channelCode"] = pobj.actionProcess;
obj["appid"] = "2e787bbaacda4c6488b9fae58fff30ba";
var rtn = null; var rtn = null;
try { try {
var requestId = opResult.requestId || req.requestId; var requestId = opResult.requestId || req.requestId;
......
...@@ -21,6 +21,40 @@ class OrderTmProductDao extends Dao { ...@@ -21,6 +21,40 @@ class OrderTmProductDao extends Dao {
raw: true raw: true
}); });
} }
async getItemByNeedNoOrderNo(needNoOrderNo, appId, t) {
var sqlWhere = {
where: {
needNoOrderNo: needNoOrderNo,
app_id: appId
},
raw: true
};
if (t) {
sqlWhere.transaction = t;
}
sqlWhere.attributes = ["id",
"deliveryOrderNo",
"needNo",
"sourceOrderNo",
"tmName",
"tmType",
"tmFormType",
"nclOneCodes",
"deliveryStatus",
"picUrl",
"colorizedPicUrl",
"sywjUrl",
"gzwtsUrl",
"nclCount",
"smwjUrl",
"updateuser_id",
"updateuser",
"notes",
"nclOneCount"
];
return this.model.findOne(sqlWhere);
}
async getItemByChannelServiceNo(channelServiceNo, appId, t) { async getItemByChannelServiceNo(channelServiceNo, appId, t) {
var sqlWhere = { var sqlWhere = {
where: { where: {
......
...@@ -128,10 +128,14 @@ class OrderService extends ServiceBase { ...@@ -128,10 +128,14 @@ class OrderService extends ServiceBase {
async updateOrderPayStatus(action_body, pobj, req) { async updateOrderPayStatus(action_body, pobj, req) {
var payStatus = action_body.payStatus || "dfk"; var payStatus = action_body.payStatus || "dfk";
var self = this; var self = this;
var result = await self.ordertmproductDao.getItemByNeedNoOrderNo(action_body.needNoOrderNo, req.app.id, t);
if (result) {
return system.getResult(null, "data is empty");
}
return await this.db.transaction(async function (t) { return await this.db.transaction(async function (t) {
await self.dao.updateByWhere({ orderPayStatus: payStatus, buyerMoblie: action_body.buyerMoblie || "" }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t); await self.dao.updateByWhere({ orderPayStatus: payStatus, buyerMoblie: action_body.buyerMoblie || "" }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t);
await self.ordertmproductDao.updateByWhere({ payStatus: payStatus }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t); await self.ordertmproductDao.updateByWhere({ payStatus: payStatus }, { where: { needNoOrderNo: action_body.needNoOrderNo, app_id: req.app.id } }, t);
return system.getResultSuccess(); return system.getResultSuccess({ deliveryOrderNo: result.data.deliveryOrderNo });
}); });
} }
async op1688ChannelPushOrder(action_body, pobj, req) { async op1688ChannelPushOrder(action_body, pobj, req) {
...@@ -623,7 +627,7 @@ class OrderService extends ServiceBase { ...@@ -623,7 +627,7 @@ class OrderService extends ServiceBase {
* @param {*} pobj * @param {*} pobj
* @param {*} req * @param {*} req
*/ */
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 = "https://yunfuapi.gongsibao.com/crm/order/submit";//线上域名
......
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