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
haoban3.0
haoban-manage3.0
Commits
83a7a273
Commit
83a7a273
authored
Apr 17, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定接口
parent
d28ae4e1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
174 additions
and
7 deletions
+174
-7
StoreRangeInfoDTO.java
...java/com/gic/haoban/manage/api/dto/StoreRangeInfoDTO.java
+58
-0
WxEnterpriseRelatedApiService.java
...ban/manage/api/service/WxEnterpriseRelatedApiService.java
+8
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+6
-0
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+41
-3
WebBaseController.java
...m/gic/haoban/manage/web/controller/WebBaseController.java
+5
-4
StoreGroupVo.java
.../main/java/com/gic/haoban/manage/web/vo/StoreGroupVo.java
+56
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StoreRangeInfoDTO.java
0 → 100644
View file @
83a7a273
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 门店选择器
*
* @author fdh
*/
public
class
StoreRangeInfoDTO
implements
Serializable
{
/**
*
*/
private
String
wxEnterpriseId
;
/**
* 关联id 默认0
*/
private
String
relationId
;
/**
* 0所有门店 1分组 2门店
*/
private
Integer
relationType
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getRelationId
()
{
return
relationId
;
}
public
void
setRelationId
(
String
relationId
)
{
this
.
relationId
=
relationId
;
}
public
Integer
getRelationType
()
{
return
relationType
;
}
public
void
setRelationType
(
Integer
relationType
)
{
this
.
relationType
=
relationType
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseRelatedApiService.java
View file @
83a7a273
...
@@ -65,6 +65,14 @@ public interface WxEnterpriseRelatedApiService {
...
@@ -65,6 +65,14 @@ public interface WxEnterpriseRelatedApiService {
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
);
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
);
/**
/**
* 根据商户id 获取所有被绑定分组
*
* @param enterpriseId
* @return
*/
public
List
<
StoreRangeInfoDTO
>
listAllBindStoreOrGroup
(
String
enterpriseId
);
/**
* @param enterpriseId
* @param enterpriseId
* @param search
* @param search
* @param pageInfo
* @param pageInfo
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
83a7a273
...
@@ -313,6 +313,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
...
@@ -313,6 +313,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
}
}
@Override
@Override
public
List
<
StoreRangeInfoDTO
>
listAllBindStoreOrGroup
(
String
enterpriseId
)
{
List
<
TabStoreRange
>
tabStoreRanges
=
storeRangeService
.
queryAllBindRangeByEnterpriseId
(
enterpriseId
);
return
EntityUtil
.
changeEntityListNew
(
StoreRangeInfoDTO
.
class
,
tabStoreRanges
);
}
@Override
public
Page
<
BindStoreInfoDTO
>
pageBindStoreByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
)
{
public
Page
<
BindStoreInfoDTO
>
pageBindStoreByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
)
{
Page
<
TabStoreRelation
>
relationPage
=
storeRangeService
.
pageStoreRelation
(
enterpriseId
,
wxEnterpriseId
,
search
,
pageInfo
);
Page
<
TabStoreRelation
>
relationPage
=
storeRangeService
.
pageStoreRelation
(
enterpriseId
,
wxEnterpriseId
,
search
,
pageInfo
);
if
(
CollectionUtils
.
isEmpty
(
relationPage
.
getResult
()))
{
if
(
CollectionUtils
.
isEmpty
(
relationPage
.
getResult
()))
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
83a7a273
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
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.WxEnterpriseRelationDetailDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -21,13 +31,41 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -21,13 +31,41 @@ public class GicDepartmentController extends WebBaseController{
@Autowired
@Autowired
private
StoreGroupService
storeGroupService
;
private
StoreGroupService
storeGroupService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@RequestMapping
(
"gic-department-list"
)
@RequestMapping
(
"gic-department-list"
)
public
HaobanResponse
departmentList
(
String
enterpriseId
,
BasePageInfo
pageInfo
,
String
keyWord
)
{
public
HaobanResponse
departmentList
(
String
enterpriseId
,
String
keyWord
)
{
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
departmentList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
departmentList
);
}
@RequestMapping
(
"gic-store-group-list"
)
public
HaobanResponse
storeGroupList
(
String
enterpriseId
,
String
keyWord
)
{
LoginVO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
StoreRangeInfoDTO
>
rangeInfoDTOList
=
wxEnterpriseRelatedApiService
.
listAllBindStoreOrGroup
(
enterpriseId
);
Set
<
String
>
groupIds
=
new
HashSet
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rangeInfoDTOList
))
{
groupIds
=
rangeInfoDTOList
.
stream
().
filter
(
dto
->
(!
dto
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
&&
dto
.
getRelationType
()
==
1
)
.
map
(
dto
->
dto
.
getRelationId
()).
collect
(
Collectors
.
toSet
());
}
Set
<
String
>
finalGroupIds
=
groupIds
;
List
<
StoreGroupVo
>
ret
=
departmentList
.
stream
().
map
(
dto
->
{
StoreGroupVo
storeGroupVo
=
new
StoreGroupVo
();
storeGroupVo
.
setRelationId
(
dto
.
getStoreGroupId
());
storeGroupVo
.
setParentRelationId
(
dto
.
getParentGroupId
());
storeGroupVo
.
setIsBind
(
finalGroupIds
.
contains
(
dto
.
getStoreGroupId
())
?
1
:
0
);
storeGroupVo
.
setRelationType
(
1
);
storeGroupVo
.
setRelationName
(
dto
.
getStoreGroupName
());
return
storeGroupVo
;
}).
collect
(
Collectors
.
toList
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WebBaseController.java
View file @
83a7a273
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.gic.haoban.auth.api.dto.DisplayRelationShortInfoDTO
;
import
com.gic.haoban.auth.api.dto.DisplayRelationShortInfoDTO
;
import
com.gic.haoban.auth.api.dto.UserRightDetailDTO
;
import
com.gic.haoban.common.utils.AuthRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -49,8 +49,9 @@ public class WebBaseController {
...
@@ -49,8 +49,9 @@ public class WebBaseController {
*
*
* @return
* @return
*/
*/
protected
UserRightDetailDTO
getLoginUser
()
{
protected
LoginVO
getLoginUser
()
{
return
(
UserRightDetailDTO
)
AuthRequestUtil
.
getSessionUser
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
return
login
;
}
}
public
boolean
haveRight
(
List
<
DisplayRelationShortInfoDTO
>
list
){
public
boolean
haveRight
(
List
<
DisplayRelationShortInfoDTO
>
list
){
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StoreGroupVo.java
0 → 100644
View file @
83a7a273
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
/**
* Created 2021/4/17.
*
* @author hua
*/
public
class
StoreGroupVo
implements
Serializable
{
private
String
relationId
;
private
Integer
relationType
;
private
String
relationName
;
private
int
isBind
=
0
;
private
String
parentRelationId
;
public
String
getRelationId
()
{
return
relationId
;
}
public
void
setRelationId
(
String
relationId
)
{
this
.
relationId
=
relationId
;
}
public
Integer
getRelationType
()
{
return
relationType
;
}
public
void
setRelationType
(
Integer
relationType
)
{
this
.
relationType
=
relationType
;
}
public
String
getRelationName
()
{
return
relationName
;
}
public
void
setRelationName
(
String
relationName
)
{
this
.
relationName
=
relationName
;
}
public
int
getIsBind
()
{
return
isBind
;
}
public
void
setIsBind
(
int
isBind
)
{
this
.
isBind
=
isBind
;
}
public
String
getParentRelationId
()
{
return
parentRelationId
;
}
public
void
setParentRelationId
(
String
parentRelationId
)
{
this
.
parentRelationId
=
parentRelationId
;
}
}
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