将租户的操作上限改为配置项
This commit is contained in:
@@ -10,6 +10,7 @@ import com.jsh.erp.exception.JshException;
|
|||||||
import com.jsh.erp.utils.StringUtil;
|
import com.jsh.erp.utils.StringUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -20,11 +21,19 @@ import java.util.*;
|
|||||||
@Service
|
@Service
|
||||||
public class TenantService {
|
public class TenantService {
|
||||||
private Logger logger = LoggerFactory.getLogger(TenantService.class);
|
private Logger logger = LoggerFactory.getLogger(TenantService.class);
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TenantMapper tenantMapper;
|
private TenantMapper tenantMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TenantMapperEx tenantMapperEx;
|
private TenantMapperEx tenantMapperEx;
|
||||||
|
|
||||||
|
@Value("${tenant.userNumLimit}")
|
||||||
|
private Integer userNumLimit;
|
||||||
|
|
||||||
|
@Value("${tenant.billsNumLimit}")
|
||||||
|
private Integer billsNumLimit;
|
||||||
|
|
||||||
|
|
||||||
public Tenant getTenant(long id)throws Exception {
|
public Tenant getTenant(long id)throws Exception {
|
||||||
Tenant result=null;
|
Tenant result=null;
|
||||||
@@ -72,8 +81,8 @@ public class TenantService {
|
|||||||
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
|
Tenant tenant = JSONObject.parseObject(beanJson, Tenant.class);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
tenant.setUserNumLimit(2); //默认用户限制数量
|
tenant.setUserNumLimit(userNumLimit); //默认用户限制数量
|
||||||
tenant.setBillsNumLimit(200); //默认单据限制数量
|
tenant.setBillsNumLimit(billsNumLimit); //默认单据限制数量
|
||||||
tenant.setCreateTime(new Date());
|
tenant.setCreateTime(new Date());
|
||||||
result=tenantMapper.insertSelective(tenant);
|
result=tenantMapper.insertSelective(tenant);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ mybatis.mapper-locations=classpath:./mapper_xml/*.xml
|
|||||||
mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml
|
mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml
|
||||||
#租户对应的角色id
|
#租户对应的角色id
|
||||||
manage.roleId=10
|
manage.roleId=10
|
||||||
|
#租户允许创建的用户数
|
||||||
|
tenant.userNumLimit=5
|
||||||
|
#租户允许创建的单据数
|
||||||
|
tenant.billsNumLimit=200
|
||||||
#插件配置
|
#插件配置
|
||||||
plugin.runMode=prod
|
plugin.runMode=prod
|
||||||
plugin.pluginPath=plugins
|
plugin.pluginPath=plugins
|
||||||
|
|||||||
Reference in New Issue
Block a user