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
39df05c6
Commit
39df05c6
authored
Jul 17, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
观云台小程序
parent
8d294c5e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
0 deletions
+43
-0
StoreAttentionApiService.java
.../java/com/gic/cloud/service/StoreAttentionApiService.java
+4
-0
StoreAttentionApiServiceImpl.java
...loud/service/outer/impl/StoreAttentionApiServiceImpl.java
+17
-0
StoreWidgetController.java
...a/com/gic/cloud/web/controller/StoreWidgetController.java
+4
-0
StoreGroupItemsVo.java
...src/main/java/com/gic/cloud/web/vo/StoreGroupItemsVo.java
+9
-0
StoreSearchVo.java
...app/src/main/java/com/gic/cloud/web/vo/StoreSearchVo.java
+9
-0
No files found.
gic-data-cloud-api/src/main/java/com/gic/cloud/service/StoreAttentionApiService.java
View file @
39df05c6
...
@@ -4,10 +4,14 @@ import com.gic.api.base.commons.Page;
...
@@ -4,10 +4,14 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.cloud.dto.AttentionStoreDTO
;
import
com.gic.cloud.dto.AttentionStoreDTO
;
import
java.util.Map
;
public
interface
StoreAttentionApiService
{
public
interface
StoreAttentionApiService
{
ServiceResponse
addStoreAttenttion
(
Integer
userId
,
Integer
enterpriseId
,
Integer
storeId
);
ServiceResponse
addStoreAttenttion
(
Integer
userId
,
Integer
enterpriseId
,
Integer
storeId
);
ServiceResponse
removeStoreAttenttion
(
Integer
enterpriseId
,
Integer
userId
,
String
storeIds
);
ServiceResponse
removeStoreAttenttion
(
Integer
enterpriseId
,
Integer
userId
,
String
storeIds
);
ServiceResponse
<
Page
<
AttentionStoreDTO
>>
pageStoreAttention
(
Integer
userId
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
);
ServiceResponse
<
Page
<
AttentionStoreDTO
>>
pageStoreAttention
(
Integer
userId
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
);
ServiceResponse
<
Map
<
Integer
,
AttentionStoreDTO
>>
getAllAttenttionStore
(
Integer
userId
,
Integer
enterpriseId
);
}
}
gic-data-cloud-service/src/main/java/com/gic/cloud/service/outer/impl/StoreAttentionApiServiceImpl.java
View file @
39df05c6
...
@@ -9,9 +9,14 @@ import com.gic.cloud.service.StoreAttenttionService;
...
@@ -9,9 +9,14 @@ import com.gic.cloud.service.StoreAttenttionService;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.google.inject.internal.asm.
$AnnotationVisitor
;
import
com.google.inject.internal.asm.
$AnnotationVisitor
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"storeAttentionApiService"
)
@Service
(
"storeAttentionApiService"
)
public
class
StoreAttentionApiServiceImpl
implements
StoreAttentionApiService
{
public
class
StoreAttentionApiServiceImpl
implements
StoreAttentionApiService
{
@Autowired
@Autowired
...
@@ -39,4 +44,16 @@ public class StoreAttentionApiServiceImpl implements StoreAttentionApiService {
...
@@ -39,4 +44,16 @@ public class StoreAttentionApiServiceImpl implements StoreAttentionApiService {
com
.
github
.
pagehelper
.
Page
<
TabAttentionStore
>
storePage
=
this
.
storeAttenttionService
.
pageStoreAttention
(
userId
,
enterpriseId
);
com
.
github
.
pagehelper
.
Page
<
TabAttentionStore
>
storePage
=
this
.
storeAttenttionService
.
pageStoreAttention
(
userId
,
enterpriseId
);
return
ServiceResponse
.
success
(
PageHelperUtils
.
changePageHelperToCurrentPage
(
storePage
,
AttentionStoreDTO
.
class
));
return
ServiceResponse
.
success
(
PageHelperUtils
.
changePageHelperToCurrentPage
(
storePage
,
AttentionStoreDTO
.
class
));
}
}
@Override
public
ServiceResponse
<
Map
<
Integer
,
AttentionStoreDTO
>>
getAllAttenttionStore
(
Integer
userId
,
Integer
enterpriseId
)
{
List
<
AttentionStoreDTO
>
result
=
this
.
pageStoreAttention
(
userId
,
enterpriseId
,
1
,
Integer
.
MAX_VALUE
).
getResult
().
getResult
();
Map
<
Integer
,
AttentionStoreDTO
>
map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
for
(
AttentionStoreDTO
storeDTO
:
result
){
map
.
put
(
storeDTO
.
getStoreId
(),
storeDTO
);
}
}
return
ServiceResponse
.
success
(
map
);
}
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreWidgetController.java
View file @
39df05c6
...
@@ -131,6 +131,7 @@ public class StoreWidgetController {
...
@@ -131,6 +131,7 @@ public class StoreWidgetController {
storeSearchDTO
.
setStoreGroupId
(
parentId
);
storeSearchDTO
.
setStoreGroupId
(
parentId
);
storeSearchDTO
.
setStoreResource
(
Long
.
valueOf
(
storeAuth
.
getStoreWidgetId
()));
storeSearchDTO
.
setStoreResource
(
Long
.
valueOf
(
storeAuth
.
getStoreWidgetId
()));
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageSize
);
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageSize
);
Map
<
Integer
,
AttentionStoreDTO
>
result
=
this
.
storeAttentionApiService
.
getAllAttenttionStore
(
userId
,
enterpriseId
).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
response
.
getResult
().
getResult
())){
if
(
CollectionUtils
.
isNotEmpty
(
response
.
getResult
().
getResult
())){
for
(
StoreDTO
dto
:
response
.
getResult
().
getResult
()){
for
(
StoreDTO
dto
:
response
.
getResult
().
getResult
()){
StoreGroupItemsVo
itemsVo
=
new
StoreGroupItemsVo
();
StoreGroupItemsVo
itemsVo
=
new
StoreGroupItemsVo
();
...
@@ -139,6 +140,7 @@ public class StoreWidgetController {
...
@@ -139,6 +140,7 @@ public class StoreWidgetController {
itemsVo
.
setIsStore
(
1
);
itemsVo
.
setIsStore
(
1
);
itemsVo
.
setIdChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getIdChain
()
+
dto
.
getStoreInfoId
()
+
"_"
);
itemsVo
.
setIdChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getIdChain
()
+
dto
.
getStoreInfoId
()
+
"_"
);
itemsVo
.
setNameChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getNameChain
()
+
dto
.
getStoreName
()
+
"/"
);
itemsVo
.
setNameChain
(
map
.
get
(
dto
.
getStoreGroupId
()).
getNameChain
()
+
dto
.
getStoreName
()
+
"/"
);
itemsVo
.
setHasAttention
(
result
.
get
(
dto
.
getStoreInfoId
())
==
null
?
0
:
1
);
items
.
add
(
itemsVo
);
items
.
add
(
itemsVo
);
}
}
groupVoPage
.
setTotalCount
(
response
.
getResult
().
getTotalCount
());
groupVoPage
.
setTotalCount
(
response
.
getResult
().
getTotalCount
());
...
@@ -285,6 +287,7 @@ public class StoreWidgetController {
...
@@ -285,6 +287,7 @@ public class StoreWidgetController {
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
join
(
storeAuth
.
getStoreInfoIdList
(),
" "
));
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
join
(
storeAuth
.
getStoreInfoIdList
(),
" "
));
Page
<
StoreDTO
>
result
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageSize
).
getResult
();
Page
<
StoreDTO
>
result
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageSize
).
getResult
();
Map
<
Integer
,
AttentionStoreDTO
>
attentionStoreDTOMap
=
this
.
storeAttentionApiService
.
getAllAttenttionStore
(
userId
,
enterpriseId
).
getResult
();
page
.
setTotalCount
(
result
.
getTotalCount
());
page
.
setTotalCount
(
result
.
getTotalCount
());
page
.
setTotalPage
(
result
.
getTotalPage
());
page
.
setTotalPage
(
result
.
getTotalPage
());
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getResult
())){
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getResult
())){
...
@@ -295,6 +298,7 @@ public class StoreWidgetController {
...
@@ -295,6 +298,7 @@ public class StoreWidgetController {
searchVo
.
setName
(
storeDTO
.
getStoreName
());
searchVo
.
setName
(
storeDTO
.
getStoreName
());
searchVo
.
setIdChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getIdChain
()
+
storeDTO
.
getStoreInfoId
()+
"_"
);
searchVo
.
setIdChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getIdChain
()
+
storeDTO
.
getStoreInfoId
()+
"_"
);
searchVo
.
setNameChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getNameChain
()
+
storeDTO
.
getStoreName
()
+
"/"
);
searchVo
.
setNameChain
(
map
.
get
(
storeDTO
.
getStoreGroupId
()).
getNameChain
()
+
storeDTO
.
getStoreName
()
+
"/"
);
searchVo
.
setHasAttention
(
attentionStoreDTOMap
.
get
(
storeDTO
.
getStoreInfoId
())
==
null
?
0
:
1
);
storeSearchVoList
.
add
(
searchVo
);
storeSearchVoList
.
add
(
searchVo
);
}
}
page
.
setResult
(
storeSearchVoList
);
page
.
setResult
(
storeSearchVoList
);
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/StoreGroupItemsVo.java
View file @
39df05c6
...
@@ -7,6 +7,7 @@ public class StoreGroupItemsVo {
...
@@ -7,6 +7,7 @@ public class StoreGroupItemsVo {
private
String
nameChain
;
private
String
nameChain
;
private
Integer
isStore
=
0
;
private
Integer
isStore
=
0
;
private
Integer
hasChildren
=
0
;
private
Integer
hasChildren
=
0
;
private
Integer
hasAttention
=
0
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
...
@@ -55,4 +56,12 @@ public class StoreGroupItemsVo {
...
@@ -55,4 +56,12 @@ public class StoreGroupItemsVo {
public
void
setNameChain
(
String
nameChain
)
{
public
void
setNameChain
(
String
nameChain
)
{
this
.
nameChain
=
nameChain
;
this
.
nameChain
=
nameChain
;
}
}
public
Integer
getHasAttention
()
{
return
hasAttention
;
}
public
void
setHasAttention
(
Integer
hasAttention
)
{
this
.
hasAttention
=
hasAttention
;
}
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/StoreSearchVo.java
View file @
39df05c6
...
@@ -7,6 +7,7 @@ public class StoreSearchVo {
...
@@ -7,6 +7,7 @@ public class StoreSearchVo {
private
String
idChain
;
private
String
idChain
;
private
String
nameChain
;
private
String
nameChain
;
private
Integer
channel
;
private
Integer
channel
;
private
Integer
hasAttention
=
0
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
...
@@ -55,4 +56,12 @@ public class StoreSearchVo {
...
@@ -55,4 +56,12 @@ public class StoreSearchVo {
public
void
setChannel
(
Integer
channel
)
{
public
void
setChannel
(
Integer
channel
)
{
this
.
channel
=
channel
;
this
.
channel
=
channel
;
}
}
public
Integer
getHasAttention
()
{
return
hasAttention
;
}
public
void
setHasAttention
(
Integer
hasAttention
)
{
this
.
hasAttention
=
hasAttention
;
}
}
}
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