Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
a3382bd8
Commit
a3382bd8
authored
Apr 08, 2020
by
季圣华
Browse files
将租户的操作上限改为配置项
parent
86cc701e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/service/tenant/TenantService.java
View file @
a3382bd8
...
...
@@ -10,6 +10,7 @@ import com.jsh.erp.exception.JshException;
import
com.jsh.erp.utils.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -20,11 +21,19 @@ import java.util.*;
@Service
public
class
TenantService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TenantService
.
class
);
@Resource
private
TenantMapper
tenantMapper
;
@Resource
private
TenantMapperEx
tenantMapperEx
;
@Value
(
"${tenant.userNumLimit}"
)
private
Integer
userNumLimit
;
@Value
(
"${tenant.billsNumLimit}"
)
private
Integer
billsNumLimit
;
public
Tenant
getTenant
(
long
id
)
throws
Exception
{
Tenant
result
=
null
;
...
...
@@ -72,8 +81,8 @@ public class TenantService {
Tenant
tenant
=
JSONObject
.
parseObject
(
beanJson
,
Tenant
.
class
);
int
result
=
0
;
try
{
tenant
.
setUserNumLimit
(
2
);
//默认用户限制数量
tenant
.
setBillsNumLimit
(
200
);
//默认单据限制数量
tenant
.
setUserNumLimit
(
userNumLimit
);
//默认用户限制数量
tenant
.
setBillsNumLimit
(
billsNumLimit
);
//默认单据限制数量
tenant
.
setCreateTime
(
new
Date
());
result
=
tenantMapper
.
insertSelective
(
tenant
);
}
catch
(
Exception
e
){
...
...
src/main/resources/application.properties
View file @
a3382bd8
...
...
@@ -16,6 +16,10 @@ mybatis.mapper-locations=classpath:./mapper_xml/*.xml
mybatis-plus.mapper-locations
=
classpath:./mapper_xml/*.xml
#租户对应的角色id
manage.roleId
=
10
#租户允许创建的用户数
tenant.userNumLimit
=
5
#租户允许创建的单据数
tenant.billsNumLimit
=
200
#插件配置
plugin.runMode
=
prod
plugin.pluginPath
=
plugins
...
...
Write
Preview
Supports
Markdown
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