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
34db97f6
Commit
34db97f6
authored
Feb 26, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5bd36f54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+15
-4
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
34db97f6
...
@@ -4,14 +4,15 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -4,14 +4,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
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.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
@RestController
@RestController
...
@@ -19,17 +20,27 @@ public class InfoController extends WebBaseController{
...
@@ -19,17 +20,27 @@ public class InfoController extends WebBaseController{
public
static
final
String
siteId
=
"ww7d6566614055cf27"
;
public
static
final
String
siteId
=
"ww7d6566614055cf27"
;
@Autowired
@Autowired
private
ApplicationApiService
applicationApiService
;
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
private
QywxCorpApiService
qywxCorpApiService
;
@Autowired
@Autowired
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@RequestMapping
(
"get-info-by-code"
)
@RequestMapping
(
"get-info-by-code"
)
public
HaobanResponse
getInfoByCode
(
String
code
)
{
public
HaobanResponse
getInfoByCode
(
String
code
)
{
String
userId
=
qywxCorpApiService
.
getUserInfoSimple
(
siteId
,
code
);
String
userDTOJson
=
qywxCorpApiService
.
getUserInfoSimple
(
siteId
,
code
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
String
userId
=
user
.
getUserid
();
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
if
(
loginStaff
==
null
){
String
corpId
=
user
.
getCorpid
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
if
(
enterprise
!=
null
){
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
}
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
siteId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
siteId
);
...
...
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