提交 5ab1422d authored 作者: gongwenjie's avatar gongwenjie

权限代码修改

上级 99831337
...@@ -68,7 +68,7 @@ public class ConfigServiceImpl implements ConfigService { ...@@ -68,7 +68,7 @@ public class ConfigServiceImpl implements ConfigService {
@Override @Override
public List<Day> findHolidaysByMonth(String date) { public List<Day> findHolidaysByMonth(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
try { try {
Date date1 = sdf.parse(date); Date date1 = sdf.parse(date);
int year = date1.getYear()+1900; int year = date1.getYear()+1900;
...@@ -101,7 +101,7 @@ public class ConfigServiceImpl implements ConfigService { ...@@ -101,7 +101,7 @@ public class ConfigServiceImpl implements ConfigService {
return dayDao.saveAll(days1); return dayDao.saveAll(days1);
} }
calendar.set(Calendar.MONTH,month-1); calendar.set(Calendar.MONTH,month-1);
calendar.set(Calendar.DAY_OF_MONTH,1); calendar.set(Calendar.DAY_OF_MONTH,0);
firstDate = calendar.getTime(); firstDate = calendar.getTime();
calendar.set(Calendar.MONTH,month); calendar.set(Calendar.MONTH,month);
calendar.set(Calendar.DAY_OF_MONTH,1); calendar.set(Calendar.DAY_OF_MONTH,1);
......
...@@ -128,7 +128,19 @@ public class UserServiceImpl implements IUserService { ...@@ -128,7 +128,19 @@ public class UserServiceImpl implements IUserService {
@Override @Override
public User findUserById(String id) { public User findUserById(String id) {
Optional<User> byId = pasUserDao.findById(id); Optional<User> byId = pasUserDao.findById(id);
return byId.orElseGet(User::new); List<String> roleIds = new ArrayList<>();
User user = null;
if(byId.isPresent()){
user = byId.get();
List<UserRole> userRoles = userRoleDao.findAllByUserId(user.getId());
for (UserRole userRole : userRoles) {
roleIds.add(userRole.getRoleId());
}
List<Role> roles = roleDao.findAllByIdIn(roleIds);
user.setRoles(roles);
}
return user;
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论