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
81d154f9
Commit
81d154f9
authored
May 19, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店
parent
dcb9fa4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
5 deletions
+58
-5
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+57
-4
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-1
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
81d154f9
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -12,8 +13,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.PowerStoreGroupDTO
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.dto.StoreWidgetRightDataDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
...
...
@@ -23,6 +32,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
@RestController
public
class
GicDepartmentController
extends
WebBaseController
{
...
...
@@ -30,14 +40,57 @@ public class GicDepartmentController extends WebBaseController{
@Autowired
private
StoreGroupService
storeGroupService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreWidgetService
storeWidgetService
;
@RequestMapping
(
"gic-department-list"
)
public
HaobanResponse
departmentList
(
String
enterpriseId
,
String
keyWord
)
{
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
public
HaobanResponse
departmentList
(
String
keyWord
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
()
;
String
enterpriseId
=
loginUser
.
getEnterpriseId
()
;
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
List
<
StoreWidgetRightDataDTO
>
list
=
null
;
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
String
clerkId
=
loginUser
.
getClerkId
()
;
ClerkDTO
clerk
=
this
.
clerkService
.
getclerkById
(
clerkId
)
;
String
storeWidgetId
=
clerk
.
getStoreWidgetId
()
;
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidgetBykey
(
storeWidgetId
);
if
(
0
!=
storeWidgetDTO
.
getSelectType
()
||
4
!=
storeWidgetDTO
.
getSelectType
())
{
return
this
.
resultResponse
(
HaoBanErrCode
.
ERR_10031
)
;
}
if
(
4
==
storeWidgetDTO
.
getSelectType
())
{
Page
page
=
new
Page
();
page
.
setPageSize
(
3000
);
page
.
setCurrentPage
(
1
);
page
=
this
.
storeWidgetService
.
listRightData
(
storeWidgetId
,
page
,
null
)
;
list
=
page
.
getResult
()
;
if
(
CollectionUtils
.
isEmpty
(
list
))
{
list
=
new
ArrayList
<
StoreWidgetRightDataDTO
>();
}
}
}
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
if
(
null
!=
list
)
{
List
<
PowerStoreGroupDTO
>
retList
=
new
ArrayList
<>();
List
<
String
>
idList
=
list
.
stream
().
map
(
dto
->
dto
.
getId
()).
collect
(
Collectors
.
toList
())
;
for
(
PowerStoreGroupDTO
item
:
departmentList
)
{
if
(
idList
.
contains
(
item
.
getStoreGroupId
()))
{
retList
.
add
(
item
)
;
}
else
{
for
(
String
id
:
idList
)
{
if
(
item
.
getStoreGroupChain
().
contains
(
id
))
{
retList
.
add
(
item
)
;
break
;
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
departmentList
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
81d154f9
...
...
@@ -104,7 +104,7 @@ public enum HaoBanErrCode {
ERR_10020
(
10020
,
"模板名称已存在"
),
ERR_10030
(
10030
,
"您还不是企微的管理员,无法查看通讯录,若需查看,请联系超级管理员开通"
),
ERR_10031
(
10031
,
"您的门店范围不支持分组查询"
),
ERR_10021
(
10021
,
"模板关联企业不能删除"
),
ERR_100015
(
100015
,
"暂存部门不能删除"
),
...
...
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