Browse Source

厦门代码优化

shiyue 4 years ago
parent
commit
9623613813
35 changed files with 590 additions and 398 deletions
  1. 2 1
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  2. 2 1
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  3. 4 4
      src/main/java/com/diagbot/enums/TableNameEnum.java
  4. 19 2
      src/main/java/com/diagbot/facade/data/AHomePageFacade.java
  5. 4 19
      src/main/java/com/diagbot/facade/data/AMedLisResultFacade.java
  6. 4 17
      src/main/java/com/diagbot/facade/data/AMedPacsResultFacade.java
  7. 15 11
      src/main/java/com/diagbot/facade/data/AStrAdmissionNoteFacade.java
  8. 14 11
      src/main/java/com/diagbot/facade/data/AStrBloodResultFacade.java
  9. 14 11
      src/main/java/com/diagbot/facade/data/AStrBloodTransfusionFacade.java
  10. 19 12
      src/main/java/com/diagbot/facade/data/AStrConsultationApplyFacade.java
  11. 14 11
      src/main/java/com/diagbot/facade/data/AStrConsultationNoteFacade.java
  12. 14 11
      src/main/java/com/diagbot/facade/data/AStrConsultationRecordFacade.java
  13. 14 11
      src/main/java/com/diagbot/facade/data/AStrConsultationResultFacade.java
  14. 20 14
      src/main/java/com/diagbot/facade/data/AStrDeathDiscussionFacade.java
  15. 19 12
      src/main/java/com/diagbot/facade/data/AStrDeathNoteFacade.java
  16. 18 12
      src/main/java/com/diagbot/facade/data/AStrDifficultCaseFacade.java
  17. 14 11
      src/main/java/com/diagbot/facade/data/AStrFirstRecordFacade.java
  18. 19 12
      src/main/java/com/diagbot/facade/data/AStrIllCriticallyFacade.java
  19. 18 12
      src/main/java/com/diagbot/facade/data/AStrIllSeriouslFacade.java
  20. 1 1
      src/main/java/com/diagbot/facade/data/AStrInformedConsentFacade.java
  21. 48 11
      src/main/java/com/diagbot/facade/data/AStrLeaveHospitalFacade.java
  22. 37 16
      src/main/java/com/diagbot/facade/data/AStrOperativeFirstRecord.java
  23. 36 16
      src/main/java/com/diagbot/facade/data/AStrOperativeNoteFacade.java
  24. 14 11
      src/main/java/com/diagbot/facade/data/AStrPeriodConclusionFacade.java
  25. 20 12
      src/main/java/com/diagbot/facade/data/AStrPreoperativeDiscussionFacade.java
  26. 7 2
      src/main/java/com/diagbot/facade/data/AStrRescueNoteFacade.java
  27. 14 11
      src/main/java/com/diagbot/facade/data/AStrTransferInNoteFacade.java
  28. 14 11
      src/main/java/com/diagbot/facade/data/AStrTransferOutNoteFacade.java
  29. 101 85
      src/main/java/com/diagbot/facade/data/StructuralDataFacade.java
  30. 25 7
      src/main/java/com/diagbot/util/FJTZDBConnHarp.java
  31. 2 7
      src/main/java/com/diagbot/vo/data/StructuralDataVo.java
  32. 11 5
      src/main/java/com/diagbot/web/DataController.java
  33. 3 3
      src/main/resources/application-local.yml
  34. 2 2
      src/main/resources/application-test.yml
  35. 8 3
      src/main/resources/jdbc.properties

+ 2 - 1
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -149,7 +149,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/sendRecordTypes").permitAll()
                 .antMatchers("/qc/data/sendMrRecordIng").permitAll()
                 .antMatchers("/qc/data/sendStructuralData").permitAll()
-                .antMatchers("/qc/data/sendStructuralDataOld").permitAll()
+                .antMatchers("/qc/data/sendStructuralOneOld").permitAll()
+                .antMatchers("/qc/data/sendStructuralDateOld").permitAll()
                 .antMatchers("/qc/data/sendMrContent").permitAll()
                 .antMatchers("/qc/data/sendMrRecord").permitAll()
                 .antMatchers("/qc/data/sendPatientInfo").permitAll()

+ 2 - 1
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -193,7 +193,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/data/sendRecordTypes", request)
                 || matchers("/qc/data/sendMrRecordIng", request)
                 || matchers("/qc/data/sendStructuralData", request)
-                || matchers("/qc/data/sendStructuralDataOld", request)
+                || matchers("/qc/data/sendStructuralOneOld", request)
+                || matchers("/qc/data/sendStructuralDateOld", request)
                 || matchers("/qc/data/sendMrContent", request)
                 || matchers("/qc/data/sendMrRecord", request)
                 || matchers("/qc/data/sendPatientInfo", request)

+ 4 - 4
src/main/java/com/diagbot/enums/TableNameEnum.java

@@ -34,7 +34,7 @@ public enum TableNameEnum implements KeyedNamed {
     PERIOD_CONCLUSION(28, "str_period_conclusion"),//阶段小结
     ILL_SERIOUSL(29, "str_ill_seriousl"),//病重通知书
     CONSULTATION_APPLY(30, "str_consultation_apply"),//会诊申请单
-    CONSULTATION_RESULT(31, "str_consultation_result"),//会诊结果单
+//    CONSULTATION_RESULT(31, "str_consultation_result"),//会诊结果单
     DATA_MODEL(32, "str_blood_result"),//输血后效果评价
 //    DATA_MODEL(33, "专科交接单"),
 //    DATA_MODEL(34, "转科记录"),
@@ -50,9 +50,9 @@ public enum TableNameEnum implements KeyedNamed {
     LIS_INFO(58, "med_lis_result"),//检验信息
     //LIS_INFO(59, "有创操作"),
     CRISIS_INFO(59, "med_crisis_info"),
-    CONSULTATION_NOTE(60, "str_consultation_note"),//会诊单
-    HOMEDIAGNOSEINFO(61, "med_home_diagnose_info"),//病案首页诊断
-    HOME_OPERATIONINFO(62, "med_home_operation_info"),//病案首页手术
+//    CONSULTATION_NOTE(60, "str_consultation_note"),//会诊单
+//    HOMEDIAGNOSEINFO(61, "med_home_diagnose_info"),//病案首页诊断
+//    HOME_OPERATIONINFO(62, "med_home_operation_info"),//病案首页手术
     MED_BEHOSPITAL_INFO(63, "med_behospital_info");//入院登记
 
     @Setter

+ 19 - 2
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -317,9 +317,26 @@ public class AHomePageFacade extends HomePageServiceImpl{
                     }
                 }
             }
+            AHomePageVO homePageVO =new AHomePageVO();
+            homePageVO = (AHomePageVO) MapUtil.mapToObject(map, AHomePageVO.class);
+            BeanUtils.copyProperties(homePageVOS.get(0),homePageVO);
+
             HomePage homePage =new HomePage();
-            homePage = (HomePage) MapUtil.mapToObject(map, HomePage.class);
-            BeanUtils.copyProperties(homePageVOS.get(0),homePage);
+            BeanUtils.copyProperties(homePageVO,homePage);
+            if (homePage.getAge().equals("0")){
+                if (null!=homePage.getNewbornMonth() && !homePage.getNewbornMonth().equals("")){
+                    homePage.setAge(homePage.getNewbornMonth());
+                    homePage.setAgeUnit("月");
+                }
+            }else {
+                homePage.setAgeUnit("岁");
+            }
+
+
+            homePage.setBehospitalDate(DateUtil.parseDateTime(homePageVO.getBehospitalDate()));//入院日期
+            homePage.setLeaveHospitalDate(DateUtil.parseDateTime(homePageVO.getLeaveHospitalDate()));//出院时间
+            homePage.setBirthday(DateUtil.parseDate(homePageVO.getBirthday()));//出生日期
+
             List<HomePage> list1=new ArrayList<>();
             list1.add(homePage);
             this.execute(list1);

+ 4 - 19
src/main/java/com/diagbot/facade/data/AMedLisResultFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.MedLisResult;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.MedLisResultFacade;
 import com.diagbot.service.impl.MedLisResultServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -24,6 +25,8 @@ import java.util.List;
 public class AMedLisResultFacade extends MedLisResultServiceImpl {
     @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Autowired
+    private MedLisResultFacade medLisResultFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 
@@ -73,29 +76,11 @@ public class AMedLisResultFacade extends MedLisResultServiceImpl {
 
     public void execute(List<MedLisResult> medLisResultList){
         try {
-            List<MedLisResult> addE = Lists.newLinkedList();
-            List<MedLisResult> updateE = Lists.newLinkedList();
             if (medLisResultList != null && medLisResultList.size() > 0) {
                 medLisResultList.stream().forEach(s -> {
-                    MedLisResult medLisResult = this.getOne(new QueryWrapper<MedLisResult>()
-                            .eq("rep_no", s.getRepNo())
-                            .eq("hospital_id", s.getHospitalId()), false);
-                    if (medLisResult != null) {
-                        s.setGmtModified(new Date());
-                        updateE.add(s);
-                    } else {
-                        s.setGmtCreate(new Date());
-                        addE.add(s);
-                    }
+                   medLisResultFacade.save(s);
                 });
             }
-            if(addE.size()>0){
-                this.saveBatch(addE);
-            }
-            if(updateE.size()>0){
-                this.baseMapper.updateBatchByKey(updateE);
-            }
-            //aMedAbnormalInfoFacade.saveAbnormalInfo("检验",JSON.toJSONString(medLisResultList),"","操作成功!");
         }catch (Exception e){
             aMedAbnormalInfoFacade.saveAbnormalInfo("检验","",JSON.toJSONString(medLisResultList),"",e.getMessage());
         }

+ 4 - 17
src/main/java/com/diagbot/facade/data/AMedPacsResultFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.MedPacsResult;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.MedPacsResultFacade;
 import com.diagbot.service.impl.MedPacsResultServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -24,6 +25,8 @@ import java.util.List;
 public class AMedPacsResultFacade extends MedPacsResultServiceImpl {
     @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Autowired
+    private MedPacsResultFacade medPacsResultFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 
@@ -77,25 +80,9 @@ public class AMedPacsResultFacade extends MedPacsResultServiceImpl {
             List<MedPacsResult> updateE = Lists.newLinkedList();
             if (medPacsResultList != null && medPacsResultList.size() > 0) {
                 medPacsResultList.stream().forEach(s -> {
-                    MedPacsResult medPacsResult = this.getOne(new QueryWrapper<MedPacsResult>()
-                            .eq("rep_no", s.getRepNo())
-                            .eq("hospital_id", s.getHospitalId()), false);
-                    if (medPacsResult != null) {
-                        s.setGmtModified(new Date());
-                        updateE.add(s);
-                    } else {
-                        s.setGmtCreate(new Date());
-                        addE.add(s);
-                    }
+                    medPacsResultFacade.save(s);
                 });
             }
-            if(addE.size()>0){
-                this.saveBatch(addE);
-            }
-            if(updateE.size()>0){
-                this.baseMapper.updateBatchByKey(updateE);
-            }
-            //aMedAbnormalInfoFacade.saveAbnormalInfo("检查",JSON.toJSONString(medPacsResultList),"","操作成功!");
         }catch (Exception e){
             aMedAbnormalInfoFacade.saveAbnormalInfo("检查","",JSON.toJSONString(medPacsResultList),"",e.getMessage());
         }

+ 15 - 11
src/main/java/com/diagbot/facade/data/AStrAdmissionNoteFacade.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrAdmissionNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -16,6 +17,7 @@ import com.diagbot.util.StringUtil;
 import com.diagbot.vo.data.ADeleteFlagVO;
 import com.diagbot.vo.data.AStrAdmissionNoteVO;
 import com.diagbot.vo.data.FJStrAdmissionNoteVo;
+import com.diagbot.vo.data.HisViewVo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -106,28 +108,30 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<FJStrAdmissionNoteVo> strAdmissionNoteVos) {
+    public  void getOneList(List<FJStrAdmissionNoteVo> strAdmissionNoteVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (FJStrAdmissionNoteVo s: strAdmissionNoteVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
+
             StrAdmissionNote strAdmissionNote =new StrAdmissionNote();
             strAdmissionNote = (StrAdmissionNote) MapUtil.mapToObject(map, StrAdmissionNote.class);
             BeanUtils.copyProperties(strAdmissionNoteVos.get(0),strAdmissionNote);

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrBloodResultFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.entity.MedicalRecordContent;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrBloodResult;
 import com.diagbot.entity.StrFirstRecord;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrBloodResultServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -40,24 +41,26 @@ public class AStrBloodResultFacade extends StrBloodResultServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrBloodTransfusionFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrBloodResult;
 import com.diagbot.entity.StrBloodTransfusion;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrBloodTransfusionServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -43,24 +44,26 @@ public class AStrBloodTransfusionFacade extends StrBloodTransfusionServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 19 - 12
src/main/java/com/diagbot/facade/data/AStrConsultationApplyFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrConsultationApply;
 import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrConsultationApplyServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -41,30 +42,36 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrConsultationApply strConsultationApply =new StrConsultationApply();
-            strConsultationApply = (StrConsultationApply) MapUtil.mapToObject(map, StrConsultationApply.class);
+            AStrConsultationApplyVO strConsultationApplyVo = (AStrConsultationApplyVO) MapUtil.mapToObject(map, AStrConsultationApplyVO.class);
+            BeanUtils.copyProperties(strConsultationApplyVo,strConsultationApply);
+
+            strConsultationApply.setConsultationDate(DateUtil.parseDate(strConsultationApplyVo.getConsultationDate(),"yyyy-MM-dd HH:mm"));//开始时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strConsultationApply);
             strConsultationApply.setWholeData(String.valueOf(wholeData));
 

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrConsultationNoteFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrConsultationNote;
 import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrConsultationNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -43,24 +44,26 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrConsultationRecordFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrConsultationRecord;
 import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrConsultationRecordServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -41,24 +42,26 @@ public class AStrConsultationRecordFacade extends StrConsultationRecordServiceIm
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrConsultationResultFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrConsultationResult;
 import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrConsultationResultServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -42,24 +43,26 @@ public class AStrConsultationResultFacade extends StrConsultationResultServiceIm
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 20 - 14
src/main/java/com/diagbot/facade/data/AStrDeathDiscussionFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrDeathDiscussion;
 import com.diagbot.entity.StrDeathNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrDeathDiscussionServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -41,36 +42,41 @@ public class AStrDeathDiscussionFacade extends StrDeathDiscussionServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
                             if (s.getDeValue1()!=null){
-                                map.put(s.getKeyEn(),s.getDeValue1());
-                                wholeData.put(list.get(i).getCh(),s.getDeValue1());
+                                map.put(s.getKeyEn(), s.getDeValue1());
+                                wholeData.put(k, s.getDeValue1());
                             }else {
-                                map.put(s.getKeyEn(),s.getDeValue());
-                                wholeData.put(list.get(i).getCh(),s.getDeValue2());
+                                map.put(s.getKeyEn(), s.getDeValue2());
+                                wholeData.put(k, s.getDeValue2());
                             }
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue1());
                 }
             }
             StrDeathDiscussion strDeathDiscussion =new StrDeathDiscussion();
-            strDeathDiscussion = (StrDeathDiscussion) MapUtil.mapToObject(map, StrDeathDiscussion.class);
+            AStrDeathDiscussionVO aStrDeathDiscussionVO = (AStrDeathDiscussionVO) MapUtil.mapToObject(map, AStrDeathDiscussionVO.class);
+            BeanUtils.copyProperties(aStrDeathDiscussionVO,strDeathDiscussion);
             BeanUtils.copyProperties(hisViewVos.get(0),strDeathDiscussion);
+
+            strDeathDiscussion.setDiscussDate(DateUtil.parseDate(aStrDeathDiscussionVO.getDiscussDate(),"yyyy-MM-dd HH:mm"));//讨论时间
             strDeathDiscussion.setWholeData(String.valueOf(wholeData));
 
             //判断是否有文本 如果有获取它

+ 19 - 12
src/main/java/com/diagbot/facade/data/AStrDeathNoteFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrDeathNote;
 import com.diagbot.entity.StrDifficultCase;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrDeathNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -41,30 +42,36 @@ public class AStrDeathNoteFacade extends StrDeathNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrDeathNote strDeathNote =new StrDeathNote();
-            strDeathNote = (StrDeathNote) MapUtil.mapToObject(map, StrDeathNote.class);
+            AStrDeathNoteVO strDeathNoteVO = (AStrDeathNoteVO) MapUtil.mapToObject(map, AStrDeathNoteVO.class);
+            BeanUtils.copyProperties(strDeathNoteVO,strDeathNote);
+            strDeathNote.setDeathDate(DateUtil.parseDate(strDeathNoteVO.getDeathDate(),"yyyy-MM-dd HH:mm:ss"));//结束时间
+            strDeathNote.setBehospitalDate(DateUtil.parseDate(strDeathNoteVO.getBehospitalDate(),"yyyy-MM-dd HH:mm:ss"));//结束时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strDeathNote);
             strDeathNote.setWholeData(String.valueOf(wholeData));
 

+ 18 - 12
src/main/java/com/diagbot/facade/data/AStrDifficultCaseFacade.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.*;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrDifficultCaseServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -40,30 +41,35 @@ public class AStrDifficultCaseFacade extends StrDifficultCaseServiceImpl{
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrDifficultCase strDifficultCase =new StrDifficultCase();
-            strDifficultCase = (StrDifficultCase) MapUtil.mapToObject(map, StrDifficultCase.class);
+            AStrDifficultCaseVO strDifficultCaseVO = (AStrDifficultCaseVO) MapUtil.mapToObject(map, AStrDifficultCaseVO.class);
+            BeanUtils.copyProperties(strDifficultCaseVO,strDifficultCase);
+            strDifficultCase.setDiscussDate(DateUtil.parseDate(strDifficultCaseVO.getDiscussDate(),"yyyy-MM-dd HH:mm"));//结束时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strDifficultCase);
             strDifficultCase.setWholeData(String.valueOf(wholeData));
 

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrFirstRecordFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrFirstRecord;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.service.impl.StrFirstRecordServiceImpl;
 import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.MedicalRecordContent;
@@ -37,29 +38,31 @@ public class AStrFirstRecordFacade extends StrFirstRecordServiceImpl {
     @Autowired
     private AMedicalRecordContentFacade aMedicalRecordContentFacade;
 
+
     /**
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
 
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 19 - 12
src/main/java/com/diagbot/facade/data/AStrIllCriticallyFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrIllCritically;
 import com.diagbot.entity.StrTransferOutNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrIllCriticallyServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -42,30 +43,36 @@ public class AStrIllCriticallyFacade extends StrIllCriticallyServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrIllCritically strIllCritically =new StrIllCritically();
-            strIllCritically = (StrIllCritically) MapUtil.mapToObject(map, StrIllCritically.class);
+            AStrIllCriticallyVO strIllCriticallyVo = (AStrIllCriticallyVO) MapUtil.mapToObject(map, AStrIllCriticallyVO.class);
+            BeanUtils.copyProperties(strIllCriticallyVo,strIllCritically);
+
+            strIllCritically.setDoctorSignDate(DateUtil.parseDate(strIllCriticallyVo.getDoctorSignDate(),"yyyy-MM-dd HH:mm"));//结束时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strIllCritically);
             strIllCritically.setWholeData(String.valueOf(wholeData));
 

+ 18 - 12
src/main/java/com/diagbot/facade/data/AStrIllSeriouslFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrIllCritically;
 import com.diagbot.entity.StrIllSeriousl;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrIllSeriouslServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -43,30 +44,35 @@ public class AStrIllSeriouslFacade extends StrIllSeriouslServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrIllSeriousl strIllSeriousl =new StrIllSeriousl();
-            strIllSeriousl = (StrIllSeriousl) MapUtil.mapToObject(map, StrIllSeriousl.class);
+            AStrIllSeriouslVO strIllSeriouslVo = (AStrIllSeriouslVO) MapUtil.mapToObject(map, AStrIllSeriouslVO.class);
+            BeanUtils.copyProperties(strIllSeriouslVo,strIllSeriousl);
+            strIllSeriousl.setDoctorSignDate(DateUtil.parseDate(strIllSeriouslVo.getDoctorSignDate(),"yyyy-MM-dd HH:mm"));//结束时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strIllSeriousl);
             strIllSeriousl.setWholeData(String.valueOf(wholeData));
 

+ 1 - 1
src/main/java/com/diagbot/facade/data/AStrInformedConsentFacade.java

@@ -39,7 +39,7 @@ public class AStrInformedConsentFacade extends StrInformedConsentServiceImpl {
                     }
                 } catch (Exception e) {
                     log.error(e.getMessage(), e);
-                    aMedAbnormalInfoFacade.saveAbnormalInfo("同意书", s.getRecId(), JSON.toJSONString(strInformedConsents), "", e.getMessage());
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("告知书", s.getRecId(), JSON.toJSONString(strInformedConsents), "", e.getMessage());
                 }
             });
         }

+ 48 - 11
src/main/java/com/diagbot/facade/data/AStrLeaveHospitalFacade.java

@@ -24,10 +24,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Component
 public class AStrLeaveHospitalFacade extends StrLeaveHospitalServiceImpl {
@@ -43,7 +40,7 @@ public class AStrLeaveHospitalFacade extends StrLeaveHospitalServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
@@ -65,15 +62,55 @@ public class AStrLeaveHospitalFacade extends StrLeaveHospitalServiceImpl {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
-            StrLeaveHospital strLeaveHospital =new StrLeaveHospital();
-            strLeaveHospital = (StrLeaveHospital) MapUtil.mapToObject(map, StrLeaveHospital.class);
-            BeanUtils.copyProperties(hisViewVos.get(0),strLeaveHospital);
+            AStrLeaveHospitalVO strLeaveHospitalVO =new AStrLeaveHospitalVO();
+            StrLeaveHospital strLeaveHospital = new StrLeaveHospital();
+            strLeaveHospitalVO = (AStrLeaveHospitalVO) MapUtil.mapToObject(map, AStrLeaveHospitalVO.class);
+            BeanUtils.copyProperties(hisViewVos.get(0),strLeaveHospitalVO);
+
+            //时间赋值
+
+            strLeaveHospital.setAuditDate(DateUtil.parseDateTime(strLeaveHospitalVO.getAuditDate()));//审核时间
+            strLeaveHospital.setRecDate(DateUtil.parseDateTime(strLeaveHospitalVO.getRecDate()));//记录时间
+            strLeaveHospital.setBehospitalDate(DateUtil.parseDateTime(strLeaveHospitalVO.getBehospitalDate()));//入院日期
+            strLeaveHospital.setLeaveHospitalDate(DateUtil.parseDateTime(strLeaveHospitalVO.getLeaveHospitalDate()));//出院时间
+            strLeaveHospital.setRecordDate(DateUtil.parseDateTime(strLeaveHospitalVO.getRecordDate()));//病历日期
+
+            BeanUtils.copyProperties(strLeaveHospitalVO,strLeaveHospital);
+            strLeaveHospital.setHospitalId(hisViewVos.get(0).getHospitalId());
             strLeaveHospital.setWholeData(String.valueOf(wholeData));
 
             if (strLeaveHospital.getLeaveHospitalDate()!=null && strLeaveHospital.getBehospitalDate()!=null){
-                long nd = 1000 * 24 * 60 * 60;//每天毫秒数
-                long diff = strLeaveHospital.getLeaveHospitalDate().getTime() - strLeaveHospital.getBehospitalDate().getTime();// 获得两个时间的毫秒时间差异
-                long day = diff / nd;// 计算差多少天
+                Integer day;
+                Calendar cal1 = Calendar.getInstance();
+                cal1.setTime(strLeaveHospital.getBehospitalDate());
+
+                Calendar cal2 = Calendar.getInstance();
+                cal2.setTime(strLeaveHospital.getLeaveHospitalDate());
+                int day1= cal1.get(Calendar.DAY_OF_YEAR);
+                int day2 = cal2.get(Calendar.DAY_OF_YEAR);
+
+                int year1 = cal1.get(Calendar.YEAR);
+                int year2 = cal2.get(Calendar.YEAR);
+                if(year1 != year2)   //同一年
+                {
+                    int timeDistance = 0 ;
+                    for(int i = year1 ; i < year2 ; i ++)
+                    {
+                        if(i%4==0 && i%100!=0 || i%400==0)    //闰年
+                        {
+                            timeDistance += 366;
+                        }
+                        else    //不是闰年
+                        {
+                            timeDistance += 365;
+                        }
+                    }
+                    day= timeDistance + (day2-day1) ;
+                }
+                else    //不同年
+                {
+                    day= day2-day1;
+                }
                 strLeaveHospital.setBehospitalDayNum(String.valueOf(day));
             }
 

+ 37 - 16
src/main/java/com/diagbot/facade/data/AStrOperativeFirstRecord.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrDeathDiscussion;
 import com.diagbot.entity.StrOperativeFirstRecord;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrOperativeFirstRecordServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -23,10 +24,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Component
 public class AStrOperativeFirstRecord extends StrOperativeFirstRecordServiceImpl {
@@ -42,30 +40,53 @@ public class AStrOperativeFirstRecord extends StrOperativeFirstRecordServiceImpl
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrOperativeFirstRecord strOperativeFirstRecord =new StrOperativeFirstRecord();
-            strOperativeFirstRecord = (StrOperativeFirstRecord) MapUtil.mapToObject(map, StrOperativeFirstRecord.class);
+            AStrOperativeFirstRecordVO strOperativeFirstRecordVO = (AStrOperativeFirstRecordVO) MapUtil.mapToObject(map, AStrOperativeFirstRecordVO.class);
+            BeanUtils.copyProperties(strOperativeFirstRecordVO,strOperativeFirstRecord);
+            strOperativeFirstRecord.setOperationDate(DateUtil.parseDate(strOperativeFirstRecordVO.getOperationDate(),"yyyy-MM-dd"));//手术时间
+
+            if (null!=strOperativeFirstRecordVO.getStartTime()){
+                String date = strOperativeFirstRecordVO.getOperationDate()+" "+strOperativeFirstRecordVO.getStartTime();
+                strOperativeFirstRecord.setStartTime(DateUtil.parseDate(date,"yyyy-MM-dd HH:mm"));//开始时间
+            }
+            if (null!=strOperativeFirstRecordVO.getEndTime()){
+                if (strOperativeFirstRecordVO.getEndTime().length()>5){
+                    Calendar cal1 = Calendar.getInstance();
+                    cal1.setTime(strOperativeFirstRecord.getOperationDate());
+                    int year = cal1.get(Calendar.YEAR);
+                    String endDate= year+"-"+strOperativeFirstRecordVO.getEndTime();
+                    strOperativeFirstRecord.setEndTime(DateUtil.parseDate(endDate,"yyyy-MM-dd HH:mm"));//结束时间
+                }else {
+                    String endDate =strOperativeFirstRecordVO.getOperationDate()+" "+strOperativeFirstRecordVO.getEndTime();
+                    strOperativeFirstRecord.setEndTime(DateUtil.parseDate(endDate,"yyyy-MM-dd HH:mm"));//结束时间
+                }
+            }
+
+
             BeanUtils.copyProperties(hisViewVos.get(0),strOperativeFirstRecord);
             strOperativeFirstRecord.setWholeData(String.valueOf(wholeData));
 

+ 36 - 16
src/main/java/com/diagbot/facade/data/AStrOperativeNoteFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrOperativeNote;
 import com.diagbot.entity.StrPreoperativeDiscussion;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrOperativeNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -23,10 +24,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Component
 public class AStrOperativeNoteFacade extends StrOperativeNoteServiceImpl {
@@ -42,30 +40,52 @@ public class AStrOperativeNoteFacade extends StrOperativeNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrOperativeNote strOperativeNote =new StrOperativeNote();
-            strOperativeNote = (StrOperativeNote) MapUtil.mapToObject(map, StrOperativeNote.class);
+            AStrOperativeNoteVO strOperativeNoteVO = (AStrOperativeNoteVO) MapUtil.mapToObject(map, AStrOperativeNoteVO.class);
+            BeanUtils.copyProperties(strOperativeNoteVO,strOperativeNote);
+
+            strOperativeNote.setOperationDate(DateUtil.parseDate(strOperativeNoteVO.getOperationDate(),"yyyy-MM-dd"));//手术时间
+            if (null!=strOperativeNoteVO.getStartTime()){
+                String date = strOperativeNoteVO.getOperationDate()+" "+strOperativeNoteVO.getStartTime();
+                strOperativeNote.setStartTime(DateUtil.parseDate(date,"yyyy-MM-dd HH:mm"));//开始时间
+            }
+            if (null!=strOperativeNoteVO.getEndTime()){
+                if (strOperativeNoteVO.getEndTime().length()>5){
+                    Calendar cal1 = Calendar.getInstance();
+                    cal1.setTime(strOperativeNote.getOperationDate());
+                    int year = cal1.get(Calendar.YEAR);
+                    String endDate= year+"-"+strOperativeNoteVO.getEndTime();
+                    strOperativeNote.setEndTime(DateUtil.parseDate(endDate,"yyyy-MM-dd HH:mm"));//结束时间
+                }else {
+                    String endDate =strOperativeNoteVO.getOperationDate()+" "+strOperativeNoteVO.getEndTime();
+                    strOperativeNote.setEndTime(DateUtil.parseDate(endDate,"yyyy-MM-dd HH:mm"));//结束时间
+                }
+            }
+
             BeanUtils.copyProperties(hisViewVos.get(0),strOperativeNote);
             strOperativeNote.setWholeData(String.valueOf(wholeData));
 

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrPeriodConclusionFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrPeriodConclusion;
 import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrPeriodConclusionServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -39,24 +40,26 @@ public class AStrPeriodConclusionFacade extends StrPeriodConclusionServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 20 - 12
src/main/java/com/diagbot/facade/data/AStrPreoperativeDiscussionFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrOperativeFirstRecord;
 import com.diagbot.entity.StrPreoperativeDiscussion;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrPreoperativeDiscussionServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -41,30 +42,37 @@ public class AStrPreoperativeDiscussionFacade extends StrPreoperativeDiscussionS
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //得到表所对应的中文名和英文名
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }
             }
             StrPreoperativeDiscussion strPreoperativeDiscussion =new StrPreoperativeDiscussion();
-            strPreoperativeDiscussion = (StrPreoperativeDiscussion) MapUtil.mapToObject(map, StrPreoperativeDiscussion.class);
+            AStrPreoperativeDiscussionVO strPreoperativeDiscussionVo = (AStrPreoperativeDiscussionVO) MapUtil.mapToObject(map, AStrPreoperativeDiscussionVO.class);
+            BeanUtils.copyProperties(strPreoperativeDiscussionVo,strPreoperativeDiscussion);
+
+            strPreoperativeDiscussion.setAuditDate(DateUtil.parseDate(strPreoperativeDiscussionVo.getAuditDate(),"yyyy-MM-dd HH:mm"));//开始时间
+            strPreoperativeDiscussion.setDiscussTime(DateUtil.parseDate(strPreoperativeDiscussionVo.getDiscussTime(),"yyyy-MM-dd HH:mm"));
+
             BeanUtils.copyProperties(hisViewVos.get(0),strPreoperativeDiscussion);
             strPreoperativeDiscussion.setWholeData(String.valueOf(wholeData));
 

+ 7 - 2
src/main/java/com/diagbot/facade/data/AStrRescueNoteFacade.java

@@ -42,7 +42,7 @@ public class AStrRescueNoteFacade extends StrRescueNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
@@ -65,7 +65,12 @@ public class AStrRescueNoteFacade extends StrRescueNoteServiceImpl {
                 }
             }
             StrRescueNote strRescueNote =new StrRescueNote();
-            strRescueNote = (StrRescueNote) MapUtil.mapToObject(map, StrRescueNote.class);
+            AStrRescueNoteVO strRescueNoteVo = (AStrRescueNoteVO) MapUtil.mapToObject(map, AStrRescueNoteVO.class);
+            BeanUtils.copyProperties(strRescueNoteVo,strRescueNote);
+
+            strRescueNote.setStartTime(DateUtil.parseDate(strRescueNoteVo.getStartTime(),"yyyy-MM-dd HH:mm"));//结束时间
+            strRescueNote.setEndTime(DateUtil.parseDate(strRescueNoteVo.getEndTime(),"yyyy-MM-dd HH:mm"));//结束时间
+
             BeanUtils.copyProperties(hisViewVos.get(0),strRescueNote);
             strRescueNote.setWholeData(String.valueOf(wholeData));
 

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrTransferInNoteFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrBloodTransfusion;
 import com.diagbot.entity.StrTransferInNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrTransferInNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -43,24 +44,26 @@ public class AStrTransferInNoteFacade extends StrTransferInNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 14 - 11
src/main/java/com/diagbot/facade/data/AStrTransferOutNoteFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.data.ColumnZhAndChDTO;
 import com.diagbot.entity.StrAdmissionNote;
 import com.diagbot.entity.StrTransferInNote;
 import com.diagbot.entity.StrTransferOutNote;
+import com.diagbot.enums.CacheKeyEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.StrTransferOutNoteServiceImpl;
 import com.diagbot.util.DateUtil;
@@ -43,24 +44,26 @@ public class AStrTransferOutNoteFacade extends StrTransferOutNoteServiceImpl {
      * 把得到的list变成一个对象
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos) {
+    public  void getOneList(List<HisViewVo> hisViewVos,String modelName) {
         try {
             Map<String,Object> map =new HashMap<>();
             Map<String,Object> wholeData =new HashMap<>();
             //得到咱表中的字段名字然后把下划线转变为驼峰
-            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
-            list.forEach(s -> {
-                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
-            });
+//            List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+//            list.forEach(s -> {
+//                s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+//            });
+            //循环list根据咱字段的名称来跟得到的数据来做比较
+            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
             for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null){
-                    for (int i = 0; i < list.size(); i++) {
-                        if (s.getKeyEn().equals(list.get(i).getEn())){
-                            map.put(s.getKeyEn(),s.getDeValue());
-                            wholeData.put(list.get(i).getCh(),s.getDeValue());
+                if (s.getKeyEn()!=null) {
+                    tableKey.forEach((k, v) -> {
+                        if (s.getKeyEn().equals(v)) {
+                            map.put(s.getKeyEn(), s.getDeValue());
+                            wholeData.put(k, s.getDeValue());
                         }
-                    }
+                    });
                 }else {
                     wholeData.put(s.getKeyCN(),s.getDeValue());
                 }

+ 101 - 85
src/main/java/com/diagbot/facade/data/StructuralDataFacade.java

@@ -110,7 +110,7 @@ public class StructuralDataFacade {
                 return RespDTO.onError("请输入病历号!");
             } else if (null==structuralDataVos.getHospitalId()) {
                 return RespDTO.onError("请输入医院编码!");
-            } else if (StringUtils.isEmpty(structuralDataVos.getRecTypeId())) {
+            } else if (StringUtils.isEmpty(structuralDataVos.getRecId())) {
                 return RespDTO.onError("请输入文书id");
             } else if (StringUtils.isEmpty(structuralDataVos.getModeId())) {
                 return RespDTO.onError("请输入文书类别名称");
@@ -135,21 +135,40 @@ public class StructuralDataFacade {
      */
     public void  sendStructuralDataOld(StructuralDataVo structuralDataVo){
         try {
-            String sql ="select * from med_behospital_info where to_char(behospitalDate,'yyyymmdd') >= '"+structuralDataVo.getBehospitalDate()+"';";
-            List<BehospitalInfo> behospitalInfo =fjtzdbConnHarp.getBehospitalInfo(sql);
-            aBehospitalInfoFacade.execute(behospitalInfo);
-            behospitalInfo.forEach(s->{
+            String sql ="select behospitalCode from med_behospital_info where to_char(behospitalDate,'yyyymmdd') >= '"+structuralDataVo.getBehospitalDate()+"'";
+            List<String> strings =fjtzdbConnHarp.getBehospitalInfoDate(sql);
+            strings.forEach(s->{
                 StructuralDataVo sData =new StructuralDataVo();
-                sData.setBehospitalCode(s.getBehospitalCode());
                 for (int i = 0; i <65 ; i++) {
-                    sData.setModeId(String.valueOf(i));
-                    executeOld(sData);
+                    String tableName=TableNameEnum.getName(i);
+                    if (null!=tableName){
+                        sData.setBehospitalCode(s);
+                        sData.setModeId(String.valueOf(i));
+                        executeOld(sData);
+                    }
                 }
             });
         }catch (Exception e){
             aMedAbnormalInfoFacade.saveAbnormalInfo("保存数据异常", "",JSON.toJSONString(structuralDataVo),"",e.getMessage());
         }
+    }
 
+    /**
+     * 终末质控,根据时间来导入数据
+     * @param behospitalCode
+     */
+    public void  sendOnebehospitalCode(List<String> behospitalCode){
+            behospitalCode.forEach(s->{
+                StructuralDataVo sData =new StructuralDataVo();
+                sData.setBehospitalCode(s);
+                for (int i = 0; i <65 ; i++) {
+                    String tableName=TableNameEnum.getName(i);
+                    if (null!=tableName){
+                        sData.setModeId(String.valueOf(i));
+                        executeOld(sData);
+                    }
+                }
+            });
     }
 
 
@@ -164,108 +183,108 @@ public class StructuralDataFacade {
             if("首次病程录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrFirstRecordFacade.getOneList(hisViewVos);
+                    aStrFirstRecordFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("输血后效果评价".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrBloodResultFacade.getOneList(hisViewVos);
+                    aStrBloodResultFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("输血/血制品病程记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrBloodTransfusionFacade.getOneList(hisViewVos);
+                    aStrBloodTransfusionFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("转入记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrTransferInNoteFacade.getOneList(hisViewVos);
+                    aStrTransferInNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("转出记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrTransferOutNoteFacade.getOneList(hisViewVos);
+                    aStrTransferOutNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("病危通知书".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrIllCriticallyFacade.getOneList(hisViewVos);
+                    aStrIllCriticallyFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("病重通知书".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrIllSeriouslFacade.getOneList(hisViewVos);
+                    aStrIllSeriouslFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("疑难病例讨论记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrDifficultCaseFacade.getOneList(hisViewVos);
+                    aStrDifficultCaseFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("死亡记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrDeathNoteFacade.getOneList(hisViewVos);
+                    aStrDeathNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("死亡病例讨论记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getMedDeathDiscussion(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrDeathDiscussionFacade.getOneList(hisViewVos);
+                    aStrDeathDiscussionFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("术后首次病程及谈话记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrOperativeFirstRecord.getOneList(hisViewVos);
+                    aStrOperativeFirstRecord.getOneList(hisViewVos,modelName);
                 }
             }else if("术前讨论、术前小结".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrPreoperativeDiscussionFacade.getOneList(hisViewVos);
+                    aStrPreoperativeDiscussionFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("手术记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrOperativeNoteFacade.getOneList(hisViewVos);
+                    aStrOperativeNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("抢救记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrRescueNoteFacade.getOneList(hisViewVos);
+                    aStrRescueNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("出院小结".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrLeaveHospitalFacade.getOneList(hisViewVos);
+                    aStrLeaveHospitalFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("会诊申请单".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrConsultationApplyFacade.getOneList(hisViewVos);
+                    aStrConsultationApplyFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("会诊结果单".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrConsultationResultFacade.getOneList(hisViewVos);
+                    aStrConsultationResultFacade.getOneList(hisViewVos,modelName);
                 }
             }else if("会诊单".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrConsultationNoteFacade.getOneList(hisViewVos);
+                    aStrConsultationNoteFacade.getOneList(hisViewVos,modelName);
                 }
             }else if ("会诊记录".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrConsultationRecordFacade.getOneList(hisViewVos);
+                    aStrConsultationRecordFacade.getOneList(hisViewVos,modelName);
                 }
             } else if("阶段小结".equals(modelName)){
                 List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
                 if (hisViewVos.size()>0){
-                    aStrPeriodConclusionFacade.getOneList(hisViewVos);
+                    aStrPeriodConclusionFacade.getOneList(hisViewVos,modelName);
                 }
             }else if ("病案首页".equals(modelName)){
                 /**
                  * 病案首页
                  */
-                String sql ="select * from "+s.getTableName()+"t where  t.behospitalCode='"+s.getBehospitalCode()+"' and t.homePage='"+s.getRecTypeId()+"'" ;
+                String sql ="select * from "+s.getTableName()+" where  behospitalCode='"+s.getBehospitalCode()+"' and homePageId='"+s.getRecId()+"'" ;
                 List<HisHomePageVO> homePage =fjtzdbConnHarp.getHomePage(sql);
                 if (homePage.size()>0) {
                     aHomePageFacade.getOneList(homePage);//病案首页
@@ -273,7 +292,7 @@ public class StructuralDataFacade {
                 /**
                  * 病案首页诊断
                  */
-                String sql01="select * from  med_home_diagnose_info  where "+"t.homePage='"+s.getRecTypeId()+"'" ;
+                String sql01="select * from  med_home_diagnose_info  where "+"homePageId='"+s.getRecId()+"'" ;
                 List<HomeDiagnoseInfo> homeDiagnoseInfos =fjtzdbConnHarp.getHomeDiagnose(sql01);
                 if (homeDiagnoseInfos.size()>0) {
                     aHomeDiagnoseInfoFacade.execute(homeDiagnoseInfos);//病案首页诊断
@@ -281,19 +300,19 @@ public class StructuralDataFacade {
                 /**
                  * 病案首页手术
                  */
-                String sql02="select * from  med_home_operation_info  where "+"t.homePage='"+s.getRecTypeId()+"'" ;
+                String sql02="select * from  med_home_operation_info  where "+"homePageId='"+s.getRecId()+"'" ;
                 List<HomeOperationInfo> homeOperationInfos =fjtzdbConnHarp.getHomeOperation(sql02);
                 if (homeOperationInfos.size()>0) {
                     aHomeOperationInfoFacade.execute(homeOperationInfos);//病案首页手术
                 }
             }else if ("医嘱信息".equals(modelName)){
-                String sql="select * from  med_doctor_advice  where "+"t.behospitalCode='"+s.getBehospitalCode()+"' and t.doctorAdviceId='"+s.getRecTypeId()+"'" ;
-                List<DoctorAdvice> doctorAdvice =fjtzdbConnHarp.getDoctorAdvice(this.sql(s));
+                String sql="select * from  med_doctor_advice  where "+" behospitalCode='"+s.getBehospitalCode()+"' and doctorAdviceId='"+s.getRecId()+"'" ;
+                List<DoctorAdvice> doctorAdvice =fjtzdbConnHarp.getDoctorAdvice(sql);
                 if (doctorAdvice.size()>0){
                     aDoctorAdviceFacade.execute(doctorAdvice);
                 }
             }else if ("入院登记".equals(modelName)){
-                String sql ="select * from "+s.getTableName()+"t where  t.behospitalCode='"+s.getBehospitalCode()+"'" ;
+                String sql ="select * from "+s.getTableName()+"   where  behospitalCode='"+s.getBehospitalCode()+"'" ;
                 List<BehospitalInfo> behospitalInfo =fjtzdbConnHarp.getBehospitalInfo(sql);
                 if (behospitalInfo.size()>0){
                     aBehospitalInfoFacade.execute(behospitalInfo);
@@ -326,7 +345,7 @@ public class StructuralDataFacade {
             }else if("入院记录".equals(modelName)){
                 List<FJStrAdmissionNoteVo> medAdmissionNote =fjtzdbConnHarp.getMedAdmissionNote(this.sql(s));
                 if (medAdmissionNote.size()>0){
-                    aStrAdmissionNoteFacade.getOneList(medAdmissionNote);
+                    aStrAdmissionNoteFacade.getOneList(medAdmissionNote,modelName);
                 }
             }else if("危急值记录".equals(modelName)){
                 List<StrCrisisNote> medCrisisNote =fjtzdbConnHarp.getMedCrisisNote(this.sql(s));
@@ -360,47 +379,47 @@ public class StructuralDataFacade {
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()){
-                        aStrFirstRecordFacade.getOneList(map.get(key));
+                        aStrFirstRecordFacade.getOneList(map.get(key),s.getTableName());
                     }
                 }
             }else if("输血后效果评价".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrBloodResultFacade.getOneList(map.get(key));
+                        aStrBloodResultFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("输血/血制品病程记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrBloodTransfusionFacade.getOneList(map.get(key));
+                        aStrBloodTransfusionFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("转入记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrTransferInNoteFacade.getOneList(map.get(key));
+                        aStrTransferInNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("转出记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrTransferOutNoteFacade.getOneList(map.get(key));
+                        aStrTransferOutNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("病危通知书".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrIllCriticallyFacade.getOneList(map.get(key));
+                        aStrIllCriticallyFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("病重通知书".equals(modelName)){
@@ -408,125 +427,125 @@ public class StructuralDataFacade {
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrIllSeriouslFacade.getOneList(map.get(key));
+                        aStrIllSeriouslFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("疑难病例讨论记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrDifficultCaseFacade.getOneList(map.get(key));
+                        aStrDifficultCaseFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("死亡记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrDeathNoteFacade.getOneList(map.get(key));
+                        aStrDeathNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("死亡病例讨论记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getMedDeathDiscussion(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrDeathDiscussionFacade.getOneList(map.get(key));
+                        aStrDeathDiscussionFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("术后首次病程及谈话记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrOperativeFirstRecord.getOneList(map.get(key));
+                        aStrOperativeFirstRecord.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("术前讨论、术前小结".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrPreoperativeDiscussionFacade.getOneList(map.get(key));
+                        aStrPreoperativeDiscussionFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("手术记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrOperativeNoteFacade.getOneList(map.get(key));
+                        aStrOperativeNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("抢救记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrRescueNoteFacade.getOneList(map.get(key));
+                        aStrRescueNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("出院小结".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrLeaveHospitalFacade.getOneList(map.get(key));
+                        aStrLeaveHospitalFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("会诊申请单".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrConsultationApplyFacade.getOneList(map.get(key));
+                        aStrConsultationApplyFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("会诊结果单".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrConsultationResultFacade.getOneList(map.get(key));
+                        aStrConsultationResultFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if("会诊单".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrConsultationNoteFacade.getOneList(map.get(key));
+                        aStrConsultationNoteFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if ("会诊记录".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrConsultationRecordFacade.getOneList(map.get(key));
+                        aStrConsultationRecordFacade.getOneList(map.get(key),modelName);
                     }
                 }
             } else if("阶段小结".equals(modelName)){
-                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
+                List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sqlOld(s));
                 if (hisViewVos.size()>0){
                     Map<String,List<HisViewVo>> map=this.executeOldDeci(hisViewVos);
                     for (String key:map.keySet()) {
-                        aStrPeriodConclusionFacade.getOneList(map.get(key));
+                        aStrPeriodConclusionFacade.getOneList(map.get(key),modelName);
                     }
                 }
             }else if ("病案首页".equals(modelName)){
                 /**
                  * 病案首页
                  */
-                String sql ="select * from "+s.getTableName()+"t where  t.behospitalCode='"+s.getBehospitalCode()+"'" ;
+                String sql ="select * from "+s.getTableName()+" t where  t.behospitalCode='"+s.getBehospitalCode()+"'" ;
                 List<HisHomePageVO> homePage =fjtzdbConnHarp.getHomePage(sql);
                 if (homePage.size()>0) {
                     aHomePageFacade.getOneList(homePage);//病案首页
                     /**
                      * 病案首页诊断
                      */
-                    String sql01="select * from  med_home_diagnose_info  where "+"t.homePage='"+homePage.get(0).getHomePageId()+"'" ;
+                    String sql01="select * from  med_home_diagnose_info  where "+" homePageId='"+homePage.get(0).getHomePageId()+"'" ;
                     List<HomeDiagnoseInfo> homeDiagnoseInfos =fjtzdbConnHarp.getHomeDiagnose(sql01);
                     if (homeDiagnoseInfos.size()>0) {
                         aHomeDiagnoseInfoFacade.execute(homeDiagnoseInfos);//病案首页诊断
@@ -534,21 +553,19 @@ public class StructuralDataFacade {
                     /**
                      * 病案首页手术
                      */
-                    String sql02="select * from  med_home_operation_info  where "+"t.homePage='"+homePage.get(0).getHomePageId()+"'" ;
+                    String sql02="select * from  med_home_operation_info  where "+" homePageId='"+homePage.get(0).getHomePageId()+"'" ;
                     List<HomeOperationInfo> homeOperationInfos =fjtzdbConnHarp.getHomeOperation(sql02);
                     if (homeOperationInfos.size()>0) {
                         aHomeOperationInfoFacade.execute(homeOperationInfos);//病案首页手术
                     }
                 }
             }else if ("医嘱信息".equals(modelName)){
-                String sql="select * from  med_doctor_advice  where "+"t.behospitalCode='"+s.getBehospitalCode()+"'";
-                List<DoctorAdvice> doctorAdvice =fjtzdbConnHarp.getDoctorAdvice(sql);
+                List<DoctorAdvice> doctorAdvice =fjtzdbConnHarp.getDoctorAdvice(this.sqlOld(s));
                 if (doctorAdvice.size()>0){
                     aDoctorAdviceFacade.execute(doctorAdvice);
                 }
             }else if ("入院登记".equals(modelName)){
-                String sql ="select * from "+s.getTableName()+"t where  t.behospitalCode='"+s.getBehospitalCode()+"'" ;
-                List<BehospitalInfo> behospitalInfo =fjtzdbConnHarp.getBehospitalInfo(sql);
+                List<BehospitalInfo> behospitalInfo =fjtzdbConnHarp.getBehospitalInfo(this.sqlOld(s));
                 if (behospitalInfo.size()>0){
                     aBehospitalInfoFacade.execute(behospitalInfo);
                 }
@@ -580,8 +597,7 @@ public class StructuralDataFacade {
             }else if("入院记录".equals(modelName)){
                 List<FJStrAdmissionNoteVo> medAdmissionNote =fjtzdbConnHarp.getMedAdmissionNote(this.sqlOld(s));
                 if (medAdmissionNote.size()>0){
-
-                    aStrAdmissionNoteFacade.getOneList(medAdmissionNote);
+                    aStrAdmissionNoteFacade.getOneList(medAdmissionNote,modelName);
                 }
             }else if("危急值记录".equals(modelName)){
                 List<StrCrisisNote> medCrisisNote =fjtzdbConnHarp.getMedCrisisNote(this.sqlOld(s));
@@ -622,7 +638,7 @@ public class StructuralDataFacade {
             return RespDTO.onSuc(map);
         } else if (structuralDataVos.getDockModeType().equals("2")) {
             AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
-            analyzeRunVO.setBehospitalCode(structuralDataVos.getBehospitalCode()+structuralDataVos.getBehospitalId());
+            analyzeRunVO.setBehospitalCode(structuralDataVos.getBehospitalCode());
             analyzeRunVO.setHospitalId(Long.valueOf(structuralDataVos.getHospitalId()));
             analyzeRunVO.setModeId(Long.valueOf(structuralDataVos.getModeId()));
             AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
@@ -683,7 +699,7 @@ public class StructuralDataFacade {
      * @return
      */
     public String sql(StructuralDataVo s){
-        String sql ="select * from "+s.getTableName()+" t where  t.behospitalCode='"+s.getBehospitalCode()+"' and t.recId='"+s.getRecTypeId()+"'" ;
+        String sql ="select * from  "+s.getTableName()+"  t where  t.behospitalCode='"+s.getBehospitalCode()+"' and t.recId= '"+s.getRecId()+"'" ;
 
         return sql;
     }

+ 25 - 7
src/main/java/com/diagbot/util/FJTZDBConnHarp.java

@@ -205,6 +205,24 @@ public class FJTZDBConnHarp {
 		return homePageList;
 	}
 
+
+	public List<String> getBehospitalInfoDate(String sql) {
+		List<String> strings=Lists.newLinkedList();
+		try {
+			FJTZDBConnHarp dbconn=new FJTZDBConnHarp();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				String s=(rs.getString("behospitalCode"));//病人住院ID
+				strings.add(s);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return strings;
+	}
+
 	/**
 	 * 获取病人登录信息
 	 * @return
@@ -367,8 +385,8 @@ public class FJTZDBConnHarp {
 				strInformedConsent.setRecId(rs.getString("recId"));
 				strInformedConsent.setHospitalId(rs.getLong("hospitalId"));
 				strInformedConsent.setBehospitalCode(rs.getString("behospitalCode"));
-				strInformedConsent.setRecTitle("recTitle");
-				strInformedConsent.setRecType("recType");
+				strInformedConsent.setRecTitle(rs.getString("recTitle"));
+				strInformedConsent.setRecType(rs.getString("recType"));
 				strInformedConsents.add(strInformedConsent);
 			}
 		} catch (Exception e) {
@@ -395,8 +413,8 @@ public class FJTZDBConnHarp {
 				strTalkInform.setRecId(rs.getString("recId"));
 				strTalkInform.setHospitalId(rs.getLong("hospitalId"));
 				strTalkInform.setBehospitalCode(rs.getString("behospitalCode"));
-				strTalkInform.setRecTitle("recTitle");
-				strTalkInform.setRecType("recType");
+				strTalkInform.setRecTitle(rs.getString("recTitle"));
+				strTalkInform.setRecType(rs.getString("recType"));
 				strTalkInforms.add(strTalkInform);
 			}
 		} catch (Exception e) {
@@ -421,7 +439,7 @@ public class FJTZDBConnHarp {
 			while(rs.next()){
 				MedLisResult medLisResult=new MedLisResult();
 				medLisResult.setRepNo(rs.getString("recId"));//报告单号
-				medLisResult.setHospitalId(rs.getLong("behospitalCode"));
+				medLisResult.setHospitalId(rs.getLong("hospitalId"));
 				medLisResult.setBehospitalCode(rs.getString("behospitalCode"));//住院病人id
 				medLisResult.setItemCode(rs.getString("itemCode"));//报告代码
 				medLisResult.setItemName(rs.getString("itemName"));//报告名称
@@ -626,7 +644,7 @@ public class FJTZDBConnHarp {
 				medWardRecord.setWardP(rs.getString("wardP"));// P
 				medWardRecord.setRecDoctor(rs.getString("recDoctor"));//记录医生
 				medWardRecord.setAuditDoctor(rs.getString("auditDoctor"));//审核医生
-				medWardRecord.setWholeData(rs.getString("wholeData"));//结构化数据
+				medWardRecord.setWholeData(rs.getString("wholeDate"));//结构化数据
 
 
 				if(null!=(rs.getString("recDate"))) {
@@ -683,7 +701,6 @@ public class FJTZDBConnHarp {
 				hisViewVo.setKeyCN(rs.getString("key_cn"));//字段中文名
 				hisViewVo.setDeValue1(rs.getString("de_value1"));//字段值1
 				hisViewVo.setDeValue2(rs.getString("de_value2"));//字段值2
-
 				if(null!=(rs.getString("deathDate"))){
 					hisViewVo.setDeathDate(DateUtil.parseDate(rs.getString("deathDate"),DateUtil.DATE_TIME_FORMAT));//死亡时间
 				}
@@ -790,6 +807,7 @@ public class FJTZDBConnHarp {
 				hisViewVo.setDeValue(rs.getString("de_value"));//字段值
 
 
+
 				if(null!=(rs.getString("recordDate"))){
 					hisViewVo.setRecordDate(DateUtil.parseDate(rs.getString("recordDate"),DateUtil.DATE_TIME_FORMAT));//质控日期
 				}

+ 2 - 7
src/main/java/com/diagbot/vo/data/StructuralDataVo.java

@@ -11,14 +11,10 @@ public class StructuralDataVo {
      * 病历号
      */
     private  String behospitalCode;
-    /**
-     * 病人id
-     */
-    private String behospitalId;
     /**
      * 文书id
      */
-    private String recTypeId;
+    private String recId;
 
     /**
      * 模板表名字
@@ -32,14 +28,13 @@ public class StructuralDataVo {
     /**
      * 入院时间
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 所对应的模板
      */
     private String modeId;
 
-    @NotBlank(message = "对接模式类型编码不能为空")
     private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
 
 }

+ 11 - 5
src/main/java/com/diagbot/web/DataController.java

@@ -85,11 +85,17 @@ public class DataController {
         return structuralDataFacade.sendStructuralData(structuralDataVos);
     }
 
-    @ApiOperation(value = "{根据时间来历史病例导入 格式yyyymmdd}")
-    @PostMapping("/sendStructuralDataOld")
-    @SysLogger("sendStructuralDataOld")
-    public void sendStructuralDataOld(@Valid @RequestBody StructuralDataVo structuralDataVos){
-         structuralDataFacade.executeOld(structuralDataVos);
+    @ApiOperation(value = "{历史病例导入单个病人}")
+    @PostMapping("/sendStructuralOneOld")
+    @SysLogger("sendStructuralOneOld")
+    public void sendStructuralOneOld(@Valid @RequestBody List<String> behospitalCode){
+         structuralDataFacade.sendOnebehospitalCode(behospitalCode);
+    }
+    @ApiOperation(value = "{历史病例导入时间格式}")
+    @PostMapping("/sendStructuralDateOld")
+    @SysLogger("sendStructuralDateOld")
+    public void sendStructuralDateOld(@Valid @RequestBody StructuralDataVo structuralDataVos){
+        structuralDataFacade.sendStructuralDataOld(structuralDataVos);
     }
 
     @ApiOperation(value = "终末质控-文书信息")

+ 3 - 3
src/main/resources/application-local.yml

@@ -59,9 +59,9 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://127.0.0.1/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.12.181/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
-      password: root
+      password: lt@great
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -111,7 +111,7 @@ spring:
     database:
       cache: 8 # cache索引
       token: 8 # Token索引
-    host: 192.168.2.122  #Redis服务器地址
+    host: 192.168.12.182  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:

+ 2 - 2
src/main/resources/application-test.yml

@@ -59,9 +59,9 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.241:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://127.0.0.1:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
-      password: lantone
+      password: root
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5

+ 8 - 3
src/main/resources/jdbc.properties

@@ -4,10 +4,15 @@
 #jdbc.username=root
 #jdbc.password=root
 
+#jdbc.driverClassName=oracle.jdbc.OracleDriver
+#jdbc.url=jdbc:oracle:thin:@192.168.2.102:1521/ORCL
+#jdbc.username=qymz
+#jdbc.password=qymz
+
 jdbc.driverClassName=oracle.jdbc.OracleDriver
-jdbc.url=jdbc:oracle:thin:@192.168.2.102:1521/ORCL
-jdbc.username=qymz
-jdbc.password=qymz
+jdbc.url=jdbc:oracle:thin:@192.168.12.88:1521/KEMR
+jdbc.username=langtong
+jdbc.password=xmdwyylt
 
 #jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
 #jdbc.url=jdbc:sqlserver://192.168.100.39\\tzmhemr;DatabaseName=bigemr