通过jdk8代码优化

master
星期八 5 years ago
parent 554c914a93
commit ce1b9f07ad
  1. 4
      src/main/java/com/lq/cms/service/impl/SysUserRoleServiceImpl.java

@ -34,7 +34,7 @@ public class SysUserRoleServiceImpl implements SysUserRoleService {
Date nowTime=new Date();
sysUserRoleDao.deleteByUserId(id);
if (roleList!=null&&roleList.size()>0) {
for (Long roleId : roleList) {
roleList.forEach(roleId->{
SysUserRole sysUserRole = findByRoleIdAndUserId(id, roleId);
if (sysUserRole != null) {
sysUserRole.setStatus(StatusTypeEnum.STATUS_ACTIVITY_YES.getValue());
@ -49,7 +49,7 @@ public class SysUserRoleServiceImpl implements SysUserRoleService {
sysUserRole.setRoleId(roleId);
sysUserRoleDao.save(sysUserRole);
}
}
});
}
}

Loading…
Cancel
Save