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
acc20215
Commit
acc20215
authored
Jul 30, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
观云台小程序
parent
b1e6fa20
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
243 additions
and
13 deletions
+243
-13
BaseSalesController.java
...ava/com/gic/cloud/web/controller/BaseSalesController.java
+26
-2
IndexController.java
...in/java/com/gic/cloud/web/controller/IndexController.java
+19
-1
StoreSearchUtils.java
...n/java/com/gic/cloud/web/controller/StoreSearchUtils.java
+23
-10
FunctionModuleVo.java
.../src/main/java/com/gic/cloud/web/vo/FunctionModuleVo.java
+152
-0
LevelVo.java
...oud-wxapp/src/main/java/com/gic/cloud/web/vo/LevelVo.java
+22
-0
dubbo-gic-data-cloud-wxapp.xml
...d-wxapp/src/main/resources/dubbo-gic-data-cloud-wxapp.xml
+1
-0
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/BaseSalesController.java
View file @
acc20215
package
com
.
gic
.
cloud
.
web
.
controller
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.cloud.web.qo.DateTypeQo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.data.api.dto.BaseSalesDTO
;
import
com.gic.data.api.dto.BaseSalesParamsDTO
;
import
com.gic.data.api.service.BaseSalesApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -12,13 +18,31 @@ import java.util.List;
public
class
BaseSalesController
{
@Autowired
private
StoreSearchUtils
storeSearchUtils
;
@Autowired
private
BaseSalesApiService
baseSalesApiService
;
@RequestMapping
(
"base-sales"
)
public
RestResponse
baseSales
(
Integer
channel
,
Integer
userId
,
Integer
enterpriseId
,
String
searchJSON
,
DateTypeQo
dateTypeQo
,
String
mbrAreaId
,
Integer
level
,
Integer
parentId
){
DateTypeQo
dateTypeQo
,
String
mbrAreaId
,
Integer
level
,
Integer
parentId
,
Integer
pageNum
,
Integer
pageSize
){
List
<
Integer
>
list
=
this
.
storeSearchUtils
.
storeSearch
(
userId
,
enterpriseId
,
searchJSON
);
List
<
String
>
onLine
=
this
.
storeSearchUtils
.
onLineStoreSearch
(
userId
,
enterpriseId
,
searchJSON
);
List
<
Integer
>
childrenStoreGroupIdList
=
this
.
storeSearchUtils
.
getChildrenStoreGroupIdList
(
parentId
);
return
null
;
BaseSalesParamsDTO
dto
=
new
BaseSalesParamsDTO
();
dto
.
setChannel
(
channel
);
dto
.
setEnterpriseId
(
enterpriseId
);
dto
.
setStoreInfoIdList
(
list
);
dto
.
setOnLine
(
onLine
);
dto
.
setMbrAreaId
(
StringUtils
.
isBlank
(
mbrAreaId
)
?
null
:
Long
.
valueOf
(
mbrAreaId
));
dto
.
setType
(
dateTypeQo
.
getType
());
dto
.
setDate
(
dateTypeQo
.
getDate
());
dto
.
setChildrenStoreGroupIdList
(
childrenStoreGroupIdList
);
dto
.
setLevel
(
level
);
dto
.
setPageNum
(
pageNum
);
dto
.
setPageSize
(
pageSize
);
ServiceResponse
<
Page
<
BaseSalesDTO
>>
response
=
this
.
baseSalesApiService
.
pageBaseSales
(
dto
);
return
RestResponse
.
success
(
response
.
getResult
());
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/IndexController.java
View file @
acc20215
...
...
@@ -8,17 +8,21 @@ import com.gic.cloud.service.FunctionModuleApiService;
import
com.gic.cloud.service.IndexApiService
;
import
com.gic.cloud.web.auth.DataAuthUtils
;
import
com.gic.cloud.web.qo.DateTypeQo
;
import
com.gic.cloud.web.vo.FunctionModuleVo
;
import
com.gic.cloud.web.vo.LevelVo
;
import
com.gic.cloud.web.vo.MbrVo
;
import
com.gic.cloud.web.vo.index.IndexSalesVo
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.data.api.dto.IndexSalesDTO
;
import
com.gic.data.api.service.IndexSalesApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.List
;
@RestController
...
...
@@ -52,7 +56,21 @@ public class IndexController {
@RequestMapping
(
"function-list"
)
public
RestResponse
functionList
(
Integer
userId
){
ServiceResponse
<
List
<
FunctionModuleDTO
>>
response
=
this
.
functionApiService
.
getFunctionByUserId
(
userId
);
return
RestResponse
.
success
(
response
.
getResult
());
List
<
FunctionModuleVo
>
list
=
new
ArrayList
<>();
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
FunctionModuleDTO
dto
:
response
.
getResult
()){
if
(
dto
!=
null
){
list
.
add
(
EntityUtil
.
changeEntityByJSON
(
FunctionModuleVo
.
class
,
dto
));
}
}
}
return
RestResponse
.
success
(
list
);
}
@RequestMapping
(
"get-level"
)
public
RestResponse
getLevel
(
Integer
userId
,
Integer
enterpriseId
,
String
searchJSON
){
LevelVo
level
=
this
.
storeSearchUtils
.
getLevel
(
userId
,
enterpriseId
,
searchJSON
);
return
RestResponse
.
success
(
level
);
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreSearchUtils.java
View file @
acc20215
...
...
@@ -14,6 +14,7 @@ import com.gic.cloud.web.auth.OnLineStore;
import
com.gic.cloud.web.auth.StoreAuth
;
import
com.gic.cloud.web.constant.StoreChannelEnum
;
import
com.gic.cloud.web.qo.StoreSearchQo
;
import
com.gic.cloud.web.vo.LevelVo
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreGroupDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
...
...
@@ -23,6 +24,7 @@ import com.gic.store.service.StoreWidgetApiService;
import
com.google.inject.internal.cglib.core.
$ClassEmitter
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.Level
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.reflections.Store
;
...
...
@@ -119,12 +121,17 @@ public class StoreSearchUtils {
return
list
;
}
public
Integer
getLevel
(
Integer
userId
,
Integer
enterpriseId
,
String
searchJson
){
public
LevelVo
getLevel
(
Integer
userId
,
Integer
enterpriseId
,
String
searchJson
){
LevelVo
vo
=
new
LevelVo
();
List
<
Integer
>
list
=
this
.
storeSearch
(
userId
,
enterpriseId
,
searchJson
);
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
join
(
list
,
","
));
List
<
StoreDTO
>
result
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
20000
).
getResult
().
getResult
();
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
join
(
list
,
" "
));
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
20000
);
if
(!
response
.
isSuccess
()
&&
response
.
getResult
()
==
null
){
return
vo
;
}
List
<
StoreDTO
>
result
=
response
.
getResult
().
getResult
();
Map
<
Integer
,
Integer
>
map
=
new
HashMap
<>();
result
.
forEach
(
storeDTO
->
{
List
<
Integer
>
storeGroupIdList
=
storeDTO
.
getStoreGroupIdList
();
...
...
@@ -135,24 +142,30 @@ public class StoreSearchUtils {
List
<
StoreGroupDTO
>
allStoreGroupIdList
=
this
.
storeGroupApiService
.
listStoreGroupByIds
(
null
,
enterpriseId
).
getResult
();
Map
<
Integer
,
Integer
>
levelMap
=
new
HashMap
<>();
allStoreGroupIdList
.
forEach
(
storeGroupDTO
->
{
levelMap
.
put
(
storeGroupDTO
.
getGroupLevel
(),
levelMap
.
get
(
storeGroupDTO
.
getGroupLevel
())==
null
?
1
:
levelMap
.
get
(
storeGroupDTO
.
getGroupLevel
())+
1
);
if
(
map
.
containsKey
(
storeGroupDTO
.
getStoreGroupId
())){
levelMap
.
put
(
storeGroupDTO
.
getGroupLevel
(),
levelMap
.
get
(
storeGroupDTO
.
getGroupLevel
())==
null
?
1
:
levelMap
.
get
(
storeGroupDTO
.
getGroupLevel
())+
1
);
}
});
int
start
=
0
;
while
(
true
){
if
(
levelMap
.
get
(
start
)
!=
null
&&
levelMap
.
get
(
start
).
intValue
()
>
1
){
return
start
;
vo
.
setLevel
(
start
);
break
;
}
start
++;
}
vo
.
setMaxLevel
(
levelMap
.
size
()
-
1
);
return
vo
;
}
public
List
<
Integer
>
getChildrenStoreGroupIdList
(
Integer
storeGroupId
){
List
<
StoreGroupDTO
>
result
=
this
.
storeGroupApiService
.
listStoreGroupAndChildren
(
storeGroupId
).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
return
result
.
stream
().
map
(
storeGroupDTO
->
storeGroupDTO
.
getStoreGroupId
()).
collect
(
Collectors
.
toList
());
}
else
{
return
new
ArrayList
<>();
if
(
storeGroupId
!=
null
){
List
<
StoreGroupDTO
>
result
=
this
.
storeGroupApiService
.
listStoreGroupAndChildren
(
storeGroupId
).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
return
result
.
stream
().
map
(
storeGroupDTO
->
storeGroupDTO
.
getStoreGroupId
()).
collect
(
Collectors
.
toList
());
}
}
return
new
ArrayList
<>();
}
private
void
getOnlineStoreIds
(
String
searchJson
,
OnLineAuth
onlineStoreAuth
,
List
<
String
>
list
,
Integer
channel
){
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/FunctionModuleVo.java
0 → 100644
View file @
acc20215
package
com
.
gic
.
cloud
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 功能组件模块
* @ClassName: FunctionModuleDTO
* @Description:
* @author guojuxing
* @date 2020/7/8 3:35 PM
*/
public
class
FunctionModuleVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1359760668258180981L
;
/**
* ID
*/
private
Integer
functionModuleId
;
/**
* 名称
*/
private
String
functionModuleName
;
/**
* 功能编码
*/
private
String
functionModuleCode
;
/**
* 功能模块说明
*/
private
String
functionModuleDesc
;
/**
* 运维操作人ID
*/
private
String
operationId
;
/**
* 运维操作人name
*/
private
String
operationName
;
private
String
logo
;
/**
* 1:有效 0:无效
*/
private
Integer
status
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
public
Integer
getFunctionModuleId
()
{
return
functionModuleId
;
}
public
FunctionModuleVo
setFunctionModuleId
(
Integer
functionModuleId
)
{
this
.
functionModuleId
=
functionModuleId
;
return
this
;
}
public
String
getFunctionModuleName
()
{
return
functionModuleName
;
}
public
FunctionModuleVo
setFunctionModuleName
(
String
functionModuleName
)
{
this
.
functionModuleName
=
functionModuleName
;
return
this
;
}
public
String
getFunctionModuleCode
()
{
return
functionModuleCode
;
}
public
FunctionModuleVo
setFunctionModuleCode
(
String
functionModuleCode
)
{
this
.
functionModuleCode
=
functionModuleCode
;
return
this
;
}
public
String
getFunctionModuleDesc
()
{
return
functionModuleDesc
;
}
public
FunctionModuleVo
setFunctionModuleDesc
(
String
functionModuleDesc
)
{
this
.
functionModuleDesc
=
functionModuleDesc
;
return
this
;
}
public
String
getOperationId
()
{
return
operationId
;
}
public
FunctionModuleVo
setOperationId
(
String
operationId
)
{
this
.
operationId
=
operationId
;
return
this
;
}
public
String
getOperationName
()
{
return
operationName
;
}
public
FunctionModuleVo
setOperationName
(
String
operationName
)
{
this
.
operationName
=
operationName
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
FunctionModuleVo
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
FunctionModuleVo
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
FunctionModuleVo
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
public
String
getLogo
()
{
return
logo
;
}
public
FunctionModuleVo
setLogo
(
String
logo
)
{
this
.
logo
=
logo
;
return
this
;
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/LevelVo.java
0 → 100644
View file @
acc20215
package
com
.
gic
.
cloud
.
web
.
vo
;
public
class
LevelVo
{
private
Integer
level
=
1
;
private
Integer
maxLevel
=
1
;
public
Integer
getLevel
()
{
return
level
;
}
public
void
setLevel
(
Integer
level
)
{
this
.
level
=
level
;
}
public
Integer
getMaxLevel
()
{
return
maxLevel
;
}
public
void
setMaxLevel
(
Integer
maxLevel
)
{
this
.
maxLevel
=
maxLevel
;
}
}
gic-data-cloud-wxapp/src/main/resources/dubbo-gic-data-cloud-wxapp.xml
View file @
acc20215
...
...
@@ -150,4 +150,5 @@
<dubbo:reference
interface=
"com.gic.cloud.service.FunctionModuleApiService"
id=
"functionModuleApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.data.api.service.performanceoverview.PerformanceOverviewApiService"
id=
"performanceOverviewApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.data.api.service.consumestructure.ConsumeStructureApiService"
id=
"consumeStructureApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.data.api.service.BaseSalesApiService"
id=
"baseSalesApiService"
timeout=
"6000"
retries=
"0"
/>
</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