|
|
@@ -1,6 +1,5 @@
|
|
|
package thyyxxk.webserver.service.yibao;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -20,7 +19,6 @@ import thyyxxk.webserver.service.externalhttp.SiZySrvc;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.BigInteger;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -163,6 +161,16 @@ public class DismissService {
|
|
|
exception.setMessage("没有找到入院时间,请重新获取病人信息。");
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
+ if (!IdCardUtil.isValidatedIdCard(param.getSocialNo())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "身份证不合法!");
|
|
|
+ }
|
|
|
+ int age = IdCardUtil.getAgeByIdCard(param.getSocialNo());
|
|
|
+ if (age < 16 || age > 60) {
|
|
|
+ if (param.getName().equals(param.getContactName()) ||
|
|
|
+ param.getContactRelation().equals("0")) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "16岁以下或60岁以上的患者,联系人不能填写本人。");
|
|
|
+ }
|
|
|
+ }
|
|
|
Date endtime = getEndtime(param.getMidSetl(), patNo, times, param.getZjdzDatetime());
|
|
|
Date tmpendtime = param.getMidSetl() ? endtime : DateUtil.parse("2999-12-31 23:59:59");
|
|
|
final int ledgerSn = dao.getLedgerSn(patNo, times);
|
|
|
@@ -183,7 +191,7 @@ public class DismissService {
|
|
|
}
|
|
|
List<String> unreceivedDrug = dao.hasUnreceivedDrugList(patNo, times);
|
|
|
if (ListUtil.notBlank(unreceivedDrug)) {
|
|
|
- throw new BizException(ExceptionEnum.LOGICAL_HTML_ERROR, dischargeErrorMessage("此患者有未接收的药单", unreceivedDrug));
|
|
|
+ throw new BizException(ExceptionEnum.LOGICAL_HTML_ERROR, dischargeErrorMessage(unreceivedDrug));
|
|
|
}
|
|
|
if (dao.hasUnreceivedFees(patNo, times, tmpendtime) > 0) {
|
|
|
ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
|
@@ -283,8 +291,8 @@ public class DismissService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private String dischargeErrorMessage(String title, List<String> messages) {
|
|
|
- StringBuilder str = new StringBuilder(title + "<br />");
|
|
|
+ private String dischargeErrorMessage(List<String> messages) {
|
|
|
+ StringBuilder str = new StringBuilder("此患者有未接收的药单" + "<br />");
|
|
|
for (String message : messages) {
|
|
|
str.append(message).append("<br>");
|
|
|
}
|