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
44c4d5fd
Commit
44c4d5fd
authored
Mar 20, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
741a4718
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
8 deletions
+104
-8
center-channel/app/base/api/impl/opreceive/ic.js
+3
-1
center-channel/app/base/service/impl/common/centerorderSve.js
+101
-7
No files found.
center-channel/app/base/api/impl/opreceive/ic.js
View file @
44c4d5fd
...
@@ -32,7 +32,9 @@ class Ic extends APIBase {
...
@@ -32,7 +32,9 @@ class Ic extends APIBase {
break
;
break
;
case
"reqCenterOrderApi"
:
//办理公司状态
case
"reqCenterOrderApi"
:
//办理公司状态
break
;
break
;
case
"paySuccess"
:
//支付回调
opResult
=
await
this
.
centerorderSve
.
paySuccess
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
44c4d5fd
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
crypto
=
require
(
'crypto'
);
const
crypto
=
require
(
'crypto'
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
CenterorderService
{
class
CenterorderService
{
constructor
()
{
constructor
()
{
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
};
};
//调用center-order
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/icapi/springBoard"
;
var
url
=
this
.
centerOrderUrl
+
"action/icapi/springBoard"
;
if
(
reqUrl
)
{
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
...
@@ -19,9 +20,9 @@ class CenterorderService{
...
@@ -19,9 +20,9 @@ class CenterorderService{
return
data
;
return
data
;
}
}
//提交公司注册方案
//提交公司注册方案
async
submitProgramme
(
pobj
){
async
submitProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
// var needinfo = res.data.needinfo;//需求信息
// var needinfo = res.data.needinfo;//需求信息
// var needsolution = res.data.needsolution;//方案信息
// var needsolution = res.data.needsolution;//方案信息
// var ab = pobj.actionBody;
// var ab = pobj.actionBody;
...
@@ -55,9 +56,9 @@ class CenterorderService{
...
@@ -55,9 +56,9 @@ class CenterorderService{
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//服务商方案作废
//服务商方案作废
async
abolishProgramme
(
pobj
){
async
abolishProgramme
(
pobj
)
{
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelSolutionNo
)
{
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelSolutionNo
)
{
//推送数据至阿里
//推送数据至阿里
// var pushObj = {
// var pushObj = {
// solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || ""
// solutionBizId:res.data.channelSolutionNo,note:pobj.actionBody.note || ""
...
@@ -66,6 +67,99 @@ class CenterorderService{
...
@@ -66,6 +67,99 @@ class CenterorderService{
}
}
return
res
;
return
res
;
}
}
//支付回调
async
paySuccess
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
if
(
!
pobj
.
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"orderNo不能为空"
);
}
if
(
!
actionBody
.
orderPrice
)
{
return
system
.
getResult
(
null
,
"orderPrice不能为空"
);
}
if
(
!
actionBody
.
phone
)
{
return
system
.
getResult
(
null
,
"phone不能为空"
);
}
if
(
pobj
.
actionBody
.
companyName
)
{
if
(
!
actionBody
.
city
)
{
return
system
.
getResult
(
null
,
"city不能为空"
);
}
if
(
!
actionBody
.
companyCategory
)
{
return
system
.
getResult
(
null
,
"companyCategory不能为空"
);
}
if
(
!
actionBody
.
orgType
)
{
return
system
.
getResult
(
null
,
"orgType不能为空"
);
}
if
(
!
actionBody
.
industryType
)
{
return
system
.
getResult
(
null
,
"industryType不能为空"
);
}
if
(
!
actionBody
.
scope
)
{
return
system
.
getResult
(
null
,
"scope不能为空"
);
}
pobj
.
actionBody
.
regType
=
"ali.companyreg"
}
else
if
(
pobj
.
actionBody
.
park
)
{
if
(
!
actionBody
.
productType
)
{
return
system
.
getResult
(
null
,
"productType不能为空"
);
}
pobj
.
actionBody
.
regType
=
"ali.companyreg_cloud"
}
else
{
return
system
.
getResult
(
null
,
"参数异常"
);
}
var
sobj
=
{
actionType
:
"getaliicProduce"
,
actionBody
:
pobj
.
actionBody
,
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败"
);
}
pobj
.
actionBody
=
data
.
data
;
// var needNo="";
// if(solutiondata.data){
// needNo=solutiondata.data.channelNeedNo;
// }
pobj
.
actionBody
.
totalSum
=
pobj
.
actionBody
.
orderPrice
;
pobj
.
actionBody
.
payTotalSum
=
pobj
.
actionBody
.
orderPrice
;
pobj
.
actionBody
.
channelOrder
=
{
channelServiceNo
:
pobj
.
actionBody
.
orderNo
,
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
orderStatus
:
2
}
var
orderrtn
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
if
(
!
orderrtn
||
!
orderrtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5012
,
"订单创建失败"
);
}
var
orderdata
=
JSON
.
parse
(
orderrtn
.
stdout
);
if
(
orderdata
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5012
,
"订单创建失败"
);
}
if
(
pobj
.
actionBody
.
solutionBizId
){
pobj
.
actionType
=
"receiveSolutionPayInfo"
;
}
else
{
pobj
.
actionType
=
"createSolutionByOrder"
;
}
var
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
var
solutionrtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
if
(
!
solutionrtn
||
!
solutionrtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
var
solutiondata
=
JSON
.
parse
(
solutionrtn
.
stdout
);
if
(
solutiondata
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
return
system
.
getResultSuccess
();
}
}
}
module
.
exports
=
CenterorderService
;
module
.
exports
=
CenterorderService
;
// var task = new CenterorderService();
// var task = new CenterorderService();
...
...
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