16897539bd18a347cd1081b418a339ac4ac68399.svn-base 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package org.jeecg.modules.system.model;
  2. import java.io.Serializable;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import org.jeecg.modules.system.entity.SysDepart;
  6. /**
  7. * <p>
  8. * 部门表 封装树结构的部门的名称的实体类
  9. * <p>
  10. *
  11. * @Author Steve
  12. * @Since 2019-01-22
  13. *
  14. */
  15. public class DepartIdModel implements Serializable {
  16. private static final long serialVersionUID = 1L;
  17. // 主键ID
  18. private String key;
  19. // 主键ID
  20. private String value;
  21. // 部门名称
  22. private String title;
  23. List<DepartIdModel> children = new ArrayList<>();
  24. /**
  25. * 将SysDepartTreeModel的部分数据放在该对象当中
  26. * @param treeModel
  27. * @return
  28. */
  29. public DepartIdModel convert(SysDepartTreeModel treeModel) {
  30. this.key = treeModel.getId();
  31. this.value = treeModel.getId();
  32. this.title = treeModel.getDepartName();
  33. return this;
  34. }
  35. /**
  36. * 该方法为用户部门的实现类所使用
  37. * @param sysDepart
  38. * @return
  39. */
  40. public DepartIdModel convertByUserDepart(SysDepart sysDepart) {
  41. this.key = sysDepart.getId();
  42. this.value = sysDepart.getId();
  43. this.title = sysDepart.getDepartName();
  44. return this;
  45. }
  46. public List<DepartIdModel> getChildren() {
  47. return children;
  48. }
  49. public void setChildren(List<DepartIdModel> children) {
  50. this.children = children;
  51. }
  52. public static long getSerialVersionUID() {
  53. return serialVersionUID;
  54. }
  55. public String getKey() {
  56. return key;
  57. }
  58. public void setKey(String key) {
  59. this.key = key;
  60. }
  61. public String getValue() {
  62. return value;
  63. }
  64. public void setValue(String value) {
  65. this.value = value;
  66. }
  67. public String getTitle() {
  68. return title;
  69. }
  70. public void setTitle(String title) {
  71. this.title = title;
  72. }
  73. }