DepartIdModel.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. /**
  18. * 主键ID
  19. */
  20. private String key;
  21. /**
  22. * 主键ID
  23. */
  24. private String value;
  25. /**
  26. * 部门名称
  27. */
  28. private String title;
  29. List<DepartIdModel> children = new ArrayList<>();
  30. /**
  31. * 将SysDepartTreeModel的部分数据放在该对象当中
  32. * @param treeModel
  33. * @return
  34. */
  35. public DepartIdModel convert(SysDepartTreeModel treeModel) {
  36. this.key = treeModel.getId();
  37. this.value = treeModel.getId();
  38. this.title = treeModel.getDepartName();
  39. return this;
  40. }
  41. /**
  42. * 该方法为用户部门的实现类所使用
  43. * @param sysDepart
  44. * @return
  45. */
  46. public DepartIdModel convertByUserDepart(SysDepart sysDepart) {
  47. this.key = sysDepart.getId();
  48. this.value = sysDepart.getId();
  49. this.title = sysDepart.getDepartName();
  50. return this;
  51. }
  52. public List<DepartIdModel> getChildren() {
  53. return children;
  54. }
  55. public void setChildren(List<DepartIdModel> children) {
  56. this.children = children;
  57. }
  58. public static long getSerialVersionUID() {
  59. return serialVersionUID;
  60. }
  61. public String getKey() {
  62. return key;
  63. }
  64. public void setKey(String key) {
  65. this.key = key;
  66. }
  67. public String getValue() {
  68. return value;
  69. }
  70. public void setValue(String value) {
  71. this.value = value;
  72. }
  73. public String getTitle() {
  74. return title;
  75. }
  76. public void setTitle(String title) {
  77. this.title = title;
  78. }
  79. }