|
|
@ -1,6 +1,7 @@ |
|
|
|
package a8k.app.a8ktype.ui; |
|
|
|
|
|
|
|
import a8k.app.a8ktype.device.BloodType; |
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
|
|
|
import io.swagger.v3.oas.annotations.media.Schema; |
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
@ -8,13 +9,21 @@ import java.util.UUID; |
|
|
|
|
|
|
|
|
|
|
|
public class TubeHolderSetting implements Serializable { |
|
|
|
public enum TubeHolderSettingState { |
|
|
|
INACTIVE, |
|
|
|
ACTIVE, |
|
|
|
LOCKED |
|
|
|
} |
|
|
|
|
|
|
|
@Schema(description = "唯一标识") |
|
|
|
public String uuid = UUID.randomUUID().toString(); //唯一标识 |
|
|
|
@Schema(description = "是否激活") |
|
|
|
@JsonIgnore |
|
|
|
public Boolean active = false;//是否激活 |
|
|
|
@Schema(description = "试管配置") |
|
|
|
public TubeSetting[] tubeSettings = new TubeSetting[10]; |
|
|
|
@Schema(description = "是否锁定(锁住后,该配置不允许被修改)") |
|
|
|
@JsonIgnore |
|
|
|
public Boolean lock = false;//如果后台已经使用,前端不允许修改 |
|
|
|
|
|
|
|
public TubeHolderSetting() { |
|
|
@ -25,6 +34,16 @@ public class TubeHolderSetting implements Serializable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public TubeHolderSettingState getState() { |
|
|
|
if (lock) { |
|
|
|
return TubeHolderSettingState.LOCKED; |
|
|
|
} |
|
|
|
if (active) { |
|
|
|
return TubeHolderSettingState.ACTIVE; |
|
|
|
} |
|
|
|
return TubeHolderSettingState.INACTIVE; |
|
|
|
} |
|
|
|
|
|
|
|
public String toString() { |
|
|
|
|
|
|
|
StringBuilder ret = new StringBuilder(String.format("\nTubeHolderSetting(Lock:%s)(%s)\n", lock, uuid)); |
|
|
@ -35,14 +54,14 @@ public class TubeHolderSetting implements Serializable { |
|
|
|
return ret.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
public static void main(String[] args) { |
|
|
|
TubeHolderSetting setting = new TubeHolderSetting(); |
|
|
|
System.out.println(setting); |
|
|
|
TubeSetting tubeSetting = setting.tubeSettings[0]; |
|
|
|
tubeSetting.userid = "FAUID1"; |
|
|
|
tubeSetting.sampleBarcode = "FA001234"; |
|
|
|
tubeSetting.projId.add(1); |
|
|
|
tubeSetting.bloodType = BloodType.WHOLE_BLOOD; |
|
|
|
tubeSetting.bloodType = BloodType.WHOLE_BLOOD; |
|
|
|
|
|
|
|
System.out.println(setting); |
|
|
|
|
|
|
|