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
c744a50e
Commit
c744a50e
authored
Mar 12, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志
parent
f3f4d1eb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
31 deletions
+70
-31
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+29
-26
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+8
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+17
-1
WxApplicationApiServiceImpl.java
...service/service/out/impl/WxApplicationApiServiceImpl.java
+7
-0
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+9
-4
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+0
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
c744a50e
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
public
interface
WxEnterpriseMapper
{
int
deleteByPrimaryKey
(
String
wxEnterpriseId
);
int
insert
(
TabHaobanWxEnterprise
record
);
int
insertSelective
(
TabHaobanWxEnterprise
record
);
TabHaobanWxEnterprise
selectByPrimaryKey
(
String
wxEnterpriseId
);
int
updateByPrimaryKeySelective
(
TabHaobanWxEnterprise
record
);
int
updateByPrimaryKey
(
TabHaobanWxEnterprise
record
);
Page
<
TabHaobanWxEnterprise
>
list
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"gicContactFlag"
)
Integer
gicContactFlag
,
@Param
(
"version"
)
String
version
);
List
<
TabHaobanWxEnterprise
>
listBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
public
interface
WxEnterpriseMapper
{
int
deleteByPrimaryKey
(
String
wxEnterpriseId
);
int
insert
(
TabHaobanWxEnterprise
record
);
int
insertSelective
(
TabHaobanWxEnterprise
record
);
TabHaobanWxEnterprise
selectByPrimaryKey
(
String
wxEnterpriseId
);
int
updateByPrimaryKeySelective
(
TabHaobanWxEnterprise
record
);
int
updateByPrimaryKey
(
TabHaobanWxEnterprise
record
);
Page
<
TabHaobanWxEnterprise
>
list
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"gicContactFlag"
)
Integer
gicContactFlag
,
@Param
(
"version"
)
String
version
);
List
<
TabHaobanWxEnterprise
>
listBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
List
<
TabHaobanWxEnterprise
>
listDelBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
c744a50e
...
...
@@ -16,6 +16,14 @@ public interface WxEnterpriseService {
*/
TabHaobanWxEnterprise
getEnterpriseBycorpId
(
String
corpId
);
/**
* 通过微信企业ID查询删除状态好办企业ID
* @param corpId
* @return
*/
TabHaobanWxEnterprise
getDelEnterpriseBycorpId
(
String
corpId
);
void
update
(
WxEnterpriseDTO
enterpriseDTO
);
int
delete
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
c744a50e
...
...
@@ -47,10 +47,26 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
@Override
public
TabHaobanWxEnterprise
getDelEnterpriseBycorpId
(
String
corpId
)
{
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
listDelBycorpId
(
corpId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
}
@Override
public
void
update
(
WxEnterpriseDTO
enterpriseDTO
)
{
enterpriseDTO
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanWxEnterprise
.
class
,
enterpriseDTO
));
}
@Override
public
int
delete
(
String
wxEnterpriseId
)
{
TabHaobanWxEnterprise
enterprise
=
new
TabHaobanWxEnterprise
();
enterprise
.
setWxEnterpriseId
(
wxEnterpriseId
);
enterprise
.
setStatusFlag
(
0
);
return
this
.
mapper
.
updateByPrimaryKeySelective
(
enterprise
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxApplicationApiServiceImpl.java
View file @
c744a50e
...
...
@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.service.WxApplicationApiService;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -23,6 +24,8 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
private
WxApplicationService
wxApplicationService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Override
public
void
addSuite
(
WxApplicationDTO
dto
)
{
...
...
@@ -36,6 +39,10 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
if
(
enterprise
!=
null
){
int
i
=
this
.
wxApplicationService
.
cancalWxApplication
(
enterprise
.
getWxEnterpriseId
(),
suiteId
);
log
.
info
(
"取消授权结果:{}"
,
i
);
TabHaobanWxApplication
wxApplication
=
this
.
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
enterprise
.
getWxEnterpriseId
(),
2
);
if
(
wxApplication
==
null
){
//如果取消好办小程序应用授权,删除企业
this
.
wxEnterpriseService
.
delete
(
enterprise
.
getWxEnterpriseId
());
}
}
log
.
info
(
"企业未绑定过,{}"
,
corpId
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
c744a50e
...
...
@@ -55,15 +55,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
public
void
callbackReviceEnterprise
(
QywxCorpInfoSimpleDTO
dto
)
{
log
.
info
(
"企业微信授权信息:{}"
,
JSON
.
toJSONString
(
dto
));
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
String
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getDelEnterpriseBycorpId
(
dto
.
getCorpid
());
String
wxEnterpriseId
=
""
;
if
(
enterprise
!=
null
){
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
wxDTO
.
setStatusFlag
(
1
);
wxEnterpriseService
.
update
(
wxDTO
);
}
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
String
userId
=
dto
.
getUserid
();
String
name
=
dto
.
getName
();
if
(
StringUtils
.
isNotBlank
(
userId
))
{
staffApiService
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
}
String
siteId
=
dto
.
getSuiteId
();
String
agentId
=
dto
.
getAgentid
();
String
agentName
=
dto
.
getAgentName
();
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
c744a50e
This diff is collapsed.
Click to expand it.
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