Commit a3382bd8 authored by 季圣华's avatar 季圣华
Browse files

将租户的操作上限改为配置项

parent 86cc701e
......@@ -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){
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment