mirror of
https://gitee.com/republicline/rax-remote-v2.git
synced 2025-08-24 00:14:58 +08:00
fixed: 给药json格式
This commit is contained in:
parent
ea24609c7e
commit
6f6643752d
|
@ -116,10 +116,12 @@ public class AddMedicineHandler implements WebSocketHandler {
|
|||
JSONObject result = new JSONObject();
|
||||
result.put("msgType", "pong");
|
||||
// 当前时间戳
|
||||
result.put("msg", new Date().getTime() - timeStamp);
|
||||
Long diff = new Date().getTime() - timeStamp;
|
||||
result.put("msg", diff);
|
||||
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,8 @@ public class MachineFeedbackHandler implements WebSocketHandler {
|
|||
JSONObject result = new JSONObject();
|
||||
result.put("msgType", "pong");
|
||||
// 当前时间戳
|
||||
result.put("msg", new Date().getTime() - timeStamp);
|
||||
Long diff = new Date().getTime() - timeStamp;
|
||||
result.put("msg", diff);
|
||||
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.rax.vital.medicine.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.rax.vital.medicine.service.AIMedicineService;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -186,8 +187,11 @@ public class AIMedicineServiceImpl implements AIMedicineService {
|
|||
}
|
||||
aiMedicines.remove(0);
|
||||
aiMedicines.add(medicine);
|
||||
return aiMedicines.get(0);
|
||||
}else {
|
||||
return Map.of();
|
||||
}
|
||||
return aiMedicines.get(0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -279,7 +279,8 @@ public class VitalSignTimerWS {
|
|||
String sessionId = machineDatabaseSessionMap.get(database);
|
||||
WebSocketSession machineSession = machineSessionMap.get(sessionId);
|
||||
if (machineSession != null) {
|
||||
result.put(medicine, value);
|
||||
result.put("medicine",medicine);
|
||||
result.put("value",value);
|
||||
result.put("flag", flag);
|
||||
result.put("msgType", "addMedicine");
|
||||
machineSession.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user