优化租户管理的编辑功能

This commit is contained in:
季圣华
2022-10-23 00:24:34 +08:00
parent d7c0012885
commit b6d1e01233
9 changed files with 66 additions and 35 deletions

View File

@@ -6,6 +6,7 @@ import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.datasource.mappers.TenantMapper;
import com.jsh.erp.datasource.mappers.TenantMapperEx;
import com.jsh.erp.datasource.mappers.UserMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.log.LogService;
@@ -33,6 +34,9 @@ public class TenantService {
@Resource
private TenantMapperEx tenantMapperEx;
@Resource
private UserMapperEx userMapperEx;
@Resource
private LogService logService;
@@ -113,6 +117,8 @@ public class TenantService {
Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class);
int result=0;
try{
//如果租户下的用户限制数量为1则将该租户之外的用户全部禁用
userMapperEx.disableUserByLimit(tenant.getTenantId());
result=tenantMapper.updateByPrimaryKeySelective(tenant);
}catch(Exception e){
JshException.writeFail(logger, e);