|
|
@@ -1,14 +1,12 @@
|
|
|
package com.coffee.bus.registry.patient;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.coffee.bus.registry.constant.PatientKeyConstant;
|
|
|
import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
|
|
|
import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
|
|
|
import com.coffee.common.cache.ConfigStorage;
|
|
|
import com.coffee.common.enums.SexEnum;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -32,83 +30,6 @@ public class ClusterPatientOperator implements PatientOperator<PatientCacheInfo>
|
|
|
return configStorage;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public PatientCacheInfo get() {
|
|
|
-// Map<String, Value> result = configStorage.getKeys(getAllKeys());
|
|
|
-// PatientCacheInfo cacheInfo = PatientCacheInfo.builder().build();
|
|
|
-// Value code =parseValue(result.get("code")) ;
|
|
|
-// if(code!=null&&code.get()!=null){
|
|
|
-// cacheInfo.setCode(code.asString());
|
|
|
-// }
|
|
|
-// Value gender =parseValue(result.get("gender"));
|
|
|
-// if(gender!=null&&gender.get()!=null){
|
|
|
-// cacheInfo.setGender(gender.as(SexEnum.class));
|
|
|
-// }
|
|
|
-// Value name =parseValue( result.get("name"));
|
|
|
-// if(name!=null&&name.get()!=null){
|
|
|
-// cacheInfo.setName(name.asString());
|
|
|
-// }
|
|
|
-// Value tenantId =parseValue(result.get("tenantId")) ;
|
|
|
-// if(tenantId!=null&&tenantId.get()!=null){
|
|
|
-// cacheInfo.setTenantId(tenantId.asString());
|
|
|
-// }
|
|
|
-// Value clinicId =parseValue(result.get("clinicId")) ;
|
|
|
-// if(clinicId!=null&&clinicId.get()!=null){
|
|
|
-// cacheInfo.setClinicId(clinicId.asString());
|
|
|
-// }
|
|
|
-// Value startTime = parseValue(result.get("startTime"));
|
|
|
-// if(startTime!=null&&startTime.get()!=null){
|
|
|
-// cacheInfo.setStartTime(startTime.asDate());
|
|
|
-// }
|
|
|
-// Value finished = parseValue(result.get("finished"));
|
|
|
-// if(finished!=null&&finished.get()!=null){
|
|
|
-// cacheInfo.setFinished(finished.asBoolean());
|
|
|
-// }
|
|
|
-// Value bindDeviceId =parseValue( result.get("bindDeviceId"));
|
|
|
-// if(bindDeviceId!=null&&bindDeviceId.get()!=null){
|
|
|
-// cacheInfo.setBindDeviceId(bindDeviceId.asString());
|
|
|
-// }
|
|
|
-// Value devices = parseValue(result.get("devices"));
|
|
|
-// if(devices!=null&&devices.get()!=null){
|
|
|
-// cacheInfo.setDevices(code.as(HashSet.class));
|
|
|
-// }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void set(PatientCacheInfo all) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- if(StrUtil.isNotEmpty(all.getCode())){
|
|
|
- map.put("code",all.getCode());
|
|
|
- }
|
|
|
- if(all.getGender()!=null){
|
|
|
- map.put("gender",all.getGender().ordinal());
|
|
|
- }
|
|
|
- if(StrUtil.isNotEmpty(all.getName())){
|
|
|
- map.put("name",all.getName());
|
|
|
- }
|
|
|
- if(StrUtil.isNotEmpty(all.getTenantId())){
|
|
|
- map.put("tenantId",all.getTenantId());
|
|
|
- }
|
|
|
- if(StrUtil.isNotEmpty(all.getClinicId())){
|
|
|
- map.put("clinicId",all.getClinicId());
|
|
|
- }
|
|
|
- if(all.getStartTime()!=null){
|
|
|
- map.put("startTime",all.getStartTime());
|
|
|
- }
|
|
|
- if(all.getIsFinished()!=null){
|
|
|
- map.put("finished",all.getIsFinished());
|
|
|
- }
|
|
|
- if(StrUtil.isNotEmpty(all.getBindDeviceId())){
|
|
|
- map.put("bindDeviceId",all.getBindDeviceId());
|
|
|
- }
|
|
|
- if(CollectionUtil.isNotEmpty(all.getDevices())){
|
|
|
- map.put("devices",all.getDevices());
|
|
|
- }
|
|
|
- configStorage.setConfigs(map);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public void setCode(String code) {
|