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
99874cac
Commit
99874cac
authored
Feb 24, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
fc8e3ad3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+1
-1
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+0
-3
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+24
-5
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
99874cac
...
...
@@ -218,7 +218,7 @@ public class StaffApiServiceImpl implements StaffApiService {
TabHaobanStaff
staff
=
staffService
.
selectByUserId
(
userId
);
if
(
staff
==
null
)
{
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
staff
.
getWxEnterpriseId
()
);
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
staff
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
99874cac
...
...
@@ -265,10 +265,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"unbind-department-list"
)
public
HaobanResponse
unbindDepartmentList
(
String
departmentId
,
String
enterpriseId
,
Integer
type
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
list
.
add
(
departmentId
);
List
<
GicTreeDTO
>
departmentList
=
storeGroupService
.
listGicTree
(
enterpriseId
,
type
,
departmentId
);
List
<
DepartmentDTO
>
dtoList
=
new
ArrayList
<
DepartmentDTO
>();
for
(
GicTreeDTO
departmentDTO
:
departmentList
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectByRelatedId
(
departmentDTO
.
getId
());
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
99874cac
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -11,13 +12,17 @@ import com.alibaba.fastjson.JSON;
import
com.gic.commons.web.ResponseThreadLocal
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
...
...
@@ -37,17 +42,31 @@ public class LoginController extends WebBaseController{
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
Config
config
;
@RequestMapping
(
"login"
)
public
void
login
(
String
auth_code
,
HttpServletResponse
response
)
{
String
siteId
=
config
.
getSuiteId
();
//String userId = qywxCorpApiService.getUserInfoSimple(siteId,auth_code);
String
userId
=
qywxCorpApiService
.
getLoginUserInfo
(
config
.
getCorpid
(),
auth_code
);
logger
.
info
(
"【企业微信登录】userId={},auth_code={}"
,
userId
,
auth_code
);
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
String
userJson
=
qywxCorpApiService
.
getLoginUserInfo
(
config
.
getCorpid
(),
auth_code
);
if
(
StringUtils
.
isBlank
(
userJson
)){
return
;
}
UserDTO
user
=
JSON
.
parseObject
(
userJson
,
UserDTO
.
class
);
logger
.
info
(
"【企业微信登录】userId={},auth_code={}"
,
user
.
getUserid
(),
auth_code
);
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
user
.
getUserid
());
if
(
loginStaff
==
null
){
String
corpId
=
user
.
getCorpid
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
if
(
enterprise
!=
null
){
staffApiService
.
wxGetAdd
(
user
.
getUserid
(),
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserId
(
user
.
getUserid
());
}
}
LoginVO
loginVO
=
new
LoginVO
();
StaffDTO
staff
=
staffApiService
.
selectById
(
"1"
);
...
...
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