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
913b9a15
Commit
913b9a15
authored
Jun 20, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
18595489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
155 additions
and
35 deletions
+155
-35
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+154
-34
center-manage/app/config/routes/api.js
+1
-1
No files found.
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
913b9a15
...
...
@@ -13,31 +13,26 @@ class TxHandler {
//console.log("put in queue",datajson)
try
{
//获取分配的业务员信息
//var salesmanInfo = await this.userService.addChance(datajson);
var
salesmanInfo
=
{
salesmanOpcode
=
"1"
,
salesmanId
=
"1"
,
clerkName
=
"zhangsan"
,
clerkPhone
=
"11111"
}
var
salesmanInfo
=
await
this
.
userService
.
getBizUserForBizChance
(
datajson
.
actionBody
.
contactsMoblie
,
datajson
.
actionBody
.
servicerName
,
datajson
.
actionBody
.
consultTypeName
);
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/bizoptCtl/insertInfo"
;
var
params
=
{
"businessMode"
:
datajson
.
needNum
,
"businessType"
:
datajson
.
consultType
,
"servicerCode"
:
datajson
.
servicerCode
,
"servicerName"
:
datajson
.
servicerName
,
"serviceCode"
:
datajson
.
regionId
,
"serviceName"
:
datajson
.
regionName
,
"contactsName"
:
datajson
.
contactsName
,
"contactsPhone"
:
datajson
.
contactsMoblie
,
"businessType"
:
datajson
.
consultType
,
"businessName"
:
datajson
.
consultTypeName
,
"salesmanOpcode"
:
salesmanInfo
.
salesmanOpcode
,
"salesmanId"
:
salesmanInfo
.
salesmanId
,
"clerkName"
:
salesmanInfo
.
clerkName
,
"clerkPhone"
:
salesmanInfo
.
clerkPhone
}
"businessMode"
:
datajson
.
actionBody
.
needNum
,
"servicerCode"
:
datajson
.
actionBody
.
servicerCode
,
"servicerName"
:
datajson
.
actionBody
.
servicerName
,
"serviceCode"
:
datajson
.
actionBody
.
regionId
,
"serviceName"
:
datajson
.
actionBody
.
regionName
,
"contactsName"
:
datajson
.
actionBody
.
contactsName
,
"contactsPhone"
:
datajson
.
actionBody
.
contactsMoblie
,
"businessType"
:
datajson
.
actionBody
.
consultType
,
"businessName"
:
datajson
.
actionBody
.
consultTypeName
}
if
(
salesmanInfo
&&
salesmanInfo
!=
'undefined'
){
params
.
salesmanOpcode
=
salesmanInfo
.
opath
;
params
.
salesmanId
=
salesmanInfo
.
userId
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkPhone
=
salesmanInfo
.
mobile
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
return
j
;
...
...
@@ -54,9 +49,9 @@ class TxHandler {
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/schemeCtl/updateStatusByDemandCode"
;
var
params
=
{
"businessMode"
:
datajson
.
needNum
,
"businessMode"
:
datajson
.
actionBody
.
needNum
,
"currentStatus"
:
"已退回"
,
"statusReason"
:
datajson
.
desc
"statusReason"
:
datajson
.
actionBody
.
refusalContent
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
...
...
@@ -82,20 +77,114 @@ class TxHandler {
async
orderSubmit
(
datajson
){
try
{
//获取分配的业务员信息
//var salesmanInfo = await this.userService.addChance(datajson);
var
salesmanInfo
=
{
salesmanOpcode
=
"1"
,
salesmanId
=
"1"
,
clerkName
=
"zhangsan"
,
clerkPhone
=
"11111"
,
skuCode
=
"1111"
,
costPrice
=
"2000"
}
var
salesmanInfo
=
await
this
.
userService
.
getBizUserForDelivery
(
datajson
.
actionBody
.
contactsMoblie
,
datajson
.
actionBody
.
servicerName
,
datajson
.
actionBody
.
productTypeName
,
datajson
.
actionBody
.
skucode
);
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/deliverybillCtl/insertInfo"
;
var
params
=
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
,
"servicerCode"
:
datajson
.
actionBody
.
servicerCode
,
"servicerName"
:
datajson
.
actionBody
.
servicerName
,
"serviceCode"
:
datajson
.
actionBody
.
regionId
,
"serviceName"
:
datajson
.
actionBody
.
regionName
,
"businessType"
:
datajson
.
actionBody
.
consultType
,
"businessName"
:
datajson
.
actionBody
.
consultTypeName
,
"skuCode"
:
datajson
.
actionBody
.
skucode
,
"deliveryInfo"
:{
"txOrderNum"
:
datajson
.
actionBody
.
txOrderNum
,
"isAdviser"
:
"已分配"
,
//是否分配顾问
"contactsName"
:
datajson
.
actionBody
.
contactsName
,
"contactsPhone"
:
datajson
.
actionBody
.
contactsMoblie
,
"payStatus"
:
"待支付"
},
"companyInfo"
:{}
}
if
(
salesmanInfo
&&
salesmanInfo
!=
'undefined'
){
params
.
salesmanOpcode
=
salesmanInfo
.
opath
;
params
.
salesmanId
=
salesmanInfo
.
userId
;
params
.
clerkName
=
salesmanInfo
.
userName
;
params
.
clerkPhone
=
salesmanInfo
.
mobile
;
params
.
costPrice
=
salesmanInfo
.
cost
}
if
(
datajson
.
actionBody
.
order_snapshot
.
needNum
&&
datajson
.
actionBody
.
order_snapshot
.
needNum
!=
'undefined'
){
params
.
businessMode
=
datajson
.
actionBody
.
order_snapshot
.
needNum
;
//商机编号
}
if
(
datajson
.
actionBody
.
order_snapshot
.
sellingPrice
&&
datajson
.
actionBody
.
order_snapshot
.
sellingPrice
!=
'undefined'
){
params
.
sellingPrice
=
datajson
.
actionBody
.
order_snapshot
.
sellingPrice
;
//价格
}
if
(
datajson
.
actionBody
.
order_snapshot
.
channelSource
&&
datajson
.
actionBody
.
order_snapshot
.
channelSource
!=
'undefined'
){
params
.
channelSource
=
datajson
.
actionBody
.
order_snapshot
.
channelSource
;
//渠道名称
}
if
(
datajson
.
actionBody
.
order_snapshot
.
channelNumber
&&
datajson
.
actionBody
.
order_snapshot
.
channelNumber
!=
'undefined'
){
params
.
channelNumber
=
datajson
.
actionBody
.
order_snapshot
.
channelNumber
;
//渠道编码
}
if
(
datajson
.
actionBody
.
order_snapshot
.
isWhether
&&
datajson
.
actionBody
.
order_snapshot
.
isWhether
!=
'undefined'
){
params
.
deliveryInfo
.
isWhether
=
datajson
.
actionBody
.
order_snapshot
.
isWhether
;
//是否刻章
}
if
(
datajson
.
actionBody
.
order_snapshot
.
financial
&&
datajson
.
actionBody
.
order_snapshot
.
financial
!=
'undefined'
){
params
.
deliveryInfo
.
financial
=
datajson
.
actionBody
.
order_snapshot
.
financial
;
//财税服务
}
if
(
datajson
.
actionBody
.
order_snapshot
.
officialSeal
&&
datajson
.
actionBody
.
order_snapshot
.
officialSeal
!=
'undefined'
){
params
.
deliveryInfo
.
officialSeal
=
datajson
.
actionBody
.
order_snapshot
.
officialSeal
;
//公章扫描件
}
if
(
datajson
.
actionBody
.
order_snapshot
.
officialSeal
&&
datajson
.
actionBody
.
order_snapshot
.
officialSeal
!=
'undefined'
){
params
.
deliveryInfo
.
officialSeal
=
datajson
.
actionBody
.
order_snapshot
.
officialSeal
;
//公章扫描件
}
if
(
datajson
.
actionBody
.
order_snapshot
.
businessLicense
&&
datajson
.
actionBody
.
order_snapshot
.
businessLicense
!=
'undefined'
){
params
.
deliveryInfo
.
businessLicense
=
datajson
.
actionBody
.
order_snapshot
.
businessLicense
;
//营业执照扫描件
}
if
(
datajson
.
actionBody
.
order_snapshot
.
taxpayerType
&&
datajson
.
actionBody
.
order_snapshot
.
taxpayerType
!=
'undefined'
){
params
.
deliveryInfo
.
taxpayerType
=
datajson
.
actionBody
.
order_snapshot
.
taxpayerType
;
//纳税人类型
}
if
(
datajson
.
actionBody
.
order_snapshot
.
buyDuration
&&
datajson
.
actionBody
.
order_snapshot
.
buyDuration
!=
'undefined'
){
params
.
deliveryInfo
.
buyDuration
=
datajson
.
actionBody
.
order_snapshot
.
buyDuration
;
//购买时长
}
if
(
datajson
.
actionBody
.
order_snapshot
.
buyTime
&&
datajson
.
actionBody
.
order_snapshot
.
buyTime
!=
'undefined'
){
params
.
deliveryInfo
.
buyTime
=
datajson
.
actionBody
.
order_snapshot
.
buyTime
;
//购买时间
}
if
(
datajson
.
actionBody
.
order_snapshot
.
isRenew
&&
datajson
.
actionBody
.
order_snapshot
.
isRenew
!=
'undefined'
){
params
.
deliveryInfo
.
isRenew
=
datajson
.
actionBody
.
order_snapshot
.
isRenew
;
//是否自动续费
}
if
(
datajson
.
actionBody
.
order_snapshot
.
whetherType
&&
datajson
.
actionBody
.
order_snapshot
.
whetherType
!=
'undefined'
){
params
.
deliveryInfo
.
whetherType
=
datajson
.
actionBody
.
order_snapshot
.
whetherType
;
//刻章类型
}
if
(
datajson
.
actionBody
.
order_snapshot
.
subjectType
&&
datajson
.
actionBody
.
order_snapshot
.
subjectType
!=
'undefined'
){
params
.
deliveryInfo
.
subjectType
=
datajson
.
actionBody
.
order_snapshot
.
subjectType
;
//代理记账主体类型
}
if
(
datajson
.
actionBody
.
order_snapshot
.
companyName
&&
datajson
.
actionBody
.
order_snapshot
.
companyName
!=
'undefined'
){
params
.
deliveryInfo
.
companyName
=
datajson
.
actionBody
.
order_snapshot
.
companyName
;
//公司名称
params
.
companyInfo
.
companyName
=
datajson
.
actionBody
.
order_snapshot
.
companyName
;
}
if
(
datajson
.
actionBody
.
order_snapshot
.
companyProperties
&&
datajson
.
actionBody
.
order_snapshot
.
companyProperties
!=
'undefined'
){
params
.
companyInfo
.
companyProperties
=
datajson
.
actionBody
.
order_snapshot
.
companyProperties
;
//公司性质
}
if
(
datajson
.
actionBody
.
order_snapshot
.
fullAddress
&&
datajson
.
actionBody
.
order_snapshot
.
fullAddress
!=
'undefined'
){
params
.
companyInfo
.
fullAddress
=
datajson
.
actionBody
.
order_snapshot
.
fullAddress
;
//详细地址
}
if
(
datajson
.
actionBody
.
order_snapshot
.
engagedIndustry
&&
datajson
.
actionBody
.
order_snapshot
.
engagedIndustry
!=
'undefined'
){
params
.
companyInfo
.
engagedIndustry
=
datajson
.
actionBody
.
order_snapshot
.
engagedIndustry
;
//从事行业
}
if
(
datajson
.
actionBody
.
order_snapshot
.
businessScope
&&
datajson
.
actionBody
.
order_snapshot
.
businessScope
!=
'undefined'
){
params
.
companyInfo
.
businessScope
=
datajson
.
actionBody
.
order_snapshot
.
businessScope
;
//经营范围
}
if
(
datajson
.
actionBody
.
order_snapshot
.
operatingPeriod
&&
datajson
.
actionBody
.
order_snapshot
.
operatingPeriod
!=
'undefined'
){
params
.
companyInfo
.
operatingPeriod
=
datajson
.
actionBody
.
order_snapshot
.
operatingPeriod
;
//经营期限
}
if
(
datajson
.
actionBody
.
order_snapshot
.
registeredCapital
&&
datajson
.
actionBody
.
order_snapshot
.
registeredCapital
!=
'undefined'
){
params
.
companyInfo
.
registeredCapital
=
datajson
.
actionBody
.
order_snapshot
.
registeredCapital
;
//注册资本
}
if
(
datajson
.
actionBody
.
order_snapshot
.
creditCode
&&
datajson
.
actionBody
.
order_snapshot
.
creditCode
!=
'undefined'
){
params
.
companyInfo
.
creditCode
=
datajson
.
actionBody
.
order_snapshot
.
creditCode
;
//统一社会信用代码
}
if
(
datajson
.
actionBody
.
order_snapshot
.
companyType
&&
datajson
.
actionBody
.
order_snapshot
.
companyType
!=
'undefined'
){
params
.
companyInfo
.
companyType
=
datajson
.
actionBody
.
order_snapshot
.
companyType
;
//公司类型
}
if
(
datajson
.
actionBody
.
order_snapshot
.
establishedTime
&&
datajson
.
actionBody
.
order_snapshot
.
establishedTime
!=
'undefined'
){
params
.
companyInfo
.
establishedTime
=
datajson
.
actionBody
.
order_snapshot
.
establishedTime
;
//成立时间
}
if
(
datajson
.
actionBody
.
order_snapshot
.
shareholderName
&&
datajson
.
actionBody
.
order_snapshot
.
shareholderName
!=
'undefined'
){
params
.
companyInfo
.
shareholderName
=
datajson
.
actionBody
.
order_snapshot
.
shareholderName
;
//法人代表
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
...
...
@@ -114,5 +203,35 @@ class TxHandler {
return
system
.
getResultError
(
error
);
}
}
//关闭交付单处理
async
needClose
(
datajson
){
try
{
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
icUrl
+
"/deliverybillCtl/updateStatusByDeliverCode"
;
var
params
=
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
,
"deliverStatus"
:
"closed"
,
"statusReason"
:
datajson
.
actionBody
.
refusalContent
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
return
{
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
"data"
:
""
,
"requestId"
:
""
}
}
else
{
return
j
;
}
}
catch
(
error
){
return
system
.
getResultError
(
error
);
}
}
}
module
.
exports
=
new
TxHandler
();
\ No newline at end of file
center-manage/app/config/routes/api.js
View file @
913b9a15
...
...
@@ -8,7 +8,7 @@ module.exports = function (app) {
if
(
!
channel
){
next
()
}
else
{
let
rtn
=
await
chnelapi
.
channelHandle
(
channel
,
req
.
path
,
req
.
body
)
let
rtn
=
await
chnelapi
.
channelHandle
(
channel
,
req
.
path
+
"/"
+
req
.
body
.
actionType
,
req
.
body
)
if
(
rtn
!=
null
){
res
.
end
(
JSON
.
stringify
({
status
:
0
,
msg
:
"ok"
}));
}
else
{
...
...
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