|
@@ -8,7 +8,9 @@ import com.nb.core.entity.MqttMessage;
|
|
|
import com.nb.core.enums.MqttTopicEnum;
|
|
import com.nb.core.enums.MqttTopicEnum;
|
|
|
import com.nb.core.handler.AbstractMqttMessageHandler;
|
|
import com.nb.core.handler.AbstractMqttMessageHandler;
|
|
|
import com.nb.web.api.entity.BusEvaluationEntity;
|
|
import com.nb.web.api.entity.BusEvaluationEntity;
|
|
|
|
|
+import com.nb.web.api.entity.BusInfusionHistoryEntity;
|
|
|
import com.nb.web.service.bus.entity.BusPatientEntity;
|
|
import com.nb.web.service.bus.entity.BusPatientEntity;
|
|
|
|
|
+import com.nb.web.service.bus.mapper.BusInfusionHistoryMapper;
|
|
|
import com.nb.web.service.bus.mapper.BusPatientMapper;
|
|
import com.nb.web.service.bus.mapper.BusPatientMapper;
|
|
|
import com.nb.web.service.bus.service.LocalBusEvaluationService;
|
|
import com.nb.web.service.bus.service.LocalBusEvaluationService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -31,6 +33,9 @@ public class BusEvaluationMessageListener extends AbstractMqttMessageHandler {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BusPatientMapper patientMapper;
|
|
private BusPatientMapper patientMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private BusInfusionHistoryMapper infusionHistoryMapper;
|
|
|
/**
|
|
/**
|
|
|
* 定义支持的主题模式
|
|
* 定义支持的主题模式
|
|
|
* @return 支持的主题模式
|
|
* @return 支持的主题模式
|
|
@@ -67,6 +72,11 @@ public class BusEvaluationMessageListener extends AbstractMqttMessageHandler {
|
|
|
evaluation.setInfusionId(patient.getInfusionId());
|
|
evaluation.setInfusionId(patient.getInfusionId());
|
|
|
evaluation.setClinicId(patient.getClinicId());
|
|
evaluation.setClinicId(patient.getClinicId());
|
|
|
evaluation.setTenantId(patient.getTenantId());
|
|
evaluation.setTenantId(patient.getTenantId());
|
|
|
|
|
+ BusInfusionHistoryEntity infusionHistory = infusionHistoryMapper.selectById(patient.getInfusionId());
|
|
|
|
|
+ if(ObjectUtil.isNotNull(infusionHistory)){
|
|
|
|
|
+ evaluation.setDeviceId(infusionHistory.getDeviceId());
|
|
|
|
|
+ }
|
|
|
|
|
+ evaluation.setId(null);
|
|
|
// 保存到数据库
|
|
// 保存到数据库
|
|
|
evaluationService.save(evaluation);
|
|
evaluationService.save(evaluation);
|
|
|
log.info("评价信息处理完成,ID: {}", evaluation.getId());
|
|
log.info("评价信息处理完成,ID: {}", evaluation.getId());
|