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
a8b75126
Commit
a8b75126
authored
Dec 20, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:企微微信授权修改
parent
dcb29c38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
28 deletions
+52
-28
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+10
-0
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+18
-6
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+5
-0
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+10
-22
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+9
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
a8b75126
...
...
@@ -37,4 +37,13 @@ public interface WxEnterpriseMapper {
*/
TabHaobanWxEnterprise
getEnterpriseBycorpId
(
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"statusFlag"
)
Integer
statusFlag
);
/**
* 获取公司by企业名称
*
* @param corpName 公司名称
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-20 20:09:52
*/
TabHaobanWxEnterprise
getEnterpriseByCorpName
(
@Param
(
"corpName"
)
String
corpName
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
a8b75126
...
...
@@ -33,12 +33,24 @@ public interface WxEnterpriseService {
int
unbind
(
String
wxEnterpriseId
);
@Deprecated
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpid
);
/**
* 所有企业微信
*
* @return
*/
List
<
TabHaobanWxEnterprise
>
listAll
();
/**
* 得到企业bycorp名称
*
* @param corpName 公司名称
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-20 20:09:21
*/
TabHaobanWxEnterprise
getEnterpriseByCorpName
(
String
corpName
);
/**
* 所有企业微信
*
* @return
*/
List
<
TabHaobanWxEnterprise
>
listAll
();
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
a8b75126
...
...
@@ -76,6 +76,11 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
@Override
public
TabHaobanWxEnterprise
getEnterpriseByCorpName
(
String
corpName
)
{
return
this
.
mapper
.
getEnterpriseByCorpName
(
corpName
);
}
@Override
public
List
<
TabHaobanWxEnterprise
>
listAll
()
{
return
mapper
.
listAll
();
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
a8b75126
...
...
@@ -61,6 +61,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
public
void
callbackReviceEnterprise
(
QywxCorpInfoSimpleDTO
dto
)
{
log
.
info
(
"企业微信授权信息:{}"
,
JSON
.
toJSONString
(
dto
));
String
corpid
=
dto
.
getCorpid
();
String
corpName
=
dto
.
getCorpName
();
String
siteId
=
dto
.
getSuiteId
();
String
agentId
=
dto
.
getAgentid
();
String
agentName
=
dto
.
getAgentName
();
...
...
@@ -70,33 +71,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
Integer
isCustomizedApp
=
dto
.
getIsCustomizedApp
();
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
String
wxEnterpriseId
=
""
;
if
(
isCustomizedApp
!=
null
&&
isCustomizedApp
==
1
)
{
//代开发
String
toOpenCorpid
=
qywxUserApiService
.
toOpenCorpid
(
corpid
,
siteId
);
log
.
info
(
"明文corpid:{},加密后的toOpenCorpid为:{}"
,
corpid
,
toOpenCorpid
);
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseBycorpIdNoStatus
(
toOpenCorpid
);
if
(
enterprise
!=
null
)
{
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
(
);
}
//获取授权好办小程序
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseByCorpName
(
corpName
);
if
(
enterprise
!=
null
)
{
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
(
);
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
()
);
wxDTO
.
setStatusFlag
(
1
);
wxDTO
.
setBindFlag
(
1
);
wxEnterpriseService
.
update
(
wxDTO
);
}
else
{
//授权好办小程序
//只需要插入更新好办小程序企业,代开发 企业表不插入
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseBycorpIdNoStatus
(
corpid
);
if
(
enterprise
!=
null
)
{
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
wxDTO
.
setStatusFlag
(
1
);
wxDTO
.
setBindFlag
(
1
);
wxEnterpriseService
.
update
(
wxDTO
);
}
else
{
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
}
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
}
if
(
StringUtils
.
isNotBlank
(
userId
))
{
staffApiService
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
}
TabHaobanWxApplication
tab
=
wxApplicationService
.
selectBySiteIdAndWxEnterpriseId
(
siteId
,
wxEnterpriseId
);
if
(
tab
==
null
)
{
tab
=
new
TabHaobanWxApplication
();
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
a8b75126
...
...
@@ -449,4 +449,12 @@
limit 1
</select>
<select
id=
"getEnterpriseByCorpName"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise
where corp_name = #{corpName}
order by create_time desc limit 1
</select>
</mapper>
\ No newline at end of file
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