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
4cb3cfb2
Commit
4cb3cfb2
authored
Dec 03, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:企微安全改造修改
parent
ac8cad91
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
90 additions
and
98 deletions
+90
-98
WxEnterpriseDTO.java
...n/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
+0
-11
WxApplicationMapper.java
...haoban/manage/service/dao/mapper/WxApplicationMapper.java
+1
-6
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+22
-5
TabHaobanWxApplication.java
.../haoban/manage/service/entity/TabHaobanWxApplication.java
+11
-0
TabHaobanWxEnterprise.java
...c/haoban/manage/service/entity/TabHaobanWxEnterprise.java
+0
-13
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+2
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+13
-25
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+8
-4
WxApplicationMapper.xml
...service/src/main/resources/mapper/WxApplicationMapper.xml
+3
-25
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+30
-9
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
View file @
4cb3cfb2
...
...
@@ -95,10 +95,6 @@ public class WxEnterpriseDTO implements Serializable {
* 是否同意授权转换external_userid时间
*/
private
Date
agreeExternalUseridTime
;
/**
* 是否使用代开发,1:是,0:否
*/
private
Integer
isCustomizedApp
;
public
String
getMemberSecret
()
{
return
memberSecret
;
...
...
@@ -428,11 +424,4 @@ public class WxEnterpriseDTO implements Serializable {
this
.
agreeExternalUseridTime
=
agreeExternalUseridTime
;
}
public
Integer
getIsCustomizedApp
()
{
return
isCustomizedApp
;
}
public
void
setIsCustomizedApp
(
Integer
isCustomizedApp
)
{
this
.
isCustomizedApp
=
isCustomizedApp
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxApplicationMapper.java
View file @
4cb3cfb2
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
WxApplicationMapper
{
int
deleteByPrimaryKey
(
String
wxApplicationId
);
int
insert
(
TabHaobanWxApplication
record
);
int
insertSelective
(
TabHaobanWxApplication
record
);
TabHaobanWxApplication
selectByPrimaryKey
(
String
wxApplicationId
);
int
updateByPrimaryKeySelective
(
TabHaobanWxApplication
record
);
int
updateByPrimaryKey
(
TabHaobanWxApplication
record
);
TabHaobanWxApplication
selectBySiteIdAndWxEnterpriseId
(
@Param
(
"siteId"
)
String
siteId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanWxApplication
>
selectByWxEnterpriseIdAndApplicationType
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"applicationType"
)
int
applicationType
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
4cb3cfb2
...
...
@@ -22,13 +22,29 @@ public interface WxEnterpriseMapper {
@Param
(
"version"
)
String
version
,
@Param
(
"enterpriseIdsNotIn"
)
List
<
String
>
enterpriseIdsNotIn
);
List
<
TabHaobanWxEnterprise
>
listBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
List
<
TabHaobanWxEnterprise
>
listDelBycorpId
(
@Param
(
"corpId"
)
String
corpId
);
List
<
TabHaobanWxEnterprise
>
listAll
();
List
<
TabHaobanWxEnterprise
>
listByIds
(
@Param
(
"enterpriseIds"
)
Set
<
String
>
wxEnterpriseIds
);
List
<
TabHaobanWxEnterprise
>
getEnterpriseBycorpIdNoStatus
(
@Param
(
"corpId"
)
String
corpId
);
/**
* 得到企业bycorpid
*
* @param corpId 公司标识
* @param statusFlag 状态标志
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-03 16:04:31
*/
TabHaobanWxEnterprise
getEnterpriseBycorpId
(
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"statusFlag"
)
Integer
statusFlag
);
/**
* 根据openCorpid查询数据
*
* @param openCorpid
* @param statusFlag 状态标志
* @return {@link TabHaobanWxEnterprise }
* @author mozhu
* @date 2021-12-03 16:04:29
*/
TabHaobanWxEnterprise
getEnterpriseByOpenCorpId
(
@Param
(
"openCorpid"
)
String
openCorpid
,
@Param
(
"statusFlag"
)
Integer
statusFlag
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxApplication.java
View file @
4cb3cfb2
...
...
@@ -9,6 +9,8 @@ public class TabHaobanWxApplication implements Serializable {
private
String
wxApplicationId
;
private
String
corpid
;
private
String
siteId
;
private
String
name
;
...
...
@@ -129,4 +131,12 @@ public class TabHaobanWxApplication implements Serializable {
public
void
setIsCustomizedApp
(
Integer
isCustomizedApp
)
{
this
.
isCustomizedApp
=
isCustomizedApp
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterprise.java
View file @
4cb3cfb2
...
...
@@ -75,10 +75,6 @@ public class TabHaobanWxEnterprise implements Serializable {
private
Date
updateTime
;
/**
* 是否使用代开发,1:是,0:否
*/
private
Integer
isCustomizedApp
;
/**
* 是否同意授权转换external_userid,1:是
*/
private
Integer
agreeExternalUseridFlag
;
...
...
@@ -87,7 +83,6 @@ public class TabHaobanWxEnterprise implements Serializable {
*/
private
Date
agreeExternalUseridTime
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
...
...
@@ -376,11 +371,4 @@ public class TabHaobanWxEnterprise implements Serializable {
this
.
agreeExternalUseridTime
=
agreeExternalUseridTime
;
}
public
Integer
getIsCustomizedApp
()
{
return
isCustomizedApp
;
}
public
void
setIsCustomizedApp
(
Integer
isCustomizedApp
)
{
this
.
isCustomizedApp
=
isCustomizedApp
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
4cb3cfb2
...
...
@@ -20,9 +20,11 @@ public interface WxEnterpriseService {
/**
* 通过微信企业ID查询删除状态好办企业ID
*
* @param corpId
* @return
*/
@Deprecated
TabHaobanWxEnterprise
getDelEnterpriseBycorpId
(
String
corpId
);
void
update
(
WxEnterpriseDTO
enterpriseDTO
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
4cb3cfb2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
public
class
WxEnterpriseServiceImpl
implements
WxEnterpriseService
{
@Autowired
WxEnterpriseMapper
mapper
;
private
WxEnterpriseMapper
mapper
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Override
public
String
add
(
WxEnterpriseDTO
wxDTO
)
{
...
...
@@ -40,20 +41,12 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override
public
TabHaobanWxEnterprise
getEnterpriseBycorpId
(
String
corpId
)
{
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
listBycorpId
(
corpId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
return
mapper
.
getEnterpriseBycorpId
(
corpId
,
1
);
}
@Override
public
TabHaobanWxEnterprise
getDelEnterpriseBycorpId
(
String
corpId
)
{
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
listDelBycorpId
(
corpId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
return
mapper
.
getEnterpriseBycorpId
(
corpId
,
0
);
}
@Override
...
...
@@ -82,16 +75,11 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override
public
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpId
)
{
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
getEnterpriseBycorpIdNoStatus
(
corpId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
list
.
get
(
0
);
}
return
null
;
return
this
.
mapper
.
getEnterpriseBycorpId
(
corpId
,
null
);
}
@Override
public
List
<
TabHaobanWxEnterprise
>
listAll
()
{
List
<
TabHaobanWxEnterprise
>
ret
=
mapper
.
listAll
();
return
ret
;
return
mapper
.
listAll
();
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
4cb3cfb2
...
...
@@ -65,18 +65,22 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
String
userId
=
dto
.
getUserid
();
Integer
isCustomizedApp
=
dto
.
getIsCustomizedApp
();
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
);
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseBycorpIdNoStatus
(
corpid
);
String
wxEnterpriseId
=
""
;
//授权好办小程序
if
(
isCustomizedApp
==
null
||
isCustomizedApp
!=
1
)
{
//只需要插入好办小程序企业
TabHaobanWxEnterprise
enterprise
=
this
.
wxEnterpriseService
.
getEnterpriseBycorpIdNoStatus
(
corpid
);
if
(
enterprise
!=
null
)
{
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
wxDTO
.
setStatusFlag
(
1
);
wxDTO
.
setBindFlag
(
1
);
wxDTO
.
setIsCustomizedApp
(
isCustomizedApp
);
wxEnterpriseService
.
update
(
wxDTO
);
}
else
{
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
}
}
if
(
StringUtils
.
isNotBlank
(
userId
))
{
staffApiService
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
}
...
...
@@ -85,6 +89,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
if
(
tab
==
null
)
{
tab
=
new
TabHaobanWxApplication
();
tab
.
setAgentId
(
agentId
);
tab
.
setCorpid
(
corpid
);
tab
.
setSiteId
(
siteId
);
tab
.
setAgentName
(
agentName
);
tab
.
setName
(
applicationName
);
...
...
@@ -159,12 +164,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
return
true
;
}
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseBy
Ei
d
(
enterpriseId
);
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseBy
I
d
(
enterpriseId
);
if
(
enterprise
==
null
||
enterprise
.
getExpireTime
()
==
null
)
{
return
true
;
}
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
();
}
@Override
...
...
haoban-manage3-service/src/main/resources/mapper/WxApplicationMapper.xml
View file @
4cb3cfb2
...
...
@@ -19,27 +19,20 @@
wx_application_id, site_id, name, permanent_code, agent_name, agent_id, application_type,
wx_enterprise_id, status_flag, create_time, update_time,is_customized_app
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_application
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete
from tab_haoban_wx_application
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxApplication"
>
insert into tab_haoban_wx_application (wx_application_id, site_id, name,
permanent_code, agent_name, agent_id,
application_type, wx_enterprise_id, status_flag,
create_time, update_time, is_customized_app)
values (#{wxApplicationId,jdbcType=VARCHAR}, #{siteId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{permanentCode,jdbcType=VARCHAR}, #{agentName,jdbcType=VARCHAR}, #{agentId,jdbcType=VARCHAR},
#{applicationType,jdbcType=INTEGER}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isCustomizedApp,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxApplication"
>
insert into tab_haoban_wx_application
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -159,21 +152,6 @@
</set>
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxApplication"
>
update tab_haoban_wx_application
set site_id = #{siteId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
permanent_code = #{permanentCode,jdbcType=VARCHAR},
agent_name = #{agentName,jdbcType=VARCHAR},
agent_id = #{agentId,jdbcType=VARCHAR},
application_type = #{applicationType,jdbcType=INTEGER},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_customized_app = #{isCustomizedApp,jdbcType=INTEGER}
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</update>
<select
id=
"selectBySiteIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
4cb3cfb2
...
...
@@ -39,6 +39,7 @@
<result
column=
"agree_external_userid_flag"
property=
"agreeExternalUseridFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"agree_external_userid_time"
property=
"agreeExternalUseridTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"is_customized_app"
property=
"isCustomizedApp"
jdbcType=
"INTEGER"
/>
<result
column=
"open_corpid"
property=
"openCorpid"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -46,7 +47,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,is_customized_app
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,is_customized_app
,open_corpid
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -162,6 +163,9 @@
<if
test=
"isCustomizedApp != null"
>
is_customized_app,
</if>
<if
test=
"openCorpid != null"
>
open_corpid,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"wxEnterpriseId != null"
>
...
...
@@ -263,6 +267,9 @@
<if
test=
"isCustomizedApp != null"
>
#{isCustomizedApp,jdbcType=INTEGER},
</if>
<if
test=
"openCorpid != null"
>
#{openCorpid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise"
>
...
...
@@ -376,6 +383,9 @@
<if
test=
"isCustomizedApp != null"
>
is_customized_app = #{isCustomizedApp,jdbcType=INTEGER},
</if>
<if
test=
"openCorpid != null"
>
open_corpid = #{openCorpid,jdbcType=VARCHAR},
</if>
</set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</update>
...
...
@@ -419,14 +429,8 @@
</foreach>
</if>
</if>
</select>
<select
id=
"listBycorpId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise
where status_flag = 1 and corpid= #{corpId}
</select>
<select
id=
"listDelBycorpId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
@@ -454,10 +458,26 @@
</if>
</select>
<select
id=
"getEnterpriseBycorpId
NoStatus
"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"getEnterpriseBycorpId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise
where corpid= #{corpId}
<if
test=
"statusFlag != null"
>
and status_flag = #{statusFlag}
</if>
limit 1
</select>
<select
id=
"getEnterpriseByOpenCorpId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise
where open_corpid= #{openCorpid}
<if
test=
"statusFlag != null"
>
and status_flag = #{statusFlag}
</if>
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