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
7433a5c3
Commit
7433a5c3
authored
Apr 23, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通知详情修改
parent
320b36ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
10 deletions
+89
-10
CustomThemeServiceImpl.java
...m/gic/enterprise/service/impl/CustomThemeServiceImpl.java
+5
-0
pom.xml
gic-platform-enterprise-web/pom.xml
+5
-10
IndexModuleController.java
.../gic/enterprise/web/controller/IndexModuleController.java
+78
-0
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+1
-0
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/CustomThemeServiceImpl.java
View file @
7433a5c3
package
com
.
gic
.
enterprise
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.enterprise.dao.mapper.TabCustomThemeMapper
;
import
com.gic.enterprise.entity.TabCustomTheme
;
import
com.gic.enterprise.service.CustomThemeService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -12,6 +15,7 @@ import java.util.List;
@Service
(
"customThemeService"
)
public
class
CustomThemeServiceImpl
implements
CustomThemeService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
CustomThemeServiceImpl
.
class
);
@Autowired
private
TabCustomThemeMapper
tabCustomThemeMapper
;
...
...
@@ -36,6 +40,7 @@ public class CustomThemeServiceImpl implements CustomThemeService {
@Override
public
Integer
getTheme
(
Integer
enterpriseId
,
String
appid
)
{
List
<
TabCustomTheme
>
list
=
this
.
tabCustomThemeMapper
.
listTheme
(
enterpriseId
,
appid
);
log
.
info
(
"小程序主题:{}"
,
JSON
.
toJSONString
(
list
));
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
).
getTheme
();
}
...
...
gic-platform-enterprise-web/pom.xml
View file @
7433a5c3
...
...
@@ -19,16 +19,6 @@
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<libraryVersion>
4.0-SNAPSHOT
</libraryVersion>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-store-api>
4.0-SNAPSHOT
</gic-store-api>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
<gic-thirdparty-sdk>
4.0-SNAPSHOT
</gic-thirdparty-sdk>
<gic-enterprise-download>
4.0-SNAPSHOT
</gic-enterprise-download>
<gic-log-api>
4.0-SNAPSHOT
</gic-log-api>
<gic-marketing-api>
4.0-SNAPSHOT
</gic-marketing-api>
<gic-member-config-api>
4.0-SNAPSHOT
</gic-member-config-api>
<gic-mall-share-api>
4.0-SNAPSHOT
</gic-mall-share-api>
<gic-mall-api>
4.0-SNAPSHOT
</gic-mall-api>
</properties>
<dependencies>
...
...
@@ -204,6 +194,11 @@
<artifactId>
gic-mall-share-api
</artifactId>
<version>
${gic-mall-share-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-data-api
</artifactId>
<version>
${gic-data-api}
</version>
</dependency>
</dependencies>
<build>
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/IndexModuleController.java
View file @
7433a5c3
...
...
@@ -3,6 +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.service.StoreStatisicsApiService
;
import
com.gic.enterprise.dto.*
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.qo.PageQO
;
...
...
@@ -11,6 +13,13 @@ 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.ProvinceDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
import
com.gic.store.service.ProvincesApiService
;
import
com.gic.store.service.StoreApiService
;
import
com.gic.store.service.StoreWidgetApiService
;
import
org.apache.catalina.User
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -20,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -39,6 +49,14 @@ public class IndexModuleController {
private
HelpCenterApiService
helpCenterApiService
;
@Autowired
private
PushMessageApiService
pushMessageApiService
;
@Autowired
private
StoreStatisicsApiService
storeStatisicsApiService
;
@Autowired
private
ProvincesApiService
provincesApiService
;
@Autowired
private
StoreWidgetApiService
storeWidgetApiService
;
@Autowired
private
StoreApiService
storeApiService
;
@RequestMapping
(
"/list-index-module"
)
public
RestResponse
listIndexModule
()
{
...
...
@@ -96,4 +114,64 @@ public class IndexModuleController {
ServiceResponse
<
Page
<
PushTypeDTO
>>
response
=
this
.
pushMessageApiService
.
pagePushType
(
null
,
1
,
10000
);
return
RestResponse
.
success
(
response
.
getResult
().
getResult
());
}
@RequestMapping
(
"store-data"
)
public
RestResponse
storeData
(
Long
regionId
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
List
<
ProvinceDTO
>>
serviceResponse
=
this
.
provincesApiService
.
selectAllProvince
();
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
<
StoreProvinceData
>>
dataResponse
=
this
.
storeStatisicsApiService
.
storeProvinceData
(
enterpriseId
,
regionId
,
authStoreIdList
);
ServiceResponse
<
List
<
StoreProvinceData
>>
dataOpenStore
=
this
.
storeStatisicsApiService
.
storeProvinceDataOpenStore
(
enterpriseId
,
regionId
,
authStoreIdList
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
if
(
serviceResponse
.
isSuccess
()
&&
serviceResponse
.
getResult
()
!=
null
){
for
(
ProvinceDTO
provinceDTO
:
serviceResponse
.
getResult
()){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
provinceDTO
.
getProvinceName
());
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"mainStoreMemberCount"
,
0
);
data
.
put
(
"openStoreMemberCount"
,
0
);
for
(
StoreProvinceData
storeProvinceData
:
dataResponse
.
getResult
()){
if
(
provinceDTO
.
getProvinceName
().
equals
(
storeProvinceData
.
getProvince
())){
data
.
put
(
"mainStoreMemberCount"
,
storeProvinceData
.
getMemberCount
());
}
}
for
(
StoreProvinceData
storeProvinceData
:
dataOpenStore
.
getResult
()){
if
(
provinceDTO
.
getProvinceName
().
equals
(
storeProvinceData
.
getProvince
())){
data
.
put
(
"openStoreMemberCount"
,
storeProvinceData
.
getMemberCount
());
}
}
//查询门店数量
data
.
put
(
"storeCount"
,
this
.
getStoreNum
(
enterpriseId
,
null
,
provinceDTO
.
getProvinceId
()));
data
.
put
(
"onlineStoreCount"
,
this
.
getStoreNum
(
enterpriseId
,
1
,
provinceDTO
.
getProvinceId
()));
map
.
put
(
"data"
,
data
);
result
.
add
(
map
);
}
}
return
RestResponse
.
success
(
result
);
}
private
Integer
getStoreNum
(
Integer
enterpriseId
,
Integer
status
,
String
provinceId
){
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStatus
(
status
);
storeSearchDTO
.
setProvinceId
(
provinceId
);
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 @
7433a5c3
...
...
@@ -120,4 +120,5 @@
<dubbo:reference
interface=
"com.gic.open.api.service.ApplicationApiService"
id=
"applicationApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.mall.share.api.service.ShopApiService"
id=
"shopApiService"
timeout=
"6000"
/>
<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"
/>
</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