Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7188f964
authored
Apr 15, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改编辑时jar包冲突bug
1 parent
446aeec2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
30 deletions
linkwe-common/pom.xml
linkwe-framework/src/main/java/com/linkwechat/framework/config/MyBatisPlusConfig.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCorpAccountMapper.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCorpAccountMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
pom.xml
linkwe-common/pom.xml
View file @
7188f96
...
@@ -39,12 +39,6 @@
...
@@ -39,12 +39,6 @@
<dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<!-- 自定义验证注解 -->
<!-- 自定义验证注解 -->
...
@@ -260,6 +254,12 @@
...
@@ -260,6 +254,12 @@
<artifactId>
bcpkix-jdk15on
</artifactId>
<artifactId>
bcpkix-jdk15on
</artifactId>
<version>
1.68
</version>
<version>
1.68
</version>
</dependency>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.jsqlparser</groupId>-->
<!-- <artifactId>jsqlparser</artifactId>-->
<!-- </dependency>-->
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
\ No newline at end of file
linkwe-framework/src/main/java/com/linkwechat/framework/config/MyBatisPlusConfig.java
View file @
7188f96
package
com
.
linkwechat
.
framework
.
config
;
package
com
.
linkwechat
.
framework
.
config
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler
;
import
com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
...
@@ -35,14 +34,62 @@ public class MyBatisPlusConfig
...
@@ -35,14 +34,62 @@ public class MyBatisPlusConfig
//
// @Bean
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// // 如果用了分页插件注意先 add TenantLineInnerInterceptor 再 add PaginationInnerInterceptor
// // 用了分页插件必须设置 MybatisConfiguration#useDeprecatedExecutor = false
// // interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
//
// interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(
// new TenantLineHandler() {
// // 获取租户 ID 值表达式,只支持单个 ID 值
// @Override
// public Expression getTenantId() {
//
// WeCorpAccount weCorpAccount
// = SecurityUtils.getLoginUser().getUser().getWeCorpAccount();
// if(null != weCorpAccount){
// return new StringValue(weCorpAccount.getCorpId());
// }
//
// return null;
// }
// // 这是 default 方法,默认返回 false 表示所有表都需要拼多租户条件,
// // 这里设置 role表不需要该条件
// @Override
// public boolean ignoreTable(String tableName) {
//
// if (Arrays.asList(weComeConfig.getNeedTenant())
// .contains(tableName)){
// return false;
// }
// return true;
// }
//
// @Override
// public String getTenantIdColumn() {
// return "corp_id";
// }
// }));
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// return interceptor;
// }
// @Bean
// public ConfigurationCustomizer configurationCustomizer() {
// return configuration -> configuration.setUseDeprecatedExecutor(false);
// }
@Bean
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
public
Interceptor
[]
plugins
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
// 如果用了分页插件注意先 add TenantLineInnerInterceptor 再 add PaginationInnerInterceptor
// 用了分页插件必须设置 MybatisConfiguration#useDeprecatedExecutor = false
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
interceptor
.
addInnerInterceptor
(
new
TenantLineInnerInterceptor
(
interceptor
.
addInnerInterceptor
(
new
TenantLineInnerInterceptor
(
new
TenantLineHandler
()
{
new
TenantLineHandler
()
{
// 获取租户 ID 值表达式,只支持单个 ID 值
// 获取租户 ID 值表达式,只支持单个 ID 值
...
@@ -74,17 +121,9 @@ public class MyBatisPlusConfig
...
@@ -74,17 +121,9 @@ public class MyBatisPlusConfig
return
"corp_id"
;
return
"corp_id"
;
}
}
}));
}));
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
(
DbType
.
MYSQL
));
return
interceptor
;
}
@Bean
public
ConfigurationCustomizer
configurationCustomizer
()
{
return
configuration
->
configuration
.
setUseDeprecatedExecutor
(
false
);
}
@Bean
//
public
Interceptor
[]
plugins
()
{
return
new
Interceptor
[]{
interceptor
,
new
PageInterceptor
()
return
new
Interceptor
[]{
new
PageInterceptor
()
};
};
}
}
}
}
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCorpAccountMapper.java
View file @
7188f96
package
com
.
linkwechat
.
wecom
.
mapper
;
package
com
.
linkwechat
.
wecom
.
mapper
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation.SqlParser
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
com.linkwechat.common.core.domain.entity.WeCorpAccount
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -18,6 +20,7 @@ public interface WeCorpAccountMapper
...
@@ -18,6 +20,7 @@ public interface WeCorpAccountMapper
* @param id 企业id相关配置ID
* @param id 企业id相关配置ID
* @return 企业id相关配置
* @return 企业id相关配置
*/
*/
@SqlParser
(
filter
=
true
)
public
WeCorpAccount
selectWeCorpAccountById
(
Long
id
);
public
WeCorpAccount
selectWeCorpAccountById
(
Long
id
);
/**
/**
...
@@ -26,6 +29,7 @@ public interface WeCorpAccountMapper
...
@@ -26,6 +29,7 @@ public interface WeCorpAccountMapper
* @param wxCorpAccount 企业id相关配置
* @param wxCorpAccount 企业id相关配置
* @return 企业id相关配置集合
* @return 企业id相关配置集合
*/
*/
@SqlParser
(
filter
=
true
)
public
List
<
WeCorpAccount
>
selectWeCorpAccountList
(
WeCorpAccount
wxCorpAccount
);
public
List
<
WeCorpAccount
>
selectWeCorpAccountList
(
WeCorpAccount
wxCorpAccount
);
/**
/**
...
@@ -34,6 +38,7 @@ public interface WeCorpAccountMapper
...
@@ -34,6 +38,7 @@ public interface WeCorpAccountMapper
* @param wxCorpAccount 企业id相关配置
* @param wxCorpAccount 企业id相关配置
* @return 结果
* @return 结果
*/
*/
@SqlParser
(
filter
=
true
)
public
int
insertWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
public
int
insertWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
/**
/**
...
@@ -42,6 +47,7 @@ public interface WeCorpAccountMapper
...
@@ -42,6 +47,7 @@ public interface WeCorpAccountMapper
* @param wxCorpAccount 企业id相关配置
* @param wxCorpAccount 企业id相关配置
* @return 结果
* @return 结果
*/
*/
@SqlParser
(
filter
=
true
)
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
);
...
@@ -50,6 +56,7 @@ public interface WeCorpAccountMapper
...
@@ -50,6 +56,7 @@ public interface WeCorpAccountMapper
* 获取有效cropid
* 获取有效cropid
* @return
* @return
*/
*/
@SqlParser
(
filter
=
true
)
public
WeCorpAccount
findValidWeCorpAccount
();
public
WeCorpAccount
findValidWeCorpAccount
();
...
@@ -58,6 +65,7 @@ public interface WeCorpAccountMapper
...
@@ -58,6 +65,7 @@ public interface WeCorpAccountMapper
* @param corpId
* @param corpId
* @return
* @return
*/
*/
@SqlParser
(
filter
=
true
)
public
int
startVailWeCorpAccount
(
@Param
(
"corpId"
)
String
corpId
);
public
int
startVailWeCorpAccount
(
@Param
(
"corpId"
)
String
corpId
);
...
@@ -66,5 +74,6 @@ public interface WeCorpAccountMapper
...
@@ -66,5 +74,6 @@ public interface WeCorpAccountMapper
* @param corpAccount
* @param corpAccount
* @return
* @return
*/
*/
@SqlParser
(
filter
=
true
)
WeCorpAccount
findWeCorpByAccount
(
@Param
(
"corpAccount"
)
String
corpAccount
);
WeCorpAccount
findWeCorpByAccount
(
@Param
(
"corpAccount"
)
String
corpAccount
);
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeCorpAccountMapper.xml
View file @
7188f96
...
@@ -22,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -22,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"providerSecret"
column=
"provider_secret"
/>
<result
property=
"providerSecret"
column=
"provider_secret"
/>
<result
property=
"customerChurnNoticeSwitch"
column=
"customer_churn_notice_switch"
/>
<result
property=
"customerChurnNoticeSwitch"
column=
"customer_churn_notice_switch"
/>
<result
property=
"wxQrLoginRedirectUri"
column=
"wx_qr_login_redirect_uri"
/>
<result
property=
"wxQrLoginRedirectUri"
column=
"wx_qr_login_redirect_uri"
/>
<result
property=
"cropAccount"
column=
"corp_account"
/>
</resultMap>
</resultMap>
<sql
id=
"selectWeCorpAccountVo"
>
<sql
id=
"selectWeCorpAccountVo"
>
select id,chat_secret,provider_secret,company_name, corp_id, corp_secret,agent_id, agent_secret, status, del_flag, create_by, create_time, update_by, update_time,contact_secret, customer_churn_notice_switch,wx_qr_login_redirect_uri from we_corp_account
select id,chat_secret,
corp_account,
provider_secret,company_name, corp_id, corp_secret,agent_id, agent_secret, status, del_flag, create_by, create_time, update_by, update_time,contact_secret, customer_churn_notice_switch,wx_qr_login_redirect_uri from we_corp_account
</sql>
</sql>
<select
id=
"selectWeCorpAccountList"
parameterType=
"WeCorpAccount"
resultMap=
"WeCorpAccountResult"
>
<select
id=
"selectWeCorpAccountList"
parameterType=
"WeCorpAccount"
resultMap=
"WeCorpAccountResult"
>
...
@@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch,
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch,
</if>
<if
test=
"providerSecret != null "
>
provider_secret,
</if>
<if
test=
"providerSecret != null "
>
provider_secret,
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri,
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri,
</if>
<if
test=
"cropAccount != null"
>
corp_account,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"companyName != null"
>
#{companyName},
</if>
<if
test=
"companyName != null"
>
#{companyName},
</if>
...
@@ -80,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -80,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"customerChurnNoticeSwitch != null "
>
#{customerChurnNoticeSwitch},
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
#{customerChurnNoticeSwitch},
</if>
<if
test=
"providerSecret != null "
>
#{providerSecret},
</if>
<if
test=
"providerSecret != null "
>
#{providerSecret},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
#{wxQrLoginRedirectUri},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
#{wxQrLoginRedirectUri},
</if>
<if
test=
"cropAccount != null"
>
#{cropAccount},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -100,11 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -100,11 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"agentId != null "
>
agent_id = #{agentId},
</if>
<if
test=
"agentId != null "
>
agent_id = #{agentId},
</if>
<if
test=
"agentSecret != null "
>
agent_secret =#{agentSecret},
</if>
<if
test=
"agentSecret != null "
>
agent_secret =#{agentSecret},
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch = #{customerChurnNoticeSwitch},
</if>
<if
test=
"customerChurnNoticeSwitch != null "
>
customer_churn_notice_switch = #{customerChurnNoticeSwitch},
</if>
<if
test=
"providerSecret != null "
>
provider_secret = #{providerSecret},
</if>
<if
test=
"providerSecret != null "
>
provider_secret = #{providerSecret},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri = #{wxQrLoginRedirectUri},
</if>
<if
test=
"wxQrLoginRedirectUri != null "
>
wx_qr_login_redirect_uri = #{wxQrLoginRedirectUri},
</if>
<if
test=
"cropAccount != null"
>
corp_account = #{cropAccount},
</if>
</trim>
</trim>
where id = #{id}
where id = #{id}
</update>
</update>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
7188f96
...
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWeCustomerList"
parameterType=
"WeCustomer"
resultMap=
"WeCustomerResult"
>
<select
id=
"selectWeCustomerList"
parameterType=
"WeCustomer"
resultMap=
"WeCustomerResult"
>
SELECT
SELECT
DISTINCT wc.external_userid,
DISTINCT wc.external_userid,
wc.`name`,
wc.`name`,
wc.avatar,
wc.avatar,
wc.type,
wc.type,
...
...
pom.xml
View file @
7188f96
...
@@ -84,9 +84,13 @@
...
@@ -84,9 +84,13 @@
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.boot.version}
</version>
<version>
${pagehelper.boot.version}
</version>
<exclusions>
<exclusions>
<!-- <exclusion>-->
<!-- <groupId>com.github.jsqlparser</groupId>-->
<!-- <artifactId>jsqlparser</artifactId>-->
<!-- </exclusion>-->
<exclusion>
<exclusion>
<groupId>
com.github.jsqlparser
</groupId>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
jsqlpars
er
</artifactId>
<artifactId>
mybatis-spring-boot-start
er
</artifactId>
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
...
@@ -251,6 +255,12 @@
...
@@ -251,6 +255,12 @@
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
${mybatis-plus.version}
</version>
<version>
${mybatis-plus.version}
</version>
<exclusions>
<exclusion>
<groupId>
com.github.jsqlparser
</groupId>
<artifactId>
jsqlparser
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -277,6 +287,9 @@
...
@@ -277,6 +287,9 @@
<version>
${nacos.version}
</version>
<version>
${nacos.version}
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
javax.xml.bind
</groupId>
<groupId>
javax.xml.bind
</groupId>
<artifactId>
jaxb-api
</artifactId>
<artifactId>
jaxb-api
</artifactId>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment