Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-data-cloud
Commits
3c886cce
Commit
3c886cce
authored
Jul 17, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
观云台小程序
parent
2d2f684f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
9 deletions
+67
-9
StoreWidgetController.java
...a/com/gic/cloud/web/controller/StoreWidgetController.java
+35
-4
StoreGroupItemsVo.java
...src/main/java/com/gic/cloud/web/vo/StoreGroupItemsVo.java
+14
-5
StoreSearchVo.java
...app/src/main/java/com/gic/cloud/web/vo/StoreSearchVo.java
+18
-0
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreWidgetController.java
View file @
3c886cce
...
...
@@ -28,10 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
@RestController
public
class
StoreWidgetController
{
...
...
@@ -106,6 +103,7 @@ public class StoreWidgetController {
Integer
pageNum
,
Integer
pageSize
){
StoreAuth
storeAuth
=
dataAuthUtils
.
getStoreAuth
(
userId
,
enterpriseId
);
List
<
Integer
>
storeGroupIdList
=
new
ArrayList
<>();
Map
<
Integer
,
StoreGroupVo
>
map
=
this
.
mapStoreGroup
(
enterpriseId
);
if
(
storeAuth
.
getStoreWidgetId
()
!=
null
)
{
StoreColumnSet
storeColumnSet
=
this
.
storeWidgetApiService
.
getStoreColumnSet
(
enterpriseId
,
storeAuth
.
getStoreWidgetId
()).
getResult
();
Set
<
Integer
>
storeGroupId
=
storeColumnSet
.
getStoreGroupId
();
...
...
@@ -119,6 +117,8 @@ public class StoreWidgetController {
StoreGroupItemsVo
itemsVo
=
new
StoreGroupItemsVo
();
itemsVo
.
setId
(
storeGroupDTO
.
getStoreGroupId
());
itemsVo
.
setName
(
storeGroupDTO
.
getStoreGroupName
());
itemsVo
.
setIdChain
(
map
.
get
(
storeGroupDTO
.
getStoreGroupId
()).
getIdChain
());
itemsVo
.
setNameChain
(
map
.
get
(
storeGroupDTO
.
getStoreGroupId
()).
getNameChain
());
List
<
StoreGroupDTO
>
result
=
this
.
storeGroupApiService
.
pageStoreGroupByIds
(
storeGroupIdList
,
enterpriseId
,
parentId
,
null
,
pageSize
,
pageNum
).
getResult
().
getResult
();
itemsVo
.
setHasChildren
(
CollectionUtils
.
isEmpty
(
result
)
?
0
:
1
);
items
.
add
(
itemsVo
);
...
...
@@ -137,6 +137,8 @@ public class StoreWidgetController {
itemsVo
.
setId
(
dto
.
getStoreInfoId
());
itemsVo
.
setName
(
dto
.
getStoreName
());
itemsVo
.
setIsStore
(
1
);
itemsVo
.
setIdChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getIdChain
()
+
dto
.
getStoreInfoId
()
+
"_"
);
itemsVo
.
setNameChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getNameChain
()
+
dto
.
getStoreName
()
+
"/"
);
items
.
add
(
itemsVo
);
}
groupVoPage
.
setTotalCount
(
response
.
getResult
().
getTotalCount
());
...
...
@@ -258,6 +260,7 @@ public class StoreWidgetController {
public
RestResponse
storeSearch
(
Integer
userId
,
Integer
enterpriseId
,
Integer
type
,
String
search
,
Integer
pageNum
,
Integer
pageSize
){
Page
<
StoreSearchVo
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
Map
<
Integer
,
StoreGroupVo
>
map
=
this
.
mapStoreGroup
(
enterpriseId
);
if
(
type
==
1
){
//门店分组
Page
<
StoreGroupDTO
>
result
=
this
.
storeGroupApiService
.
pageStoreGroupByIds
(
null
,
enterpriseId
,
null
,
search
,
pageSize
,
pageNum
).
getResult
();
page
.
setTotalPage
(
result
.
getTotalPage
());
...
...
@@ -268,6 +271,8 @@ public class StoreWidgetController {
StoreSearchVo
searchVo
=
new
StoreSearchVo
();
searchVo
.
setId
(
storeGroupDTO
.
getStoreGroupId
()+
""
);
searchVo
.
setName
(
storeGroupDTO
.
getStoreGroupName
());
searchVo
.
setIdChain
(
map
.
get
(
storeGroupDTO
.
getStoreGroupId
()).
getIdChain
());
searchVo
.
setNameChain
(
map
.
get
(
storeGroupDTO
.
getStoreGroupId
()).
getNameChain
());
storeSearchVoList
.
add
(
searchVo
);
}
page
.
setResult
(
storeSearchVoList
);
...
...
@@ -287,6 +292,8 @@ public class StoreWidgetController {
StoreSearchVo
searchVo
=
new
StoreSearchVo
();
searchVo
.
setId
(
storeDTO
.
getStoreInfoId
()+
""
);
searchVo
.
setName
(
storeDTO
.
getStoreName
());
searchVo
.
setIdChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getIdChain
()
+
storeDTO
.
getStoreInfoId
()+
"_"
);
searchVo
.
setNameChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getNameChain
()
+
storeDTO
.
getStoreName
()
+
"/"
);
storeSearchVoList
.
add
(
searchVo
);
}
page
.
setResult
(
storeSearchVoList
);
...
...
@@ -335,6 +342,30 @@ public class StoreWidgetController {
return
RestResponse
.
success
(
page
);
}
private
Map
<
Integer
,
StoreGroupVo
>
mapStoreGroup
(
Integer
enterpriseId
){
List
<
StoreGroupDTO
>
result
=
this
.
storeGroupApiService
.
listStoreGroupByIds
(
null
,
enterpriseId
).
getResult
();
Map
<
Integer
,
StoreGroupVo
>
map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
this
.
parseStoreGroup
(
result
,
map
,
0
);
}
return
map
;
}
private
void
parseStoreGroup
(
List
<
StoreGroupDTO
>
storeGroupDTOList
,
Map
<
Integer
,
StoreGroupVo
>
map
,
Integer
storeGroupId
){
for
(
StoreGroupDTO
dto
:
storeGroupDTOList
){
if
(
storeGroupId
.
intValue
()
==
dto
.
getParentStoreGroupId
().
intValue
()){
StoreGroupVo
vo
=
new
StoreGroupVo
();
vo
.
setParentId
(
storeGroupId
);
vo
.
setStoreGroupId
(
dto
.
getStoreGroupId
());
vo
.
setStoreGroupName
(
dto
.
getStoreGroupName
());
vo
.
setIdChain
(
map
.
get
(
storeGroupId
)
==
null
?
"_0_"
+
dto
.
getStoreGroupId
()+
"_"
:
map
.
get
(
storeGroupId
).
getIdChain
()+
dto
.
getStoreGroupId
()+
"_"
);
vo
.
setNameChain
(
map
.
get
(
storeGroupId
)
==
null
?
dto
.
getStoreGroupName
()+
"/"
:
map
.
get
(
storeGroupId
).
getNameChain
()+
dto
.
getStoreGroupName
()+
"/"
);
map
.
put
(
dto
.
getStoreGroupId
(),
vo
);
this
.
parseStoreGroup
(
storeGroupDTOList
,
map
,
dto
.
getStoreGroupId
());
}
}
}
private
List
<
OnLineStoreVo
>
listOnLineStore
(
List
<
String
>
storeIdList
,
Integer
type
,
Integer
enterpriseId
){
List
<
OnLineStoreVo
>
list
=
new
ArrayList
<>();
if
(
type
==
StoreChannelEnum
.
GICMALL
.
getChannel
()){
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/StoreGroupItemsVo.java
View file @
3c886cce
...
...
@@ -3,7 +3,8 @@ package com.gic.cloud.web.vo;
public
class
StoreGroupItemsVo
{
private
Integer
id
;
private
String
name
;
private
String
chain
;
private
String
idChain
;
private
String
nameChain
;
private
Integer
isStore
=
0
;
private
Integer
hasChildren
=
0
;
...
...
@@ -39,11 +40,19 @@ public class StoreGroupItemsVo {
this
.
hasChildren
=
hasChildren
;
}
public
String
getChain
()
{
return
c
hain
;
public
String
get
Id
Chain
()
{
return
idC
hain
;
}
public
void
setChain
(
String
chain
)
{
this
.
chain
=
chain
;
public
void
setIdChain
(
String
idChain
)
{
this
.
idChain
=
idChain
;
}
public
String
getNameChain
()
{
return
nameChain
;
}
public
void
setNameChain
(
String
nameChain
)
{
this
.
nameChain
=
nameChain
;
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/StoreSearchVo.java
View file @
3c886cce
...
...
@@ -4,6 +4,8 @@ public class StoreSearchVo {
private
String
id
;
private
String
name
;
private
String
desc
;
private
String
idChain
;
private
String
nameChain
;
public
String
getId
()
{
return
id
;
...
...
@@ -28,4 +30,20 @@ public class StoreSearchVo {
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getIdChain
()
{
return
idChain
;
}
public
void
setIdChain
(
String
idChain
)
{
this
.
idChain
=
idChain
;
}
public
String
getNameChain
()
{
return
nameChain
;
}
public
void
setNameChain
(
String
nameChain
)
{
this
.
nameChain
=
nameChain
;
}
}
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