|
|
@@ -19,6 +19,7 @@ import javax.persistence.OrderBy;
|
|
|
import javax.persistence.SequenceGenerator;
|
|
|
import javax.persistence.Table;
|
|
|
import javax.persistence.Transient;
|
|
|
+
|
|
|
import org.codehaus.jackson.annotate.JsonIgnore;
|
|
|
import org.hibernate.annotations.Cache;
|
|
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
|
|
@@ -75,7 +76,7 @@ public class User implements Serializable {
|
|
|
private Short enable;
|
|
|
|
|
|
private Short issys;
|
|
|
-
|
|
|
+
|
|
|
@Column(name = "user_imid")
|
|
|
private Long userIMId;
|
|
|
|
|
|
@@ -124,7 +125,7 @@ public class User implements Serializable {
|
|
|
@Transient
|
|
|
@NotFound(action = NotFoundAction.IGNORE)
|
|
|
private String ip;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 判断是否被分配
|
|
|
*/
|
|
|
@@ -259,9 +260,9 @@ public class User implements Serializable {
|
|
|
if (this.enterprise == null)
|
|
|
setCurrentEnterprise();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void setCurrentEnterprise(Enterprise enterprise) {
|
|
|
- if(!CollectionUtils.isEmpty(SystemSession.getUser().getEnterprises())) {
|
|
|
+ if (!CollectionUtils.isEmpty(SystemSession.getUser().getEnterprises())) {
|
|
|
Set<Enterprise> enterprises = new HashSet<Enterprise>();
|
|
|
for (Enterprise en : SystemSession.getUser().getEnterprises()) {
|
|
|
if (en.equals(enterprise)) {
|
|
|
@@ -313,7 +314,7 @@ public class User implements Serializable {
|
|
|
public void setIp(String ip) {
|
|
|
this.ip = ip;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public boolean getDistribute() {
|
|
|
return distribute;
|
|
|
}
|
|
|
@@ -324,18 +325,56 @@ public class User implements Serializable {
|
|
|
|
|
|
/**
|
|
|
* 获取用户所属企业UU号
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@JSONField(serialize = false)
|
|
|
@JsonIgnore
|
|
|
public Set<Long> getEnUUs() {
|
|
|
Set<Long> enUUs = new HashSet<Long>();
|
|
|
- if( ! CollectionUtils.isEmpty(enterprises)) {
|
|
|
- for(Enterprise en : enterprises) {
|
|
|
+ if (!CollectionUtils.isEmpty(enterprises)) {
|
|
|
+ for (Enterprise en : enterprises) {
|
|
|
enUUs.add(en.getUu());
|
|
|
}
|
|
|
}
|
|
|
return enUUs;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int hashCode() {
|
|
|
+ final int prime = 31;
|
|
|
+ int result = 1;
|
|
|
+ result = prime * result + ((userEmail == null) ? 0 : userEmail.hashCode());
|
|
|
+ result = prime * result + ((userTel == null) ? 0 : userTel.hashCode());
|
|
|
+ result = prime * result + ((userUU == null) ? 0 : userUU.hashCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean equals(Object obj) {
|
|
|
+ if (this == obj)
|
|
|
+ return true;
|
|
|
+ if (obj == null)
|
|
|
+ return false;
|
|
|
+ if (getClass() != obj.getClass())
|
|
|
+ return false;
|
|
|
+ User other = (User) obj;
|
|
|
+ if (userEmail == null) {
|
|
|
+ if (other.userEmail != null)
|
|
|
+ return false;
|
|
|
+ } else if (!userEmail.equals(other.userEmail))
|
|
|
+ return false;
|
|
|
+ if (userTel == null) {
|
|
|
+ if (other.userTel != null)
|
|
|
+ return false;
|
|
|
+ } else if (!userTel.equals(other.userTel))
|
|
|
+ return false;
|
|
|
+ if (userUU == null) {
|
|
|
+ if (other.userUU != null)
|
|
|
+ return false;
|
|
|
+ } else if (!userUU.equals(other.userUU))
|
|
|
+ return false;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|