|
@@ -3,9 +3,11 @@ package cn.hnthyy.thmz.webservice.impl;
|
|
|
|
|
|
|
|
import cn.hnthyy.thmz.entity.his.mz.Employee;
|
|
import cn.hnthyy.thmz.entity.his.mz.Employee;
|
|
|
import cn.hnthyy.thmz.entity.his.zd.ZdDeptAll;
|
|
import cn.hnthyy.thmz.entity.his.zd.ZdDeptAll;
|
|
|
|
|
+import cn.hnthyy.thmz.entity.thmz.CriticalValue;
|
|
|
import cn.hnthyy.thmz.mapper.his.zd.ZdDeptAllMapper;
|
|
import cn.hnthyy.thmz.mapper.his.zd.ZdDeptAllMapper;
|
|
|
import cn.hnthyy.thmz.service.his.mz.EmployeeService;
|
|
import cn.hnthyy.thmz.service.his.mz.EmployeeService;
|
|
|
import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
|
|
import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
|
|
|
|
|
+import cn.hnthyy.thmz.service.thmz.CriticalValueService;
|
|
|
import cn.hnthyy.thmz.service.thmz.MessageService;
|
|
import cn.hnthyy.thmz.service.thmz.MessageService;
|
|
|
import cn.hnthyy.thmz.webservice.CriticalWebService;
|
|
import cn.hnthyy.thmz.webservice.CriticalWebService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -27,9 +29,12 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
private EmployeeService employeeService;
|
|
private EmployeeService employeeService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ZdUnitCodeService zdUnitCodeService;
|
|
private ZdUnitCodeService zdUnitCodeService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CriticalValueService criticalValueService;
|
|
|
@SuppressWarnings("all")
|
|
@SuppressWarnings("all")
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ZdDeptAllMapper zdDeptAllMapper;
|
|
private ZdDeptAllMapper zdDeptAllMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public String criticalAccept(String accessToken, String msg) {
|
|
public String criticalAccept(String accessToken, String msg) {
|
|
|
log.info("收到危急值信息:----->" + msg + "<-------");
|
|
log.info("收到危急值信息:----->" + msg + "<-------");
|
|
@@ -111,13 +116,13 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
}
|
|
}
|
|
|
List<Employee> employees = employeeService.queryEmployeeByDept(zkWard != null ? zkWard : targetDeptCode.trim());
|
|
List<Employee> employees = employeeService.queryEmployeeByDept(zkWard != null ? zkWard : targetDeptCode.trim());
|
|
|
List<ZdDeptAll> zdDeptAlls = zdDeptAllMapper.selectBySmallDept(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())){
|
|
|
|
|
|
|
+ if (zdDeptAlls != null && zdDeptAlls.size() > 0) {
|
|
|
|
|
+ for (ZdDeptAll zdDeptAll : zdDeptAlls) {
|
|
|
|
|
+ if (StringUtils.isBlank(zdDeptAll.getDept())) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
List<Employee> tempList = employeeService.queryEmployeeByDept(zdDeptAll.getDept());
|
|
List<Employee> tempList = employeeService.queryEmployeeByDept(zdDeptAll.getDept());
|
|
|
- if(tempList==null || tempList.size()<=0){
|
|
|
|
|
|
|
+ if (tempList == null || tempList.size() <= 0) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
employees.addAll(tempList);
|
|
employees.addAll(tempList);
|
|
@@ -143,7 +148,7 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
if (employees != null) {
|
|
if (employees != null) {
|
|
|
Set<String> fullCodes = new HashSet<>();
|
|
Set<String> fullCodes = new HashSet<>();
|
|
|
for (Employee employee : employees) {
|
|
for (Employee employee : employees) {
|
|
|
- if(!fullCodes.contains(employee.getCodeRs())){
|
|
|
|
|
|
|
+ if (!fullCodes.contains(employee.getCodeRs())) {
|
|
|
if (codes == null) {
|
|
if (codes == null) {
|
|
|
codes = employee.getCodeRs();
|
|
codes = employee.getCodeRs();
|
|
|
} else {
|
|
} else {
|
|
@@ -154,10 +159,20 @@ public class CriticalWebServiceImpl implements CriticalWebService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (codes != null) {
|
|
if (codes != null) {
|
|
|
- String MsgID= (String) myJsonObject.get("MsgID");
|
|
|
|
|
- messageService.sendWxMessage(codes, content.replaceAll("=",":").replaceAll(" ",""));
|
|
|
|
|
- log.info("消息id=【"+MsgID+"】的危机值消息发布成功,接收人codes=【"+codes+"】");
|
|
|
|
|
|
|
+ String MsgID = (String) myJsonObject.get("MsgID");
|
|
|
|
|
+ content = content.replaceAll("=", ":").replaceAll(" ", "");
|
|
|
|
|
+ messageService.sendWxMessage(codes, content);
|
|
|
|
|
+ log.info("消息id=【" + MsgID + "】的危机值消息发布成功,接收人codes=【" + codes + "】");
|
|
|
//messageService.sendWxMessage("01387,3210", content.replaceAll("=", ":").replaceAll(" ", ""));
|
|
//messageService.sendWxMessage("01387,3210", content.replaceAll("=", ":").replaceAll(" ", ""));
|
|
|
|
|
+ try {
|
|
|
|
|
+ CriticalValue criticalValue = new CriticalValue();
|
|
|
|
|
+ criticalValue.setContent(content);
|
|
|
|
|
+ criticalValue.setEmployeeCodes(codes);
|
|
|
|
|
+ criticalValue.setCreateTime(new Date());
|
|
|
|
|
+ criticalValueService.saveCriticalValue(criticalValue);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
resultMap.put("Code", "true");
|
|
resultMap.put("Code", "true");
|
|
|
resultMap.put("Message", "");
|
|
resultMap.put("Message", "");
|