|
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.nb.auth.utils.SecurityUtil;
|
|
|
import com.nb.web.api.entity.BusClinicEntity;
|
|
|
import com.nb.web.api.entity.BusDeviceEntity;
|
|
|
import com.nb.web.api.entity.BusInfusionHistoryEntity;
|
|
|
@@ -40,6 +41,8 @@ import com.nb.core.result.R;
|
|
|
import com.nb.core.utils.ExceptionUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
|
@@ -115,12 +118,10 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
|
|
|
|
|
|
@Override
|
|
|
public void validateBeforeUpdate(BusPatientEntity entity) {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void validateBeforeDelete(String id) {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -228,6 +229,9 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
|
|
|
|
|
|
@Override
|
|
|
public List<PatientMonitorResult> selectAll(PatientMonitorQuery query) {
|
|
|
+ if(Boolean.TRUE.equals(query.selectAll())){
|
|
|
+ return patientService.selectAll(query.getTenantId());
|
|
|
+ }
|
|
|
Page<PatientMonitorResult> page = new Page<>(0, 9999, false);
|
|
|
IPage<PatientMonitorResult> result = this.baseMapper.selectMonitor(page, query);
|
|
|
if (CollectionUtil.isNotEmpty(result.getRecords())) {
|
|
|
@@ -236,6 +240,21 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
|
|
|
return result.getRecords();
|
|
|
}
|
|
|
|
|
|
+ @Cacheable(value = "patientList",key = "#tenantId")
|
|
|
+ public List<PatientMonitorResult> selectAll(String tenantId){
|
|
|
+ PatientMonitorQuery query = new PatientMonitorQuery();
|
|
|
+ Page<PatientMonitorResult> page = new Page<>(0, 9999, false);
|
|
|
+ IPage<PatientMonitorResult> result = this.baseMapper.selectMonitor(page, query);
|
|
|
+ if (CollectionUtil.isNotEmpty(result.getRecords())) {
|
|
|
+ result.getRecords().forEach(PatientMonitorResult::handleWarn);
|
|
|
+ }
|
|
|
+ return result.getRecords();
|
|
|
+ }
|
|
|
+
|
|
|
+ @CacheEvict(value = "patientList",key = "#tenantId")
|
|
|
+ public void deleteAllCache(String tenantId){
|
|
|
+
|
|
|
+ }
|
|
|
/**
|
|
|
*
|
|
|
* 根据医院和住院号获取一个患者
|
|
|
@@ -313,6 +332,7 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
|
|
|
this.updateById(patient);
|
|
|
patientOperator.setClinicId(patient.getClinicId());
|
|
|
wsPublishUtils.publishPatientMonitor(originPatientInfo.getId(), patient.getTenantId());
|
|
|
+ patientService.deleteAllCache(patient.getTenantId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -559,7 +579,7 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
|
|
|
CompletableFuture.runAsync(()-> wsPublishUtils.publishPatientMonitor(clinic.getPatientId(),clinic.getTenantId()));
|
|
|
SpringUtil.publishEvent(new ClinicManageEvent(this,clinic.getTenantId(),clinic.getPatientId(),manageEnum));
|
|
|
}
|
|
|
-
|
|
|
+ patientService.deleteAllCache(clinic.getTenantId());
|
|
|
return result;
|
|
|
}
|
|
|
|