Commit 5b89f153 by 王勇飞

add PAID status for deliver

parent 9a789435
...@@ -213,11 +213,15 @@ class AliHandler { ...@@ -213,11 +213,15 @@ class AliHandler {
// } // }
let rc = system.getObject("util.execClient"); let rc = system.getObject("util.execClient");
let obj = await this.actionBodyHandler(datajson.actionBody); let obj = await this.actionBodyHandler(datajson.actionBody);
let requrl = this.icUrl + "/deliverybillCtl/dealAliDeliveryInfo";
// var bizurl = this.icUrl + "/bizoptCtl/updateStatusByDemandCode";
//渠道名称和渠道编码 //渠道名称和渠道编码
obj.channelSource = channelobj.name; obj.channelSource = channelobj.name;
obj.channelNumber = channelobj.code; obj.channelNumber = channelobj.code;
//分配业务员
//如果订单状态为已支付
if (datajson.actionBody.needsolution.status && datajson.actionBody.needsolution.status == "PAID") {
//查询业务员信息并填充到obj
if (datajson.actionBody.needsolution.salesmanInfo.salesmanChannelId) { if (datajson.actionBody.needsolution.salesmanInfo.salesmanChannelId) {
//去数据库查询该业务员信息 //去数据库查询该业务员信息
try { try {
...@@ -242,9 +246,6 @@ class AliHandler { ...@@ -242,9 +246,6 @@ class AliHandler {
console.log("分配交付员失败."); console.log("分配交付员失败.");
} }
let requrl = this.icUrl + "/deliverybillCtl/dealAliDeliveryInfo";
// var bizurl = this.icUrl + "/bizoptCtl/updateStatusByDemandCode";
if (deliveryInfo && deliveryInfo != 'undefined') { if (deliveryInfo && deliveryInfo != 'undefined') {
obj.clerkOpcode = deliveryInfo.opath;//交付员opcode obj.clerkOpcode = deliveryInfo.opath;//交付员opcode
obj.clerkId = deliveryInfo.userId;//交付员id obj.clerkId = deliveryInfo.userId;//交付员id
...@@ -254,13 +255,7 @@ class AliHandler { ...@@ -254,13 +255,7 @@ class AliHandler {
// obj.servicerCode = deliveryInfo.compId; // obj.servicerCode = deliveryInfo.compId;
} }
console.log("推送数据oj: " + JSON.stringify(obj)); //异步更新需求状态 channelNeedNo
var rtn = await rc.execPost3({ "d": obj }, requrl);
console.log("pushOrderDelivery插入数据成功---------------------------------" + rtn.stdout);
let cacheDeliveryInfo = await this.cacheManager["AliCache"].cache(cachestr, JSON.stringify({ cachestr: cachestr }), 180);
console.log("交付单缓存信息: " + JSON.stringify(cacheDeliveryInfo));
// 更新需求状态 channelNeedNo
if (datajson.actionBody && datajson.actionBody.channelNeedNo) { if (datajson.actionBody && datajson.actionBody.channelNeedNo) {
var stau = { var stau = {
"businessMode": datajson.actionBody.channelNeedNo, "businessMode": datajson.actionBody.channelNeedNo,
...@@ -268,8 +263,13 @@ class AliHandler { ...@@ -268,8 +263,13 @@ class AliHandler {
} }
rc.execPost3({ "d": stau }, this.icUrl + "/bizoptCtl/updateStatusByDemandCode");//更新商机状态为已完成 rc.execPost3({ "d": stau }, this.icUrl + "/bizoptCtl/updateStatusByDemandCode");//更新商机状态为已完成
} }
}
console.log("推送数据obj: " + JSON.stringify(obj));
var rtn = await rc.execPost3({ "d": obj }, requrl);
console.log("pushOrderDelivery插入数据成功---------------------------------" + rtn.stdout);
let cacheDeliveryInfo = await this.cacheManager["AliCache"].cache(cachestr, JSON.stringify({ cachestr: cachestr }), 180);
console.log("交付单缓存信息: " + JSON.stringify(cacheDeliveryInfo));
return { return {
"status": 1, //1代表成功,否则失败 "status": 1, //1代表成功,否则失败
"msg": "", "msg": "",
...@@ -422,9 +422,12 @@ class AliHandler { ...@@ -422,9 +422,12 @@ class AliHandler {
obj.skuCode = data.skuCode; obj.skuCode = data.skuCode;
} }
if (data.needsolution.status) { //交付单状态码 if (data.needsolution.status) { //交付单状态码
if (data.needsolution.status = "USER_UPLOADED") { if (data.needsolution.status = "PAID") {//已支付
obj.deliverStatus = "received"; obj.deliverStatus = "received";
} }
if (data.needsolution.status = "USER_UPLOADED") {//已上传
obj.deliverStatus = "collecting";
}
} }
if (data.needsolution.customerRemark) { //状态原因 if (data.needsolution.customerRemark) { //状态原因
obj.statusReason = data.needsolution.customerRemark; obj.statusReason = data.needsolution.customerRemark;
......
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