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
8e78223f
Commit
8e78223f
authored
Mar 26, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店控件修复
parent
cede3f35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
44 deletions
+54
-44
DataAuthUtils.java
...p/src/main/java/com/gic/cloud/web/auth/DataAuthUtils.java
+0
-0
IndexController.java
...in/java/com/gic/cloud/web/controller/IndexController.java
+9
-9
StoreWidgetController.java
...a/com/gic/cloud/web/controller/StoreWidgetController.java
+42
-35
dubbo-gic-data-cloud-wxapp.xml
...d-wxapp/src/main/resources/dubbo-gic-data-cloud-wxapp.xml
+3
-0
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/auth/DataAuthUtils.java
View file @
8e78223f
This diff is collapsed.
Click to expand it.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/IndexController.java
View file @
8e78223f
...
...
@@ -62,8 +62,8 @@ public class IndexController {
@RequestMapping
(
"index-mbr"
)
public
RestResponse
indexMbr
(
Integer
enterpriseId
,
Integer
userId
){
List
<
MbrVo
>
mbrArea
=
this
.
dataAuthUtils
.
getMbrArea
(
userId
,
enterpriseId
);
return
RestResponse
.
success
(
mbrArea
);
//
List<MbrVo> mbrArea = this.dataAuthUtils.getMbrArea(userId, enterpriseId);
return
RestResponse
.
success
();
}
@RequestMapping
(
"index-sales"
)
...
...
@@ -91,10 +91,10 @@ public class IndexController {
list
.
add
(-
1
);
onLine
.
add
(
"-1"
);
}
List
<
Long
>
mbrAreaIdList
=
this
.
dataAuthUtils
.
getMbrAreaId
(
userId
,
enterpriseId
);
//
List<Long> mbrAreaIdList = this.dataAuthUtils.getMbrAreaId(userId, enterpriseId);
ServiceResponse
<
IndexMemberDTO
>
indexMember
=
this
.
indexSalesApiService
.
getIndexMember
(
enterpriseId
,
list
,
onLine
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
mbrAreaIdList
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
());
null
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
());
return
RestResponse
.
success
(
indexMember
.
getResult
());
}
...
...
@@ -108,19 +108,19 @@ public class IndexController {
list
.
add
(-
1
);
onLine
.
add
(
"-1"
);
}
List
<
Long
>
mbrAreaIdList
=
this
.
dataAuthUtils
.
getMbrAreaId
(
userId
,
enterpriseId
);
//
List<Long> mbrAreaIdList = this.dataAuthUtils.getMbrAreaId(userId, enterpriseId);
ServiceResponse
<
IndexMemberOrderCntDTO
>
allMemberOrderCntResponse
=
this
.
indexSalesApiService
.
getIndexMemberOrderCnt
(
enterpriseId
,
list
,
onLine
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
mbrAreaIdList
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
(),
1
);
null
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
(),
1
);
ServiceResponse
<
IndexMemberOrderCntDTO
>
memberOrderCntResponse
=
this
.
indexSalesApiService
.
getIndexMemberOrderCnt
(
enterpriseId
,
list
,
onLine
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
mbrAreaIdList
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
(),
2
);
null
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
(),
2
);
ServiceResponse
<
IndexMemberOldOrderCnt
>
oldOrderCnt
=
this
.
indexSalesApiService
.
getIndexMemberOldOrderCnt
(
enterpriseId
,
list
,
onLine
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
mbrAreaIdList
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
null
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
());
ServiceResponse
<
IndexMemberBirthCntDTO
>
birthOrderCnt
=
this
.
indexSalesApiService
.
getIndexMemberBirthOrderCnt
(
enterpriseId
,
list
,
onLine
,
StringUtils
.
isNoneBlank
(
mbrAreaId
)
?
Long
.
valueOf
(
mbrAreaId
)
:
null
,
mbrAreaIdList
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
());
null
,
dateTypeQo
.
getType
(),
dateTypeQo
.
getDate
());
log
.
info
(
"allMemberOrderCntResponse:{}"
,
JSON
.
toJSONString
(
allMemberOrderCntResponse
));
log
.
info
(
"memberOrderCntResponse:{}"
,
JSON
.
toJSONString
(
memberOrderCntResponse
));
log
.
info
(
"oldOrderCnt:{}"
,
JSON
.
toJSONString
(
oldOrderCnt
));
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreWidgetController.java
View file @
8e78223f
...
...
@@ -4,6 +4,8 @@ import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.cloud.dto.AttentionStoreDTO
;
import
com.gic.cloud.dto.DataAuthDTO
;
import
com.gic.cloud.service.DataAuthApiService
;
...
...
@@ -41,7 +43,7 @@ import java.util.*;
@RestController
public
class
StoreWidgetController
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
StoreWidgetController
.
class
);
private
static
final
String
WGSCODE
=
"WGS"
;
@Autowired
private
DataAuthUtils
dataAuthUtils
;
@Autowired
...
...
@@ -65,7 +67,9 @@ public class StoreWidgetController {
@Autowired
private
StoreSearchUtils
storeSearchUtils
;
@Autowired
private
DataAuthApiService
dataAuthApiService
;
private
MenuApiService
menuApiService
;
@Autowired
private
StoreBrandApiService
storeBrandApiService
;
@RequestMapping
(
"store-widget-index"
)
public
RestResponse
storeWidgetIndex
(
Integer
userId
,
Integer
enterpriseId
){
...
...
@@ -110,9 +114,13 @@ 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
());
List
<
MenuDTO
>
listMenu
=
this
.
menuApiService
.
getUserMenuOfAppNotTree
(
enterpriseId
,
userId
,
null
,
getAppId
(
"gyt-app"
)).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
listMenu
)){
for
(
MenuDTO
menu
:
listMenu
){
if
(
WGSCODE
.
equals
(
menu
.
getMenuCode
())){
vo
.
setHasWgs
(
1
);
}
}
}
return
RestResponse
.
success
(
vo
);
}
...
...
@@ -186,6 +194,8 @@ public class StoreWidgetController {
int
typeOfStoreRegion
=
3
;
//门店标签
int
typeOfStoreTag
=
4
;
//门店品牌
int
storeBrand
=
5
;
if
(
type
==
typeOfStore
){
if
(
storeColumnSet
!=
null
){
Set
<
Integer
>
storeType
=
storeColumnSet
.
getStoreType
();
...
...
@@ -237,41 +247,26 @@ public class StoreWidgetController {
}
}
return
RestResponse
.
success
(
list
);
}
else
{
return
otherType
(
storeColumnSet
);
}
}
private
RestResponse
otherType
(
StoreColumnSet
storeColumnSet
)
{
List
<
StoreTypeVo
>
list
=
new
ArrayList
<>();
if
(
storeColumnSet
!=
null
)
{
Set
<
Integer
>
status
=
storeColumnSet
.
getStatus
();
if
(
CollectionUtils
.
isEmpty
(
status
))
{
return
RestResponse
.
success
();
}
else
if
(
type
==
storeBrand
){
List
<
StoreTypeVo
>
list
=
new
ArrayList
<>();
List
<
StoreBrandDTO
>
brandDTOS
=
null
;
if
(
storeColumnSet
!=
null
){
Set
<
Integer
>
brandIds
=
storeColumnSet
.
getBrandId
();
brandDTOS
=
this
.
storeBrandApiService
.
listStoreBrandByIds
(
new
ArrayList
<>(
brandIds
)).
getResult
();
}
else
{
List
<
Integer
>
statusList
=
new
ArrayList
<
Integer
>(
status
);
for
(
Integer
s
:
statusList
){
brandDTOS
=
this
.
storeBrandApiService
.
listAllStoreBrand
(
enterpriseId
,
null
).
getResult
();
}
if
(
CollectionUtils
.
isNotEmpty
(
brandDTOS
)){
brandDTOS
.
stream
().
forEach
(
storeBrandDTO
->
{
StoreTypeVo
storeTypeVo
=
new
StoreTypeVo
();
storeTypeVo
.
setId
(
s
+
""
);
if
(
s
.
equals
(
1
)){
storeTypeVo
.
setName
(
"启用"
);
}
else
{
storeTypeVo
.
setName
(
"不启用"
);
}
storeTypeVo
.
setId
(
storeBrandDTO
.
getStoreBrandId
()+
""
);
storeTypeVo
.
setName
(
storeBrandDTO
.
getStoreBrandName
());
list
.
add
(
storeTypeVo
);
}
}
);
}
}
else
{
StoreTypeVo
storeTypeVo
=
new
StoreTypeVo
();
storeTypeVo
.
setId
(
"1"
);
storeTypeVo
.
setName
(
"启用"
);
list
.
add
(
storeTypeVo
);
StoreTypeVo
storeTypeVoNot
=
new
StoreTypeVo
();
storeTypeVoNot
.
setId
(
"2"
);
storeTypeVoNot
.
setName
(
"不启用"
);
list
.
add
(
storeTypeVoNot
);
return
RestResponse
.
success
(
list
);
}
return
RestResponse
.
success
(
list
);
return
RestResponse
.
success
();
}
@RequestMapping
(
"on-store-list"
)
...
...
@@ -516,6 +511,8 @@ public class StoreWidgetController {
return
list
;
}
private
String
getChannelName
(
Integer
channel
){
StoreChannelEnum
[]
values
=
StoreChannelEnum
.
values
();
for
(
StoreChannelEnum
storeChannelEnum
:
values
){
...
...
@@ -535,4 +532,14 @@ public class StoreWidgetController {
items
.
add
(
onLine
);
}
}
private
String
getAppId
(
String
menuCode
)
{
//根据menuCode去查询对应的appId
ServiceResponse
<
MenuDTO
>
resp
=
menuApiService
.
getMenuByMenuCode
(
menuCode
);
if
(
resp
.
isSuccess
())
{
MenuDTO
tempDTO
=
resp
.
getResult
();
return
tempDTO
.
getProject
();
}
return
null
;
}
}
gic-data-cloud-wxapp/src/main/resources/dubbo-gic-data-cloud-wxapp.xml
View file @
8e78223f
...
...
@@ -155,4 +155,7 @@
<dubbo:reference
interface=
"com.gic.data.api.service.member.MemberCloudDataApiService"
id=
"memberCloudDataApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.open.api.service.EnterpriseLicenseApiService"
id=
"enterpriseLicenseApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.auth.service.UserResourceApiService"
id=
"userResourceApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.member.config.api.service.UserListFieldApiService"
id=
"userListFieldApiService"
timeout=
"6000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.UnionEnterpriseAuthApiService"
id=
"unionEnterpriseAuthApiService"
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