YuceUserVo.java 790 B

12345678910111213141516171819202122232425262728293031
  1. package com.nokia.vo;
  2. import com.nokia.pojo.Role;
  3. import com.nokia.pojo.User;
  4. import lombok.Data;
  5. @Data
  6. public class YuceUserVo {
  7. // 用户id
  8. private Integer userId;
  9. // 姓名
  10. private String userName;
  11. // 省
  12. private String province;
  13. // 归属地市
  14. // private String belongCity;
  15. // 权限地市
  16. private Integer city;
  17. public YuceUserVo(User user) {
  18. this.userId = user.getUserId();
  19. this.userName = user.getUserName();
  20. this.province = user.getProvince().getAreaName();
  21. // this.belongCity = user.getCity().getCityNameZh();
  22. for (Role role : user.getRoles()) {
  23. if ("yuce".equals(role.getSystem())) {
  24. this.city = role.getCities().get(0).getAreaId();
  25. }
  26. }
  27. }
  28. }