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
4db671c8
Commit
4db671c8
authored
Apr 12, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getAllPathName
parent
382ba98b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
center-channel/app/base/api/impl/opaction/order.js
+4
-0
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+41
-2
No files found.
center-channel/app/base/api/impl/opaction/order.js
View file @
4db671c8
...
@@ -6,6 +6,7 @@ class ProductAPI extends WEBBase {
...
@@ -6,6 +6,7 @@ class ProductAPI extends WEBBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsProductSve
=
system
.
getObject
(
"service.utilsSve.utilsProductSve"
);
}
}
/**
/**
...
@@ -41,6 +42,9 @@ class ProductAPI extends WEBBase {
...
@@ -41,6 +42,9 @@ class ProductAPI extends WEBBase {
case
"getOrderInfo"
:
//获取订单列表信息
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"getPathName"
:
opResult
=
await
this
.
utilsProductSve
.
getAllPathName
(
pobj
);
break
;
case
"getOrderStatisticsByUappId"
:
case
"getOrderStatisticsByUappId"
:
opResult
=
await
this
.
utilsOrderSve
.
getOrdersStatisticsByUappId
(
pobj
);
opResult
=
await
this
.
utilsOrderSve
.
getOrdersStatisticsByUappId
(
pobj
);
break
;
break
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
4db671c8
...
@@ -153,6 +153,44 @@ class UtilsProductService extends AppServiceBase {
...
@@ -153,6 +153,44 @@ class UtilsProductService extends AppServiceBase {
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
return
result
;
}
}
}
module
.
exports
=
UtilsProductService
;
/**
* 根据path_name 聚合
* @param pobj
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
getAllPathName
(
pobj
){
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'getAllPathName'
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
){
return
system
.
getResultFail
(
-
1
,
'获取数据失败,请稍后再试!'
);
}
let
data
=
result
.
data
;
let
map
=
new
Map
();
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
let
item
=
data
[
i
];
let
strs
=
item
.
path_name
.
split
(
'/'
);
let
classOne
=
strs
[
1
];
let
classTwo
=
strs
[
2
];
if
(
map
.
has
(
classOne
)){
let
val
=
map
.
get
(
classOne
);
val
.
push
(
classTwo
)
map
.
set
(
classOne
,
val
);
}
else
{
let
arr
=
[];
arr
.
push
(
classTwo
)
map
.
set
(
classOne
,
arr
);
}
}
let
resultData
=
[];
map
.
forEach
((
v
,
k
)
=>
{
let
obj
=
{};
obj
[
'key'
]
=
k
;
obj
[
'data'
]
=
v
;
resultData
.
push
(
obj
)
})
return
system
.
getResult
(
resultData
);
}
}
module
.
exports
=
UtilsProductService
;
\ No newline at end of file
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