采用jdk8新特效修改

master
星期八 5 years ago
parent a13f590f4b
commit eee3dd9e5f
  1. 2
      src/main/java/com/lq/cms/service/impl/SysLogServiceImpl.java
  2. 18
      src/main/java/com/lq/cms/service/impl/SysPermissionServiceImpl.java
  3. 6
      src/main/java/com/lq/cms/service/impl/SysResourceServiceImpl.java
  4. 16
      src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java
  5. 2
      src/main/java/com/lq/cms/service/impl/SysRoleServiceImpl.java
  6. 2
      src/main/java/com/lq/cms/service/impl/SysUserRoleServiceImpl.java
  7. 2
      src/main/java/com/lq/cms/service/impl/SysUserServiceImpl.java
  8. 2
      src/main/java/com/lq/cms/service/impl/WechatInfoServiceImpl.java

@ -15,7 +15,7 @@ import java.util.List;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class SysLogServiceImpl extends BaseServiceImpl<SysLog> implements SysLogService {
public class SysLogServiceImpl implements SysLogService {
@Autowired
private SysLogDao sysLogDao;

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
* @Author: qi
@ -26,7 +27,7 @@ import java.util.List;
* @Date: Create in 12:06 AM 2019/7/23
*/
@Service
public class SysPermissionServiceImpl extends BaseServiceImpl<SysPermission> implements SysPermissionService{
public class SysPermissionServiceImpl implements SysPermissionService{
@Autowired
private SysPermissionDao sysPermissionDao;
@ -39,20 +40,23 @@ public class SysPermissionServiceImpl extends BaseServiceImpl<SysPermission> imp
public List<SysPermissionVo> findListPage(SysPermissionVo vo) {
List<SysPermissionVo> sysPermissionVos = sysPermissionDao.findListPage(vo);
sysPermissionVos.forEach(sysPermissionVo1->{
if (sysPermissionVo1.getSysResourceId()!=null) {
SysResource sysResource = sysResourceDao.findOne(sysPermissionVo1.getSysResourceId());
Optional<Long> sysResourceIdOptional = Optional.of(sysPermissionVo1.getSysResourceId());
if (sysResourceIdOptional.isPresent()) {
SysResource sysResource = sysResourceDao.findOne(sysResourceIdOptional.get());
if (sysResource!=null) {
sysPermissionVo1.setSysResourceName(sysResource.getMenuName());
}
}
if (sysPermissionVo1.getCreateUserId()!=null) {
SysUser createUser = sysUserDao.findOne(sysPermissionVo1.getCreateUserId());
Optional<Long> createUserIdOptional = Optional.of(sysPermissionVo1.getCreateUserId());
if (createUserIdOptional.isPresent()) {
SysUser createUser = sysUserDao.findOne(createUserIdOptional.get());
if (createUser!=null) {
sysPermissionVo1.setCreateUserName(createUser.getLoginName());
}
}
if (sysPermissionVo1.getUpdateUserId()!=null) {
SysUser updateUser = sysUserDao.findOne(sysPermissionVo1.getUpdateUserId());
Optional<Long> updateUserIdOptional = Optional.of(sysPermissionVo1.getUpdateUserId());
if (updateUserIdOptional.isPresent()) {
SysUser updateUser = sysUserDao.findOne(updateUserIdOptional.get());
if (updateUser!=null) {
sysPermissionVo1.setUpdateUserName(updateUser.getLoginName());
}

@ -58,7 +58,7 @@ public class SysResourceServiceImpl extends BaseServiceImpl<SysResource> impleme
map.put("permissionId", PermissionTyepEnum.SELECT.getValue());
List<SysResource> menusItmeList=sysResourceDao.findMenu(map);
List<MenusComposite> list=new ArrayList<>();
for (SysResource sysResource:menusItmeList){
menusItmeList.forEach(sysResource->{
MenusItem menusItem=new MenusItem();
menusItem.setMenuname(sysResource.getMenuName());
menusItem.setIcon(sysResource.getMenuIco());
@ -74,7 +74,9 @@ public class SysResourceServiceImpl extends BaseServiceImpl<SysResource> impleme
menusItem.add(menus);
}
list.add(menusItem);
}
});
return list;
}

@ -27,7 +27,7 @@ import java.util.*;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class SysRoleResourcePermissionServiceImpl extends BaseServiceImpl<SysRoleResourcePermission> implements SysRoleResourcePermissionService {
public class SysRoleResourcePermissionServiceImpl implements SysRoleResourcePermissionService {
public static final String RESOURCE_SYMBOL = "_";
@ -128,10 +128,10 @@ public class SysRoleResourcePermissionServiceImpl extends BaseServiceImpl<SysRol
public List<PermissionVo> findAllPermissonVo() {
List<PermissionVo> list = new ArrayList<>();
List<SysResource> sysResourceList = sysResourceDao.findAll();
Iterator iterator = sysResourceList.iterator();
Iterator<SysResource> iterator = sysResourceList.iterator();
PermissionTyepEnum[] tyepEnums = PermissionTyepEnum.values();
while (iterator.hasNext()){
SysResource sysResource = (SysResource) iterator.next();
SysResource sysResource = iterator.next();
if (sysResource!=null){
for (PermissionTyepEnum permissionTyepEnum:tyepEnums){
PermissionVo permissionVo = new PermissionVo();
@ -151,19 +151,21 @@ public class SysRoleResourcePermissionServiceImpl extends BaseServiceImpl<SysRol
*内部方法用于判断角色是否有权限
*/
private boolean isCheck(Long resourceId,Long permissionId,Long roleId){
boolean result = false;
if (permissionId!=null&&roleId!=null){
SysRoleResourcePermission roleResourcePermission=sysRoleResourcePermissionDao.getByResourceIdAndPermissionIdAndRoleId(resourceId,permissionId,roleId);
if (roleResourcePermission!=null&&StatusTypeEnum.STATUS_ACTIVITY_YES.getValue().equals(roleResourcePermission.getStatus())){
return true;
}else{
return false;
result = true;
}
}
return result;
}
/**
*内部方法拼接资源和权限ID
*/
private Map<String,Object> getAttributes(Long resourceId,Long permissionId){
Map<String,Object> map=new HashMap<>();
Map<String,Object> map=new HashMap<>(1);
map.put(PERMISSIONID_KEY,resourceId+RESOURCE_SYMBOL+permissionId);
return map;
}

@ -22,7 +22,7 @@ import java.util.Map;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class SysRoleServiceImpl extends BaseServiceImpl<SysRole> implements SysRoleService {
public class SysRoleServiceImpl implements SysRoleService {
@Autowired
private SysRoleDao sysRoleDao;

@ -19,7 +19,7 @@ import java.util.Map;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class SysUserRoleServiceImpl extends BaseServiceImpl<SysUserRole> implements SysUserRoleService {
public class SysUserRoleServiceImpl implements SysUserRoleService {
@Autowired
private SysUserRoleDao sysUserRoleDao;

@ -18,7 +18,7 @@ import java.util.List;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUser> implements SysUserService {
public class SysUserServiceImpl implements SysUserService {
@Autowired
private SysUserDao sysUserDao;

@ -15,7 +15,7 @@ import java.util.List;
* Created by qi_liang on 2018/6/21.
*/
@Service
public class WechatInfoServiceImpl extends BaseServiceImpl<WechatInfo> implements WechatInfoService {
public class WechatInfoServiceImpl implements WechatInfoService {
@Autowired
private WechatInfoDao wechatInfoDao;

Loading…
Cancel
Save