|
@@ -3,6 +3,8 @@ package cn.hnthyy.thmz.webservice.impl;
|
|
|
|
|
|
import cn.hnthyy.thmz.Utils.SpringBeanUtils;
|
|
|
import cn.hnthyy.thmz.entity.his.Employee;
|
|
|
+import cn.hnthyy.thmz.entity.his.ZdDeptAll;
|
|
|
+import cn.hnthyy.thmz.mapper.his.ZdDeptAllMapper;
|
|
|
import cn.hnthyy.thmz.service.his.EmployeeService;
|
|
|
import cn.hnthyy.thmz.service.his.ZdUnitCodeService;
|
|
|
import cn.hnthyy.thmz.service.impl.his.EmployeeServiceImpl;
|
|
@@ -13,6 +15,7 @@ import cn.hnthyy.thmz.webservice.CriticalWebService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -25,7 +28,9 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
MessageService messageService = null;
|
|
|
EmployeeService employeeService = null;
|
|
|
ZdUnitCodeService zdUnitCodeService = null;
|
|
|
-
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private ZdDeptAllMapper zdDeptAllMapper;
|
|
|
@Override
|
|
|
public String criticalAccept(String accessToken, String msg) {
|
|
|
log.info("收到危急值信息:----->" + msg + "<-------");
|
|
@@ -106,6 +111,19 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
}
|
|
|
}
|
|
|
List<Employee> employees = employeeService.queryEmployeeByDept(zkWard != null ? zkWard : targetDeptCode.trim());
|
|
|
+ List<ZdDeptAll> zdDeptAlls = zdDeptAllMapper.selectBySmallDept(zkWard != null ? zkWard : targetDeptCode.trim());
|
|
|
+ if(zdDeptAlls!=null && zdDeptAlls.size()>0){
|
|
|
+ for (ZdDeptAll zdDeptAll:zdDeptAlls){
|
|
|
+ if(StringUtils.isBlank(zdDeptAll.getDept())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<Employee> tempList = employeeService.queryEmployeeByDept(zdDeptAll.getDept());
|
|
|
+ if(tempList==null || tempList.size()<=0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ employees.addAll(tempList);
|
|
|
+ }
|
|
|
+ }
|
|
|
String codes = null;
|
|
|
Set<String> tempSet = new HashSet<>();
|
|
|
if (StringUtils.isNotBlank(referPhysician)) {
|
|
@@ -120,21 +138,19 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
if (tempSet.size() > 0) {
|
|
|
List<Employee> tempsEmps = employeeService.queryByCodes(new ArrayList<>(tempSet));
|
|
|
if (tempsEmps != null && tempsEmps.size() > 0) {
|
|
|
- for (Employee emp : tempsEmps) {
|
|
|
- if (codes == null) {
|
|
|
- codes = emp.getCodeRs();
|
|
|
- } else {
|
|
|
- codes += "," + emp.getCodeRs();
|
|
|
- }
|
|
|
- }
|
|
|
+ employees.addAll(tempsEmps);
|
|
|
}
|
|
|
}
|
|
|
if (employees != null) {
|
|
|
+ Set<String> fullCodes = new HashSet<>();
|
|
|
for (Employee employee : employees) {
|
|
|
- if (codes == null) {
|
|
|
- codes = employee.getCodeRs();
|
|
|
- } else {
|
|
|
- codes += "," + employee.getCodeRs();
|
|
|
+ if(!fullCodes.contains(employee.getCodeRs())){
|
|
|
+ if (codes == null) {
|
|
|
+ codes = employee.getCodeRs();
|
|
|
+ } else {
|
|
|
+ codes += "," + employee.getCodeRs();
|
|
|
+ }
|
|
|
+ fullCodes.add(employee.getCodeRs());
|
|
|
}
|
|
|
}
|
|
|
}
|