|
|
@@ -1,16 +1,18 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
+import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.ReflectUtil;
|
|
|
-import cn.hutool.core.util.SerializeUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.errorprone.annotations.Var;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.checkerframework.checker.units.qual.C;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
|
@@ -20,13 +22,12 @@ import thyyxxk.webserver.constants.Message;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.CheckTheCallbackDao;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.JianYanJianChaDao;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
|
-import thyyxxk.webserver.entity.CodeName;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
-import thyyxxk.webserver.entity.dictionary.CyComboGrid;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.*;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.JyJcCheckItemDto;
|
|
|
+import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.dto.RepelJyJc;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.PrintYshReqVo;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.vo.ViewInspectionItemDetailsVo;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
|
|
|
@@ -38,7 +39,7 @@ import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.service.hutoolcache.UserCache;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
-import java.io.Serializable;
|
|
|
+import java.lang.reflect.Array;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
@@ -140,7 +141,7 @@ public class JianYanJianChaShenQingService {
|
|
|
zhuYiShiXiang.append(((String) value).trim()).append("\n");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("错误:", e);
|
|
|
}
|
|
|
}
|
|
|
map.put("mattersNeedingAttention", zhuYiShiXiang.toString());
|
|
|
@@ -610,7 +611,7 @@ public class JianYanJianChaShenQingService {
|
|
|
cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, "医嘱已停用:【" + value.getName() + "】"));
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ jyjcRepel(huanZheXinXi, param.getList(), finalI, cuoWuXinXi, jcCodes, jyCodes, JC_TYPE.equals(param.getReqType()));
|
|
|
}
|
|
|
|
|
|
if (StringUtil.notBlank(cuoWuXinXi.toString())) {
|
|
|
@@ -627,6 +628,64 @@ public class JianYanJianChaShenQingService {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "操作成功", reqNos);
|
|
|
}
|
|
|
|
|
|
+ private void jyjcRepel(XinZhenYiZhu huanZheXinXi,
|
|
|
+ List<YshYjReq> items,
|
|
|
+ int finalI,
|
|
|
+ StringBuilder cuoWuXinXi,
|
|
|
+ Set<String> jcCodes,
|
|
|
+ Set<String> jyCodes,
|
|
|
+ boolean isCheck) {
|
|
|
+
|
|
|
+ YshYjReq item = items.get(finalI - 1);
|
|
|
+ List<RepelJyJc> repelJyJcs = dao.selectRepelJyJc(item.getOrderCode());
|
|
|
+
|
|
|
+ if (!repelJyJcs.isEmpty()) {
|
|
|
+ RepelJyJc repelJyJc = repelJyJcs.get(0);
|
|
|
+ String dateTime = DateUtil.formatDate(DateUtil
|
|
|
+ .date()
|
|
|
+ .offset(DateField.HOUR, -repelJyJc.getRepelHour()), DateUtil.DEFAULT_PATTERN);
|
|
|
+
|
|
|
+ for (RepelJyJc jyJcRepel : repelJyJcs) {
|
|
|
+ Set<String> tmp;
|
|
|
+ if (isCheck) {
|
|
|
+ tmp = jcCodes;
|
|
|
+ } else {
|
|
|
+ tmp = jyCodes;
|
|
|
+ }
|
|
|
+ if (tmp.contains(jyJcRepel.getRepelCode())) {
|
|
|
+ cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, "两种项目不能同时开具,项目名字:" + getName(items, jyJcRepel.getRepelCode())));
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ QueryWrapper<?> qw = new QueryWrapper<>()
|
|
|
+ .eq("inpatient_no", huanZheXinXi.getInpatientNo())
|
|
|
+ .eq("admiss_times", huanZheXinXi.getAdmissTimes())
|
|
|
+ .in("order_code", repelJyJcs.stream().map(RepelJyJc::getRepelCode).collect(Collectors.toSet()))
|
|
|
+ .ge("sys_date", dateTime);
|
|
|
+ List<YshYjReq> repelNames = dao.selectJcJyRepel(qw);
|
|
|
+ if (!repelNames.isEmpty()) {
|
|
|
+ for (YshYjReq tmp : repelNames) {
|
|
|
+ RepelJyJc tmpRepel = repelJyJcs.stream()
|
|
|
+ .filter(i -> i.getRepelCode().equals(tmp.getOrderCode()))
|
|
|
+ .findFirst().orElse(new RepelJyJc());
|
|
|
+ String format = StrUtil.format("当前项目和:【{}】,需要间隔:【{}】小时才能重新开具", tmp.getOrderName(),
|
|
|
+ tmpRepel.getRepelHour());
|
|
|
+ cuoWuXinXi.append(baoCunCuoWuXinXi(finalI, format));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getName(List<YshYjReq> data, String code) {
|
|
|
+ return data.stream()
|
|
|
+ .filter(item -> item.getOrderCode().equals(code))
|
|
|
+ .findFirst()
|
|
|
+ .map(YshYjReq::getOrderName)
|
|
|
+ .orElse("");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private Map<String, JyJcCheckItemDto> getItemInfo(Set<String> itemCodes, Boolean isCheck) {
|
|
|
Map<String, JyJcCheckItemDto> collect = new HashMap<>();
|
|
|
if (!itemCodes.isEmpty()) {
|