提交 ff7ce8ad authored 作者: gongwenjie's avatar gongwenjie

考勤

上级 bc4d6936
...@@ -17,10 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,10 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/** /**
* @Author gwj * @Author gwj
...@@ -68,7 +65,9 @@ public class TestController { ...@@ -68,7 +65,9 @@ public class TestController {
authorityName.add("角色管理"); authorityName.add("角色管理");
List<Authority> authorities = authorityDao.findAllByNameIn(authorityName); List<Authority> authorities = authorityDao.findAllByNameIn(authorityName);
Role role = roleDao.findByName("管理员"); Optional<Role> optional = roleDao.findById("5e82c9d8e02f2a779aa76993");
if(optional.isPresent()){
Role role = optional.get();
List<RoleAuthority> roleAuthorities = new ArrayList<>(); List<RoleAuthority> roleAuthorities = new ArrayList<>();
if(authorities!=null){ if(authorities!=null){
authorities.forEach(authority->{ authorities.forEach(authority->{
...@@ -79,4 +78,7 @@ public class TestController { ...@@ -79,4 +78,7 @@ public class TestController {
roleAuthorityDao.saveAll(roleAuthorities); roleAuthorityDao.saveAll(roleAuthorities);
} }
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论