Quellcode durchsuchen

del 删除多余代码

A17404李放 vor 3 Jahren
Ursprung
Commit
f953ec6de7

+ 0 - 8
coffee-system/src/main/java/com/coffee/bus/registry/Operator.java

@@ -18,14 +18,6 @@ import java.util.*;
  * @createTime 2022年04月07日 16:07:00
  */
 public interface Operator<T> {
-    /**
-     * 获取所有缓存数据
-     * @return
-     */
-    @Deprecated
-    T get();
-
-    void set(T all);
 
     ConfigStorage getConfig();
 

+ 0 - 84
coffee-system/src/main/java/com/coffee/bus/registry/device/ClusterDeviceOperator.java

@@ -28,90 +28,6 @@ public class ClusterDeviceOperator implements DeviceOperator<DeviceCacheInfo> {
         return configStorage;
     }
 
-    @Override
-    public DeviceCacheInfo get() {
-//        Map<String, Value> result = configStorage.getKeys(getAllKeys());
-//        DeviceCacheInfo cacheInfo = DeviceCacheInfo.builder().build();
-//        Value deviceId =parseValue(result.get("deviceId")) ;
-//        if(deviceId!=null&&deviceId.get()!=null){
-//            cacheInfo.setDeviceId(deviceId.asString());
-//        }
-//        Value alias =parseValue(result.get("alias"));
-//        if(alias!=null&&alias.get()!=null){
-//            cacheInfo.setAlias(alias.asString());
-//        }
-//        Value enable =parseValue( result.get("enable"));
-//        if(enable!=null&&enable.get()!=null){
-//            cacheInfo.setEnable(enable.asBoolean());
-//        }
-//        Value tenantId =parseValue(result.get("tenantId")) ;
-//        if(tenantId!=null&&tenantId.get()!=null){
-//            cacheInfo.setTenantId(tenantId.asString());
-//        }
-//        Value usingId =parseValue(result.get("usingId")) ;
-//        if(usingId!=null&&usingId.get()!=null){
-//            cacheInfo.setUsingId(usingId.asString());
-//        }
-//        Value startTime = parseValue(result.get("startTime"));
-//        if(startTime!=null&&startTime.get()!=null){
-//            cacheInfo.setStartTime(startTime.asDate());
-//        }
-//        Value patientCode = parseValue(result.get("patientCode"));
-//        if(patientCode!=null&&patientCode.get()!=null){
-//            cacheInfo.setPatientCode(patientCode.asString());
-//        }
-//        Value status =parseValue( result.get("status"));
-//        if(status!=null&&status.get()!=null){
-//            cacheInfo.setStatus(status.as(DeviceStatusEnum.class));
-//        }
-//        Value master = parseValue(result.get("master"));
-//        if(master!=null&&master.get()!=null){
-//            cacheInfo.setMaster(master.asBoolean());
-//        }
-//        Value classification = parseValue(result.get("classification"));
-//        if(classification!=null&&classification.get()!=null){
-//            cacheInfo.setClassification(classification.asString());
-//        }
-//        return cacheInfo;
-        return null;
-    }
-
-    @Override
-    public void set(DeviceCacheInfo all) {
-        Map<String, Object> map = new HashMap<>();
-        if(StrUtil.isNotEmpty(all.getDeviceId())){
-            map.put("deviceId",all.getDeviceId());
-        }
-        if(StrUtil.isNotEmpty(all.getAlias())){
-            map.put("alias",all.getAlias());
-        }
-        if(all.getEnable()!=null){
-            map.put("enable",all.getEnable());
-        }
-        if(StrUtil.isNotEmpty(all.getTenantId())){
-            map.put("tenantId",all.getTenantId());
-        }
-        if(StrUtil.isNotEmpty(all.getUsingId())){
-            map.put("usingId",all.getUsingId());
-        }
-        if(all.getStartTime()!=null){
-            map.put("startTime",all.getStartTime());
-        }
-        if(StrUtil.isNotEmpty(all.getPatientCode())){
-            map.put("patientCode",all.getPatientCode());
-        }
-        if(all.getStatus()!=null){
-            map.put("status",all.getStatus());
-        }
-        if(all.getMaster()!=null){
-            map.put("master",all.getMaster());
-        }
-        if(all.getClassification()!=null){
-            map.put("classification",all.getClassification());
-        }
-        configStorage.setConfigs(map);
-    }
-
     @Override
     public void setDeviceId(String deviceId) {
         configStorage.setConfig(DeviceKeyConstant.DEVICE_ID,deviceId);

+ 0 - 79
coffee-system/src/main/java/com/coffee/bus/registry/patient/ClusterPatientOperator.java

@@ -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) {