Ver código fonte

Merge branch '20210512_yw_check' into develop

songxinlu 4 anos atrás
pai
commit
3089d79803

+ 4 - 0
src/main/java/com/diagbot/dto/MedicalRecordDTO.java

@@ -21,6 +21,10 @@ public class MedicalRecordDTO implements Serializable {
      * 病人住院ID
      */
     private String behospitalCode;
+    /**
+     * 病人医院ID
+     */
+    private Long hospitalId;
     /**
      * 模块id
      */

+ 3 - 5
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -154,7 +154,6 @@ public class MedCheckWorkFacade {
      */
     public void execute(String param) {
         JSONObject paramJson = JSONObject.parseObject(param);
-        Long hospiatlId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
         JSONObject typeValue = paramJson.getJSONObject("typeVal");
         JSONObject typeName = paramJson.getJSONObject("typeName");
         int searchSize = paramJson.getInteger("searchSize");
@@ -165,11 +164,10 @@ public class MedCheckWorkFacade {
         HashMap<String, MedBehospitalType> medBehospitalTypeMap = new HashMap<>();
         //1.获取有指定文书、没有患者类型的患者数据
         RecordTypeVO recordContentVO = new RecordTypeVO();
-        recordContentVO.setHospitalId(hospiatlId);
         recordContentVO.setModeList(new ArrayList<>(typeValue.keySet()));
         List<MedicalRecordDTO> medicalRecordList = medicalRecordServiceImpl.getMedicalRecord(recordContentVO);
         if (medicalRecordList != null && !medicalRecordList.isEmpty()) {
-            getPatientRecordType(medBehospitalTypeMap, medicalRecordList, typeValue, typeName, hospiatlId);
+            getPatientRecordType(medBehospitalTypeMap, medicalRecordList, typeValue, typeName);
         }
         //2.批量执行插入操作
         try {
@@ -193,7 +191,7 @@ public class MedCheckWorkFacade {
     private void getPatientRecordType(HashMap<String, MedBehospitalType> medBehospitalTypeMap,
                                       List<MedicalRecordDTO> medicalRecordList,
                                       JSONObject typeValue,
-                                      JSONObject typeName, Long hospiatlId) {
+                                      JSONObject typeName) {
 
         if (medicalRecordList == null || medicalRecordList.isEmpty()) {
             return;
@@ -217,7 +215,7 @@ public class MedCheckWorkFacade {
                 medBehospitalType.setBehospitalType(typeName.getString(medicalRecordDTO.getModeId() + ""));
                 medBehospitalType.setValue(typeValue.getInteger(medicalRecordDTO.getModeId() + ""));
                 medBehospitalType.setCreateTime(DateUtil.now());
-                medBehospitalType.setHospitalId(hospiatlId);
+                medBehospitalType.setHospitalId(medicalRecordDTO.getHospitalId());
                 medBehospitalTypeMap.put(medicalRecordDTO.getBehospitalCode(), medBehospitalType);
             }
         }

+ 3 - 2
src/main/resources/mapper/MedicalRecordMapper.xml

@@ -74,14 +74,15 @@
 
     <select id="getMedicalRecord"  resultType="com.diagbot.dto.MedicalRecordDTO">
         SELECT DISTINCT
-        a.behospital_code,
+        a.behospital_code behospitalCode,
+        a.hospital_id hospitalId,
         c.mode_id
         from
         med_behospital_info a LEFT JOIN med_behospital_type b
         on a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N' and b.is_deleted = 'N'
         LEFT JOIN med_medical_record c
         on a.behospital_code = c.behospital_code and a.hospital_id = c.hospital_id and a.is_deleted = 'N' and c.is_deleted = 'N'
-        where  b.`value` is null and a.hospital_id = #{hospitalId}
+        where  b.`value` is null
         <if test="modeList != null and modeList.size() > 0">
             and c.mode_id in
             <foreach collection="modeList" open="(" separator="," close=")" item="item">