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
3fd2d994
Commit
3fd2d994
authored
Feb 22, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加日志
parent
9b03fbb7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
380 additions
and
3 deletions
+380
-3
QywxCorpInfoDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxCorpInfoDTO.java
+166
-0
WxApplicationDTO.java
.../java/com/gic/haoban/manage/api/dto/WxApplicationDTO.java
+119
-0
WxApplicationApiService.java
...ic/haoban/manage/api/service/WxApplicationApiService.java
+10
-0
WxEnterpriseApiService.java
...gic/haoban/manage/api/service/WxEnterpriseApiService.java
+2
-0
TabHaobanWxApplication.java
.../haoban/manage/service/entity/TabHaobanWxApplication.java
+1
-1
WxApplicationApiServiceImpl.java
...service/service/out/impl/WxApplicationApiServiceImpl.java
+28
-0
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+6
-0
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+22
-2
test.java
.../main/java/com/gic/haoban/manage/web/controller/test.java
+25
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxCorpInfoDTO.java
0 → 100644
View file @
3fd2d994
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
/**
*
* 企业微信授权信息
*
*/
public
class
QywxCorpInfoDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
errcode
;
private
String
errmsg
;
/* 授权方企业微信id */
private
String
corpid
;
/* 授权方企业微信名称 */
private
String
corpName
;
/* 授权方企业微信类型,认证号:verified, 注册号:unverified */
private
String
corpType
;
/* 授权方企业微信方形头像 */
private
String
corpSquareLogoUrl
;
/* 授权管理员的userid,可能为空(内部管理员一定有,不可更改) */
private
String
userid
;
/* 授权管理员的name,可能为空(内部管理员一定有,不可更改) */
private
String
name
;
/* 授权管理员的头像url */
private
String
avatar
;
/* 授权方应用id */
private
String
agentid
;
/* 授权方应用名字 */
private
String
agentName
;
/* 授权方应用方形头像 */
private
String
agentSquareLogoUrl
;
/* 授权方应用圆形头像 */
private
String
roundLogoUrl
;
/* 应用id */
private
String
suiteId
;
public
Integer
getErrcode
()
{
return
errcode
;
}
public
void
setErrcode
(
Integer
errcode
)
{
this
.
errcode
=
errcode
;
}
public
String
getErrmsg
()
{
return
errmsg
;
}
public
void
setErrmsg
(
String
errmsg
)
{
this
.
errmsg
=
errmsg
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getCorpName
()
{
return
corpName
;
}
public
void
setCorpName
(
String
corpName
)
{
this
.
corpName
=
corpName
;
}
public
String
getCorpType
()
{
return
corpType
;
}
public
void
setCorpType
(
String
corpType
)
{
this
.
corpType
=
corpType
;
}
public
String
getCorpSquareLogoUrl
()
{
return
corpSquareLogoUrl
;
}
public
void
setCorpSquareLogoUrl
(
String
corpSquareLogoUrl
)
{
this
.
corpSquareLogoUrl
=
corpSquareLogoUrl
;
}
public
String
getUserid
()
{
return
userid
;
}
public
void
setUserid
(
String
userid
)
{
this
.
userid
=
userid
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
public
String
getAgentid
()
{
return
agentid
;
}
public
void
setAgentid
(
String
agentid
)
{
this
.
agentid
=
agentid
;
}
public
String
getAgentName
()
{
return
agentName
;
}
public
void
setAgentName
(
String
agentName
)
{
this
.
agentName
=
agentName
;
}
public
String
getAgentSquareLogoUrl
()
{
return
agentSquareLogoUrl
;
}
public
void
setAgentSquareLogoUrl
(
String
agentSquareLogoUrl
)
{
this
.
agentSquareLogoUrl
=
agentSquareLogoUrl
;
}
public
String
getRoundLogoUrl
()
{
return
roundLogoUrl
;
}
public
void
setRoundLogoUrl
(
String
roundLogoUrl
)
{
this
.
roundLogoUrl
=
roundLogoUrl
;
}
public
String
getSuiteId
()
{
return
suiteId
;
}
public
void
setSuiteId
(
String
suiteId
)
{
this
.
suiteId
=
suiteId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxApplicationDTO.java
0 → 100644
View file @
3fd2d994
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
WxApplicationDTO
implements
Serializable
{
private
String
wxApplicationId
;
private
String
siteId
;
private
String
name
;
private
String
permanentCode
;
private
String
agentName
;
private
String
agentId
;
private
Integer
applicationType
;
private
String
wxEnterpriseId
;
private
Integer
statusFlag
;
private
Date
createTime
;
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getWxApplicationId
()
{
return
wxApplicationId
;
}
public
void
setWxApplicationId
(
String
wxApplicationId
)
{
this
.
wxApplicationId
=
wxApplicationId
==
null
?
null
:
wxApplicationId
.
trim
();
}
public
String
getSiteId
()
{
return
siteId
;
}
public
void
setSiteId
(
String
siteId
)
{
this
.
siteId
=
siteId
==
null
?
null
:
siteId
.
trim
();
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
==
null
?
null
:
name
.
trim
();
}
public
String
getPermanentCode
()
{
return
permanentCode
;
}
public
void
setPermanentCode
(
String
permanentCode
)
{
this
.
permanentCode
=
permanentCode
==
null
?
null
:
permanentCode
.
trim
();
}
public
String
getAgentName
()
{
return
agentName
;
}
public
void
setAgentName
(
String
agentName
)
{
this
.
agentName
=
agentName
==
null
?
null
:
agentName
.
trim
();
}
public
String
getAgentId
()
{
return
agentId
;
}
public
void
setAgentId
(
String
agentId
)
{
this
.
agentId
=
agentId
==
null
?
null
:
agentId
.
trim
();
}
public
Integer
getApplicationType
()
{
return
applicationType
;
}
public
void
setApplicationType
(
Integer
applicationType
)
{
this
.
applicationType
=
applicationType
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxApplicationApiService.java
0 → 100644
View file @
3fd2d994
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
/**
* Created by tgs on 2020/2/22.
*/
public
interface
WxApplicationApiService
{
void
addSuite
(
WxApplicationDTO
dto
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseApiService.java
View file @
3fd2d994
...
...
@@ -24,4 +24,6 @@ public interface WxEnterpriseApiService {
* @return
*/
WxEnterpriseDTO
getOne
(
String
wxEnterpriseId
);
WxEnterpriseDTO
getEnterpriseBycorpId
(
String
corpId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxApplication.java
View file @
3fd2d994
...
...
@@ -16,7 +16,7 @@ public class TabHaobanWxApplication implements Serializable {
private
String
agentId
;
private
Integer
applicationType
;
private
Integer
applicationType
=
2
;
private
String
wxEnterpriseId
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxApplicationApiServiceImpl.java
0 → 100644
View file @
3fd2d994
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created by tgs on 2020/2/22.
*/
@Service
(
"wxApplicationApiService"
)
public
class
WxApplicationApiServiceImpl
implements
WxApplicationApiService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
WxApplicationApiServiceImpl
.
class
);
@Autowired
private
WxApplicationService
wxApplicationService
;
@Override
public
void
addSuite
(
WxApplicationDTO
dto
)
{
TabHaobanWxApplication
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanWxApplication
.
class
,
dto
);
this
.
wxApplicationService
.
insert
(
tab
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
3fd2d994
...
...
@@ -106,6 +106,12 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
return
wxDTO
;
}
@Override
public
WxEnterpriseDTO
getEnterpriseBycorpId
(
String
corpId
)
{
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseBycorpId
(
corpId
);
return
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
enterprise
);
}
private
void
addAllDepartment
(
List
<
DepartmentDTO
>
list
,
Integer
parentId
,
String
wxEnterpriseId
){
int
level
=
1
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
3fd2d994
...
...
@@ -2,7 +2,11 @@ package com.gic.haoban.manage.web.controller;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -13,7 +17,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.ApplicationDTO
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
...
...
@@ -24,6 +27,10 @@ public class ApplicationController extends WebBaseController{
private
ApplicationApiService
applicationApiService
;
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
...
...
@@ -38,7 +45,7 @@ public class ApplicationController extends WebBaseController{
//String suiteId = GlobalVar.ctxPropertiesMap.get("suiteId");
String
suiteId
=
"ww7d6566614055cf27"
;
log
.
info
(
"应用ID:{}"
,
suiteId
);
String
redictUrl
=
"http
://gicdev.demogic
.com/haoban-manage3-web/callback"
;
String
redictUrl
=
"http
s://www.gicdev
.com/haoban-manage3-web/callback"
;
String
authorizationUrl
=
this
.
qywxSuiteApiService
.
getGrantAuthorizationUrl
(
suiteId
,
redictUrl
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
authorizationUrl
);
}
...
...
@@ -48,7 +55,20 @@ public class ApplicationController extends WebBaseController{
public
HaobanResponse
callback
(
String
code
){
String
suiteId
=
"ww7d6566614055cf27"
;
String
result
=
this
.
qywxSuiteApiService
.
corpAuth
(
suiteId
,
code
);
QywxCorpInfoDTO
dto
=
JSON
.
parseObject
(
result
,
QywxCorpInfoDTO
.
class
);
WxApplicationDTO
applicationDTO
=
new
WxApplicationDTO
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
dto
.
getCorpid
());
if
(
enterpriseDTO
!=
null
){
applicationDTO
.
setName
(
dto
.
getAgentName
());
applicationDTO
.
setWxEnterpriseId
(
enterpriseDTO
.
getWxEnterpriseId
());
applicationDTO
.
setAgentId
(
dto
.
getAgentid
());
applicationDTO
.
setApplicationType
(
1
);
applicationDTO
.
setAgentName
(
dto
.
getAgentName
());
applicationDTO
.
setSiteId
(
dto
.
getSuiteId
());
wxApplicationApiService
.
addSuite
(
applicationDTO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_0
,
dto
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/test.java
0 → 100644
View file @
3fd2d994
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Created by tgs on 2020/2/22.
*/
public
class
Test
{
public
static
void
main
(
String
[]
args
){
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"pre_auth_code"
,
"pre"
);
Map
<
String
,
Object
>
sessionInfo
=
new
HashMap
<>();
sessionInfo
.
put
(
"appid"
,
new
String
[]{
"1"
,
"2"
});
sessionInfo
.
put
(
"auth_type"
,
1
);
param
.
put
(
"session_info"
,
sessionInfo
);
System
.
out
.
println
(
JSON
.
toJSONString
(
param
));
System
.
out
.
println
(
new
String
[]{
"1"
,
"2"
});
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
3fd2d994
...
...
@@ -38,6 +38,7 @@
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxCorpApiService"
id=
"qywxCorpApiService"
/>
<dubbo:reference
interface=
"com.gic.dict.api.service.ManagerDictService"
id=
"managerDictService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxSuiteApiService"
id=
"qywxSuiteApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxApplicationApiService"
id=
"wxApplicationApiService"
/>
...
...
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