DeptDto.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package easydo.technology.system.dto;
  2. import com.fasterxml.jackson.annotation.JsonFormat;
  3. import com.fasterxml.jackson.annotation.JsonInclude;
  4. import easydo.technology.base.CommonDto;
  5. import lombok.Getter;
  6. import lombok.NoArgsConstructor;
  7. import lombok.Setter;
  8. import java.time.LocalDateTime;
  9. import java.util.List;
  10. import java.util.Objects;
  11. /**
  12. * @author jinjin
  13. * @date 2020-09-25
  14. */
  15. @Getter
  16. @Setter
  17. @NoArgsConstructor
  18. public class DeptDto extends CommonDto {
  19. private static final long serialVersionUID = 1L;
  20. private Long id;
  21. private Long pid;
  22. private Integer subCount;
  23. private String name;
  24. private Integer deptSort;
  25. private String firmType;
  26. private String firmCredit;
  27. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  28. private LocalDateTime firmTime;
  29. private String firmAddress;
  30. private String firmCapital;
  31. private String firmNature;
  32. private String firmLegalPerson;
  33. private String firmLegalPersonPhone;
  34. private String firmFunctionary;
  35. private String firmFunctionaryPhone;
  36. private String firmOfficePhone;
  37. private String firmFaxNumber;
  38. private String firmBusinessAddress;
  39. private String remark;
  40. @JsonInclude(JsonInclude.Include.NON_EMPTY)
  41. private List<DeptDto> children;
  42. private Boolean enabled;
  43. public Boolean getHasChildren() {
  44. return subCount > 0;
  45. }
  46. public Boolean getLeaf() {
  47. return subCount <= 0;
  48. }
  49. public String getLabel() {
  50. return name;
  51. }
  52. @Override
  53. public boolean equals(Object o) {
  54. if (this == o) {
  55. return true;
  56. }
  57. if (o == null || getClass() != o.getClass()) {
  58. return false;
  59. }
  60. DeptDto deptDto = (DeptDto) o;
  61. return Objects.equals(id, deptDto.id) &&
  62. Objects.equals(name, deptDto.name);
  63. }
  64. @Override
  65. public int hashCode() {
  66. return Objects.hash(id, name);
  67. }
  68. }