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
162036e0
Commit
162036e0
authored
Mar 30, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
81165516
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
237 additions
and
18 deletions
+237
-18
QywxCallBackDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
+12
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+4
-1
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+5
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+8
-0
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+67
-5
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+1
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+15
-0
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+3
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+15
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+15
-0
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+14
-0
AdminController.java
...com/gic/haoban/manage/web/controller/AdminController.java
+64
-0
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+1
-11
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+3
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
View file @
162036e0
...
...
@@ -31,6 +31,8 @@ public class QywxCallBackDTO implements Serializable{
* 成员创建:create_user;成员修改:update_user;成员删除:delete_user*/
private
String
changeType
;
private
String
avatar
;
public
String
getSuiteId
()
{
return
suiteId
;
}
...
...
@@ -190,4 +192,14 @@ public class QywxCallBackDTO implements Serializable{
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
162036e0
...
...
@@ -58,4 +58,6 @@ public interface StaffApiService {
public
int
countByDepartmentIds
(
List
<
String
>
departmentIds
);
public
List
<
StaffDTO
>
listByPhoneNumber
(
String
phoneNumber
);
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
162036e0
...
...
@@ -60,4 +60,6 @@ public interface DepartmentMapper {
int
countByDepartment
(
@Param
(
"departmentId"
)
String
departmentId
);
TabHaobanDepartment
getByRelatedIdNotInRecycle
(
@Param
(
"relatedId"
)
String
relatedId
);
Object
listByIds
(
@Param
(
"departmentIds"
)
List
<
String
>
departmentIds
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
162036e0
...
...
@@ -34,4 +34,6 @@ public interface StaffMapper {
TabHaobanStaff
selectSuperByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanStaff
>
listByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
TabHaobanStaff
listByUserIdsAndWxEnterpriseId
(
@Param
(
"userIds"
)
List
<
String
>
userIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
162036e0
...
...
@@ -44,4 +44,6 @@ public interface DepartmentService {
DepartmentDTO
getByRelatedIdNotInRecycle
(
String
relatedId
);
List
<
DepartmentDTO
>
listByIds
(
List
<
String
>
departmentIds
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
162036e0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
java.util.List
;
import
java.util.Set
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.github.pagehelper.Page
;
public
interface
StaffService
{
...
...
@@ -22,4 +23,6 @@ public interface StaffService {
TabHaobanStaff
selectByUserIdAndEnterpriseId
(
String
userId
,
String
wxEnterpriseId
);
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
162036e0
...
...
@@ -164,4 +164,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
mapper
.
getByRelatedIdNotInRecycle
(
relatedId
));
}
@Override
public
List
<
DepartmentDTO
>
listByIds
(
List
<
String
>
departmentIds
)
{
return
EntityUtil
.
changeEntityListByJSON
(
DepartmentDTO
.
class
,
mapper
.
listByIds
(
departmentIds
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
162036e0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.service.StaffService
;
...
...
@@ -71,4 +74,9 @@ public class StaffServiceImpl implements StaffService {
return
this
.
mapper
.
updateByPrimaryKeySelective
(
staff
);
}
@Override
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
)
{
return
EntityUtil
.
changeEntityListByJSON
(
StaffDTO
.
class
,
this
.
mapper
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
162036e0
...
...
@@ -14,9 +14,13 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
...
...
@@ -26,6 +30,7 @@ import com.gic.haoban.manage.service.service.StaffService;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.service.MemberOpenCardBusinessService
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.redis.data.anno.RedisLock
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -50,6 +55,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private
static
final
String
SELF_APP
=
"selfSuiteId"
;
@Autowired
private
MemberOpenCardBusinessService
memberOpenCardBusinessService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
ClerkService
clerkService
;
@Override
public
MemberUnionidRelatedDTO
getByUnionId
(
String
staffId
,
String
unionid
)
{
...
...
@@ -84,6 +97,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
follow_user
=
""
;
String
createTime
=
""
;
String
userId
=
""
;
String
avatar
=
""
;
if
(
StringUtils
.
isNotBlank
(
unionIdJson
)){
JSONObject
jo
=
JSON
.
parseObject
(
unionIdJson
);
String
external_contact
=
jo
.
getString
(
"external_contact"
);
...
...
@@ -94,6 +108,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
follow_user
=
jo
.
getString
(
"follow_user"
);
avatar
=
jo
.
getString
(
"avatar"
);
if
(
StringUtils
.
isNotBlank
(
follow_user
)){
JSONArray
j
=
JSON
.
parseArray
(
follow_user
);
for
(
Object
object
:
j
)
{
...
...
@@ -113,17 +128,31 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
SELF_APP
.
equals
(
suiteid
)){
MemberDTO
member
=
null
;
for
(
TabHaobanWxEnterpriseRelated
tabHaobanWxEnterpriseRelated
:
list
)
{
member
=
memberService
.
getMemberByUnionid
(
unionId
,
tabHaobanWxEnterpriseRelated
.
getEnterpriseId
());
if
(
member
!=
null
){
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userId
,
tabHaobanWxEnterpriseRelated
.
getWxEnterpriseId
());
List
<
StaffDepartmentRelatedDTO
>
relatedList
=
staffDepartmentRelatedApiService
.
listByStaffId
(
staff
.
getStaffId
());
String
clerkCode
=
""
;
if
(!
relatedList
.
isEmpty
()){
for
(
StaffDepartmentRelatedDTO
staffDepartmentRelatedDTO
:
relatedList
)
{
clerkCode
=
staffDepartmentRelatedDTO
.
getClerkCode
();
if
(
StringUtils
.
isNotBlank
(
clerkCode
)){
break
;
}
}
}
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
tabHaobanWxEnterpriseRelated
.
getEnterpriseId
(),
clerkCode
);
if
(
clerk
!=
null
){
member
=
memberOpenCardBusinessService
.
getMemberByQywxChannelParam
(
tabHaobanWxEnterpriseRelated
.
getEnterpriseId
(),
unionId
,
null
,
name
,
avatar
,
clerk
.
getQrcodeParam
());
}
//member = memberService.getMemberByUnionid(unionId, tabHaobanWxEnterpriseRelated.getEnterpriseId());
// if(member != null){
// break;
// }
if
(
member
!=
null
){
dto
.
setMemberId
(
member
.
getMemberId
());
}
dto
.
setSelfExternalUserid
(
dto
.
getExternalUserid
());
dto
.
setUnionid
(
unionId
);
}
dto
.
setExternalName
(
name
);
dto
.
setAddCreateTime
(
createTime
);
...
...
@@ -134,7 +163,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
dto
.
setWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
dto
.
setSuiteid
(
wxEnterprise
.
getWxSecretKey
());
MemberUnionidRelatedDTO
exsitDTO
=
memberUnionRelatedService
.
getByParams
(
dto
.
getWxUserId
(),
wxEnterprise
.
getWx
EnterpriseId
(),
name
,
createTime
);
MemberUnionidRelatedDTO
exsitDTO
=
memberUnionRelatedService
.
getByParams
(
dto
.
getWxUserId
(),
tabHaobanWxEnterpriseRelated
.
get
EnterpriseId
(),
name
,
createTime
);
String
uuid
=
""
;
if
(
exsitDTO
==
null
){
uuid
=
memberUnionRelatedService
.
addMemberUnionidRelated
(
dto
);
...
...
@@ -150,7 +179,40 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberUnionRelatedService
.
update
(
exsitDTO
);
uuid
=
exsitDTO
.
getMemberUnionidRelatedId
();
}
return
uuid
;
}
// if(member != null){
// dto.setMemberId(member.getMemberId());
// }
// dto.setSelfExternalUserid(dto.getExternalUserid());
// dto.setUnionid(unionId);
}
// dto.setExternalName(name);
// dto.setAddCreateTime(createTime);
// if(StringUtils.isBlank(unionId)){
// return "";
// }
//
// dto.setWxEnterpriseId(wxEnterprise.getWxEnterpriseId());
// dto.setSuiteid(wxEnterprise.getWxSecretKey());
//
// MemberUnionidRelatedDTO exsitDTO = memberUnionRelatedService.getByParams(dto.getWxUserId(), wxEnterprise.getWxEnterpriseId(),name,createTime);
// String uuid = "";
// if(exsitDTO == null){
// uuid = memberUnionRelatedService.addMemberUnionidRelated(dto);
// }else{
// //如果是自建更新uuid
// if(SELF_APP.equals(suiteid)){
// exsitDTO.setUnionid(unionId);
// exsitDTO.setMemberId(dto.getMemberId());
// }else{
// //更新对外联系人id
// exsitDTO.setExternalUserid(dto.getExternalUserid());
// }
// memberUnionRelatedService.update(exsitDTO);
// uuid = exsitDTO.getMemberUnionidRelatedId();
// }
return
""
;
}
@Override
public
void
delMemberUnionidRelated
(
MemberUnionidRelatedDTO
dto
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
162036e0
...
...
@@ -224,6 +224,7 @@ public class MessageApiServiceImpl implements MessageApiService {
staff
.
setStaffName
(
qywxCallBackDTO
.
getUserName
());
staff
.
setWxUserId
(
qywxCallBackDTO
.
getUserid
());
staff
.
setPostion
(
qywxCallBackDTO
.
getPosition
());
staff
.
setHeadImg
(
qywxCallBackDTO
.
getAvatar
());
staff
.
setNationCode
(
"86"
);
//激活状态
if
(
qywxCallBackDTO
.
getStatus
()
!=
null
&&
qywxCallBackDTO
.
getStatus
()
==
1
){
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
162036e0
...
...
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.haoban.manage.api.dto.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.hibernate.hql.internal.CollectionSubqueryFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -796,6 +797,20 @@ public class StaffApiServiceImpl implements StaffApiService {
}
return
staffDepartmentRelatedMapper
.
countByDepartmentIds
(
departmentIds
);
}
@Override
public
List
<
StaffDTO
>
listByUserIdsAndWxEnterpriseId
(
List
<
String
>
userIds
,
String
wxEnterpriseId
)
{
List
<
StaffDTO
>
list
=
staffService
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
for
(
StaffDTO
staffDTO
:
list
)
{
List
<
String
>
departmentIds
=
new
ArrayList
<>();
List
<
TabHaobanStaffDepartmentRelated
>
relatedList
=
staffDepartmentRelatedService
.
listStaffDepartmentByStaffId
(
staffDTO
.
getStaffId
());
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
relatedList
)
{
departmentIds
.
add
(
tabHaobanStaffDepartmentRelated
.
getDepartmentId
());
}
List
<
DepartmentDTO
>
departmentList
=
departmentService
.
listByIds
(
departmentIds
);
staffDTO
.
setDepartmentList
(
departmentList
);
}
return
list
;
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
...
...
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
162036e0
...
...
@@ -49,5 +49,7 @@
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOpenCardBusinessService"
id=
"memberOpenCardBusinessService"
/>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
162036e0
...
...
@@ -462,4 +462,18 @@
and status_flag = 1
and recycle_flag != 1
</select>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where status_flag = 1
<if
test=
"departmentIds != null and departmentIds.size() > 0"
>
and department_id IN
<foreach
collection=
"departmentIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
order by sort desc
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
162036e0
...
...
@@ -317,4 +317,18 @@
and super_manager_flag = 1
</select>
<select
id=
"listByUserIdsAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"userIds != null and userIds.size() > 0"
>
and wx_user_id IN
<foreach
collection=
"userIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
162036e0
...
...
@@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
...
...
@@ -142,4 +143,17 @@ public class AuthRequestUtil {
.
getRequestAttributes
();
return
attrs
.
getResponse
();
}
public
static
Object
getLoginUser
()
{
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
){
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
)){
token
=
cookie
.
getValue
();
}
}
}
return
getAppLoginUser
(
token
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AdminController.java
0 → 100644
View file @
162036e0
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
@RestController
public
class
AdminController
extends
WebBaseController
{
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
1
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
adminList
=
qywxSuiteApiService
.
getAdminList
(
enterprise
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
application
.
getAgentId
()));
List
<
String
>
userIds
=
new
ArrayList
<
String
>();
if
(
StringUtils
.
isNotBlank
(
adminList
)){
JSONArray
jsonArr
=
JSON
.
parseArray
(
adminList
);
for
(
Object
object
:
jsonArr
)
{
JSONObject
json
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
userIds
.
add
(
json
.
getString
(
"userId"
));
}
}
List
<
StaffDTO
>
list
=
new
ArrayList
<>();
if
(!
userIds
.
isEmpty
()){
list
=
staffApiService
.
listByUserIdsAndWxEnterpriseId
(
userIds
,
wxEnterpriseId
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
162036e0
...
...
@@ -119,17 +119,7 @@ public class LoginController extends WebBaseController{
@RequestMapping
(
"get-login-info"
)
public
HaobanResponse
getLoginInfo
(){
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
){
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
)){
token
=
cookie
.
getValue
();
}
}
}
LoginVO
loginVO
=
(
LoginVO
)
AuthRequestUtil
.
getAppLoginUser
(
token
);
LoginVO
loginVO
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
162036e0
...
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.Cookie
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -52,7 +54,7 @@ public class StaffController extends WebBaseController{
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Sessio
nUser
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Logi
nUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
...
...
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