优化系统权限逻辑
This commit is contained in:
@@ -62,7 +62,7 @@ public class RoleService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Role> getRole()throws Exception {
|
||||
public List<Role> allList()throws Exception {
|
||||
RoleExample example = new RoleExample();
|
||||
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Role> list=null;
|
||||
|
||||
@@ -126,11 +126,11 @@ public class UserBusinessService {
|
||||
}
|
||||
|
||||
public List<UserBusiness> getBasicData(String keyId, String type)throws Exception{
|
||||
UserBusinessExample example = new UserBusinessExample();
|
||||
example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<UserBusiness> list=null;
|
||||
try{
|
||||
UserBusinessExample example = new UserBusinessExample();
|
||||
example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
@@ -138,6 +138,15 @@ public class UserBusinessService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public String getUBValueByTypeAndKeyId(String type, String keyId) throws Exception {
|
||||
String ubValue = "";
|
||||
List<UserBusiness> ubList = getBasicData(keyId, type);
|
||||
if(ubList!=null && ubList.size()>0) {
|
||||
ubValue = ubList.get(0).getValue();
|
||||
}
|
||||
return ubValue;
|
||||
}
|
||||
|
||||
public Long checkIsValueExist(String type, String keyId)throws Exception {
|
||||
UserBusinessExample example = new UserBusinessExample();
|
||||
example.createCriteria().andTypeEqualTo(type).andKeyIdEqualTo(keyId)
|
||||
@@ -155,29 +164,6 @@ public class UserBusinessService {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Boolean checkIsUserBusinessExist(String TypeVale, String KeyIdValue, String UBValue)throws Exception {
|
||||
UserBusinessExample example = new UserBusinessExample();
|
||||
String newVaule = "%" + UBValue + "%";
|
||||
if(TypeVale !=null && KeyIdValue !=null) {
|
||||
example.createCriteria().andTypeEqualTo(TypeVale).andKeyIdEqualTo(KeyIdValue).andValueLike(newVaule)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
} else {
|
||||
example.createCriteria().andValueLike(newVaule)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
}
|
||||
List<UserBusiness> list=null;
|
||||
try{
|
||||
list= userBusinessMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
if(list!=null&&list.size() > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateBtnStr(String keyId, String type, String btnStr) throws Exception{
|
||||
logService.insertLog("关联关系",
|
||||
|
||||
Reference in New Issue
Block a user