Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-platform-enterprise
Commits
d89b3587
Commit
d89b3587
authored
Apr 23, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通知详情修改
parent
18647159
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
1 deletions
+130
-1
IndexModuleController.java
.../gic/enterprise/web/controller/IndexModuleController.java
+129
-1
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+1
-0
No files found.
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/IndexModuleController.java
View file @
d89b3587
...
...
@@ -3,7 +3,8 @@ package com.gic.enterprise.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.data.api.dto.StoreProvinceData
;
import
com.gic.data.api.dto.*
;
import
com.gic.data.api.service.MemberDataApiService
;
import
com.gic.data.api.service.StoreStatisicsApiService
;
import
com.gic.enterprise.dto.*
;
import
com.gic.enterprise.error.ErrorCode
;
...
...
@@ -13,6 +14,7 @@ import com.gic.enterprise.service.IndexModuleApiService;
import
com.gic.enterprise.service.PushMessageApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.dto.CityDTO
;
import
com.gic.store.dto.ProvinceDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
import
com.gic.store.service.ProvincesApiService
;
...
...
@@ -57,6 +59,8 @@ public class IndexModuleController {
private
StoreWidgetApiService
storeWidgetApiService
;
@Autowired
private
StoreApiService
storeApiService
;
@Autowired
private
MemberDataApiService
memberDataApiService
;
@RequestMapping
(
"/list-index-module"
)
public
RestResponse
listIndexModule
()
{
...
...
@@ -160,6 +164,114 @@ public class IndexModuleController {
return
RestResponse
.
success
(
result
);
}
@RequestMapping
(
"store-city-data"
)
public
RestResponse
storeCityData
(
String
province
,
Long
regionId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
CityDTO
>>
serviceResponse
=
this
.
provincesApiService
.
selectAllCity
();
ServiceResponse
<
List
<
ProvinceDTO
>>
provinceResponse
=
this
.
provincesApiService
.
selectAllProvince
();
String
provinceId
=
null
;
for
(
ProvinceDTO
provinceDTO
:
provinceResponse
.
getResult
()){
if
(
provinceDTO
.
getProvinceName
().
equals
(
province
)){
provinceId
=
provinceDTO
.
getProvinceId
();
}
}
if
(
StringUtils
.
isBlank
(
provinceId
)){
return
RestResponse
.
success
();
}
List
<
Integer
>
authStoreIdList
=
new
ArrayList
<>();
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
!=
1
){
ServiceResponse
<
List
<
Integer
>>
authResponse
=
this
.
storeWidgetApiService
.
listStoreIdByStoreWidgetId
(
enterpriseId
,
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getStoreResource
().
intValue
());
if
(
authResponse
.
isSuccess
()){
authStoreIdList
=
authResponse
.
getResult
();
}
if
(
CollectionUtils
.
isEmpty
(
authStoreIdList
)){
authStoreIdList
.
add
(-
1
);
}
}
ServiceResponse
<
List
<
StoreCityData
>>
dataResponse
=
this
.
storeStatisicsApiService
.
storeCityData
(
enterpriseId
,
regionId
,
authStoreIdList
,
province
);
ServiceResponse
<
List
<
StoreCityData
>>
dataOpenStore
=
this
.
storeStatisicsApiService
.
storeCityDataOpenStore
(
enterpriseId
,
regionId
,
authStoreIdList
,
province
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
if
(
serviceResponse
.
isSuccess
()
&&
serviceResponse
.
getResult
()
!=
null
){
for
(
CityDTO
cityDTO
:
serviceResponse
.
getResult
()){
if
(
cityDTO
.
getProvinceId
().
equals
(
provinceId
)){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
cityDTO
.
getCityName
());
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"mainStoreMemberCount"
,
0
);
data
.
put
(
"openStoreMemberCount"
,
0
);
for
(
StoreCityData
storeCityData
:
dataResponse
.
getResult
()){
if
(
cityDTO
.
getCityName
().
equals
(
storeCityData
.
getCity
())){
data
.
put
(
"mainStoreMemberCount"
,
storeCityData
.
getMemberCount
());
}
}
for
(
StoreCityData
storeCityData
:
dataOpenStore
.
getResult
()){
if
(
cityDTO
.
getCityName
().
equals
(
storeCityData
.
getCity
())){
data
.
put
(
"openStoreMemberCount"
,
storeCityData
.
getMemberCount
());
}
}
//查询门店数量
data
.
put
(
"storeCount"
,
this
.
getStoreNum
(
enterpriseId
,
null
,
provinceId
,
cityDTO
.
getCityId
()));
data
.
put
(
"onlineStoreCount"
,
this
.
getStoreNum
(
enterpriseId
,
1
,
provinceId
,
cityDTO
.
getCityId
()));
map
.
put
(
"data"
,
data
);
result
.
add
(
map
);
}
}
}
return
RestResponse
.
success
(
result
);
}
@RequestMapping
(
"list-member-data"
)
public
RestResponse
listMember
(
Integer
type
,
Long
cardAreaId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
List
<
MemberDataDTO
>>
response
=
this
.
memberDataApiService
.
listMemberData
(
enterpriseId
,
type
,
cardAreaId
,
userId
);
return
RestResponse
.
success
(
response
.
getResult
());
}
@RequestMapping
(
"get-member-data"
)
public
RestResponse
getMemberData
(
Integer
type
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
MemberDataDTO
>
memberData
=
this
.
memberDataApiService
.
getMemberData
(
enterpriseId
,
type
,
userId
);
return
RestResponse
.
success
(
memberData
.
getResult
());
}
@RequestMapping
(
"list-member-channel-data"
)
public
RestResponse
listMemberChannelData
(
Integer
type
,
Integer
cuType
,
Long
areaId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
List
<
MemberChannelDataDTO
>>
response
=
this
.
memberDataApiService
.
listMemberChannelData
(
type
,
cuType
,
areaId
,
enterpriseId
,
userId
);
return
RestResponse
.
success
(
response
.
getResult
());
}
@RequestMapping
(
"get-member-channel-data"
)
public
RestResponse
getMemberChannelData
(
Integer
type
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
MemberChannelDataDTO
>
memberChannelData
=
this
.
memberDataApiService
.
getMemberChannelData
(
type
,
enterpriseId
,
userId
);
return
RestResponse
.
success
(
memberChannelData
.
getResult
());
}
@RequestMapping
(
"list-channel-data"
)
public
RestResponse
listChannelData
(
Integer
type
,
Integer
cuType
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
List
<
MemberChannelDataDTO
>>
listServiceResponse
=
this
.
memberDataApiService
.
listChannelData
(
type
,
cuType
,
enterpriseId
,
userId
);
return
RestResponse
.
success
(
listServiceResponse
.
getResult
());
}
@RequestMapping
(
"consumption-analysis"
)
public
RestResponse
consumptionAnalysis
(
Integer
consumptionType
,
Long
cardConfigId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
ServiceResponse
<
List
<
ConsumptionAnalysisDTO
>>
listServiceResponse
=
this
.
memberDataApiService
.
consumptionAnalysis
(
consumptionType
,
cardConfigId
,
enterpriseId
,
userId
);
return
RestResponse
.
success
(
listServiceResponse
.
getResult
());
}
private
Integer
getStoreNum
(
Integer
enterpriseId
,
Integer
status
,
String
provinceId
){
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
...
...
@@ -174,4 +286,20 @@ public class IndexModuleController {
ServiceResponse
<
Long
>
countFromES
=
this
.
storeApiService
.
queryStoreCountFromES
(
storeSearchDTO
);
return
countFromES
.
getResult
().
intValue
();
}
private
Integer
getStoreNum
(
Integer
enterpriseId
,
Integer
status
,
String
provinceId
,
String
cityId
){
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStatus
(
status
);
storeSearchDTO
.
setProvinceId
(
provinceId
);
storeSearchDTO
.
setCityId
(
cityId
);
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
()
!=
1
){
Long
storeResource
=
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getStoreResource
();
if
(
storeResource
!=
null
){
storeSearchDTO
.
setStoreResource
(
storeResource
);
}
}
ServiceResponse
<
Long
>
countFromES
=
this
.
storeApiService
.
queryStoreCountFromES
(
storeSearchDTO
);
return
countFromES
.
getResult
().
intValue
();
}
}
gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
View file @
d89b3587
...
...
@@ -122,4 +122,5 @@
<dubbo:reference
interface=
"com.gic.mall.api.service.MallActivityThemeApiService"
id=
"mallActivityThemeApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.data.api.service.StoreStatisicsApiService"
id=
"storeStatisicsApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.auth.service.ResourceApiService"
id=
"resourceApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.data.api.service.MemberDataApiService"
id=
"memberDataApiService"
timeout=
"6000"
/>
</beans>
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