Commit 6b6a2444 by 王勇飞

gyq

parent 7f8c1a56
......@@ -146,8 +146,9 @@ class DeliverybillCtl extends CtlBase {
// 创建融易算服务实例
async insertInfo(mobj, qobj, req) {
console.log('mobj--------------------------------',mobj);
try {
var pobj = mobj.actionBody.messageBody;
var pobj = mobj.actionBody;
var cachestr = sha235(JSON.stringify(pobj));
var cacheInfo = await this.cacheManager["TxCache"].getCache(cachestr);
if (cacheInfo && cacheInfo != 'undefined') {
......@@ -178,12 +179,15 @@ class DeliverybillCtl extends CtlBase {
obj.source_name = "tencentCloud";
pobj.contactsPhone = pobj.contactMobile;
delete pobj.contactMobile;
// if (pobj.taxpayerType == 1) {
// pobj.taxpayerName = "generalTaxpayer";
// }
// else if (pobj.taxpayerType == 2) {
// pobj.taxpayerName = "smallScaleTaxpayer";
// }
if (pobj.taxpayerType == 1) {
pobj.taxpayerType = "generalTaxpayer";
pobj.taxpayerName = "一般纳税人";
}
else if (pobj.taxpayerType == 2) {
pobj.taxpayerType = "smallScaleTaxpayer";
pobj.taxpayerName = "小规模纳税人";
}
obj.delivery_info = pobj;
obj.biz_id = pobj.bizId;
var buInfo = await this.service.insertInfo(obj);
......@@ -209,7 +213,7 @@ class DeliverybillCtl extends CtlBase {
//更新融易算服务实例
async updateServer(mobj, qobj, req) {
try {
var pobj = mobj.actionBody.messageBody;
var pobj = mobj.actionBody;
var cachestr = sha235(JSON.stringify(pobj));
var cacheInfo = await this.cacheManager["TxCache"].getCache(cachestr);
if (cacheInfo && cacheInfo != 'undefined') {
......@@ -230,6 +234,15 @@ class DeliverybillCtl extends CtlBase {
delete pobj.companyBizType;
pobj.creditCode = pobj.uscc;
delete pobj.uscc;
if (pobj.taxpayerType == 1) {
pobj.taxpayerType = "generalTaxpayer";
pobj.taxpayerName = "一般纳税人";
}
else if (pobj.taxpayerType == 2) {
pobj.taxpayerType = "smallScaleTaxpayer";
pobj.taxpayerName = "小规模纳税人";
}
obj = {
"delivery_code": pobj.orderId + "_book",
"delivery_info": pobj,
......@@ -267,32 +280,36 @@ class DeliverybillCtl extends CtlBase {
return system.getResult(null, err.message)
}
}
async portog(){
console.log(settings.port);
}
}
module.exports = DeliverybillCtl;
// var task = new DeliverybillCtl();
// var obj = {
// "actionType": "produceData",
// "actionBody": {
// "pushUrl": "http://ic.com:8000/web/bizchance/deliverybillCtl",
// "actionType": "insertInfo",
// "identifyCode": "book-manage",
// "messageBody": {
// "requestId": "825da0a74432-738f-4bed-468d-d51aa880",
// "bizId": "2292748809",
// "userId": "24173452443103825",
// "orderId": "235184456620496",
// "areatype": "city",
// "area": "100010",
// "topOrgCode": "rong_yi_suan",
// "taxpayerType": 1,
// "contactMobile": "18510669321"
// }
// }
// }
// task.insertInfo(obj, {}, {}).then(d => {
// console.log(JSON.stringify(d));
// })
var task = new DeliverybillCtl();
var obj = {
"actionType": "produceData",
"actionBody": {
"pushUrl": "http://ic.com:8000/web/bizchance/deliverybillCtl",
"actionType": "insertInfo",
"identifyCode": "book-manage",
"messageBody": {
"requestId": "825da0a74432-738f-4bed-468d-d51aa880",
"bizId": "2292748809",
"userId": "24173452443103825",
"orderId": "235184456620496",
"areatype": "city",
"area": "100010",
"topOrgCode": "rong_yi_suan",
"taxpayerType": 1,
"contactMobile": "18510669321"
}
}
}
task.portog().then(d => {
console.log(JSON.stringify(d));
})
// var obj = {
// "actionType": "produceData",
......
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