|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.ListUtils;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
@@ -480,35 +481,47 @@ public class PublicServer {
|
|
|
throw new BizException(ExceptionEnum.LOGICAL_ERROR, "该医嘱下的草药已经发药,无法删除。");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- public String yaoPinXinXi(List<String> code) {
|
|
|
+ /**
|
|
|
+ * 药品限制
|
|
|
+ *
|
|
|
+ * @param listCode 药品的编码以及规格 做成code
|
|
|
+ * @return 返回提示
|
|
|
+ */
|
|
|
+ public String yaoPinXianZhi(List<String> listCode, boolean delFlag) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
- qw.in("rtrim(code) + rtrim(serial)", code);
|
|
|
+ qw.in("rtrim(code) + rtrim(serial)", listCode);
|
|
|
Map<String, YaoPinXiangMu> map = dao.huoQuYaoPinPiPeiXinXi(qw).stream().collect(
|
|
|
- Collectors.toMap(YaoPinXiangMu::getCode, a -> a, (k1, k2) -> k1));
|
|
|
- int index = 1;
|
|
|
- for (String s : code) {
|
|
|
- if (map.containsKey(s)) {
|
|
|
- YaoPinXiangMu yp = map.get(s);
|
|
|
- if (yp.getDelFlag().equals("1")) {
|
|
|
- sb.append(cuoWuXinXi(index, yp.getName(), "该药品已经被停用了。"));
|
|
|
- }
|
|
|
- if (StringUtil.isBlank(yp.getNationalCode())) {
|
|
|
- sb.append(cuoWuXinXi(index, yp.getName(), "该药品没有匹配医保码。"));
|
|
|
- }
|
|
|
- } else {
|
|
|
- sb.append(cuoWuXinXi(index, "", "没有找到对应的信息。"));
|
|
|
+ Collectors.toMap(YaoPinXiangMu::getZdCode, a -> a, (k1, k2) -> k1));
|
|
|
+ return yaoPingXiangMuXianZhi(map, sb, "药品", delFlag);
|
|
|
+ }
|
|
|
+
|
|
|
+ public String xiangMuXianZhi(List<String> listCode, boolean delFlag) {
|
|
|
+ Map<String, YaoPinXiangMu> map = dao.huoQuXiangMuXinXi(listCode).stream().collect(
|
|
|
+ Collectors.toMap(YaoPinXiangMu::getZdCode, a -> a, (k1, k2) -> k1));
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ return yaoPingXiangMuXianZhi(map, sb, "项目", delFlag);
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
+ public String yaoPingXiangMuXianZhi(Map<String, YaoPinXiangMu> map, StringBuilder sb, String name, boolean delFlag) {
|
|
|
+ for (YaoPinXiangMu item : map.values()) {
|
|
|
+ if (delFlag && item.getDelFlag() == 1) {
|
|
|
+ sb.append(cuoWuXinXi(item.getZdCode(), item.getSerial().trim().equals("00") ? "医嘱名:" + item.getName() + " 项目名:" + item.getZdName() : "" + item.getName(), name + "已被停用"));
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(item.getNationalCode()) && !delFlag) {
|
|
|
+ sb.append(cuoWuXinXi(item.getZdCode(), item.getSerial().trim().equals("00") ? "医嘱名:" + item.getName() + " 项目名:" + item.getZdName() : "" + item.getName(), name + "没有匹配医保编码"));
|
|
|
}
|
|
|
- index++;
|
|
|
}
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
- public String cuoWuXinXi(int index, String name, String xinXi) {
|
|
|
- return "第" + index + "个,【" + name + "】," + xinXi + "<br>";
|
|
|
+ public String cuoWuXinXi(String code, String name, String xinXi) {
|
|
|
+ return "编码:<span style='color:teal'>【" + code + "】</span><br>" +
|
|
|
+ "名称:<span style='color:#a5673f'>【" + name + "】 </span><br>" +
|
|
|
+ "<span style='color:red'>" + xinXi + "</span><br>";
|
|
|
}
|
|
|
|
|
|
}
|