Commit 0739419f by 王勇飞

gyq

parent b7fb33ee
...@@ -14,6 +14,7 @@ class DeliverybillCtl extends CtlBase { ...@@ -14,6 +14,7 @@ class DeliverybillCtl extends CtlBase {
this.cacheService = system.getObject("service.bizchance.cacheinfoSve"); this.cacheService = system.getObject("service.bizchance.cacheinfoSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard"; this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
this.queueUrl = "http://192.168.1.128:4018/api/queueAction/producer/springBoard"; this.queueUrl = "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
this.wdyUrl = "http://192.168.1.113:4011/api/action/order/springBoard";
} }
/*根据用户id获取商机信息,分页获取*/ /*根据用户id获取商机信息,分页获取*/
...@@ -231,6 +232,8 @@ class DeliverybillCtl extends CtlBase { ...@@ -231,6 +232,8 @@ class DeliverybillCtl extends CtlBase {
var rs = await this.service.findInfoByDeliverCode(pobj)//先得到交付单详情 var rs = await this.service.findInfoByDeliverCode(pobj)//先得到交付单详情
if (rs && rs != 'undefined') { if (rs && rs != 'undefined') {
rs.delivery_info.startTime = pobj.baseInfo.startTime; rs.delivery_info.startTime = pobj.baseInfo.startTime;
var d = new Date(rs.delivery_info.startTime);
rs.delivery_info.endTime = this.oneYearPast(d, 1);//到期时间
//回传信息给庄冰,放队列 //回传信息给庄冰,放队列
var rc = system.getObject("util.execClient"); var rc = system.getObject("util.execClient");
var requrl = this.queueUrl; var requrl = this.queueUrl;
...@@ -251,7 +254,25 @@ class DeliverybillCtl extends CtlBase { ...@@ -251,7 +254,25 @@ class DeliverybillCtl extends CtlBase {
var j = JSON.parse(rtn.stdout); var j = JSON.parse(rtn.stdout);
console.log("RRRRRRRRRRRRRR"); console.log("RRRRRRRRRRRRRR");
console.log(JSON.stringify(j)); console.log(JSON.stringify(j));
if (j.status == 1) {
params = {
"actionType": "produceData",
"actionBody": {
"pushUrl": this.wdyUrl,
"actionType": "jftime",
"identifyCode": "ic-manage",
"messageBody": {
"orderNum": pobj.deliverNumber,//订单编码
"startTime": rs.delivery_info.startTime,
"endTime": rs.delivery_info.endTime
}
}
}
rtn = await rc.execPost(params, requrl);
var j1 = JSON.parse(rtn.stdout);
console.log("R1RRRRR1RR1RRRR1RR1");
console.log(JSON.stringify(j1));
if (j.status == 1 && j1.status == 1) {
//更新详情 //更新详情
var uarr = { var uarr = {
"deliverNumber": pobj.deliverNumber, "deliverNumber": pobj.deliverNumber,
...@@ -301,7 +322,26 @@ class DeliverybillCtl extends CtlBase { ...@@ -301,7 +322,26 @@ class DeliverybillCtl extends CtlBase {
var rtn = await rc.execPost(params, requrl); var rtn = await rc.execPost(params, requrl);
console.log("_____________________________" + rtn.stdout); console.log("_____________________________" + rtn.stdout);
var j = JSON.parse(rtn.stdout); var j = JSON.parse(rtn.stdout);
if (j.status == 1) {
var j1status = 1;
if (pobj.deliverStatus == "closed"){//退款
params = {
"actionType": "produceData",
"actionBody": {
"pushUrl": this.wdyUrl,
"actionType": "refundOrder",
"identifyCode": "ic-manage",
"messageBody": {
"orderNum": pobj.deliverNumber//订单编码
}
}
}
rtn = await rc.execPost(params, requrl);
console.log("_____________________________tuifei" + rtn.stdout);
var j1 = JSON.parse(rtn.stdout);
j1status = j1.status;
}
if (j.status == 1 && j1status == 1) {
await this.service.updateStatusByDeliverCode(pobj); await this.service.updateStatusByDeliverCode(pobj);
var pInfo = this.service.findInfoByDeliverCode(pobj); var pInfo = this.service.findInfoByDeliverCode(pobj);
if (pInfo) { if (pInfo) {
......
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