Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
79bbf128
Commit
79bbf128
authored
Aug 26, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tx-fi-tax' of gitlab.gongsibao.com:jiangyong/zhichan into tx-fi-tax
parents
30d72f88
07446d4b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
305 deletions
+83
-305
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
+74
-62
tx-fi-tax/app/base/db/impl/bizchance/deliverybillDao.js
+6
-115
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+3
-128
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
79bbf128
...
...
@@ -145,10 +145,9 @@ class DeliverybillCtl extends CtlBase {
}
// 创建融易算服务实例
async
insertInfo
(
obj
,
qobj
,
req
)
{
console
.
log
(
"GGGGGGG----------------------------------------------"
+
JSON
.
stringify
(
obj
));
async
insertInfo
(
mobj
,
qobj
,
req
)
{
try
{
var
pobj
=
obj
.
actionBody
.
messageBody
;
var
pobj
=
m
obj
.
actionBody
.
messageBody
;
var
cachestr
=
sha235
(
JSON
.
stringify
(
pobj
));
var
cacheInfo
=
await
this
.
cacheManager
[
"TxCache"
].
getCache
(
cachestr
);
if
(
cacheInfo
&&
cacheInfo
!=
'undefined'
)
{
...
...
@@ -158,31 +157,36 @@ class DeliverybillCtl extends CtlBase {
"data"
:
""
,
"requestId"
:
""
}
}
}
else
{
pobj
.
orderId
=
pobj
.
orderId
+
"_book"
;
pobj
.
contactsPhone
=
pobj
.
contactsMobile
;
pobj
.
product_code
=
"bookkeeping"
;
pobj
.
product_name
=
"代帐服务"
;
pobj
.
delivery_status
=
"received"
;
pobj
.
facilitator_id
=
"10"
;
pobj
.
facilitator_name
=
"公司宝"
;
pobj
.
source_number
=
"tx"
;
pobj
.
source_name
=
"tencentCloud"
;
pobj
.
taxpayerName
=
pobj
.
taxpayerType
;
if
(
pobj
.
taxpayerType
==
1
){
pobj
.
taxpayerType
=
"generalTaxpayer"
;
}
else
if
(
pobj
.
taxpayerType
==
2
){
pobj
.
taxpayerType
=
"smallScaleTaxpayer"
;
}
if
(
pobj
.
solutionBizId
){
var
scheme
=
await
this
.
fitaxschemeService
.
findInfoByBizid
({
"bizId"
:
pobj
.
solutionBizId
});
if
(
scheme
){
var
obj
=
{};
obj
.
delivery_code
=
pobj
.
orderId
+
"_book"
;
obj
.
source_number
=
"tx"
;
if
(
pobj
.
solutionBizId
)
{
obj
.
scheme_number
=
pobj
.
solutionBizId
;
var
scheme
=
await
this
.
fitaxschemeService
.
findInfoByBizid
({
"bizId"
:
pobj
.
solutionBizId
});
if
(
scheme
)
{
pobj
.
demand_code
=
scheme
.
demand_code
;
}
}
var
buInfo
=
await
this
.
service
.
insertInfo
(
pobj
);
obj
.
product_code
=
"bookkeeping"
;
obj
.
product_name
=
"代帐服务"
;
obj
.
service_address
=
pobj
.
area
;
obj
.
delivery_status
=
"received"
;
obj
.
facilitator_id
=
"10"
;
obj
.
facilitator_name
=
"公司宝"
;
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";
// }
obj
.
delivery_info
=
pobj
;
obj
.
biz_id
=
pobj
.
bizId
;
var
buInfo
=
await
this
.
service
.
insertInfo
(
obj
);
if
(
buInfo
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
return
{
...
...
@@ -191,7 +195,7 @@ class DeliverybillCtl extends CtlBase {
"data"
:
buInfo
,
"requestId"
:
""
}
}
}
else
{
return
system
.
getResultFail
(
buInfo
);
}
...
...
@@ -203,12 +207,11 @@ class DeliverybillCtl extends CtlBase {
}
//更新融易算服务实例
async
updateServer
(
obj
,
qobj
,
req
)
{
async
updateServer
(
m
obj
,
qobj
,
req
)
{
try
{
var
pobj
=
obj
.
actionBody
.
messageBody
;
var
pobj
=
m
obj
.
actionBody
.
messageBody
;
var
cachestr
=
sha235
(
JSON
.
stringify
(
pobj
));
var
cacheInfo
=
await
this
.
cacheManager
[
"TxCache"
].
getCache
(
cachestr
);
var
cacheInfo
;
if
(
cacheInfo
&&
cacheInfo
!=
'undefined'
)
{
return
{
"status"
:
1
,
//1代表成功,否则失败
...
...
@@ -217,31 +220,22 @@ class DeliverybillCtl extends CtlBase {
"requestId"
:
""
}
}
else
{
if
(
!
pobj
.
requestId
||
pobj
.
requestId
==
'undefined'
)
{
throw
new
Error
(
"requestId 不能为空"
);
}
if
(
!
pobj
.
bizId
||
pobj
.
bizId
==
'undefined'
)
{
throw
new
Error
(
"bizId 不能为空"
);
}
if
(
!
pobj
.
orderId
||
pobj
.
orderId
==
'undefined'
)
{
throw
new
Error
(
"orderId 不能为空"
);
if
(
pobj
.
contactMobile
&&
pobj
.
contactMobile
!=
'undefined'
)
{
pobj
.
contactsPhone
=
pobj
.
contactMobile
;
delete
pobj
.
contactMobile
;
}
if
(
!
pobj
.
topOrgCode
||
pobj
.
topOrgCode
==
'undefined'
)
{
throw
new
Error
(
"topOrgCode 不能为空"
);
}
if
(
!
pobj
.
companyName
||
pobj
.
companyName
==
'undefined'
)
{
throw
new
Error
(
"companyName 不能为空"
);
}
if
(
!
pobj
.
contactName
||
pobj
.
contactName
==
'undefined'
)
{
throw
new
Error
(
"contactName 不能为空"
);
}
if
(
!
pobj
.
companyBizType
||
pobj
.
companyBizType
==
'undefined'
)
{
throw
new
Error
(
"companyBizType 不能为空"
);
}
if
(
!
pobj
.
uscc
||
pobj
.
uscc
==
'undefined'
)
{
throw
new
Error
(
"uscc 不能为空"
);
}
const
rs
=
await
this
.
service
.
updateServer
(
pobj
);
pobj
.
contactsName
=
pobj
.
contactName
;
delete
pobj
.
contactName
;
pobj
.
companyType
=
pobj
.
companyBizType
;
delete
pobj
.
companyBizType
;
pobj
.
creditCode
=
pobj
.
uscc
;
delete
pobj
.
uscc
;
obj
=
{
"delivery_code"
:
pobj
.
orderId
+
"_book"
,
"delivery_info"
:
pobj
,
"biz_id"
:
pobj
.
bizId
};
const
rs
=
await
this
.
service
.
updateServer
(
obj
);
if
(
rs
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
return
{
...
...
@@ -284,23 +278,41 @@ module.exports = DeliverybillCtl;
// "actionType": "insertInfo",
// "identifyCode": "book-manage",
// "messageBody": {
// "requestId": "825da0a74432-738f-4bed-b48d-d51aa808",
// "bizId": "5892748825",
// "contactsPhone": "18510669321",
// "userId": "10973452443103825",
// "orderId": "341184456620496_book",
// "requestId": "825da0a74432-738f-4bed-468d-d51aa880",
// "bizId": "2292748809",
// "userId": "24173452443103825",
// "orderId": "235184456620496",
// "areatype": "city",
// "area": "100010",
// "topOrgCode": "rong_yi_suan",
// "taxpayerType": 1,
// "product_code": "bookkeeping",
// "product_name": "代账服务",
// "service_address": "110100",
// "delivery_status": "waituserconfirm",
// "facilitator_id": "10"
// "contactMobile": "18510669321"
// }
// }
// }
// task.insertInfo(obj, {}, {}).then(d => {
// console.log(JSON.stringify(d));
// })
// 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",
// "orderId": "235184456620496",
// "companyName": "北京融易算",
// "contactName": "JAMES7",
// "taxpayerType": 5,
// "contactMobile": "18510669367",
// "companyBizType": 1,
// "uscc": "911101053516460817K"
// }
// }
// }
// task.updateServer(obj, {}, {}).then(d => {
// console.log(JSON.stringify(d));
// })
tx-fi-tax/app/base/db/impl/bizchance/deliverybillDao.js
View file @
79bbf128
...
...
@@ -109,126 +109,17 @@ class DeliverybillDao extends Dao {
}
async
insertInfo
(
qobj
,
t
)
{
var
obj
=
{
"delivery_code"
:
qobj
.
orderId
,
"product_code"
:
qobj
.
product_code
,
"product_name"
:
qobj
.
product_name
,
"service_address"
:
qobj
.
area
,
"delivery_status"
:
qobj
.
delivery_status
,
"facilitator_id"
:
qobj
.
facilitator_id
,
"biz_id"
:
qobj
.
bizId
};
// source_number
if
(
qobj
.
source_number
&&
qobj
.
source_number
!=
'undefined'
)
{
obj
.
source_number
=
qobj
.
source_number
;
delete
qobj
.
source_number
;
}
// demand_code
if
(
qobj
.
demand_code
&&
qobj
.
demand_code
!=
'undefined'
)
{
obj
.
demand_code
=
qobj
.
demand_code
;
delete
qobj
.
demand_code
;
}
// sku_code
if
(
qobj
.
sku_code
&&
qobj
.
sku_code
!=
'undefined'
)
{
obj
.
sku_code
=
qobj
.
sku_code
;
delete
qobj
.
sku_code
;
}
// scheme_number
if
(
qobj
.
solutionBizId
&&
qobj
.
solutionBizId
!=
'undefined'
)
{
obj
.
scheme_number
=
qobj
.
solutionBizId
;
delete
qobj
.
solutionBizId
;
}
// selling_price
if
(
qobj
.
selling_price
&&
qobj
.
selling_price
!=
'undefined'
)
{
obj
.
selling_price
=
qobj
.
selling_price
;
delete
qobj
.
selling_price
;
}
// cost_price
if
(
qobj
.
cost_price
&&
qobj
.
cost_price
!=
'undefined'
)
{
obj
.
cost_price
=
qobj
.
cost_price
;
delete
qobj
.
cost_price
;
}
// close_reason
if
(
qobj
.
close_reason
&&
qobj
.
close_reason
!=
'undefined'
)
{
obj
.
close_reason
=
qobj
.
close_reason
;
delete
qobj
.
close_reason
;
}
// facilitator_name
if
(
qobj
.
facilitator_name
&&
qobj
.
facilitator_name
!=
'undefined'
)
{
obj
.
facilitator_name
=
qobj
.
facilitator_name
;
delete
qobj
.
facilitator_name
;
}
// salesman_opcode
if
(
qobj
.
salesman_opcode
&&
qobj
.
salesman_opcode
!=
'undefined'
)
{
obj
.
salesman_opcode
=
qobj
.
salesman_opcode
;
delete
qobj
.
salesman_opcode
;
}
// salesman_id
if
(
qobj
.
salesman_id
&&
qobj
.
salesman_id
!=
'undefined'
)
{
obj
.
salesman_id
=
qobj
.
salesman_id
;
delete
qobj
.
salesman_id
;
}
// salesman_name
if
(
qobj
.
salesman_name
&&
qobj
.
salesman_name
!=
'undefined'
)
{
obj
.
salesman_name
=
qobj
.
salesman_name
;
delete
qobj
.
salesman_name
;
}
// salesman_phone
if
(
qobj
.
salesman_phone
&&
qobj
.
salesman_phone
!=
'undefined'
)
{
obj
.
salesman_phone
=
qobj
.
salesman_phone
;
delete
qobj
.
salesman_phone
;
}
// source_name
if
(
qobj
.
source_name
&&
qobj
.
source_name
!=
'undefined'
)
{
obj
.
source_name
=
qobj
.
source_name
;
delete
qobj
.
source_name
;
}
// master_source_number
if
(
qobj
.
master_source_number
&&
qobj
.
master_source_number
!=
'undefined'
)
{
obj
.
master_source_number
=
qobj
.
master_source_number
;
delete
qobj
.
master_source_number
;
}
// settle_status
if
(
qobj
.
settle_status
&&
qobj
.
settle_status
!=
'undefined'
)
{
obj
.
settle_status
=
qobj
.
settle_status
;
delete
qobj
.
settle_status
;
}
// settlebill_id
if
(
qobj
.
settlebill_id
&&
qobj
.
settlebill_id
!=
'undefined'
)
{
obj
.
settlebill_id
=
qobj
.
settlebill_id
;
delete
qobj
.
settlebill_id
;
}
// delivery_man_id
if
(
qobj
.
delivery_man_id
&&
qobj
.
delivery_man_id
!=
'undefined'
)
{
obj
.
delivery_man_id
=
qobj
.
delivery_man_id
;
delete
qobj
.
delivery_man_id
;
}
// delivery_man_name
if
(
qobj
.
delivery_man_name
&&
qobj
.
delivery_man_name
!=
'undefined'
)
{
obj
.
delivery_man_name
=
qobj
.
delivery_man_name
;
delete
qobj
.
delivery_man_name
;
}
// delivery_man_opcode
if
(
qobj
.
delivery_man_opcode
&&
qobj
.
delivery_man_opcode
!=
'undefined'
)
{
obj
.
delivery_man_opcode
=
qobj
.
delivery_man_opcode
;
delete
qobj
.
delivery_man_opcode
;
}
delete
qobj
.
orderId
;
delete
qobj
.
product_code
;
delete
qobj
.
product_name
;
delete
qobj
.
service_address
;
delete
qobj
.
delivery_status
;
delete
qobj
.
facilitator_id
;
obj
.
delivery_info
=
qobj
;
return
await
this
.
create
(
obj
,
t
);
return
await
this
.
create
(
qobj
,
t
);
}
async
updateServer
(
qobj
,
whereobj
,
t
)
{
return
await
this
.
updateByWhere
(
qobj
,
whereobj
,
t
);
async
updateServer
(
qobj
,
t
)
{
var
setobj
=
{
"delivery_info"
:
qobj
.
delivery_info
};
var
whereobj
=
{
"delivery_code"
:
qobj
.
delivery_code
,
"biz_id"
:
qobj
.
biz_id
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
async
findOneByDeliveryCodeAndBizId
(
qobj
)
{
var
qcwhere
=
{
"delivery_code"
:
qobj
.
orderId
,
"biz_id"
:
qobj
.
bizI
d
};
var
qcwhere
=
{
"delivery_code"
:
qobj
.
delivery_code
,
"biz_id"
:
qobj
.
biz_i
d
};
return
await
this
.
findOne
(
qcwhere
);
}
/**
...
...
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
79bbf128
...
...
@@ -245,137 +245,12 @@ class DeliverybillService extends ServiceBase {
async
updateServer
(
qobj
)
{
var
self
=
this
;
var
bill
=
await
self
.
dao
.
findOneByDeliveryCodeAndBizId
(
qobj
);
var
obj
=
{};
var
whereobj
=
{
"delivery_code"
:
qobj
.
orderId
,
"biz_id"
:
qobj
.
bizId
};
// source_number
if
(
qobj
.
source_number
&&
qobj
.
source_number
!=
'undefined'
)
{
obj
.
source_number
=
qobj
.
source_number
;
delete
qobj
.
source_number
;
}
// demand_code
if
(
qobj
.
demand_code
&&
qobj
.
demand_code
!=
'undefined'
)
{
obj
.
demand_code
=
qobj
.
demand_code
;
delete
qobj
.
demand_code
;
}
// sku_code
if
(
qobj
.
sku_code
&&
qobj
.
sku_code
!=
'undefined'
)
{
obj
.
sku_code
=
qobj
.
sku_code
;
delete
qobj
.
sku_code
;
}
// scheme_number
if
(
qobj
.
solutionBizId
&&
qobj
.
solutionBizId
!=
'undefined'
)
{
obj
.
scheme_number
=
qobj
.
solutionBizId
;
delete
qobj
.
solutionBizId
;
}
// product_code
if
(
qobj
.
product_code
&&
qobj
.
product_code
!=
'undefined'
)
{
obj
.
product_code
=
qobj
.
product_code
;
delete
qobj
.
product_code
;
}
// product_name
if
(
qobj
.
product_name
&&
qobj
.
product_name
!=
'undefined'
)
{
obj
.
product_name
=
qobj
.
product_name
;
delete
qobj
.
product_name
;
}
// service_address
if
(
qobj
.
service_address
&&
qobj
.
service_address
!=
'undefined'
)
{
obj
.
service_address
=
qobj
.
service_address
;
delete
qobj
.
service_address
;
}
// delivery_status
if
(
qobj
.
delivery_status
&&
qobj
.
delivery_status
!=
'undefined'
)
{
obj
.
delivery_status
=
qobj
.
delivery_status
;
delete
qobj
.
delivery_status
;
}
// selling_price
if
(
qobj
.
selling_price
&&
qobj
.
selling_price
!=
'undefined'
)
{
obj
.
selling_price
=
qobj
.
selling_price
;
delete
qobj
.
selling_price
;
}
// cost_price
if
(
qobj
.
cost_price
&&
qobj
.
cost_price
!=
'undefined'
)
{
obj
.
cost_price
=
qobj
.
cost_price
;
delete
qobj
.
cost_price
;
}
// close_reason
if
(
qobj
.
close_reason
&&
qobj
.
close_reason
!=
'undefined'
)
{
obj
.
close_reason
=
qobj
.
close_reason
;
delete
qobj
.
close_reason
;
}
// facilitator_id
if
(
qobj
.
facilitator_id
&&
qobj
.
facilitator_id
!=
'undefined'
)
{
obj
.
facilitator_id
=
qobj
.
facilitator_id
;
delete
qobj
.
facilitator_id
;
}
// facilitator_name
if
(
qobj
.
facilitator_name
&&
qobj
.
facilitator_name
!=
'undefined'
)
{
obj
.
facilitator_name
=
qobj
.
facilitator_name
;
delete
qobj
.
facilitator_name
;
}
// salesman_opcode
if
(
qobj
.
salesman_opcode
&&
qobj
.
salesman_opcode
!=
'undefined'
)
{
obj
.
salesman_opcode
=
qobj
.
salesman_opcode
;
delete
qobj
.
salesman_opcode
;
}
// salesman_id
if
(
qobj
.
salesman_id
&&
qobj
.
salesman_id
!=
'undefined'
)
{
obj
.
salesman_id
=
qobj
.
salesman_id
;
delete
qobj
.
salesman_id
;
}
// salesman_name
if
(
qobj
.
salesman_name
&&
qobj
.
salesman_name
!=
'undefined'
)
{
obj
.
salesman_name
=
qobj
.
salesman_name
;
delete
qobj
.
salesman_name
;
}
// salesman_phone
if
(
qobj
.
salesman_phone
&&
qobj
.
salesman_phone
!=
'undefined'
)
{
obj
.
salesman_phone
=
qobj
.
salesman_phone
;
delete
qobj
.
salesman_phone
;
}
// source_name
if
(
qobj
.
source_name
&&
qobj
.
source_name
!=
'undefined'
)
{
obj
.
source_name
=
qobj
.
source_name
;
delete
qobj
.
source_name
;
}
// master_source_number
if
(
qobj
.
master_source_number
&&
qobj
.
master_source_number
!=
'undefined'
)
{
obj
.
master_source_number
=
qobj
.
master_source_number
;
delete
qobj
.
master_source_number
;
}
// settle_status
if
(
qobj
.
settle_status
&&
qobj
.
settle_status
!=
'undefined'
)
{
obj
.
settle_status
=
qobj
.
settle_status
;
delete
qobj
.
settle_status
;
}
// settlebill_id
if
(
qobj
.
settlebill_id
&&
qobj
.
settlebill_id
!=
'undefined'
)
{
obj
.
settlebill_id
=
qobj
.
settlebill_id
;
delete
qobj
.
settlebill_id
;
}
// delivery_man_id
if
(
qobj
.
delivery_man_id
&&
qobj
.
delivery_man_id
!=
'undefined'
)
{
obj
.
delivery_man_id
=
qobj
.
delivery_man_id
;
delete
qobj
.
delivery_man_id
;
}
// delivery_man_name
if
(
qobj
.
delivery_man_name
&&
qobj
.
delivery_man_name
!=
'undefined'
)
{
obj
.
delivery_man_name
=
qobj
.
delivery_man_name
;
delete
qobj
.
delivery_man_name
;
}
// delivery_man_opcode
if
(
qobj
.
delivery_man_opcode
&&
qobj
.
delivery_man_opcode
!=
'undefined'
)
{
obj
.
delivery_man_opcode
=
qobj
.
delivery_man_opcode
;
delete
qobj
.
delivery_man_opcode
;
}
delete
qobj
.
orderId
;
obj
.
delivery_info
=
JSON
.
parse
((
JSON
.
stringify
(
bill
.
delivery_info
)
+
JSON
.
stringify
(
qobj
)).
replace
(
/}{/
,
','
));
qobj
.
delivery_info
=
JSON
.
parse
((
JSON
.
stringify
(
bill
.
delivery_info
)
+
JSON
.
stringify
(
qobj
.
delivery_info
)).
replace
(
/}{/
,
','
));
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateServer
(
obj
,
where
obj
,
t
);
return
await
self
.
dao
.
updateServer
(
q
obj
,
t
);
});
}
//根据bizId查询deliverybill表中的所有信息
async
getInfo
(
pobj
)
{
let
result
=
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment