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
75c37c57
Commit
75c37c57
authored
Apr 01, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取企业登录用户信息-门店列表
parent
b5ed472e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
9 deletions
+113
-9
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+9
-1
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+20
-0
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+43
-8
MemberLoginQo.java
...main/java/com/gic/haoban/manage/web/qo/MemberLoginQo.java
+41
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
75c37c57
...
@@ -150,5 +150,13 @@ public interface DepartmentApiService {
...
@@ -150,5 +150,13 @@ public interface DepartmentApiService {
* @param departmentId
* @param departmentId
*/
*/
ServiceResponse
gicDel
(
String
departmentId
);
ServiceResponse
gicDel
(
String
departmentId
);
/**
* 查门店/部门列表
*
* @param
* @return
*/
ServiceResponse
<
List
<
DepartmentDTO
>>
listStoreListByStaffId
(
String
wxUserId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
75c37c57
...
@@ -4,13 +4,16 @@ import java.util.ArrayList;
...
@@ -4,13 +4,16 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -70,6 +73,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -70,6 +73,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
private
StoreGroupService
storeGroupService
;
private
StoreGroupService
storeGroupService
;
@Autowired
@Autowired
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Override
@Override
...
@@ -661,4 +667,18 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -661,4 +667,18 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
}
@Override
public
ServiceResponse
<
List
<
DepartmentDTO
>>
listStoreListByStaffId
(
String
staffId
)
{
ServiceResponse
<
List
<
DepartmentDTO
>>
rer
=
new
ServiceResponse
<
List
<
DepartmentDTO
>>();
List
<
StaffDepartmentRelatedDTO
>
relateList
=
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
if
(
CollectionUtils
.
isEmpty
(
relateList
))
{
logger
.
info
(
"没有部分显示:{}"
,
staffId
);
return
rer
;
}
List
<
String
>
departmentIds
=
relateList
.
stream
().
map
(
dto
->
dto
.
getDepartmentId
()).
collect
(
Collectors
.
toList
());
List
<
DepartmentDTO
>
departmentList
=
listByDepartmentIds
(
departmentIds
,
1
);
rer
.
setResult
(
departmentList
);
return
rer
;
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
75c37c57
...
@@ -2,19 +2,26 @@ package com.gic.haoban.manage.web.controller;
...
@@ -2,19 +2,26 @@ package com.gic.haoban.manage.web.controller;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.contacts.manage.api.service.StoreService
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.MemberLoginQo
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -42,6 +49,12 @@ public class InfoController extends WebBaseController{
...
@@ -42,6 +49,12 @@ public class InfoController extends WebBaseController{
@Autowired
@Autowired
private
QywxUserApiService
qywxUserApiService
;
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
StoreService
storeService
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InfoController
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InfoController
.
class
);
@Autowired
@Autowired
...
@@ -102,19 +115,41 @@ public class InfoController extends WebBaseController{
...
@@ -102,19 +115,41 @@ public class InfoController extends WebBaseController{
}
}
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getMemberSecret
(),
code
);
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getMemberSecret
(),
code
);
logger
.
info
(
"会员微信登录信息=============>{}"
,
userDTOJson
);
logger
.
info
(
"会员微信登录信息=============>{}"
,
userDTOJson
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
MemberLoginQo
user
=
JSON
.
parseObject
(
userDTOJson
,
MemberLoginQo
.
class
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
}
String
userId
=
user
.
getUserid
();
String
corpId
=
user
.
getCorpid
();
Map
<
String
,
String
>
ret
=
new
HashMap
<>();
StaffDTO
staffDTO
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
user
.
getUserId
(),
enterpriseDTO
.
getWxEnterpriseId
());
ret
.
put
(
"userId"
,
userId
);
if
(
staffDTO
==
null
)
{
ret
.
put
(
"corpId"
,
corpId
);
logger
.
info
(
"成员不存在"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
ServiceResponse
<
List
<
DepartmentDTO
>>
response
=
departmentApiService
.
listStoreListByStaffId
(
staffDTO
.
getStaffId
());
List
<
DepartmentDTO
>
result
=
response
.
getResult
();
List
<
StoreVO
>
retList
=
new
ArrayList
<>();
if
(
response
.
getCode
()
==
1
&&
CollectionUtils
.
isNotEmpty
(
result
))
{
result
.
stream
().
forEach
(
dto
->
{
StoreVO
VO
=
new
StoreVO
();
VO
.
setDepartmentId
(
dto
.
getDepartmentId
());
VO
.
setStoreId
(
dto
.
getRelatedId
());
//为空,则无该值
VO
.
setStoreName
(
dto
.
getDepartmentName
());
VO
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
VO
.
setStoreImg
(
""
);
//先置空
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
dto
.
getRelatedId
()))
{
StoreDTO
storeDTO
=
storeService
.
getStore
(
dto
.
getRelatedId
());
if
(
storeDTO
!=
null
)
{
VO
.
setEnterpriseId
(
storeDTO
.
getEnterpriseId
());
VO
.
setStoreImg
(
storeDTO
.
getImageUrl
());
//先置空
}
}
VO
.
setCreateTime
(
dto
.
getCreateTime
());
retList
.
add
(
VO
);
});
user
.
setStoreList
(
retList
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
user
);
}
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/MemberLoginQo.java
0 → 100644
View file @
75c37c57
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* Created 2020/4/1.
*
* @author hua
*/
public
class
MemberLoginQo
implements
Serializable
{
private
String
userId
;
private
String
corpId
;
private
List
<
StoreVO
>
storeList
;
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getCorpId
()
{
return
corpId
;
}
public
void
setCorpId
(
String
corpId
)
{
this
.
corpId
=
corpId
;
}
public
List
<
StoreVO
>
getStoreList
()
{
return
storeList
;
}
public
void
setStoreList
(
List
<
StoreVO
>
storeList
)
{
this
.
storeList
=
storeList
;
}
}
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