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
dbe12de7
Commit
dbe12de7
authored
May 20, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新接口
parent
cf9d3ddf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
20 deletions
+45
-20
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
+18
-0
center-channel/app/base/service/impl/receiveSve/icpNeedSve.js
+4
-3
center-channel/app/base/service/impl/receiveSve/icpOrderSve.js
+23
-17
No files found.
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
View file @
dbe12de7
...
...
@@ -24,6 +24,10 @@ class GatewaypushlogService extends ServiceBase {
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
try
{
var
icloginfo
=
icloginfos
[
i
];
if
(
icloginfo
.
version
==
1
)
{
self
.
newTaskHandle
(
icloginfo
);
continue
;
}
var
requestdata
=
null
;
if
(
icloginfo
&&
icloginfo
.
requestjson
)
{
requestdata
=
JSON
.
parse
(
icloginfo
.
requestjson
);
...
...
@@ -66,6 +70,20 @@ class GatewaypushlogService extends ServiceBase {
}
}
async
newTaskHandle
(
item
)
{
if
(
!
item
.
interface_path
||
!
item
.
interface_method
)
{
return
system
.
getResult
(
null
,
"接口对应的interface_path、interface_method参数信息为空"
);
}
//操作的方法名称
let
invokeObj
=
system
.
getObject
(
item
.
interface_path
);
if
(
!
invokeObj
[
item
.
interface_method
])
{
return
system
.
getResult
(
null
,
"接口对应的interface_method方法解析有误"
);
}
pobj
.
interface_params
=
interface_info
.
params
;
let
params
=
[
pobj
];
let
doRes
=
await
invokeObj
[
interface_info
.
method_name
].
apply
(
invokeObj
,
params
);
return
doRes
;
}
}
...
...
center-channel/app/base/service/impl/receiveSve/icpNeedSve.js
View file @
dbe12de7
...
...
@@ -9,10 +9,11 @@ class IcpNeedService extends AppServiceBase {
}
async
submitNeed
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
if
(
!
pobj
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,6000001"
);
}
let
sobj
=
pobj
;
sobj
.
actionBody
.
type
=
pobj
.
consultType
;
sobj
.
actionType
=
"getProductTypeInfo"
;
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
let
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
...
...
@@ -30,8 +31,8 @@ class IcpNeedService extends AppServiceBase {
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
type
=
pobj
.
consultType
||
pobj
.
channel_type_code
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
intentionBizId
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
// pobj.actionBody.type = "baidu.icp";
...
...
center-channel/app/base/service/impl/receiveSve/icpOrderSve.js
View file @
dbe12de7
...
...
@@ -17,7 +17,7 @@ class IcpOrderService extends AppServiceBase {
}
let
sobj
=
{
actionType
:
"getIcpProduce"
,
actionBody
:
{
typeCode
:
pobj
.
actionBody
.
consultType
,
province
:
pobj
.
province
},
actionBody
:
{
typeCode
:
pobj
.
consultType
,
province
:
pobj
.
province
},
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
...
...
@@ -33,31 +33,37 @@ class IcpOrderService extends AppServiceBase {
if
(
productItem
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败,6100002"
);
}
pobj
.
userInfo
=
{
channel_userid
:
pobj
.
userName
||
""
}
pobj
.
actionBody
.
totalSum
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
orderPrice
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
payTotalSum
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
payCode
=
productItem
.
data
.
payCode
;
pobj
.
actionBody
.
productPriceId
=
productItem
.
data
.
productPriceId
;
pobj
.
actionBody
.
channelItemCode
=
productItem
.
data
.
channelItemCode
;
pobj
.
actionBody
.
channelNeedNo
=
productItem
.
data
.
channelNeedNo
;
pobj
.
actionBody
.
needNo
=
productItem
.
data
.
needNo
;
pobj
.
actionBody
.
channelNeedNo
=
pobj
.
orderNo
;
pobj
.
actionBody
.
needNo
=
pobj
.
orderNo
;
pobj
.
actionBody
.
bizId
=
pobj
.
orderNo
;
//适应之前的逻辑
pobj
.
actionBody
.
quantity
=
1
;
pobj
.
actionBody
.
channelOrder
=
{
channelServiceNo
:
pobj
.
actionBody
.
orderNo
,
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
channelServiceNo
:
pobj
.
orderNo
,
channelOrderNo
:
pobj
.
orderNo
,
orderStatus
:
2
}
let
orderItem
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
console
.
log
(
"orderItem........................................................."
,
JSON
.
stringify
(
orderItem
))
if
(
orderItem
.
status
!=
0
&&
orderItem
.
status
!=
-
1
)
{
return
system
.
getResultFail
(
-
5010
,
"订单创建失败,6100003"
);
}
if
(
orderItem
.
data
)
{
pobj
.
actionBody
.
orderNo
=
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
;
}
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
orderNo
;
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
;
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
;
pobj
.
actionType
=
"receiveSolutionPayInfoNew"
;
let
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
let
solutionRes
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
console
.
log
(
"solutionRes......................................................"
,
JSON
.
stringify
(
solutionRes
))
if
(
!
solutionRes
||
!
solutionRes
.
stdout
)
{
return
system
.
getResultFail
(
-
5010
,
"方案创建失败,6100004"
);
}
...
...
@@ -102,19 +108,19 @@ class IcpOrderService extends AppServiceBase {
// }
let
yfObj
=
{
actionBody
:
{
area
:
pobj
.
actionBody
.
province
,
idempotentSource
:
pobj
.
actionBody
.
regType
,
area
:
pobj
.
province
,
idempotentSource
:
pobj
.
regType
||
""
,
//之前推送参数,待验证是否有用
orderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
orderPrice
:
Number
(
pobj
.
actionBody
.
orderPrice
/
100
),
phone
:
pobj
.
actionBody
.
publishMobil
e
,
phone
:
pobj
.
publishMobile
||
pobj
.
phon
e
,
needId
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
companyName
:
pobj
.
actionBody
.
CompanyName
||
''
,
companyName
:
pobj
.
CompanyName
||
''
,
appName
:
pobj
.
appInfo
.
app_name
||
''
,
sku
:
data
.
data
.
service_code
||
''
sku
:
productItem
.
data
.
service_code
||
''
},
appInfo
:
pobj
.
appInfo
}
console
.
log
(
"yfObj......................................................"
,
JSON
.
stringify
(
yfObj
))
let
yunfuPushRes
=
await
this
.
utilsPushSve
.
business2Channel
(
yfObj
,
"pushOrderICPBusinessNew"
);
if
(
pobj
.
actionBody
.
isDirectBuy
&&
pobj
.
actionBody
.
isDirectBuy
==
1
)
{
//直接下单需执行添加订单业务员操作
if
(
yunfuPushRes
&&
yunfuPushRes
.
status
==
0
)
{
...
...
@@ -125,7 +131,7 @@ class IcpOrderService extends AppServiceBase {
needsolution
:
yunfuPushRes
.
data
.
solutionContent
,
channelNeedNo
:
yunfuPushRes
.
data
.
channelNeedNo
,
channelSolutionNo
:
yunfuPushRes
.
data
.
channelSolutionNo
,
skuCode
:
data
.
data
.
payCode
,
skuCode
:
productItem
.
data
.
payCode
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
...
...
@@ -139,6 +145,7 @@ class IcpOrderService extends AppServiceBase {
salesmanChannelId
:
resData
.
orderList
&&
resData
.
orderList
.
length
>
0
?
resData
.
orderList
[
0
].
operator
:
""
,
};
deliveryObj
.
actionBody
.
needsolution
=
{
salesmanInfo
:
salesmanInfo
,
orderNo
:
orderrtn
.
data
.
orderNo
}
console
.
log
(
"deliveryObj......................................................"
,
JSON
.
stringify
(
deliveryObj
))
this
.
utilsPushSve
.
business2Channel
(
deliveryObj
,
"pushDeliveryOrder"
);
}
}
...
...
@@ -147,15 +154,14 @@ class IcpOrderService extends AppServiceBase {
}
async
closeOrder
(
pobj
)
{
let
actionBody
=
pobj
.
actionBody
;
let
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
let
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
rtn
.
status
==
0
&&
rtn
.
data
)
{
let
channelOrderNo
=
pobj
.
actionBody
.
orderNo
;
let
channelOrderNo
=
pobj
.
orderNo
;
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
pobj
.
actionType
=
"delOrder"
;
let
order
rtn
=
await
this
.
utilsOrderSve
.
delOrder
(
pobj
,
actionBody
);
if
(
order
rtn
.
status
<
0
)
{
let
order
Res
=
await
this
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
order
Res
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
let
tmpObj
=
{
...
...
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