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
279859f6
Commit
279859f6
authored
Aug 25, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
观云台小程序 See merge request
!19
parents
e8cf3030
0db06a43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
GoDownComponent.java
...in/java/com/gic/cloud/web/controller/GoDownComponent.java
+26
-0
StoreWidgetController.java
...a/com/gic/cloud/web/controller/StoreWidgetController.java
+8
-0
StoreWidgetIndexVo.java
...rc/main/java/com/gic/cloud/web/vo/StoreWidgetIndexVo.java
+9
-0
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/GoDownComponent.java
View file @
279859f6
...
...
@@ -7,6 +7,7 @@ import com.gic.cloud.web.constant.StoreChannelEnum;
import
com.gic.cloud.web.utils.LevelUtil
;
import
com.gic.cloud.web.vo.BaseSalesVo
;
import
com.gic.cloud.web.vo.LevelVo
;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.data.api.dto.BaseDTO
;
import
com.gic.data.api.dto.BaseSalesDTO
;
import
com.gic.data.api.qo.common.CommonQO
;
...
...
@@ -15,11 +16,17 @@ import com.gic.enterprise.service.WmStoreApiService;
import
com.gic.mall.share.api.dto.shop.ShopDTO
;
import
com.gic.mall.share.api.enums.ShopTypeEnum
;
import
com.gic.mall.share.api.service.ShopApiService
;
import
com.gic.store.dto.ClerkDTO
;
import
com.gic.store.service.ClerkApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
GoDownComponent
{
...
...
@@ -31,6 +38,8 @@ public class GoDownComponent {
private
StoreSearchUtils
storeSearchUtils
;
@Autowired
private
DataAuthUtils
dataAuthUtils
;
@Autowired
private
ClerkApiService
clerkApiService
;
public
void
parseTotal
(
ServiceResponse
<?>
response
,
BaseSalesVo
vo
){
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
...
...
@@ -172,11 +181,28 @@ public class GoDownComponent {
}
}
if
(
channel
==
StoreChannelEnum
.
OFFLINE
.
getChannel
()){
List
<
ClerkDTO
>
clerkDTOS
=
new
ArrayList
<>();
if
(
level
.
intValue
()
==
8
){
List
<
String
>
clerkIdList
=
page
.
getResult
().
stream
().
map
(
b
->
{
BaseDTO
baseSalesDTO
=
(
BaseDTO
)
b
;
return
baseSalesDTO
.
getAreaId
()
==
null
?
baseSalesDTO
.
getId
()
:
baseSalesDTO
.
getAreaId
();
}).
collect
(
Collectors
.
toList
());
clerkDTOS
=
this
.
clerkApiService
.
listClerkByIds
(
enterpriseId
,
StringUtils
.
join
(
clerkIdList
,
","
)).
getResult
();
}
final
Map
<
Integer
,
ClerkDTO
>
clerkDTOMap
=
CollectionUtil
.
toMap
(
clerkDTOS
,
"clerkId"
);
page
.
getResult
().
stream
().
forEach
(
b
->
{
BaseDTO
baseSalesDTO
=
(
BaseDTO
)
b
;
baseSalesDTO
.
setLevel
(
level
);
baseSalesDTO
.
setChannel
(
StoreChannelEnum
.
OFFLINE
.
getChannel
());
baseSalesDTO
.
setHasChildren
(
level
<=
maxLevel
?
1
:
0
);
if
(
clerkDTOMap
!=
null
&&
level
.
intValue
()
==
8
){
ClerkDTO
clerkDTO
=
clerkDTOMap
.
get
(
baseSalesDTO
.
getAreaId
()
==
null
?
baseSalesDTO
.
getId
()
:
baseSalesDTO
.
getAreaId
());
if
(
clerkDTO
!=
null
){
baseSalesDTO
.
setName
(
clerkDTO
.
getClerkName
());
}
else
{
baseSalesDTO
.
setName
(
"未知"
);
}
}
});
}
}
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreWidgetController.java
View file @
279859f6
...
...
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.cloud.dto.AttentionStoreDTO
;
import
com.gic.cloud.dto.DataAuthDTO
;
import
com.gic.cloud.service.DataAuthApiService
;
import
com.gic.cloud.service.StoreAttentionApiService
;
import
com.gic.cloud.web.auth.DataAuthUtils
;
import
com.gic.cloud.web.auth.OnLineAuth
;
...
...
@@ -56,6 +58,8 @@ public class StoreWidgetController {
private
StoreAttentionApiService
storeAttentionApiService
;
@Autowired
private
StoreSearchUtils
storeSearchUtils
;
@Autowired
private
DataAuthApiService
dataAuthApiService
;
@RequestMapping
(
"store-widget-index"
)
public
RestResponse
storeWidgetIndex
(
Integer
userId
,
Integer
enterpriseId
){
...
...
@@ -96,6 +100,10 @@ public class StoreWidgetController {
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getResult
())){
vo
.
setAttentionCount
(
result
.
getTotalCount
());
}
DataAuthDTO
dataAuthDTO
=
this
.
dataAuthApiService
.
ggetDataAuthByUserId
(
enterpriseId
,
userId
).
getResult
();
if
(
dataAuthDTO
!=
null
){
vo
.
setHasWgs
(
dataAuthDTO
.
getNoOwnerStore
()
==
null
?
0
:
dataAuthDTO
.
getNoOwnerStore
());
}
return
RestResponse
.
success
(
vo
);
}
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/StoreWidgetIndexVo.java
View file @
279859f6
...
...
@@ -8,6 +8,7 @@ public class StoreWidgetIndexVo {
private
List
<
IndexItemVo
>
items
;
private
Integer
attentionCount
=
0
;
private
Integer
singleRegion
=
0
;
private
Integer
hasWgs
=
0
;
public
Integer
getType
()
{
return
type
;
...
...
@@ -40,4 +41,12 @@ public class StoreWidgetIndexVo {
public
void
setSingleRegion
(
Integer
singleRegion
)
{
this
.
singleRegion
=
singleRegion
;
}
public
Integer
getHasWgs
()
{
return
hasWgs
;
}
public
void
setHasWgs
(
Integer
hasWgs
)
{
this
.
hasWgs
=
hasWgs
;
}
}
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