瀏覽代碼

修改审核接口

songxinlu 3 年之前
父節點
當前提交
68e34c7772
共有 1 個文件被更改,包括 33 次插入26 次删除
  1. 33 26
      src/main/java/com/diagbot/facade/MedAppealExamineInfoManagementFacade.java

+ 33 - 26
src/main/java/com/diagbot/facade/MedAppealExamineInfoManagementFacade.java

@@ -25,6 +25,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedAppealExamineInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ApprovedVo;
 import com.diagbot.vo.GetAppealReviewVO;
@@ -187,39 +188,46 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
         if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.RECOVER.getKey())) {
             qcresultVO.setType(4);
             qcresultVO.setDelStatus(1);
+            //判断条目是否以恢复
+            QcresultDetail qcresultDetail = getQcresultDetail(approvedVo);
+            if (qcresultDetail != null) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "该条目已恢复,无法进行审核操作,请走驳回流程。");
+            }
+
             //调用删除恢复接口
-            QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
+            List<QcresultDetail> qcresultDetails = qcresultDetailFacade.list(new QueryWrapper<QcresultDetail>()
                     .eq("hospital_id", approvedVo.getHospitalId())
                     .eq("behospital_code", approvedVo.getBehospitalCode())
                     .eq("cases_entry_id", approvedVo.getQcResultAlgVO().getCasesEntryId())
+                    .eq("is_deleted",IsDeleteEnum.Y.getKey())
                     .eq("grade_type", 2)
+                    .orderByDesc("gmt_create")
             );
-            if (qcresultDetail == null) {
-                throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "该条目已删除,无法进行审核操作,请走驳回流程。");
-            }
-            qcResultAlgVO.setId(qcresultDetail.getId());
-            qcresultVO.setOptResultAlgVO(qcResultAlgVO);
-            AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
-            if (analyzeDTORespDTO.getIsSuccess()) {
-                approvedVo.setQcresultDetailId(qcresultDetail.getId());
-                Boolean appealInfo = updateAppealInfo(approvedVo);
-                MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
-                medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.RECOVER.getKey());
-                medAppealExamineInfo.setExampleStatus(ExampleStatusEnum.ADOPT_EXAMPLE.getKey());
-                medAppealExamineInfo.setRemark(qcResultAlgVO.getExplainInfo());
-                medAppealExamineInfo.setGmtCreate(dateTime);
-                boolean update = this.update(medAppealExamineInfo, new UpdateWrapper<MedAppealExamineInfo>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("appeal_info_id", approvedVo.getId())
-                        .eq("check_id", approvedVo.getAppealId())
-                );
-                if (appealInfo && update) {
-                    return true;
+            if(ListUtil.isNotEmpty(qcresultDetails)){
+                qcResultAlgVO.setId(qcresultDetails.get(0).getId());
+                qcresultVO.setOptResultAlgVO(qcResultAlgVO);
+                AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
+                if (analyzeDTORespDTO.getIsSuccess()) {
+                    approvedVo.setQcresultDetailId(qcresultDetails.get(0).getId());
+                    Boolean appealInfo = updateAppealInfo(approvedVo);
+                    MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
+                    medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.RECOVER.getKey());
+                    medAppealExamineInfo.setExampleStatus(ExampleStatusEnum.ADOPT_EXAMPLE.getKey());
+                    medAppealExamineInfo.setRemark(qcResultAlgVO.getExplainInfo());
+                    medAppealExamineInfo.setGmtCreate(dateTime);
+                    boolean update = this.update(medAppealExamineInfo, new UpdateWrapper<MedAppealExamineInfo>()
+                            .eq("is_deleted", IsDeleteEnum.N.getKey())
+                            .eq("appeal_info_id", approvedVo.getId())
+                            .eq("check_id", approvedVo.getAppealId())
+                    );
+                    if (appealInfo && update) {
+                        return true;
+                    } else {
+                        throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
+                    }
                 } else {
-                    throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
+                    throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "恢复失败!");
                 }
-            } else {
-                throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "恢复失败!");
             }
         }
         if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.ADD_NO_EXIST.getKey())) {
@@ -242,7 +250,6 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
         }
         throw new CommonException(CommonErrorCode.NOT_EXISTS, "无此类型处理方式!");
     }
-
     public Boolean updateAppealInfo(ApprovedVo approvedVo) {
         MedAppealInfo medAppealInfo = new MedAppealInfo();
         medAppealInfo.setQcresultDetailId(approvedVo.getQcresultDetailId());