|
|
@@ -1,7 +1,7 @@
|
|
|
package com.coffee.bus.registry.device;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.coffee.bus.bean.DeviceBasicInfo;
|
|
|
+import com.coffee.bus.registry.device.bean.DeviceBasicInfo;
|
|
|
import com.coffee.common.enums.SexEnum;
|
|
|
import com.coffee.common.redis.RedisUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -19,9 +19,9 @@ import java.util.Map;
|
|
|
*/
|
|
|
@AllArgsConstructor
|
|
|
public class DeviceOperator {
|
|
|
- private final DeviceBasicInfo deviceBasicInfo;
|
|
|
+ private transient final DeviceBasicInfo deviceBasicInfo;
|
|
|
|
|
|
- private final RedisUtils redisUtils;
|
|
|
+ private transient final RedisUtils redisUtils;
|
|
|
|
|
|
/**
|
|
|
* 该操作是否有效,即判断该操作是否存在设备id
|
|
|
@@ -36,30 +36,37 @@ public class DeviceOperator {
|
|
|
*/
|
|
|
public DeviceOperator clear(){
|
|
|
if(!validate)return this;
|
|
|
- redisUtils.del(deviceBasicInfo.getDeviceId());
|
|
|
+ redisUtils.del(deviceBasicInfo.getKey());
|
|
|
return this;
|
|
|
}
|
|
|
/**
|
|
|
* 将自身同步至redis
|
|
|
* @param
|
|
|
*/
|
|
|
- public DeviceOperator sysn(){
|
|
|
+ public DeviceOperator sync(){
|
|
|
if(!validate)return this;
|
|
|
- redisUtils.hmset(this.getDeviceId(),getMap());
|
|
|
+ redisUtils.hmset(deviceBasicInfo.getKey(),getMap());
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public DeviceOperator updateAlias(String alias){
|
|
|
+ if(!validate)return this;
|
|
|
+ deviceBasicInfo.setAlias(alias);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"alias",alias);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public DeviceOperator updateEnable(Integer enable){
|
|
|
if(!validate)return this;
|
|
|
deviceBasicInfo.setEnable(enable);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"enable",enable);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"enable",enable);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public DeviceOperator updateTenantId(String tenantId){
|
|
|
if(!validate)return this;
|
|
|
deviceBasicInfo.setTenantId(tenantId);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"tenantId",tenantId);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"tenantId",tenantId);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
@@ -67,14 +74,14 @@ public class DeviceOperator {
|
|
|
public DeviceOperator updateRunId(String runId){
|
|
|
if(!validate)return this;
|
|
|
deviceBasicInfo.setId(runId);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"id",runId);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"id",runId);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public DeviceOperator updateStartTime(Date startTime){
|
|
|
if(!validate)return this;
|
|
|
deviceBasicInfo.setStartTime(startTime);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"startTime",startTime);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"startTime",startTime);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
@@ -82,69 +89,69 @@ public class DeviceOperator {
|
|
|
public DeviceOperator updateRegisterTime(Date registerTime){
|
|
|
if(!validate)return this;
|
|
|
deviceBasicInfo.setRegisterTime(registerTime);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"registerTime",registerTime);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public DeviceOperator updatePatientCode(String patientCode){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setPatientCode(patientCode);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"patientCode",patientCode);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public DeviceOperator updatePatientName(String patientName){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setPatientName(patientName);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"patientName",patientName);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public DeviceOperator updateGender(SexEnum gender){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setGender(gender);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"gender",gender);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public DeviceOperator updateBedNo(String bedNo){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setBedNo(bedNo);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"bedNo",bedNo);
|
|
|
+ redisUtils.hset(deviceBasicInfo.getKey(),"registerTime",registerTime);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public DeviceOperator updateWard(String ward){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setWard(ward);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"ward",ward);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public DeviceOperator updateRemark(String remark){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setRemark(remark);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"remark",remark);
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
- public DeviceOperator updateClinicId(String clinicId){
|
|
|
- if(!validate)return this;
|
|
|
- deviceBasicInfo.setClinicId(clinicId);
|
|
|
- redisUtils.hset(deviceBasicInfo.getDeviceId(),"clinicId",clinicId);
|
|
|
- return this;
|
|
|
- }
|
|
|
+//
|
|
|
+// public DeviceOperator updatePatientCode(String patientCode){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setPatientCode(patientCode);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"patientCode",patientCode);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// public DeviceOperator updatePatientName(String patientName){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setPatientName(patientName);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"patientName",patientName);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// public DeviceOperator updateGender(SexEnum gender){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setGender(gender);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"gender",gender);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// public DeviceOperator updateBedNo(String bedNo){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setBedNo(bedNo);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"bedNo",bedNo);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// public DeviceOperator updateWard(String ward){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setWard(ward);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"ward",ward);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// public DeviceOperator updateRemark(String remark){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setRemark(remark);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"remark",remark);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
+//
|
|
|
+// public DeviceOperator updateClinicId(String clinicId){
|
|
|
+// if(!validate)return this;
|
|
|
+// deviceBasicInfo.setClinicId(clinicId);
|
|
|
+// redisUtils.hset(deviceBasicInfo.getKey(),"clinicId",clinicId);
|
|
|
+// return this;
|
|
|
+// }
|
|
|
|
|
|
public String getDeviceId(){
|
|
|
return deviceBasicInfo.getDeviceId();
|
|
|
@@ -174,33 +181,33 @@ public class DeviceOperator {
|
|
|
return deviceBasicInfo.getRegisterTime();
|
|
|
}
|
|
|
|
|
|
- public String getPatientCode(){
|
|
|
- return deviceBasicInfo.getPatientCode();
|
|
|
- }
|
|
|
-
|
|
|
- public String getPatientName(){
|
|
|
- return deviceBasicInfo.getPatientName();
|
|
|
- }
|
|
|
-
|
|
|
- public SexEnum getGender(){
|
|
|
- return deviceBasicInfo.getGender();
|
|
|
- }
|
|
|
-
|
|
|
- public String getBedNo(){
|
|
|
- return deviceBasicInfo.getBedNo();
|
|
|
- }
|
|
|
-
|
|
|
- public String getWard(){
|
|
|
- return deviceBasicInfo.getWard();
|
|
|
- }
|
|
|
-
|
|
|
- public String getRemark(){
|
|
|
- return deviceBasicInfo.getRemark();
|
|
|
- }
|
|
|
-
|
|
|
- public String getClinicId(){
|
|
|
- return deviceBasicInfo.getClinicId();
|
|
|
- }
|
|
|
+// public String getPatientCode(){
|
|
|
+// return deviceBasicInfo.getPatientCode();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public String getPatientName(){
|
|
|
+// return deviceBasicInfo.getPatientName();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public SexEnum getGender(){
|
|
|
+// return deviceBasicInfo.getGender();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public String getBedNo(){
|
|
|
+// return deviceBasicInfo.getBedNo();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public String getWard(){
|
|
|
+// return deviceBasicInfo.getWard();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public String getRemark(){
|
|
|
+// return deviceBasicInfo.getRemark();
|
|
|
+// }
|
|
|
+//
|
|
|
+// public String getClinicId(){
|
|
|
+// return deviceBasicInfo.getClinicId();
|
|
|
+// }
|
|
|
/**
|
|
|
* 判断设备在系统中是否存在
|
|
|
* @return
|