|
|
@@ -56,6 +56,7 @@ public class RabbitMqListener {
|
|
|
* @return void
|
|
|
*/
|
|
|
@RabbitListener(queuesToDeclare = @Queue("cloud.patient"))
|
|
|
+ @Transactional (rollbackFor = Exception.class)
|
|
|
public void patientQueue(@Payload String body) {
|
|
|
log.info("消息队列中,病人队列{cloud.patient},接受消息:{}",body);
|
|
|
BusHospitalLogEntity hospitalLog = new BusHospitalLogEntity();
|
|
|
@@ -70,26 +71,26 @@ public class RabbitMqListener {
|
|
|
BusClinicEntity clinic= source.toClinic(patientId);
|
|
|
PatientMonitorDetailResult patientDetail = patientClient.lookPatientDetail(patientId);
|
|
|
BusClinicEntity existClinic = patientDetail.getClinic();
|
|
|
- if(Boolean.TRUE.equals(clinic.getFinished())){
|
|
|
- if(ObjectUtil.isNull(existClinic)||
|
|
|
- ObjectUtil.isNull(existClinic.getUndoConfig())||
|
|
|
- ObjectUtil.notEqual(clinic.getUndoConfig(),
|
|
|
- existClinic.getUndoConfig())){
|
|
|
- //避免重复撤泵,进行撤泵处理
|
|
|
- clinicClient.finish(existClinic.getId(),existClinic.getTenantId(),clinic.getUndoConfig());
|
|
|
- if (patientDetail.getInfusion()!=null) {
|
|
|
- //刷新分包标识
|
|
|
- deviceClient.refreshClassification(patientDetail.getInfusion().getDeviceId());
|
|
|
- }
|
|
|
- }else {
|
|
|
- clinic.setFinished(null);
|
|
|
- clinicClient.update(existClinic.getId(),clinic);
|
|
|
- }
|
|
|
- }else {
|
|
|
+// if(Boolean.TRUE.equals(clinic.getFinished())){
|
|
|
+// if(ObjectUtil.isNull(existClinic)||
|
|
|
+// ObjectUtil.isNull(existClinic.getUndoConfig())||
|
|
|
+// ObjectUtil.notEqual(clinic.getUndoConfig(),
|
|
|
+// existClinic.getUndoConfig())){
|
|
|
+// //避免重复撤泵,进行撤泵处理
|
|
|
+// clinicClient.finish(existClinic.getId(),existClinic.getTenantId(),clinic.getUndoConfig());
|
|
|
+// if (patientDetail.getInfusion()!=null) {
|
|
|
+// //刷新分包标识
|
|
|
+// deviceClient.refreshClassification(patientDetail.getInfusion().getDeviceId());
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// clinic.setFinished(null);
|
|
|
+// clinicClient.update(existClinic.getId(),clinic);
|
|
|
+// }
|
|
|
+// }else {
|
|
|
//当上一个临床状态为已结束时,对比临床信息是否发生改变,生成新的临床信息
|
|
|
boolean sameClinic=false;
|
|
|
if(StrUtil.isNotEmpty(existClinic.getId())){
|
|
|
- sameClinic=(clinic.getSurgeryName()).equals(
|
|
|
+ sameClinic=ObjectUtil.equal(clinic.getSurgeryName(),
|
|
|
existClinic.getSurgeryName());
|
|
|
}
|
|
|
if(!sameClinic){
|
|
|
@@ -102,11 +103,11 @@ public class RabbitMqListener {
|
|
|
clinic.setStartTime(existClinic.getStartTime());
|
|
|
clinicClient.update(existClinic.getId(),clinic);
|
|
|
}
|
|
|
- }
|
|
|
+// }
|
|
|
hospitalLog.setResult(JSONUtil.toJsonStr(clinic));
|
|
|
hospitalLog.setSuccess(true);
|
|
|
}catch (Exception e){
|
|
|
- log.info("消息队列【cloud.patient】处理消息{}失败,",body,e);
|
|
|
+ log.error("消息队列【cloud.patient】处理消息{}失败,",body,e);
|
|
|
hospitalLog.setMessage(ExceptionUtil.getExceptionMsg(e));
|
|
|
hospitalLog.setSuccess(false);
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
@@ -124,6 +125,7 @@ public class RabbitMqListener {
|
|
|
* @return void
|
|
|
*/
|
|
|
@RabbitListener(queuesToDeclare = @Queue("cloud.pump"))
|
|
|
+ @Transactional (rollbackFor = Exception.class)
|
|
|
public void pumpQueue(@Payload String body) {
|
|
|
BusHospitalLogEntity hospitalLog = new BusHospitalLogEntity();
|
|
|
hospitalLog.setMsgId(IdWorker.getIdStr());
|
|
|
@@ -143,10 +145,14 @@ public class RabbitMqListener {
|
|
|
device.setClassification(deviceClient.getClassification(device.getDeviceId()));
|
|
|
device.setDataNumber(deviceClient.nextDataNumber(device.getDeviceId()));
|
|
|
BusDeviceRunningEntity sync = iotMsgHandler.sync(device, device.getDeviceId());
|
|
|
+ if(!source.isRemove()){
|
|
|
+ clinicClient.finish(sync.getClinicId(),sync.getTenantId(),null);
|
|
|
+ deviceClient.refreshClassification(sync.getDeviceId());
|
|
|
+ }
|
|
|
hospitalLog.setResult(JSONUtil.toJsonStr(sync));
|
|
|
hospitalLog.setSuccess(true);
|
|
|
}catch (Exception e){
|
|
|
- log.info("消息队列【cloud.pump】处理消息{}失败,",body,e);
|
|
|
+ log.error("消息队列【cloud.pump】处理消息{}失败,",body,e);
|
|
|
hospitalLog.setMessage(ExceptionUtil.getExceptionMsg(e));
|
|
|
hospitalLog.setSuccess(false);
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
@@ -173,6 +179,7 @@ public class RabbitMqListener {
|
|
|
* @return void
|
|
|
*/
|
|
|
@RabbitListener(queuesToDeclare = @Queue("cloud.analgesicScore"))
|
|
|
+ @Transactional (rollbackFor = Exception.class)
|
|
|
public void analgesicScoreQueue(@Payload String body) {
|
|
|
log.info("消息队列中,评分队列{cloud.analgesicScore},接受消息:{}",body);
|
|
|
BusHospitalLogEntity hospitalLog = new BusHospitalLogEntity();
|
|
|
@@ -195,7 +202,7 @@ public class RabbitMqListener {
|
|
|
hospitalLog.setResult(JSONUtil.toJsonStr(eval));
|
|
|
hospitalLog.setSuccess(true);
|
|
|
}catch (Exception e){
|
|
|
- log.info("消息队列【cloud.analgesicScore】处理消息{}失败,",body,e);
|
|
|
+ log.error("消息队列【cloud.analgesicScore】处理消息{}失败,",body,e);
|
|
|
hospitalLog.setMessage(ExceptionUtil.getExceptionMsg(e));
|
|
|
hospitalLog.setSuccess(false);
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|