fixed: 修正生命体征这部分的返回json内容,便于处理
This commit is contained in:
parent
9b2daf8452
commit
ea24609c7e
|
@ -5,7 +5,6 @@ import com.rax.vital.timer.AIMedicineTimer;
|
||||||
import com.rax.vital.timer.VitalSignTimerWS;
|
import com.rax.vital.timer.VitalSignTimerWS;
|
||||||
import com.rax.vital.util.DatabaseNameUtil;
|
import com.rax.vital.util.DatabaseNameUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.joda.time.LocalDateTime;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.socket.*;
|
import org.springframework.web.socket.*;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class WSChannelInterceptor implements ChannelInterceptor {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OAuth2AuthorizationService authorizationService;
|
private OAuth2AuthorizationService authorizationService;
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private VitalSignTimer vitalSignTimer;
|
// private VitalSignTimer vitalSignTimer;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChatService chatService;
|
private ChatService chatService;
|
||||||
|
@ -53,9 +53,9 @@ public class WSChannelInterceptor implements ChannelInterceptor {
|
||||||
|
|
||||||
if (StompCommand.DISCONNECT.equals(accessor.getCommand())
|
if (StompCommand.DISCONNECT.equals(accessor.getCommand())
|
||||||
|| StompCommand.UNSUBSCRIBE.equals(accessor.getCommand()) || StompCommand.ABORT.equals(accessor.getCommand())) {
|
|| StompCommand.UNSUBSCRIBE.equals(accessor.getCommand()) || StompCommand.ABORT.equals(accessor.getCommand())) {
|
||||||
String simpSessionId = (String) accessor.getHeader("simpSessionId");
|
// String simpSessionId = (String) accessor.getHeader("simpSessionId");
|
||||||
vitalSignTimer.stopTimerTaskMongo(simpSessionId);
|
// vitalSignTimer.stopTimerTaskMongo(simpSessionId);
|
||||||
chatService.stopTimerTask(simpSessionId);
|
// chatService.stopTimerTask(simpSessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
|
|
|
@ -33,8 +33,8 @@ import java.util.ArrayList;
|
||||||
@RequestMapping("/medicine")
|
@RequestMapping("/medicine")
|
||||||
public class MedicineController {
|
public class MedicineController {
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private VitalSignTimer vitalSignTimer;
|
// private VitalSignTimer vitalSignTimer;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OAuth2AuthorizationService authorizationService;
|
private OAuth2AuthorizationService authorizationService;
|
||||||
|
@ -45,26 +45,26 @@ public class MedicineController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DoctorMedicineService doctorMedicineService;
|
private DoctorMedicineService doctorMedicineService;
|
||||||
|
|
||||||
@MessageMapping("/getSurgeryData")
|
// @MessageMapping("/getSurgeryData")
|
||||||
public void doctorMedicine(MessageHeaders messageHeaders, String body) {
|
// public void doctorMedicine(MessageHeaders messageHeaders, String body) {
|
||||||
LinkedMultiValueMap nativeHeaders = (LinkedMultiValueMap) messageHeaders.get("nativeHeaders");
|
// LinkedMultiValueMap nativeHeaders = (LinkedMultiValueMap) messageHeaders.get("nativeHeaders");
|
||||||
ArrayList tokenList = (ArrayList) nativeHeaders.get("token");
|
// ArrayList tokenList = (ArrayList) nativeHeaders.get("token");
|
||||||
String token = (String) tokenList.get(0);
|
// String token = (String) tokenList.get(0);
|
||||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
// OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||||
|
//
|
||||||
String username = authorization.getPrincipalName();
|
// String username = authorization.getPrincipalName();
|
||||||
String simpSessionId = messageHeaders.get("simpSessionId", String.class);
|
// String simpSessionId = messageHeaders.get("simpSessionId", String.class);
|
||||||
|
//
|
||||||
JSONObject params = JSONObject.parseObject(body);
|
// JSONObject params = JSONObject.parseObject(body);
|
||||||
// 病人名
|
// // 病人名
|
||||||
String patientName = params.getString("patientName");
|
// String patientName = params.getString("patientName");
|
||||||
// 病人身份证
|
// // 病人身份证
|
||||||
String idNum = params.getString("idNum");
|
// String idNum = params.getString("idNum");
|
||||||
// yyyyMMdd
|
// // yyyyMMdd
|
||||||
String date = params.getString("date");
|
// String date = params.getString("date");
|
||||||
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
// String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
||||||
vitalSignTimer.createAndSendMessageMongo(databaseName, username, simpSessionId);
|
// vitalSignTimer.createAndSendMessageMongo(databaseName, username, simpSessionId);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// @MessageMapping("/changeAIFlag")
|
// @MessageMapping("/changeAIFlag")
|
||||||
// public void changeAIFlag(MessageHeaders messageHeaders, String body) {
|
// public void changeAIFlag(MessageHeaders messageHeaders, String body) {
|
||||||
|
|
|
@ -1,4 +1,16 @@
|
||||||
package com.rax.vital.medicine.dto;
|
package com.rax.vital.medicine.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class MedicineDTO {
|
public class MedicineDTO {
|
||||||
|
private String linkNum;
|
||||||
|
private String medicineName;
|
||||||
|
private String medicineRate;
|
||||||
|
private String countMedicine;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ public interface AIMedicineService {
|
||||||
void changeAIFlagMedicine(MongoTemplate template, String flag, String medicine, String value);
|
void changeAIFlagMedicine(MongoTemplate template, String flag, String medicine, String value);
|
||||||
|
|
||||||
// 获取累计用药量
|
// 获取累计用药量
|
||||||
List getCountMedicine(MongoTemplate template);
|
Map getCountMedicine(MongoTemplate template);
|
||||||
|
|
||||||
// 获取ai给药信息
|
// 获取ai给药信息
|
||||||
List getAiMedicine(MongoTemplate template);
|
Map getAiMedicine(MongoTemplate template);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public interface DoctorMedicineService {
|
public interface DoctorMedicineService {
|
||||||
|
|
||||||
List<Map> getDocMedicine(MongoTemplate template);
|
Map getDocMedicine(MongoTemplate template);
|
||||||
|
|
||||||
List<Map> getDocMedicine(Connection connection);
|
List<Map> getDocMedicine(Connection connection);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class AIMedicineServiceImpl implements AIMedicineService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List getCountMedicine(MongoTemplate template) {
|
public Map getCountMedicine(MongoTemplate template) {
|
||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.limit(1);
|
query.limit(1);
|
||||||
query.with(Sort.by(Sort.Order.desc("Time")));
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
|
@ -187,15 +187,15 @@ public class AIMedicineServiceImpl implements AIMedicineService {
|
||||||
aiMedicines.remove(0);
|
aiMedicines.remove(0);
|
||||||
aiMedicines.add(medicine);
|
aiMedicines.add(medicine);
|
||||||
}
|
}
|
||||||
return aiMedicines;
|
return aiMedicines.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List getAiMedicine(MongoTemplate template) {
|
public Map getAiMedicine(MongoTemplate template) {
|
||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.limit(1);
|
query.limit(2);
|
||||||
query.with(Sort.by(Sort.Order.desc("Time")));
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
List<Map> aimedicinetable = template.find(query, Map.class, "aimedicinetable");
|
List<Map> aimedicinetable = template.find(query, Map.class, "aimedicinetable");
|
||||||
return aimedicinetable;
|
return aimedicinetable.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,12 +26,12 @@ import java.util.Map;
|
||||||
public class DoctorMedicineServiceImpl implements DoctorMedicineService {
|
public class DoctorMedicineServiceImpl implements DoctorMedicineService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map> getDocMedicine(MongoTemplate template) {
|
public Map getDocMedicine(MongoTemplate template) {
|
||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.limit(1);
|
query.limit(1);
|
||||||
query.with(Sort.by(Sort.Order.desc("Time")));
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
List<Map> doctorMedicineTable = template.find(query, Map.class, "doctormedicinetable");
|
List<Map> doctorMedicineTable = template.find(query, Map.class, "doctormedicinetable");
|
||||||
return doctorMedicineTable;
|
return doctorMedicineTable.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,15 +39,23 @@ public class FlagServiceImpl implements FlagService {
|
||||||
query.limit(1);
|
query.limit(1);
|
||||||
query.with(Sort.by(Sort.Order.desc("Time")));
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
List<Map> linkTable = template.find(query, Map.class, "linktable");
|
List<Map> linkTable = template.find(query, Map.class, "linktable");
|
||||||
System.out.println("linkTable = " + linkTable);
|
|
||||||
flagMap.put("linkFlag", linkTable.get(0).get("Flag"));
|
|
||||||
List<Map> aiFlagTable = template.find(query, Map.class, "aiflagtable");
|
List<Map> aiFlagTable = template.find(query, Map.class, "aiflagtable");
|
||||||
System.out.println("aiFlagTable = " + aiFlagTable);
|
|
||||||
flagMap.put("aiFlag", aiFlagTable.get(0).get("Flag"));
|
|
||||||
List<Map> endFlagTable = template.find(query, Map.class, "endflagtable");
|
List<Map> endFlagTable = template.find(query, Map.class, "endflagtable");
|
||||||
System.out.println("endFlagTable = " + endFlagTable);
|
if (linkTable != null && linkTable.size() > 0
|
||||||
|
&& aiFlagTable != null && aiFlagTable.size() > 0
|
||||||
|
&& endFlagTable != null && endFlagTable.size() > 0) {
|
||||||
|
|
||||||
|
flagMap.put("linkFlag", linkTable.get(0).get("Flag"));
|
||||||
|
flagMap.put("aiFlag", aiFlagTable.get(0).get("Flag"));
|
||||||
flagMap.put("endFlag", endFlagTable.get(0).get("Flag"));
|
flagMap.put("endFlag", endFlagTable.get(0).get("Flag"));
|
||||||
return flagMap;
|
return flagMap;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
flagMap.put("linkFlag", "");
|
||||||
|
flagMap.put("aiFlag", "");
|
||||||
|
flagMap.put("endFlag", "");
|
||||||
|
return flagMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -80,17 +80,17 @@ public class VitalSignServiceImpl implements VitalSignsService {
|
||||||
|
|
||||||
if (vitalList != null && vitalList.size() > 0) {
|
if (vitalList != null && vitalList.size() > 0) {
|
||||||
Map map = vitalList.get(0);
|
Map map = vitalList.get(0);
|
||||||
Double bis = (Double) map.get("BIS");
|
Double bis = Double.valueOf((String) map.get("BIS"));
|
||||||
map.put("BIS_except", bis <= 40 || bis >= 60);
|
map.put("BIS_except", bis <= 40 || bis >= 60);
|
||||||
Double hr = (Double) map.get("HR");
|
Double hr = Double.valueOf((String) map.get("HR"));
|
||||||
map.put("HR_except", hr <= 50 || hr >= 80);
|
map.put("HR_except", hr <= 50 || hr >= 80);
|
||||||
Double sbp = (Double) map.get("SBP");
|
Double sbp = Double.valueOf((String) map.get("SBP"));
|
||||||
map.put("SBP_except", sbp <= 90 || sbp >= 120);
|
map.put("SBP_except", sbp <= 90 || sbp >= 120);
|
||||||
Double dbp = (Double) map.get("DBP");
|
Double dbp = Double.valueOf((String) map.get("DBP"));
|
||||||
map.put("DBP_except", dbp <= 60 || dbp >= 90);
|
map.put("DBP_except", dbp <= 60 || dbp >= 90);
|
||||||
Double st = (Double) map.get("ST");
|
Double st = Double.valueOf((String) map.get("ST"));
|
||||||
map.put("ST_except", st <= -0.2 || st >= 0.2);
|
map.put("ST_except", st <= -0.2 || st >= 0.2);
|
||||||
Double etCO2 = (Double) map.get("EtCO2");
|
Double etCO2 = Double.valueOf((String) map.get("EtCO2"));
|
||||||
map.put("EtCO2_except", etCO2 <= 30 || etCO2 >= 45);
|
map.put("EtCO2_except", etCO2 <= 30 || etCO2 >= 45);
|
||||||
}
|
}
|
||||||
return vitalList;
|
return vitalList;
|
||||||
|
|
|
@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
* @date 2024/2/29
|
* @date 2024/2/29
|
||||||
*/
|
*/
|
||||||
@RefreshScope
|
@RefreshScope
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class VitalSignTimer {
|
public class VitalSignTimer {
|
||||||
|
|
||||||
|
@ -81,52 +80,52 @@ public class VitalSignTimer {
|
||||||
*
|
*
|
||||||
* @author zhaoyz
|
* @author zhaoyz
|
||||||
*/
|
*/
|
||||||
public void createAndSendMessageMongo(String database, String username, String simpSessionId) {
|
// public void createAndSendMessageMongo(String database, String username, String simpSessionId) {
|
||||||
|
//
|
||||||
synchronized (username) {
|
// synchronized (username) {
|
||||||
if (!masterControlMap.containsKey(database)) {
|
// if (!masterControlMap.containsKey(database)) {
|
||||||
masterControlMap.put(database, username);
|
// masterControlMap.put(database, username);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
TimerTask task = timerMongoTaskMap.get(simpSessionId);
|
// TimerTask task = timerMongoTaskMap.get(simpSessionId);
|
||||||
if (task != null) {
|
// if (task != null) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
MongoDBSource mongoDBSource = mongoDBSourceMap.get(simpSessionId);
|
// MongoDBSource mongoDBSource = mongoDBSourceMap.get(simpSessionId);
|
||||||
if (mongoDBSource == null) {
|
// if (mongoDBSource == null) {
|
||||||
mongoDBSource = new MongoDBSource(mongoDBHost, mongoPassword, mongoUsername, database);
|
// mongoDBSource = new MongoDBSource(mongoDBHost, mongoPassword, mongoUsername, database);
|
||||||
mongoDBSourceMap.put(simpSessionId, mongoDBSource);
|
// mongoDBSourceMap.put(simpSessionId, mongoDBSource);
|
||||||
mongoDBSource.open();
|
// mongoDBSource.open();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
MongoDBSource finalMongoDBSource = mongoDBSource;
|
// MongoDBSource finalMongoDBSource = mongoDBSource;
|
||||||
TimerTask timerTask = new TimerTask() {
|
// TimerTask timerTask = new TimerTask() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
|
//
|
||||||
MongoTemplate template = finalMongoDBSource.getConnection();
|
// MongoTemplate template = finalMongoDBSource.getConnection();
|
||||||
HashMap<String, Object> result = new HashMap();
|
// HashMap<String, Object> result = new HashMap();
|
||||||
List vitalSignsList = vitalSignsService.getVitalSignsList(template);
|
// List vitalSignsList = vitalSignsService.getVitalSignsList(template);
|
||||||
result.put("vitalSignsList", vitalSignsList);
|
// result.put("vitalSignsList", vitalSignsList);
|
||||||
List aiMedicineList = aiMedicineService.getAIMedicine(template);
|
// List aiMedicineList = aiMedicineService.getAIMedicine(template);
|
||||||
result.put("aiMedicineList", aiMedicineList);
|
// result.put("aiMedicineList", aiMedicineList);
|
||||||
List docMedicineList = doctorMedicineService.getDocMedicine(template);
|
// List docMedicineList = doctorMedicineService.getDocMedicine(template);
|
||||||
result.put("docMedicineList", docMedicineList);
|
// result.put("docMedicineList", docMedicineList);
|
||||||
List revulsionList = revulsionService.getRevulsionServiceList(template);
|
// List revulsionList = revulsionService.getRevulsionServiceList(template);
|
||||||
result.put("revulsionList", revulsionList);
|
// result.put("revulsionList", revulsionList);
|
||||||
Map flags = flagService.getFlags(template);
|
// Map flags = flagService.getFlags(template);
|
||||||
result.put("flags", flags);
|
// result.put("flags", flags);
|
||||||
|
//
|
||||||
simpMessagingTemplate.convertAndSendToUser(username + ":" + database, "/surgeryData", result);
|
// simpMessagingTemplate.convertAndSendToUser(username + ":" + database, "/surgeryData", result);
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
// 定时任务,设置1秒
|
// // 定时任务,设置1秒
|
||||||
Timer timer = new Timer();
|
// Timer timer = new Timer();
|
||||||
timer.schedule(timerTask, 0, 1000);
|
// timer.schedule(timerTask, 0, 1000);
|
||||||
timerMongoTaskMap.put(simpSessionId, timerTask);
|
// timerMongoTaskMap.put(simpSessionId, timerTask);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import com.rax.vital.datasource.CustomDataSource;
|
import com.rax.vital.datasource.CustomDataSource;
|
||||||
import com.rax.vital.datasource.MongoDBSource;
|
import com.rax.vital.datasource.MongoDBSource;
|
||||||
import com.rax.vital.datasource.MySQLSource;
|
import com.rax.vital.datasource.MySQLSource;
|
||||||
|
import com.rax.vital.medicine.dto.MedicineDTO;
|
||||||
import com.rax.vital.medicine.service.*;
|
import com.rax.vital.medicine.service.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
@ -16,10 +17,7 @@ import org.springframework.web.socket.WebSocketSession;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@RefreshScope
|
@RefreshScope
|
||||||
|
@ -122,20 +120,52 @@ public class VitalSignTimerWS {
|
||||||
// endFlag 1代表手术进行 0代表手术结束
|
// endFlag 1代表手术进行 0代表手术结束
|
||||||
// linkFlag 1泵异常 0正常
|
// linkFlag 1泵异常 0正常
|
||||||
jsonObject.put("flags", flags);
|
jsonObject.put("flags", flags);
|
||||||
|
Map<String, Object> medicineRateMap = new HashMap<>();
|
||||||
if (flags.get("aiFlag") != null && flags.get("aiFlag").equals("1")) {
|
if (flags.get("aiFlag") != null && flags.get("aiFlag").equals("1")) {
|
||||||
// ai给药信息
|
// ai给药信息
|
||||||
List aiMedicineList = aiMedicineService.getAiMedicine(template);
|
medicineRateMap = aiMedicineService.getAiMedicine(template);
|
||||||
jsonObject.put("medicineRate", aiMedicineList);
|
|
||||||
} else if (flags.get("aiFlag") != null && flags.get("aiFlag").equals("0")) {
|
} else if (flags.get("aiFlag") != null && flags.get("aiFlag").equals("0")) {
|
||||||
// 医生给药信息
|
// 医生给药信息
|
||||||
List docMedicineList = doctorMedicineService.getDocMedicine(template);
|
medicineRateMap = doctorMedicineService.getDocMedicine(template);
|
||||||
jsonObject.put("medicineRate", docMedicineList);
|
}
|
||||||
|
|
||||||
|
// 写上面会存在线程安全问题
|
||||||
|
ArrayList<MedicineDTO> medicineList = new ArrayList<>();
|
||||||
|
medicineList.add(new MedicineDTO("1", "丙泊酚", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("2", "舒芬太尼", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("3", "瑞芬太尼", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("4", "顺阿曲库胺", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("5", "尼卡地平", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("6", "艾司洛尔", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("7", "麻黄素", "0", "0"));
|
||||||
|
medicineList.add(new MedicineDTO("8", "阿托品", "0", "0"));
|
||||||
|
|
||||||
|
if (medicineRateMap != null && !medicineRateMap.isEmpty()) {
|
||||||
|
for (String key : medicineRateMap.keySet()) {
|
||||||
|
for (MedicineDTO medicineDTO : medicineList) {
|
||||||
|
if (medicineDTO.getMedicineName().equals(key)) {
|
||||||
|
medicineDTO.setMedicineRate(medicineRateMap.get(key).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jsonObject.put("rateModTime",medicineRateMap.get("Time"));
|
||||||
|
}else {
|
||||||
|
jsonObject.put("rateModTime","0");
|
||||||
}
|
}
|
||||||
// 总的药量信息
|
// 总的药量信息
|
||||||
List countMedicineList = aiMedicineService.getCountMedicine(template);
|
Map<String, Object> countMedicineMap = aiMedicineService.getCountMedicine(template);
|
||||||
jsonObject.put("countMedicine", countMedicineList);
|
if (countMedicineMap != null && !countMedicineMap.isEmpty()) {
|
||||||
jsonObject.put("msgType", "msg");
|
for (String key : countMedicineMap.keySet()) {
|
||||||
|
for (MedicineDTO medicineDTO : medicineList) {
|
||||||
|
if ((medicineDTO.getMedicineName() + "Sum").equals(key)) {
|
||||||
|
medicineDTO.setMedicineRate(countMedicineMap.get(key).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jsonObject.put("medicineList", medicineList);
|
||||||
|
jsonObject.put("msgType", "msg");
|
||||||
// 如果是人工给药展示人工给药的内容
|
// 如果是人工给药展示人工给药的内容
|
||||||
WebSocketMessage message = new TextMessage(jsonObject.toJSONString().getBytes());
|
WebSocketMessage message = new TextMessage(jsonObject.toJSONString().getBytes());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user