|
@@ -33,23 +33,21 @@ public class FluorescenceTestController {
|
|
|
public ResultVo<String> save(@RequestBody JSONObject js) {
|
|
|
JSONObject personInfo = js.getJSONObject("ReportPersonInfo");
|
|
|
String caseStr = personInfo.getString("Case");
|
|
|
-
|
|
|
if (StringUtil.isBlank(caseStr)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "病例号为空无法保存。");
|
|
|
}
|
|
|
-
|
|
|
Integer id = Integer.valueOf(caseStr);
|
|
|
-
|
|
|
- Patient p = dao.selectPatInfoByReqNo(id);
|
|
|
+ // 查询门诊患者
|
|
|
+ Patient p = dao.selectPatInfoMz(id);
|
|
|
+ // 查询住院患者
|
|
|
+ p = p == null ? dao.selectPatInfoByReqNo(id) : p;
|
|
|
if (p == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "未查询到患者信息。");
|
|
|
}
|
|
|
-
|
|
|
- Integer count = dao.selectCountById(id);
|
|
|
+ Integer count = dao.selectCountById(id, p.getInpatientNo(), p.getAdmissTimes());
|
|
|
if (count > 0) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "请勿重复上传。");
|
|
|
}
|
|
|
-
|
|
|
FluorescenceSpecimenResult f = new FluorescenceSpecimenResult();
|
|
|
f.setHospitalName(personInfo.getString("HospitalName"))
|
|
|
.setId(id)
|
|
@@ -68,13 +66,13 @@ public class FluorescenceTestController {
|
|
|
.setBedNo(personInfo.getString("BedNo"))
|
|
|
.setPatNo(p.getInpatientNo())
|
|
|
.setTimes(p.getAdmissTimes());
|
|
|
-
|
|
|
js.remove("ReportPersonInfo");
|
|
|
f.setOutcome(js.toString());
|
|
|
dao.insert(f);
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private static Date strToDate(String str) {
|
|
|
if (StringUtil.notBlank(str)) {
|
|
|
str = str.replace("T", " ");
|