fixed: 给药json格式
This commit is contained in:
parent
ea24609c7e
commit
6f6643752d
|
@ -116,10 +116,12 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("msgType", "pong");
|
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()));
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,8 @@ public class MachineFeedbackHandler implements WebSocketHandler {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("msgType", "pong");
|
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()));
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rax.vital.medicine.service.impl;
|
package com.rax.vital.medicine.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import com.mongodb.BasicDBObject;
|
import com.mongodb.BasicDBObject;
|
||||||
import com.rax.vital.medicine.service.AIMedicineService;
|
import com.rax.vital.medicine.service.AIMedicineService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -186,8 +187,11 @@ public class AIMedicineServiceImpl implements AIMedicineService {
|
||||||
}
|
}
|
||||||
aiMedicines.remove(0);
|
aiMedicines.remove(0);
|
||||||
aiMedicines.add(medicine);
|
aiMedicines.add(medicine);
|
||||||
|
return aiMedicines.get(0);
|
||||||
|
}else {
|
||||||
|
return Map.of();
|
||||||
}
|
}
|
||||||
return aiMedicines.get(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -279,7 +279,8 @@ public class VitalSignTimerWS {
|
||||||
String sessionId = machineDatabaseSessionMap.get(database);
|
String sessionId = machineDatabaseSessionMap.get(database);
|
||||||
WebSocketSession machineSession = machineSessionMap.get(sessionId);
|
WebSocketSession machineSession = machineSessionMap.get(sessionId);
|
||||||
if (machineSession != null) {
|
if (machineSession != null) {
|
||||||
result.put(medicine, value);
|
result.put("medicine",medicine);
|
||||||
|
result.put("value",value);
|
||||||
result.put("flag", flag);
|
result.put("flag", flag);
|
||||||
result.put("msgType", "addMedicine");
|
result.put("msgType", "addMedicine");
|
||||||
machineSession.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
machineSession.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user