Browse Source

1、增加取消归档操作

liuqq 3 years ago
parent
commit
6cb4eaf61e

+ 22 - 11
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -157,6 +157,11 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return qcTypeId;
     }
 
+    /**
+     * @Description:归档/取消归档
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
     public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
         try {
             //验证数据是否存在
@@ -166,11 +171,11 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 return RespDTO.onError("请输入医院编码!");
             }else {
                 UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
-                updateWrapper.eq("behospital_code", aDeleteFlagVO.getBehospitalCode())
-                        .eq("hospital_id", aDeleteFlagVO.getHospitalId())
-                        .eq("is_deleted",IsDeleteEnum.N)
-                        .set("is_deleted",IsDeleteEnum.Y)
-                        .set("gmt_modified", DateUtil.now());
+                updateWrapper.eq("behospital_code", aDeleteFlagVO.getBehospitalCode());
+                updateWrapper.eq("hospital_id", aDeleteFlagVO.getHospitalId());
+                updateWrapper.eq("is_deleted",IsDeleteEnum.N);
+                updateWrapper.set("is_deleted",IsDeleteEnum.Y);
+                updateWrapper.set("gmt_modified", DateUtil.now());
 
                 Boolean flag=update(new BehospitalInfo(),updateWrapper);
                 //aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-删除",JSON.toJSONString(aDeleteFlagVO),"","删除成功!");
@@ -191,12 +196,18 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 return RespDTO.onError("请输入医院编码!");
             }else{
                 UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
-                updateWrapper.eq("behospital_code", aPlaceFileVO.getBehospitalCode())
-                        .eq("hospital_id", aPlaceFileVO.getHospitalId())
-                        .eq("is_deleted",IsDeleteEnum.N)
-                        .set("is_placefile","1")
-                        .set("placefile_date",aPlaceFileVO.getPlaceFileDate().isEmpty()?DateUtil.formatDateTime(DateUtil.now()):DateUtil.parseDateTime(aPlaceFileVO.getPlaceFileDate()))
-                        .set("gmt_modified", DateUtil.now());
+                updateWrapper.eq("behospital_code", aPlaceFileVO.getBehospitalCode());
+                updateWrapper.eq("hospital_id", aPlaceFileVO.getHospitalId());
+                updateWrapper.eq("is_deleted",IsDeleteEnum.N);
+                if("0".equals(aPlaceFileVO.getDeleteState())){
+                    //取消归档为运行病历
+                    updateWrapper.set("is_placefile","0");
+                }else if("1".equals(aPlaceFileVO.getDeleteState())){
+                    //归档为终末病历
+                    updateWrapper.set("is_placefile","1");
+                }
+                updateWrapper.set("placefile_date",aPlaceFileVO.getPlaceFileDate().isEmpty()?DateUtil.formatDateTime(DateUtil.now()):DateUtil.parseDateTime(aPlaceFileVO.getPlaceFileDate()));
+                updateWrapper.set("gmt_modified", DateUtil.now());
 
                 Boolean flag=update(new BehospitalInfo(),updateWrapper);
                 return RespDTO.onSuc(flag);

+ 1 - 0
src/main/java/com/diagbot/vo/data/APlaceFileVO.java

@@ -9,4 +9,5 @@ public class APlaceFileVO {
     private String behospitalCode;//病人住院ID
     private Long hospitalId;//医院编码
     private String placeFileDate;//归档时间
+    private String  deleteState;//1:归档,0:取消归档
 }