Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
QianQiXiang
haoban-manage3.0
Commits
007f59b4
Commit
007f59b4
authored
Apr 17, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定接口
parent
83a7a273
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
17 deletions
+55
-17
StoreRangeInfoDTO.java
...java/com/gic/haoban/manage/api/dto/StoreRangeInfoDTO.java
+11
-0
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+26
-17
StoreGroupVo.java
.../main/java/com/gic/haoban/manage/web/vo/StoreGroupVo.java
+18
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StoreRangeInfoDTO.java
View file @
007f59b4
...
@@ -15,6 +15,10 @@ public class StoreRangeInfoDTO implements Serializable {
...
@@ -15,6 +15,10 @@ public class StoreRangeInfoDTO implements Serializable {
*
*
*/
*/
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
/**
* 企业名称
*/
private
String
wxEnterpriseName
;
/**
/**
* 关联id 默认0
* 关联id 默认0
...
@@ -26,6 +30,13 @@ public class StoreRangeInfoDTO implements Serializable {
...
@@ -26,6 +30,13 @@ public class StoreRangeInfoDTO implements Serializable {
*/
*/
private
Integer
relationType
;
private
Integer
relationType
;
public
String
getWxEnterpriseName
()
{
return
wxEnterpriseName
;
}
public
void
setWxEnterpriseName
(
String
wxEnterpriseName
)
{
this
.
wxEnterpriseName
=
wxEnterpriseName
;
}
/**
/**
*/
*/
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
007f59b4
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.HashSet
;
import
com.gic.enterprise.api.dto.PowerStoreGroupDTO
;
import
java.util.List
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
java.util.Set
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
java.util.stream.Collectors
;
import
com.gic.haoban.auth.api.dto.UserRightDetailDTO
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterprise
RelationDetail
DTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -18,11 +16,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -18,11 +16,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.enterprise.api.dto.PowerStoreGroupDTO
;
import
java.util.HashMap
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
java.util.HashSet
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
java.util.List
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
java.util.Map
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
java.util.stream.Collectors
;
@RestController
@RestController
public
class
GicDepartmentController
extends
WebBaseController
{
public
class
GicDepartmentController
extends
WebBaseController
{
...
@@ -49,17 +47,28 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -49,17 +47,28 @@ public class GicDepartmentController extends WebBaseController{
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
StoreRangeInfoDTO
>
rangeInfoDTOList
=
wxEnterpriseRelatedApiService
.
listAllBindStoreOrGroup
(
enterpriseId
);
List
<
StoreRangeInfoDTO
>
rangeInfoDTOList
=
wxEnterpriseRelatedApiService
.
listAllBindStoreOrGroup
(
enterpriseId
);
Set
<
String
>
groupIds
=
new
HashSet
<>();
Map
<
String
,
StoreRangeInfoDTO
>
storeRangeMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rangeInfoDTOList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
rangeInfoDTOList
))
{
groupIds
=
rangeInfoDTOList
.
stream
().
filter
(
dto
->
(!
dto
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
&&
dto
.
getRelationType
()
==
1
)
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
enterpriseId
);
.
map
(
dto
->
dto
.
getRelationId
()).
collect
(
Collectors
.
toSet
());
Map
<
String
,
WxEnterpriseDTO
>
wxEnterpriseDTOMap
=
wxEnterpriseDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getWxEnterpriseId
(),
dto
->
dto
));
storeRangeMap
=
rangeInfoDTOList
.
stream
().
filter
(
dto
->
(!
dto
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
&&
dto
.
getRelationType
()
==
1
)
.
map
(
dto
->
{
dto
.
setWxEnterpriseName
(
wxEnterpriseDTOMap
.
get
(
dto
.
getWxEnterpriseId
()).
getCorpName
());
return
dto
;
}).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getRelationId
(),
dto
->
dto
));
}
}
Set
<
String
>
finalGroupIds
=
groupIds
;
Map
<
String
,
StoreRangeInfoDTO
>
finalStoreRangeMap
=
storeRangeMap
;
List
<
StoreGroupVo
>
ret
=
departmentList
.
stream
().
map
(
dto
->
{
List
<
StoreGroupVo
>
ret
=
departmentList
.
stream
().
map
(
dto
->
{
StoreRangeInfoDTO
mid
=
finalStoreRangeMap
.
get
(
dto
.
getStoreGroupId
());
StoreGroupVo
storeGroupVo
=
new
StoreGroupVo
();
StoreGroupVo
storeGroupVo
=
new
StoreGroupVo
();
storeGroupVo
.
setRelationId
(
dto
.
getStoreGroupId
());
storeGroupVo
.
setRelationId
(
dto
.
getStoreGroupId
());
storeGroupVo
.
setParentRelationId
(
dto
.
getParentGroupId
());
storeGroupVo
.
setParentRelationId
(
dto
.
getParentGroupId
());
storeGroupVo
.
setIsBind
(
finalGroupIds
.
contains
(
dto
.
getStoreGroupId
())
?
1
:
0
);
if
(
mid
!=
null
)
{
storeGroupVo
.
setIsBind
(
1
);
storeGroupVo
.
setWxEnterpriseId
(
mid
.
getWxEnterpriseId
());
storeGroupVo
.
setWxEnterpriseName
(
mid
.
getWxEnterpriseName
());
}
storeGroupVo
.
setRelationType
(
1
);
storeGroupVo
.
setRelationType
(
1
);
storeGroupVo
.
setRelationName
(
dto
.
getStoreGroupName
());
storeGroupVo
.
setRelationName
(
dto
.
getStoreGroupName
());
return
storeGroupVo
;
return
storeGroupVo
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StoreGroupVo.java
View file @
007f59b4
...
@@ -12,8 +12,26 @@ public class StoreGroupVo implements Serializable {
...
@@ -12,8 +12,26 @@ public class StoreGroupVo implements Serializable {
private
Integer
relationType
;
private
Integer
relationType
;
private
String
relationName
;
private
String
relationName
;
private
int
isBind
=
0
;
private
int
isBind
=
0
;
private
String
wxEnterpriseId
;
private
String
wxEnterpriseName
;
private
String
parentRelationId
;
private
String
parentRelationId
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getWxEnterpriseName
()
{
return
wxEnterpriseName
;
}
public
void
setWxEnterpriseName
(
String
wxEnterpriseName
)
{
this
.
wxEnterpriseName
=
wxEnterpriseName
;
}
public
String
getRelationId
()
{
public
String
getRelationId
()
{
return
relationId
;
return
relationId
;
}
}
...
...
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