|
@@ -38,12 +38,10 @@ public class TriageService {
|
|
|
|
|
|
public ResultVo<Map<String, Object>> getUnTriagedPatients(Integer currentPage, Integer pageSize) {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
- Map<String, Object> map = new HashMap<>(Capacity.TWO);
|
|
|
if (depts.length == 0) {
|
|
|
- map.put("totalSize", 0);
|
|
|
- map.put("list", new ArrayList<>());
|
|
|
- return ResultVoUtil.success(map);
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
}
|
|
|
+ Map<String, Object> map = new HashMap<>(Capacity.TWO);
|
|
|
IPage<MzfzPatientOrder> iPage = new Page<>(currentPage, pageSize);
|
|
|
iPage = dao.getUnTriagedPatients(iPage, depts);
|
|
|
map.put("totalSize", iPage.getTotal());
|
|
@@ -53,16 +51,25 @@ public class TriageService {
|
|
|
|
|
|
public ResultVo<List<MzfzPatientOrder>> getTriagedPatients() {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
+ if (depts.length == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
+ }
|
|
|
return ResultVoUtil.success(dao.getTriagedPatients(depts));
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<MzfzPatientOrder>> getTreatedPatients() {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
+ if (depts.length == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
+ }
|
|
|
return ResultVoUtil.success(dao.getTreatedPatients(depts));
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<FloorScreen>> getBigScreenData(Boolean fullName) {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
+ if (depts.length == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
+ }
|
|
|
List<MzfzPatientOrder> list = dao.getBigScreenData(depts);
|
|
|
Map<String, FloorScreen> map = new HashMap<>(Capacity.DEFAULT);
|
|
|
for (MzfzPatientOrder item : list) {
|
|
@@ -107,6 +114,9 @@ public class TriageService {
|
|
|
|
|
|
public ResultVo<List<CodeName>> getChosenDept() {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
+ if (depts.length == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
+ }
|
|
|
return ResultVoUtil.success(dao.getDept(depts));
|
|
|
}
|
|
|
|
|
@@ -157,6 +167,9 @@ public class TriageService {
|
|
|
|
|
|
public ResultVo<Map<String, Object>> getAllPatients(String searchContent, Integer currentPage, Integer pageSize) {
|
|
|
String[] depts = StringUtil.triageDeptString2Array(dao.selectChosenDepts(TokenUtil.getTokenUserId()));
|
|
|
+ if (depts.length == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请先前往【科室设置】分配分诊科室!");
|
|
|
+ }
|
|
|
Map<String, Object> map = new HashMap<>(Capacity.TWO);
|
|
|
searchContent = StringUtil.isBlank(searchContent) ? "%%" : searchContent + "%";
|
|
|
IPage<MzfzPatientOrder> iPage = new Page<>(currentPage, pageSize);
|
|
@@ -203,22 +216,22 @@ public class TriageService {
|
|
|
WebSocketServer.sendFloorTriageMessage(notifyRelation.getSocketSid(), msg);
|
|
|
WebSocketServer.sendRoomTriageMessage(notifyRelation.getRoomCode(), msg);
|
|
|
dao.updateNotifyDatetime(param.getSerialNo());
|
|
|
- return ResultVoUtil.success();
|
|
|
+// return ResultVoUtil.success();
|
|
|
// todo 下面这一部分在完成迁移后删除
|
|
|
-// RestTemplate template = new RestTemplate();
|
|
|
-// String result;
|
|
|
-// try {
|
|
|
-// result = template.postForObject(triageNotifyUrl, messageForPush, String.class);
|
|
|
-// } catch (Exception e) {
|
|
|
-// return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
-// }
|
|
|
-// if (param.getAction() == 1) {
|
|
|
-// if (null != result && result.equals("0")) {
|
|
|
-// dao.updateStatus(param.getSerialNo());
|
|
|
-// } else {
|
|
|
-// log.error("消息推送失败,没有找到在线的分诊台连接。{}", messageForPush);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return ResultVoUtil.success(result);
|
|
|
+ RestTemplate template = new RestTemplate();
|
|
|
+ String result;
|
|
|
+ try {
|
|
|
+ result = template.postForObject(triageNotifyUrl, messageForPush, String.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
+ }
|
|
|
+ if (param.getAction() == 1) {
|
|
|
+ if (null != result && result.equals("0")) {
|
|
|
+ dao.updateStatus(param.getSerialNo());
|
|
|
+ } else {
|
|
|
+ log.error("消息推送失败,没有找到在线的分诊台连接。{}", messageForPush);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(result);
|
|
|
}
|
|
|
}
|