|
|
@@ -1,6 +1,7 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
import cn.hutool.core.map.BiMap;
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
import cn.hutool.db.DbUtil;
|
|
|
@@ -300,6 +301,7 @@ public class YiZhuLuRuServer {
|
|
|
sqlSession.close();
|
|
|
}
|
|
|
drgOrderUpdate(patInfo.getInpatientNo() + "_" + patInfo.getAdmissTimes() + "_" + patInfo.getLedgerSn());
|
|
|
+
|
|
|
sendAMessageToTheNurse(param, userCode, patInfo, "新增医嘱");
|
|
|
|
|
|
List<BigDecimal> orders = yiZhuList.stream().map(XinZhenYzActOrder::getActOrderNo).collect(Collectors.toList());
|
|
|
@@ -350,16 +352,18 @@ public class YiZhuLuRuServer {
|
|
|
}
|
|
|
|
|
|
private void sendAMessageToTheNurse(XinZhenYiZhu param, String inputCode, XinZhenYiZhu patInfo, String name) {
|
|
|
- List<String> content = new ArrayList<>();
|
|
|
- for (XinZhenYzActOrder item : param.getList()) {
|
|
|
- String sb = notificationStyle("医嘱名", "409eff", item.getOrderName()) +
|
|
|
- notificationStyle("医嘱时间", "409eff", DateUtil.formatDatetime(item.getStartTime())) +
|
|
|
- notificationStyle("床位", "409eff", patInfo.getBedNo()) +
|
|
|
- notificationStyle("患者姓名", "409eff", patInfo.getName()) +
|
|
|
- notificationStyle("频次", "409eff", item.getFrequCode());
|
|
|
- content.add(sb);
|
|
|
- }
|
|
|
- publicServer.faSongXiaoXi(patInfo, content, name, inputCode);
|
|
|
+ ThreadUtil.execute(() -> {
|
|
|
+ List<String> content = new ArrayList<>();
|
|
|
+ for (XinZhenYzActOrder item : param.getList()) {
|
|
|
+ String sb = notificationStyle("医嘱名", "409eff", item.getOrderName()) +
|
|
|
+ notificationStyle("医嘱时间", "409eff", DateUtil.formatDatetime(item.getStartTime())) +
|
|
|
+ notificationStyle("床位", "409eff", patInfo.getBedNo()) +
|
|
|
+ notificationStyle("患者姓名", "409eff", patInfo.getName()) +
|
|
|
+ notificationStyle("频次", "409eff", item.getFrequCode());
|
|
|
+ content.add(sb);
|
|
|
+ }
|
|
|
+ publicServer.faSongXiaoXi(patInfo, content, name, inputCode);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private String notificationStyle(String name, String color, String content) {
|
|
|
@@ -1607,10 +1611,10 @@ public class YiZhuLuRuServer {
|
|
|
if (xinZhenYzActOrders == null) {
|
|
|
return R.fail(ExceptionEnum.ERROR_EL_MESSAGE, "未找到相关数据");
|
|
|
}
|
|
|
- BigDecimal[] actOrderNo = publicServer.getActOrderNo(xinZhenYzActOrders.size());
|
|
|
+ List<BigDecimal> actOrderNo = publicServer.getActOrderNo(xinZhenYzActOrders.size());
|
|
|
List<BigDecimal> execute = transactionTemplate.execute(status -> {
|
|
|
try {
|
|
|
- return createOnceOrder(xinZhenYzActOrders, actOrderNo[0]);
|
|
|
+ return createOnceOrder(xinZhenYzActOrders, actOrderNo);
|
|
|
} catch (Exception e) {
|
|
|
status.setRollbackOnly();
|
|
|
throw e;
|
|
|
@@ -1622,14 +1626,15 @@ public class YiZhuLuRuServer {
|
|
|
return R.ok(js);
|
|
|
}
|
|
|
|
|
|
- private List<BigDecimal> createOnceOrder(List<XinZhenYzActOrder> orderList, BigDecimal orderNo) {
|
|
|
+ private List<BigDecimal> createOnceOrder(List<XinZhenYzActOrder> orderList, List<BigDecimal> orderNo) {
|
|
|
BiMap<BigDecimal, BigDecimal> map = new BiMap<>(new HashMap<>());
|
|
|
- AtomicReference<BigDecimal> startOrderNo = new AtomicReference<>(orderNo);
|
|
|
+ AtomicReference<Integer> index = new AtomicReference<>(0);
|
|
|
List<BigDecimal> rst = new ArrayList<>();
|
|
|
orderList.forEach(item -> {
|
|
|
- startOrderNo.set(startOrderNo.get().add(BigDecimal.ONE));
|
|
|
- map.put(item.getActOrderNo(), startOrderNo.get());
|
|
|
- item.setActOrderNo(startOrderNo.get());
|
|
|
+ BigDecimal order = orderNo.get(index.get());
|
|
|
+ map.put(item.getActOrderNo(), order);
|
|
|
+ item.setActOrderNo(order);
|
|
|
+ index.set(index.get() + 1);
|
|
|
});
|
|
|
ListUtil.batchList(orderList, YiZhuLuRuDao.class, (mapper, item) -> {
|
|
|
if (item.getParentNo() != null) {
|
|
|
@@ -1642,4 +1647,14 @@ public class YiZhuLuRuServer {
|
|
|
});
|
|
|
return rst;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 更新患者就诊方式的方法
|
|
|
+ * @param patNo 患者编号,用于唯一标识一位患者
|
|
|
+ * @param type 就诊类型,表示患者的就诊方式或类型
|
|
|
+ */
|
|
|
+ public void updateZyDisWay(String patNo, String type) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|