|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|
|
import java.io.Serializable;
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
import javax.persistence.*;
|
|
|
|
|
|
import com.uas.sso.core.Const;
|
|
|
@@ -280,7 +281,7 @@ public class Userspace implements Serializable {
|
|
|
}
|
|
|
|
|
|
public String getSpaceName() {
|
|
|
- if (spaceName.contains(Const.REPEAT_SEPARATOR)) {
|
|
|
+ if (spaceName != null && spaceName.contains(Const.REPEAT_SEPARATOR)) {
|
|
|
return spaceName.substring(0, spaceName.indexOf(Const.REPEAT_SEPARATOR));
|
|
|
}
|
|
|
return spaceName;
|
|
|
@@ -331,7 +332,7 @@ public class Userspace implements Serializable {
|
|
|
}
|
|
|
|
|
|
public String getBusinessCode() {
|
|
|
- if (businessCode.contains(Const.REPEAT_SEPARATOR)) {
|
|
|
+ if (businessCode != null && businessCode.contains(Const.REPEAT_SEPARATOR)) {
|
|
|
return businessCode.substring(0, businessCode.indexOf(Const.REPEAT_SEPARATOR));
|
|
|
}
|
|
|
return businessCode;
|
|
|
@@ -588,7 +589,7 @@ public class Userspace implements Serializable {
|
|
|
userSpaceView.setSpaceUU(this.getSpaceUU());
|
|
|
userSpaceView.setSpaceName(this.getSpaceName());
|
|
|
userSpaceView.setCorporation(this.getCorporation());
|
|
|
- userSpaceView.setRegisterDate(this.getRegisterDate().getTime());
|
|
|
+ userSpaceView.setRegisterDate(Optional.ofNullable(registerDate).map(Timestamp::getTime).orElse(null));
|
|
|
userSpaceView.setAdmin(this.getAdmin().toView());
|
|
|
userSpaceView.setAdminUU(this.getAdminUU());
|
|
|
userSpaceView.setBusinessCode(this.getBusinessCode());
|