From 86886a91f34518827c9be14dcec9d2c8808269d4 Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Tue, 12 Sep 2023 14:41:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E8=A1=80=E6=8A=A5=E5=91=8A=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E8=A7=86=E5=9B=BE=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-config/blood-view-collect-config.json | 4 +++ .../impl/SdBusinessServiceImpl.java | 25 ++++++++++++++++--- .../message/mapper/SdRyBloodMapper.java | 5 +++- src/main/resources/mapper/SdRyBloodMapper.xml | 1 + 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 data-config/blood-view-collect-config.json diff --git a/data-config/blood-view-collect-config.json b/data-config/blood-view-collect-config.json new file mode 100644 index 0000000..984323c --- /dev/null +++ b/data-config/blood-view-collect-config.json @@ -0,0 +1,4 @@ +{ + "desc": "输血报告单视图采集额外配置", + "where": " AND FDESC NOT LIKE '%申请单%' " +} \ No newline at end of file diff --git a/src/main/java/com/docus/server/message/busservice/impl/SdBusinessServiceImpl.java b/src/main/java/com/docus/server/message/busservice/impl/SdBusinessServiceImpl.java index 24cb59e..1fd565f 100644 --- a/src/main/java/com/docus/server/message/busservice/impl/SdBusinessServiceImpl.java +++ b/src/main/java/com/docus/server/message/busservice/impl/SdBusinessServiceImpl.java @@ -1,5 +1,6 @@ package com.docus.server.message.busservice.impl; +import com.alibaba.fastjson.JSONObject; import com.docus.core.util.FileUtil; import com.docus.core.util.Func; import com.docus.infrastructure.core.exception.BaseException; @@ -60,6 +61,8 @@ public class SdBusinessServiceImpl implements SdBusinessService { @Autowired private SdRyBloodMapper sdRyBloodMapper; + private static final TableJsonRead JSON_READ = new TableJsonRead(); + @Override public MessageResponse recordSubmitHandle(Message message) { try { @@ -200,11 +203,12 @@ public class SdBusinessServiceImpl implements SdBusinessService { @Override public List getBloodView(String inpatientNo, Integer admissTimes) { String disDate = tBasicMapper.getDischargeDateByInpatientNoAndTimes(inpatientNo, admissTimes); - if(Func.isBlank(disDate)){ - disDate="18010203"; + if (Func.isBlank(disDate)) { + disDate = "18010203"; } + String where = getBloodViewWhere(); // 视图数据 - List bloodReportDtoList = sdRyBloodMapper.getByInpatientNoAndAdmissions(inpatientNo, admissTimes); + List bloodReportDtoList = sdRyBloodMapper.getByInpatientNoAndAdmissions(inpatientNo, admissTimes,where); if (Func.isEmpty(bloodReportDtoList)) { return new ArrayList<>(); } @@ -239,6 +243,21 @@ public class SdBusinessServiceImpl implements SdBusinessService { return vos; } + private static String getBloodViewWhere() { + try { + JSONObject jsonObject = JSON_READ.Read("data-config", "blood-view-collect-config.json", JSONObject.class); + String where = jsonObject.getString("where"); + return where == null ? "" : where; + } catch (Exception ex) { + return ""; + } + + } + + public static void main(String[] args) { + System.out.println(getBloodViewWhere()); + } + private void compensateTask(List patientIds, List collectorIds) { CompensateTasRequest dto = new CompensateTasRequest(); dto.setPatientIds(patientIds); diff --git a/src/main/java/com/docus/server/message/mapper/SdRyBloodMapper.java b/src/main/java/com/docus/server/message/mapper/SdRyBloodMapper.java index e2975ad..01875f3 100644 --- a/src/main/java/com/docus/server/message/mapper/SdRyBloodMapper.java +++ b/src/main/java/com/docus/server/message/mapper/SdRyBloodMapper.java @@ -17,7 +17,10 @@ public interface SdRyBloodMapper { * 根据住院号和住院次数查询血液报告单 * @param inpatientNo 病案号 * @param admissions 住院次数 + * @param where 其他查询条件 * @return 血液报告单 */ - List getByInpatientNoAndAdmissions(@Param("inpatientNo") String inpatientNo, @Param("admissions") Integer admissions); + List getByInpatientNoAndAdmissions(@Param("inpatientNo") String inpatientNo, + @Param("admissions") Integer admissions, + @Param("where") String where); } diff --git a/src/main/resources/mapper/SdRyBloodMapper.xml b/src/main/resources/mapper/SdRyBloodMapper.xml index 0ad934c..217221a 100644 --- a/src/main/resources/mapper/SdRyBloodMapper.xml +++ b/src/main/resources/mapper/SdRyBloodMapper.xml @@ -17,5 +17,6 @@ WHERE FBIHID = #{inpatientNo} AND FBINCU = ${admissions} + ${where}