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
37b0861b
Commit
37b0861b
authored
Jun 28, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
50bf868d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
52 deletions
+74
-52
center-manage/app/base/service/impl/common/channelhandlers/tx.js
+24
-9
center-manage/app/config/settings.js
+50
-43
No files found.
center-manage/app/base/service/impl/common/channelhandlers/tx.js
View file @
37b0861b
var
system
=
require
(
"../../../../system"
);
const
sha235
=
require
(
"sha256"
);
var
settings
=
require
(
"../../../../../config/settings"
);
class
TxHandler
{
constructor
()
{
this
.
icUrl
=
"http://ic.com:8000
/web/bizchance"
;
this
.
icUrl
=
settings
.
icUrl
()
+
"
/web/bizchance"
;
this
.
userService
=
system
.
getObject
(
"service.auth.userSve"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
}
...
...
@@ -48,7 +49,7 @@ class TxHandler {
if
(
datajson
.
actionBody
.
CompanyName
&&
datajson
.
actionBody
.
CompanyName
!=
'undefined'
)
{
params
.
companyName
=
datajson
.
actionBody
.
CompanyName
;
}
if
(
datajson
.
actionBody
.
UserName
&&
datajson
.
actionBody
.
UserName
!=
'undefined'
){
if
(
datajson
.
actionBody
.
UserName
&&
datajson
.
actionBody
.
UserName
!=
'undefined'
)
{
params
.
UserName
=
datajson
.
actionBody
.
UserName
;
}
if
(
salesmanInfo
&&
salesmanInfo
!=
'undefined'
)
{
...
...
@@ -154,12 +155,13 @@ class TxHandler {
//获取分配的业务员信息
var
ConsultTypeName
=
""
;
console
.
log
(
"productTypeName-----------------------------"
+
datajson
.
actionBody
.
productTypeName
);
if
(
datajson
.
actionBody
.
productTypeName
&&
datajson
.
actionBody
.
productTypeName
!=
'undefined'
){
if
(
datajson
.
actionBody
.
productTypeName
&&
datajson
.
actionBody
.
productTypeName
!=
'undefined'
)
{
ConsultTypeName
=
datajson
.
actionBody
.
productTypeName
.
split
(
"/"
)[
2
];
}
console
.
log
(
"ConsultTypeName-----------------------------"
+
ConsultTypeName
);
var
salesmanInfo
=
await
this
.
userService
.
getBizUserForDelivery
(
datajson
.
actionBody
.
orderSnapshot
.
contactsPhone
,
datajson
.
actionBody
.
servicerName
,
ConsultTypeName
,
datajson
.
actionBody
.
txPriceCode
,
datajson
.
actionBody
.
regionName
);
requrl
=
this
.
icUrl
+
"/deliverybillCtl/insertInfo"
;
var
bizurl
=
this
.
icUrl
+
"/bizoptCtl/updateStatusByDemandCode"
;
var
params
=
{
"deliverNumber"
:
datajson
.
actionBody
.
orderNum
,
"servicerName"
:
datajson
.
actionBody
.
servicerName
,
...
...
@@ -168,7 +170,7 @@ class TxHandler {
"businessType"
:
datajson
.
actionBody
.
productType
,
"businessName"
:
ConsultTypeName
,
"skuCode"
:
datajson
.
actionBody
.
txPriceCode
,
"txOrderNum"
:
datajson
.
actionBody
.
txOrderNum
,
"txOrderNum"
:
datajson
.
actionBody
.
txOrderNum
,
"baseInfo"
:
{
"txOrderNum"
:
datajson
.
actionBody
.
txOrderNum
,
"isAdviser"
:
"已分配"
,
//是否分配顾问
...
...
@@ -192,6 +194,11 @@ class TxHandler {
params
.
baseInfo
.
clerkName
=
salesmanInfo
.
userName
,
params
.
baseInfo
.
clerkPhone
=
salesmanInfo
.
mobile
}
if
(
!
params
.
serviceCode
||
params
.
serviceCode
==
'undefined'
)
{
if
(
datajson
.
actionBody
.
orderSnapshot
.
servicerCode
&&
datajson
.
actionBody
.
orderSnapshot
.
servicerCode
!=
'undefined'
)
{
params
.
serviceCode
=
datajson
.
actionBody
.
orderSnapshot
.
servicerCode
;
//fuwushang id
}
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
needNum
&&
datajson
.
actionBody
.
orderSnapshot
.
needNum
!=
'undefined'
)
{
params
.
businessMode
=
datajson
.
actionBody
.
orderSnapshot
.
needNum
;
//商机编号
}
...
...
@@ -244,7 +251,7 @@ class TxHandler {
if
(
datajson
.
actionBody
.
orderSnapshot
.
whetherType
&&
datajson
.
actionBody
.
orderSnapshot
.
whetherType
!=
'undefined'
)
{
params
.
baseInfo
.
whetherType
=
datajson
.
actionBody
.
orderSnapshot
.
whetherType
;
//刻章类型
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"annualReport"
)){
//年报信息
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"annualReport"
))
{
//年报信息
params
.
baseInfo
.
annualReport
=
datajson
.
actionBody
.
orderSnapshot
.
annualReport
;
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
hasOwnProperty
(
"addressType"
))
{
//注册地址类型
...
...
@@ -272,7 +279,7 @@ class TxHandler {
params
.
companyInfo
.
fullAddress
=
datajson
.
actionBody
.
orderSnapshot
.
fullAddress
;
//详细地址
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
residenceAddress
&&
datajson
.
actionBody
.
orderSnapshot
.
residenceAddress
!=
'undefined'
)
{
params
.
companyInfo
.
fullAddress
=
datajson
.
actionBody
.
orderSnapshot
.
residenceAddress
;
//详细地址
params
.
companyInfo
.
residenceAddress
=
datajson
.
actionBody
.
orderSnapshot
.
residenceAddress
;
//zhusuo
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
engagedIndustry
&&
datajson
.
actionBody
.
orderSnapshot
.
engagedIndustry
!=
'undefined'
)
{
params
.
companyInfo
.
engagedIndName
=
datajson
.
actionBody
.
orderSnapshot
.
engagedIndustry
;
//从事行业名称
...
...
@@ -284,7 +291,7 @@ class TxHandler {
params
.
companyInfo
.
operatingPeriod
=
datajson
.
actionBody
.
orderSnapshot
.
operatingPeriod
;
//经营期限
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
businessTerm
&&
datajson
.
actionBody
.
orderSnapshot
.
businessTerm
!=
'undefined'
)
{
params
.
companyInfo
.
operatingPeriod
=
datajson
.
actionBody
.
orderSnapshot
.
businessTerm
;
//经营期限
params
.
companyInfo
.
businessTerm
=
datajson
.
actionBody
.
orderSnapshot
.
businessTerm
;
//经营期限
}
if
(
datajson
.
actionBody
.
orderSnapshot
.
registeredCapital
&&
datajson
.
actionBody
.
orderSnapshot
.
registeredCapital
!=
'undefined'
)
{
params
.
companyInfo
.
registeredCapital
=
datajson
.
actionBody
.
orderSnapshot
.
registeredCapital
;
//注册资本
...
...
@@ -301,8 +308,16 @@ class TxHandler {
var
rtn
=
await
rc
.
execPost3
({
"d"
:
params
},
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"rtn---------------------------------"
+
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
console
.
log
(
"j---------------------------------"
+
rtn
.
stdout
);
var
stau
=
{
"businessMode"
:
params
.
businessMode
,
"currentStatus"
:
"isFinished"
,
"statusReason"
:
""
}
rtn
=
await
rc
.
execPost3
({
"d"
:
stau
},
bizurl
);
//更新商机状态为已完成
var
j1
=
SON
.
parse
(
rtn
.
stdout
);
console
.
log
(
"j1---------------------------------"
+
rtn
.
stdout
);
if
(
j
.
status
==
0
&&
j1
.
status
==
0
)
{
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
null
,
1200000
);
return
{
"status"
:
1
,
//1代表成功,否则失败
...
...
center-manage/app/config/settings.js
View file @
37b0861b
var
path
=
require
(
'path'
);
var
localsettings
=
require
(
"./localsettings"
);
var
ENVINPUT
=
{
KONG_ADMIAN
:
process
.
env
.
KONG_ADMIAN
,
DB_HOST
:
process
.
env
.
DB_HOST
,
DB_PORT
:
process
.
env
.
DB_PORT
,
DB_USER
:
process
.
env
.
DB_USER
,
DB_PWD
:
process
.
env
.
DB_PWD
,
DB_NAME
:
process
.
env
.
PAAS_DB_NAME
,
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
REDIS_DB
:
process
.
env
.
PAAS_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
var
localsettings
=
require
(
"./localsettings"
);
var
ENVINPUT
=
{
KONG_ADMIAN
:
process
.
env
.
KONG_ADMIAN
,
DB_HOST
:
process
.
env
.
DB_HOST
,
DB_PORT
:
process
.
env
.
DB_PORT
,
DB_USER
:
process
.
env
.
DB_USER
,
DB_PWD
:
process
.
env
.
DB_PWD
,
DB_NAME
:
process
.
env
.
PAAS_DB_NAME
,
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
REDIS_DB
:
process
.
env
.
PAAS_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
};
var
settings
=
{
env
:
ENVINPUT
.
APP_ENV
,
env
:
ENVINPUT
.
APP_ENV
,
salt
:
"%iatpD1gcxz7iF#B"
,
defaultpwd
:
"gsb2020"
,
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
80
,
kongurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
defaultpwd
:
"gsb2020"
,
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
80
,
kongurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
localsettings
.
kongurl
;
}
else
{
}
else
{
return
ENVINPUT
.
KONG_ADMIAN
;
}
},
pmappname
:
"center-app"
,
pmappid
:
1
,
pmcompanyid
:
1
,
pmroleid
:{
"ta"
:
1
,
"pr"
:
2
},
redis
:
function
(){
if
(
this
.
env
==
"dev"
){
icUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://ic.com:8000"
;
}
else
{
return
"http://icdeliver-service"
;
}
},
pmappname
:
"center-app"
,
pmappid
:
1
,
pmcompanyid
:
1
,
pmroleid
:
{
"ta"
:
1
,
"pr"
:
2
},
redis
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
localsettings
.
redis
;
}
else
{
}
else
{
return
{
host
:
ENVINPUT
.
REDIS_HOST
,
port
:
ENVINPUT
.
REDIS_PORT
,
password
:
ENVINPUT
.
REDIS_PWD
,
db
:
ENVINPUT
.
REDIS_DB
,
host
:
ENVINPUT
.
REDIS_HOST
,
port
:
ENVINPUT
.
REDIS_PORT
,
password
:
ENVINPUT
.
REDIS_PWD
,
db
:
ENVINPUT
.
REDIS_DB
,
};
}
},
database
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
database
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
database
;
}
else
{
}
else
{
return
{
dbname
:
ENVINPUT
.
DB_NAME
,
user
:
ENVINPUT
.
DB_USER
,
password
:
ENVINPUT
.
DB_PWD
,
config
:
{
dbname
:
ENVINPUT
.
DB_NAME
,
user
:
ENVINPUT
.
DB_USER
,
password
:
ENVINPUT
.
DB_PWD
,
config
:
{
host
:
ENVINPUT
.
DB_HOST
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
...
...
@@ -62,9 +69,9 @@ var settings = {
acquire
:
90000000
,
idle
:
1000000
},
debug
:
false
,
timezone
:
'+08:00'
,
dialectOptions
:
{
debug
:
false
,
timezone
:
'+08:00'
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
...
...
@@ -73,5 +80,5 @@ var settings = {
}
}
};
settings
.
ENVINPUT
=
ENVINPUT
;
settings
.
ENVINPUT
=
ENVINPUT
;
module
.
exports
=
settings
;
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