浏览代码

添加部分方法日志记录

shiyue 3 年之前
父节点
当前提交
d0751171b0

+ 61 - 57
src/main/java/com/diagbot/facade/str/AStrConsultationApplyFacade.java

@@ -49,40 +49,42 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
     private AMedicalRecordContentFacade aMedicalRecordContentFacade;
     @Autowired
     private AMedicalRecordFacade aMedicalRecordFacade;
+
     /**
      * 把得到的list变成一个对象
+     *
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos,String modeId) {
+    public void getOneList(List<HisViewVo> hisViewVos, String modeId) {
         try {
-            Map<String,Object> map =new HashMap<>();
-            Map<String,Object> wholeData =new HashMap<>();
+            Map<String, Object> map = new HashMap<>();
+            Map<String, Object> wholeData = new HashMap<>();
             String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
-            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
+            Map<String, String> tableKey = columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
-            for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null) {
+            for (HisViewVo s : hisViewVos) {
+                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());
+                } else {
+                    wholeData.put(s.getKeyCN(), s.getDeValue());
                 }
             }
-            StrConsultationApply strConsultationApply =new StrConsultationApply();
+            StrConsultationApply strConsultationApply = new StrConsultationApply();
             AStrConsultationApplyVO strConsultationApplyVo = (AStrConsultationApplyVO) MapUtil.mapToObject(map, AStrConsultationApplyVO.class);
-            BeanUtils.copyProperties(strConsultationApplyVo,strConsultationApply);
+            BeanUtils.copyProperties(strConsultationApplyVo, strConsultationApply);
 
-            strConsultationApply.setConsultationDate(DateUtil.parseDate(strConsultationApplyVo.getConsultationDate(),"yyyy-MM-dd HH:mm"));//开始时间
+            strConsultationApply.setConsultationDate(DateUtil.parseDate(strConsultationApplyVo.getConsultationDate(), "yyyy-MM-dd HH:mm"));//开始时间
 
-            BeanUtils.copyProperties(hisViewVos.get(0),strConsultationApply);
+            BeanUtils.copyProperties(hisViewVos.get(0), strConsultationApply);
             strConsultationApply.setWholeData(JSON.toJSONString(wholeData));
 
             aMedicalRecordContentFacade.executeByView(hisViewVos.get(0));
-            aMedicalRecordFacade.executeByView(hisViewVos.get(0),modeId);
+            aMedicalRecordFacade.executeByView(hisViewVos.get(0), modeId);
 
             this.dealData(strConsultationApply);
         } catch (Exception e) {
@@ -91,28 +93,28 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
         }
     }
 
-    public void getColumnZhAndCh(){
-        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
-        list.forEach(s->{
+    public void getColumnZhAndCh() {
+        List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+        list.forEach(s -> {
             s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
         });
 
-        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
-        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationApply");
+        Map<String, String> columnMap = EntityUtil.makeMapWithKeyValue(list, "ch", "en");
+        Boolean flag = columnFacade.createColumn(columnMap, "strConsultationApply");
 
         //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
-        if(!flag){
+        if (!flag) {
             return;
         }
     }
 
 
     //会诊申请单
-    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
-        StrConsultationApply strConsultationApply=new StrConsultationApply();
+    public void dealData(String columnMap, Map<String, Object> entityMap, Long hospitalId) {
+        StrConsultationApply strConsultationApply = new StrConsultationApply();
         try {
-            AStrConsultationApplyVO strConsultationApplyVO=(AStrConsultationApplyVO) MapUtil.mapToObject(entityMap, AStrConsultationApplyVO.class);
-            BeanUtils.copyProperties(strConsultationApplyVO,strConsultationApply);
+            AStrConsultationApplyVO strConsultationApplyVO = (AStrConsultationApplyVO) MapUtil.mapToObject(entityMap, AStrConsultationApplyVO.class);
+            BeanUtils.copyProperties(strConsultationApplyVO, strConsultationApply);
             strConsultationApply.setHospitalId(hospitalId);//医院编码
 
             strConsultationApply.setAuditDate(DateUtil.parseDateTime(strConsultationApplyVO.getAuditDate()));//审核时间
@@ -123,33 +125,33 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
             strConsultationApply.setConsultationDate(DateUtil.parseDateTime(strConsultationApplyVO.getConsultationDate()));//会诊时间
             strConsultationApply.setWholeData(columnMap);
             //判断数据库中是否存在,不存在insert
-            if(isExist(strConsultationApply)){
+            if (isExist(strConsultationApply)) {
                 strConsultationApply.setGmtCreate(new Date());//记录创建时间
                 this.save(strConsultationApply);
-            }else{
+            } else {
                 strConsultationApply.setGmtModified(new Date());//记录修改时间
-                this.update(strConsultationApply,new QueryWrapper<StrConsultationApply>()
+                this.update(strConsultationApply, new QueryWrapper<StrConsultationApply>()
                         .eq("rec_id", strConsultationApply.getRecId())
                         .eq("hospital_id", strConsultationApply.getHospitalId())
                         .eq("behospital_code", strConsultationApply.getBehospitalCode())
-                        .eq("is_deleted","N"));
+                        .eq("is_deleted", "N"));
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单",strConsultationApply.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", strConsultationApply.getRecId(), JSON.toJSONString(entityMap), "", e.getMessage());
         }
 
     }
 
-    public Boolean isExist(StrConsultationApply strConsultationApply){
-        Boolean flag=true;
+    public Boolean isExist(StrConsultationApply strConsultationApply) {
+        Boolean flag = true;
         int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationApply>()
                 .eq("rec_id", strConsultationApply.getRecId())
                 .eq("hospital_id", strConsultationApply.getHospitalId())
                 .eq("behospital_code", strConsultationApply.getBehospitalCode()));
-        if(count>0){
-            flag=false;
+        if (count > 0) {
+            flag = false;
         }
         return flag;
     }
@@ -182,51 +184,53 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
         }
     }
 
-    public void dealData(StrConsultationApply medConsultationApply){
+    public void dealData(StrConsultationApply medConsultationApply) {
         try {
             //判断数据库中是否存在,不存在insert
-            if(isExist(medConsultationApply)){
+            if (isExist(medConsultationApply)) {
                 medConsultationApply.setGmtCreate(new Date());//记录创建时间
                 this.save(medConsultationApply);
-            }else{
+                aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "新增会诊申请单");
+            } else {
                 medConsultationApply.setGmtModified(new Date());//记录修改时间
-                this.update(medConsultationApply,new QueryWrapper<StrConsultationApply>()
+                this.update(medConsultationApply, new QueryWrapper<StrConsultationApply>()
                         .eq("rec_id", medConsultationApply.getRecId())
                         .eq("hospital_id", medConsultationApply.getHospitalId())
                         .eq("behospital_code", medConsultationApply.getBehospitalCode()));
+                aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "修改会诊申请单");
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单",medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "会诊申请单出错:" + e.getMessage());
         }
 
     }
 
-    public RespDTO execDealData(List<StrConsultationApplyVO> list){
-        if(list!=null && list.size()>0){
+    public RespDTO execDealData(List<StrConsultationApplyVO> list) {
+        if (list != null && list.size() > 0) {
             //循环验证数据有效性
-            for (StrConsultationApplyVO strConsultationApplyVO:list) {
-                if("".equals(strConsultationApplyVO.getRecId())) {
+            for (StrConsultationApplyVO strConsultationApplyVO : list) {
+                if ("".equals(strConsultationApplyVO.getRecId())) {
                     return RespDTO.onError("请输入记录编号!");
-                }else if(strConsultationApplyVO.getHospitalId()==null){
+                } else if (strConsultationApplyVO.getHospitalId() == null) {
                     return RespDTO.onError("请输入医院编码!");
-                }else if("".equals(strConsultationApplyVO.getBehospitalCode())){
+                } else if ("".equals(strConsultationApplyVO.getBehospitalCode())) {
                     return RespDTO.onError("请输入病人住院编码!");
                 }
             }
             //初始、格式化数据
-            List<StrConsultationApply> strConsultationApplyList= Lists.newArrayList();
-            strConsultationApplyList= BeanUtil.listCopyTo(list,StrConsultationApply.class);
+            List<StrConsultationApply> strConsultationApplyList = Lists.newArrayList();
+            strConsultationApplyList = BeanUtil.listCopyTo(list, StrConsultationApply.class);
             execute(strConsultationApplyList);
 
             return RespDTO.onSuc(strConsultationApplyList);
-        }else{
+        } else {
             return RespDTO.onError("未接收到数据!");
         }
     }
 
-    public void execute(List<StrConsultationApply> list){
+    public void execute(List<StrConsultationApply> list) {
         try {
             List<StrConsultationApply> addE = Lists.newLinkedList();
             List<StrConsultationApply> updateE = Lists.newLinkedList();
@@ -235,7 +239,7 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
                     StrConsultationApply strConsultationApply = this.getOne(new QueryWrapper<StrConsultationApply>()
                             .eq("rec_id", s.getRecId())
                             .eq("hospital_id", s.getHospitalId())
-                            .eq("behospital_code",s.getBehospitalCode()), false);
+                            .eq("behospital_code", s.getBehospitalCode()), false);
                     if (strConsultationApply != null) {
                         s.setGmtModified(new Date());
                         updateE.add(s);
@@ -245,15 +249,15 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
                     }
                 });
             }
-            if(addE.size()>0){
+            if (addE.size() > 0) {
                 strConsultationApplyService.saveBatch(addE);
             }
-            if(updateE.size()>0){
+            if (updateE.size() > 0) {
                 this.baseMapper.updateBatchByKey(updateE);
             }
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单","", JSON.toJSONString(list),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单", "", JSON.toJSONString(list), "", e.getMessage());
         }
     }
 

+ 60 - 56
src/main/java/com/diagbot/facade/str/AStrConsultationNoteFacade.java

@@ -50,37 +50,39 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
     private AMedicalRecordContentFacade aMedicalRecordContentFacade;
     @Autowired
     private AMedicalRecordFacade aMedicalRecordFacade;
+
     /**
      * 把得到的list变成一个对象
+     *
      * @param
      */
-    public  void getOneList(List<HisViewVo> hisViewVos,String modeId) {
+    public void getOneList(List<HisViewVo> hisViewVos, String modeId) {
         try {
-            Map<String,Object> map =new HashMap<>();
-            Map<String,Object> wholeData =new HashMap<>();
+            Map<String, Object> map = new HashMap<>();
+            Map<String, Object> wholeData = new HashMap<>();
             String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
-            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
+            Map<String, String> tableKey = columnFacade.getColumn(CacheKeyEnum.getName(modelName));
             //循环list根据咱字段的名称来跟得到的数据来做比较
-            for (HisViewVo s: hisViewVos) {
-                if (s.getKeyEn()!=null) {
+            for (HisViewVo s : hisViewVos) {
+                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());
+                } else {
+                    wholeData.put(s.getKeyCN(), s.getDeValue());
                 }
             }
-            StrConsultationNote strConsultationNote =new StrConsultationNote();
+            StrConsultationNote strConsultationNote = new StrConsultationNote();
             AStrConsultationNoteVO aStrConsultationNote = (AStrConsultationNoteVO) MapUtil.mapToObject(map, StrConsultationNote.class);
-            BeanUtils.copyProperties(aStrConsultationNote,strConsultationNote);
-            BeanUtils.copyProperties(hisViewVos.get(0),strConsultationNote);
+            BeanUtils.copyProperties(aStrConsultationNote, strConsultationNote);
+            BeanUtils.copyProperties(hisViewVos.get(0), strConsultationNote);
             strConsultationNote.setWholeData(JSON.toJSONString(wholeData));
 
             aMedicalRecordContentFacade.executeByView(hisViewVos.get(0));
-            aMedicalRecordFacade.executeByView(hisViewVos.get(0),modeId);
+            aMedicalRecordFacade.executeByView(hisViewVos.get(0), modeId);
 
             this.dealData(strConsultationNote);
         } catch (Exception e) {
@@ -89,28 +91,28 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
         }
     }
 
-    public void getColumnZhAndCh(){
-        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
-        list.forEach(s->{
+    public void getColumnZhAndCh() {
+        List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+        list.forEach(s -> {
             s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
         });
 
-        Map<String, String> columnMap=EntityUtil.makeMapWithKeyValue(list,"ch","en");
-        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationNote");
+        Map<String, String> columnMap = EntityUtil.makeMapWithKeyValue(list, "ch", "en");
+        Boolean flag = columnFacade.createColumn(columnMap, "strConsultationNote");
 
         //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
-        if(!flag){
+        if (!flag) {
             return;
         }
     }
 
 
     //会诊单(申请和结果)
-    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
-        StrConsultationNote strConsultationNote=new StrConsultationNote();
+    public void dealData(String columnMap, Map<String, Object> entityMap, Long hospitalId) {
+        StrConsultationNote strConsultationNote = new StrConsultationNote();
         try {
-            AStrConsultationNoteVO strConsultationNoteVO=(AStrConsultationNoteVO) MapUtil.mapToObject(entityMap, AStrConsultationNoteVO.class);
-            BeanUtils.copyProperties(strConsultationNoteVO,strConsultationNote);
+            AStrConsultationNoteVO strConsultationNoteVO = (AStrConsultationNoteVO) MapUtil.mapToObject(entityMap, AStrConsultationNoteVO.class);
+            BeanUtils.copyProperties(strConsultationNoteVO, strConsultationNote);
             strConsultationNote.setHospitalId(hospitalId);//医院编码
 
             strConsultationNote.setAuditDate(DateUtil.parseDateTime(strConsultationNoteVO.getAuditDate()));//审核时间
@@ -122,33 +124,33 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
 
             strConsultationNote.setWholeData(columnMap);
             //判断数据库中是否存在,不存在insert
-            if(isExist(strConsultationNote)){
+            if (isExist(strConsultationNote)) {
                 strConsultationNote.setGmtCreate(new Date());//记录创建时间
                 this.save(strConsultationNote);
-            }else{
+            } else {
                 strConsultationNote.setGmtModified(new Date());//记录修改时间
-                this.update(strConsultationNote,new QueryWrapper<StrConsultationNote>()
+                this.update(strConsultationNote, new QueryWrapper<StrConsultationNote>()
                         .eq("rec_id", strConsultationNote.getRecId())
                         .eq("hospital_id", strConsultationNote.getHospitalId())
                         .eq("behospital_code", strConsultationNote.getBehospitalCode())
-                        .eq("is_deleted","N"));
+                        .eq("is_deleted", "N"));
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)",strConsultationNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)", strConsultationNote.getRecId(), JSON.toJSONString(entityMap), "", e.getMessage());
         }
 
     }
 
-    public Boolean isExist(StrConsultationNote strConsultationNote){
-        Boolean flag=true;
+    public Boolean isExist(StrConsultationNote strConsultationNote) {
+        Boolean flag = true;
         int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationNote>()
                 .eq("rec_id", strConsultationNote.getRecId())
                 .eq("hospital_id", strConsultationNote.getHospitalId())
                 .eq("behospital_code", strConsultationNote.getBehospitalCode()));
-        if(count>0){
-            flag=false;
+        if (count > 0) {
+            flag = false;
         }
         return flag;
     }
@@ -181,51 +183,53 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
         }
     }
 
-    public void dealData(StrConsultationNote medConsultationNote){
+    public void dealData(StrConsultationNote medConsultationNote) {
         try {
             //判断数据库中是否存在,不存在insert
-            if(isExist(medConsultationNote)){
+            if (isExist(medConsultationNote)) {
                 medConsultationNote.setGmtCreate(new Date());//记录创建时间
                 this.save(medConsultationNote);
-            }else{
+                aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)", medConsultationNote.getRecId(), JSON.toJSONString(medConsultationNote), "", "新增会诊单(申请和结果)");
+            } else {
                 medConsultationNote.setGmtModified(new Date());//记录修改时间
-                this.update(medConsultationNote,new QueryWrapper<StrConsultationNote>()
+                this.update(medConsultationNote, new QueryWrapper<StrConsultationNote>()
                         .eq("rec_id", medConsultationNote.getRecId())
                         .eq("hospital_id", medConsultationNote.getHospitalId())
                         .eq("behospital_code", medConsultationNote.getBehospitalCode()));
+                aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)", medConsultationNote.getRecId(), JSON.toJSONString(medConsultationNote), "", "修改会诊单(申请和结果)");
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)",medConsultationNote.getRecId(), JSON.toJSONString(medConsultationNote),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)", medConsultationNote.getRecId(), JSON.toJSONString(medConsultationNote), "", "会诊单(申请和结果)出错:" + e.getMessage());
         }
 
     }
 
-    public RespDTO execDealData(List<StrConsultationNoteVO> list){
-        if(list!=null && list.size()>0){
+    public RespDTO execDealData(List<StrConsultationNoteVO> list) {
+        if (list != null && list.size() > 0) {
             //循环验证数据有效性
-            for (StrConsultationNoteVO strConsultationNoteVO:list) {
-                if("".equals(strConsultationNoteVO.getRecId())) {
+            for (StrConsultationNoteVO strConsultationNoteVO : list) {
+                if ("".equals(strConsultationNoteVO.getRecId())) {
                     return RespDTO.onError("请输入记录编号!");
-                }else if(strConsultationNoteVO.getHospitalId()==null){
+                } else if (strConsultationNoteVO.getHospitalId() == null) {
                     return RespDTO.onError("请输入医院编码!");
-                }else if("".equals(strConsultationNoteVO.getBehospitalCode())){
+                } else if ("".equals(strConsultationNoteVO.getBehospitalCode())) {
                     return RespDTO.onError("请输入病人住院编码!");
                 }
             }
             //初始、格式化数据
-            List<StrConsultationNote> strConsultationNoteList= Lists.newArrayList();
-            strConsultationNoteList= BeanUtil.listCopyTo(list,StrConsultationNote.class);
+            List<StrConsultationNote> strConsultationNoteList = Lists.newArrayList();
+            strConsultationNoteList = BeanUtil.listCopyTo(list, StrConsultationNote.class);
             execute(strConsultationNoteList);
 
             return RespDTO.onSuc(strConsultationNoteList);
-        }else{
+        } else {
             return RespDTO.onError("未接收到数据!");
         }
     }
 
-    public void execute(List<StrConsultationNote> list){
+    public void execute(List<StrConsultationNote> list) {
         try {
             List<StrConsultationNote> addE = Lists.newLinkedList();
             List<StrConsultationNote> updateE = Lists.newLinkedList();
@@ -234,7 +238,7 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
                     StrConsultationNote strConsultationNote = this.getOne(new QueryWrapper<StrConsultationNote>()
                             .eq("rec_id", s.getRecId())
                             .eq("hospital_id", s.getHospitalId())
-                            .eq("behospital_code",s.getBehospitalCode()), false);
+                            .eq("behospital_code", s.getBehospitalCode()), false);
                     if (strConsultationNote != null) {
                         s.setGmtModified(new Date());
                         updateE.add(s);
@@ -244,15 +248,15 @@ public class AStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
                     }
                 });
             }
-            if(addE.size()>0){
+            if (addE.size() > 0) {
                 strConsultationNoteService.saveBatch(addE);
             }
-            if(updateE.size()>0){
+            if (updateE.size() > 0) {
                 this.baseMapper.updateBatchByKey(updateE);
             }
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单","", JSON.toJSONString(list),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单", "", JSON.toJSONString(list), "", e.getMessage());
         }
     }
 

+ 66 - 69
src/main/java/com/diagbot/facade/str/AStrCrisisNoteFacade.java

@@ -53,25 +53,25 @@ public class AStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
     private AMedicalRecordFacade aMedicalRecordFacade;
 
 
-    public void getColumnZhAndCh(){
-        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
-        list.forEach(s->{
+    public void getColumnZhAndCh() {
+        List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+        list.forEach(s -> {
             s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
         });
 
-        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
-        Boolean flag=columnFacade.createColumn(columnMap,"strCrisisNote");
-        if(!flag){
+        Map<String, String> columnMap = EntityUtil.makeMapWithKeyValue(list, "ch", "en");
+        Boolean flag = columnFacade.createColumn(columnMap, "strCrisisNote");
+        if (!flag) {
             return;
         }
     }
 
 
-    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
-        StrCrisisNote strCrisisNote=new StrCrisisNote();
+    public void dealData(String columnMap, Map<String, Object> entityMap, Long hospitalId) {
+        StrCrisisNote strCrisisNote = new StrCrisisNote();
         try {
-            AStrCrisisNoteVO strCrisisNoteVO=(AStrCrisisNoteVO) MapUtil.mapToObject(entityMap, AStrCrisisNoteVO.class);
-            BeanUtils.copyProperties(strCrisisNoteVO,strCrisisNote);
+            AStrCrisisNoteVO strCrisisNoteVO = (AStrCrisisNoteVO) MapUtil.mapToObject(entityMap, AStrCrisisNoteVO.class);
+            BeanUtils.copyProperties(strCrisisNoteVO, strCrisisNote);
             strCrisisNote.setHospitalId(hospitalId);//医院编码
 
             strCrisisNote.setAuditDate(DateUtil.parseDateTime(strCrisisNoteVO.getAuditDate()));//审核时间
@@ -84,32 +84,32 @@ public class AStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
 
 
             //判断数据库中是否存在,不存在insert
-            if(isExist(strCrisisNote)){
+            if (isExist(strCrisisNote)) {
                 strCrisisNote.setGmtCreate(new Date());//记录创建时间
                 this.save(strCrisisNote);
-            }else{
+            } else {
                 strCrisisNote.setGmtModified(new Date());//记录修改时间
-                this.update(strCrisisNote,new QueryWrapper<StrCrisisNote>()
+                this.update(strCrisisNote, new QueryWrapper<StrCrisisNote>()
                         .eq("rec_id", strCrisisNote.getRecId())
                         .eq("hospital_id", strCrisisNote.getHospitalId())
                         .eq("behospital_code", strCrisisNote.getBehospitalCode()));
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录",strCrisisNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录", strCrisisNote.getRecId(), JSON.toJSONString(entityMap), "", e.getMessage());
         }
 
     }
 
-    public Boolean isExist(StrCrisisNote strCrisisNote){
-        Boolean flag=true;
+    public Boolean isExist(StrCrisisNote strCrisisNote) {
+        Boolean flag = true;
         int count = this.baseMapper.selectCount(new QueryWrapper<StrCrisisNote>()
                 .eq("rec_id", strCrisisNote.getRecId())
                 .eq("hospital_id", strCrisisNote.getHospitalId())
                 .eq("behospital_code", strCrisisNote.getBehospitalCode()));
-        if(count>0){
-            flag=false;
+        if (count > 0) {
+            flag = false;
         }
         return flag;
     }
@@ -142,105 +142,102 @@ public class AStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
         }
     }
 
-    public void dealData(AStrCrisisNoteVO medCrisisNoteVo,String modeId){
+    public void dealData(AStrCrisisNoteVO medCrisisNoteVo, String modeId) {
         try {
 
-            Map<String,Object> listMap =this.objectToMap(medCrisisNoteVo);
-            Map<String,Object> map = new HashMap<>();
+            Map<String, Object> listMap = this.objectToMap(medCrisisNoteVo);
+            Map<String, Object> map = new HashMap<>();
             String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
             //得到表所对应的中文名和英文名
-            Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName) );
-            if (listMap.size()>0){
-                listMap.forEach((k,v)->{
-                    tableKey.forEach((tableK,tableV)->{
-                        if (k.equals(tableV) && null!=v){
-                            map.put(tableK,v.toString());
+            Map<String, String> tableKey = columnFacade.getColumn(CacheKeyEnum.getName(modelName));
+            if (listMap.size() > 0) {
+                listMap.forEach((k, v) -> {
+                    tableKey.forEach((tableK, tableV) -> {
+                        if (k.equals(tableV) && null != v) {
+                            map.put(tableK, v.toString());
                         }
                     });
                 });
             }
-            StrCrisisNote strCrisisNote =new StrCrisisNote();
-            BeanUtils.copyProperties(medCrisisNoteVo,strCrisisNote);
+            StrCrisisNote strCrisisNote = new StrCrisisNote();
+            BeanUtils.copyProperties(medCrisisNoteVo, strCrisisNote);
             strCrisisNote.setHospitalId(Long.valueOf(medCrisisNoteVo.getHospitalId()));
 
-            strCrisisNote.setRecordDate(DateUtil.parseDate(medCrisisNoteVo.getRecordDate(),"yyyy-MM-dd HH:mm:ss"));//出生日期
-            strCrisisNote.setRecieveDate(DateUtil.parseDate(medCrisisNoteVo.getRecieveDate(),"yyyy-MM-dd HH:mm:ss"));//病历日期
-
+            strCrisisNote.setRecordDate(DateUtil.parseDate(medCrisisNoteVo.getRecordDate(), "yyyy-MM-dd HH:mm:ss"));//出生日期
+            strCrisisNote.setRecieveDate(DateUtil.parseDate(medCrisisNoteVo.getRecieveDate(), "yyyy-MM-dd HH:mm:ss"));//病历日期
 
 
-            HisViewVo hisViewVo =new HisViewVo();
-            BeanUtils.copyProperties(strCrisisNote,hisViewVo);
-
+            HisViewVo hisViewVo = new HisViewVo();
+            BeanUtils.copyProperties(strCrisisNote, hisViewVo);
 
 
             aMedicalRecordContentFacade.executeByView(hisViewVo);
-            aMedicalRecordFacade.executeByView(hisViewVo,"23");
+            aMedicalRecordFacade.executeByView(hisViewVo, "23");
 
 
             //判断数据库中是否存在,不存在insert
-            if(isExist(strCrisisNote)){
+            if (isExist(strCrisisNote)) {
                 strCrisisNote.setGmtCreate(new Date());//记录创建时间
                 strCrisisNote.setWholeData(JSON.toJSONString(map));
                 this.save(strCrisisNote);
-            }else{
+                aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录", medCrisisNoteVo.getRecId(), JSON.toJSONString(medCrisisNoteVo), "", "新增危急值记录");
+            } else {
                 strCrisisNote.setGmtModified(new Date());//记录修改时间
                 strCrisisNote.setWholeData(JSON.toJSONString(map));
-                this.update(strCrisisNote,new QueryWrapper<StrCrisisNote>()
+                this.update(strCrisisNote, new QueryWrapper<StrCrisisNote>()
                         .eq("rec_id", strCrisisNote.getRecId())
                         .eq("hospital_id", strCrisisNote.getHospitalId())
                         .eq("behospital_code", strCrisisNote.getBehospitalCode())
-                        .eq("is_deleted","N"));
+                        .eq("is_deleted", "N"));
+                aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录", medCrisisNoteVo.getRecId(), JSON.toJSONString(medCrisisNoteVo), "", "修改危急值记录");
             }
 
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录",medCrisisNoteVo.getRecId(), JSON.toJSONString(medCrisisNoteVo),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录", medCrisisNoteVo.getRecId(), JSON.toJSONString(medCrisisNoteVo), "", "危急值记录出错:" + e.getMessage());
         }
 
     }
 
-    private  Map<String,Object> objectToMap(Object o) throws IllegalAccessException {
-        if(null == o){
+    private Map<String, Object> objectToMap(Object o) throws IllegalAccessException {
+        if (null == o) {
             return null;
         }
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         Field[] declaredFields = o.getClass().getDeclaredFields();
-        for (Field field :declaredFields) {
+        for (Field field : declaredFields) {
             // (此处如果不设置 无法获取对象的私有属性)
             field.setAccessible(true);
-            map.put(field.getName(),field.get(o));
+            map.put(field.getName(), field.get(o));
         }
         return map;
     }
 
 
-
-
-
-    public RespDTO execDealData(List<StrCrisisNoteVO> list){
-        if(list!=null && list.size()>0){
+    public RespDTO execDealData(List<StrCrisisNoteVO> list) {
+        if (list != null && list.size() > 0) {
             //循环验证数据有效性
-            for (StrCrisisNoteVO strCrisisNoteVO:list) {
-                if("".equals(strCrisisNoteVO.getRecId())) {
+            for (StrCrisisNoteVO strCrisisNoteVO : list) {
+                if ("".equals(strCrisisNoteVO.getRecId())) {
                     return RespDTO.onError("请输入记录编号!");
-                }else if(strCrisisNoteVO.getHospitalId()==null){
+                } else if (strCrisisNoteVO.getHospitalId() == null) {
                     return RespDTO.onError("请输入医院编码!");
-                }else if("".equals(strCrisisNoteVO.getBehospitalCode())){
+                } else if ("".equals(strCrisisNoteVO.getBehospitalCode())) {
                     return RespDTO.onError("请输入病人住院编码!");
                 }
             }
             //初始、格式化数据
-            List<StrCrisisNote> strCrisisNoteList= Lists.newArrayList();
-            strCrisisNoteList= BeanUtil.listCopyTo(list,StrCrisisNote.class);
+            List<StrCrisisNote> strCrisisNoteList = Lists.newArrayList();
+            strCrisisNoteList = BeanUtil.listCopyTo(list, StrCrisisNote.class);
             execute(strCrisisNoteList);
 
             return RespDTO.onSuc(strCrisisNoteList);
-        }else{
+        } else {
             return RespDTO.onError("未接收到数据!");
         }
     }
 
-    public void execute(List<StrCrisisNote> list){
+    public void execute(List<StrCrisisNote> list) {
         try {
             List<StrCrisisNote> addE = Lists.newLinkedList();
             List<StrCrisisNote> updateE = Lists.newLinkedList();
@@ -249,7 +246,7 @@ public class AStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
                     StrCrisisNote strCrisisNote = this.getOne(new QueryWrapper<StrCrisisNote>()
                             .eq("rec_id", s.getRecId())
                             .eq("hospital_id", s.getHospitalId())
-                            .eq("behospital_code",s.getBehospitalCode()), false);
+                            .eq("behospital_code", s.getBehospitalCode()), false);
                     if (strCrisisNote != null) {
                         s.setGmtModified(new Date());
                         updateE.add(s);
@@ -259,15 +256,15 @@ public class AStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
                     }
                 });
             }
-            if(addE.size()>0){
+            if (addE.size() > 0) {
                 strCrisisNoteService.saveBatch(addE);
             }
-            if(updateE.size()>0){
+            if (updateE.size() > 0) {
                 this.baseMapper.updateBatchByKey(updateE);
             }
-        }catch (Exception e){
-            log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-危急值记录","", JSON.toJSONString(list),"",e.getMessage());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-危急值记录", "", JSON.toJSONString(list), "", e.getMessage());
         }
     }
 }

+ 3 - 3
src/main/java/com/diagbot/facade/str/AStrInvasiveOperativeNoteFacade.java

@@ -55,6 +55,7 @@ public class AStrInvasiveOperativeNoteFacade extends StrInvasiveOperativeNoteSer
             if (isExist(strInvasiveOperativeNote)) {
                 strInvasiveOperativeNote.setGmtCreate(LocalDateTime.now());//记录创建时间
                 this.save(strInvasiveOperativeNote);
+                aMedAbnormalInfoFacade.saveAbnormalInfo("有创操作", strInvasiveOperativeNote.getRecId(), JSON.toJSONString(strInvasiveOperativeNote), "", "新增有创操作");
             } else {
                 strInvasiveOperativeNote.setGmtModified(LocalDateTime.now());//记录修改时间
                 strInvasiveOperativeNote.setIsDeleted("N");
@@ -62,11 +63,12 @@ public class AStrInvasiveOperativeNoteFacade extends StrInvasiveOperativeNoteSer
                         .eq("rec_id", strInvasiveOperativeNote.getRecId())
                         .eq("hospital_id", strInvasiveOperativeNote.getHospitalId())
                         .eq("behospital_code", strInvasiveOperativeNote.getBehospitalCode()));
+                aMedAbnormalInfoFacade.saveAbnormalInfo("有创操作", strInvasiveOperativeNote.getRecId(), JSON.toJSONString(strInvasiveOperativeNote), "", "更新有创操作");
             }
 
         } catch (Exception e) {
             log.error(e.getMessage(), e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("手术记录", strInvasiveOperativeNote.getRecId(), JSON.toJSONString(strInvasiveOperativeNote), "", e.getMessage());
+            aMedAbnormalInfoFacade.saveAbnormalInfo("有创操作", strInvasiveOperativeNote.getRecId(), JSON.toJSONString(strInvasiveOperativeNote), "", "有创操作出错:" + e.getMessage());
         }
 
     }
@@ -114,6 +116,4 @@ public class AStrInvasiveOperativeNoteFacade extends StrInvasiveOperativeNoteSer
     }
 
 
-
-
 }