ソースを参照

审核通过接口修改

zhanghang 3 年 前
コミット
94a9b1481a

+ 35 - 14
src/main/java/com/diagbot/facade/MedAppealExamineInfoManagementFacade.java

@@ -70,11 +70,13 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
         //获取处理方式
         String handling = approvedVo.getExampleOperation();
         if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_DEL.getKey())){
+            QcresultDetail detail = getQcresultDetail(approvedVo);
             //调用删除接口
             qcresultVO.setDelStatus(0);
             qcresultVO.setType(4);
             AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
             if(analyzeDTORespDTO.getIsSuccess()){
+                approvedVo.setQcresultDetailId(detail.getId());
                 Boolean appealInfo = updateAppealInfo(approvedVo);
                 MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
                 medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.UP_OR_DEL.getKey());
@@ -96,10 +98,12 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
             }
         }
         if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_UP.getKey())){
+            QcresultDetail detail = getQcresultDetail(approvedVo);
             //调用修改接口
             qcresultVO.setType(3);
             AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
             if(analyzeDTORespDTO.getIsSuccess()){
+                approvedVo.setQcresultDetailId(detail.getId());
                 Boolean appealInfo = updateAppealInfo(approvedVo);
                 MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
                 medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.UP_OR_UP.getKey());
@@ -136,7 +140,22 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
 
             AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
             if(analyzeDTORespDTO.getIsSuccess()){
-                Boolean updateAppealInfo = updateAppealInfo(approvedVo);
+                QcresultDetail detail = getQcresultDetail(approvedVo);
+                QcCasesEntry qcCasesEntry = qcCasesEntryFacade.getOne(new QueryWrapper<QcCasesEntry>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("id", approvedVo.getQcResultAlgVO().getCasesEntryId())
+                );
+                MedAppealInfo medAppealInfo = new MedAppealInfo();
+                medAppealInfo.setQcresultDetailId(detail.getId());
+                medAppealInfo.setCasesEntryName(qcCasesEntry.getName());
+                medAppealInfo.setQcresultDetailMsg(detail.getMsg());
+                medAppealInfo.setWorkFlowNodeId(approvedVo.getWorkFlowNodeId());
+                boolean update = medAppealInfoManagementFacade.update(medAppealInfo, new UpdateWrapper<MedAppealInfo>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", approvedVo.getHospitalId())
+                        .eq("behospital_code", approvedVo.getBehospitalCode())
+                        .eq("id", approvedVo.getId())
+                );
                 MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
                 medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.ADD_EXIST.getKey());
                 medAppealExamineInfo.setExampleStatus(ExampleStatusEnum.ADOPT_EXAMPLE.getKey());
@@ -147,7 +166,7 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
                         .eq("appeal_info_id", approvedVo.getId())
                         .eq("check_id", approvedVo.getAppealId())
                 );
-                if(updateAppealInfo && update1){
+                if(update && update1){
                     return  true;
                 }else {
                     throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
@@ -162,6 +181,8 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
             //调用删除接口
             AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
             if(analyzeDTORespDTO.getIsSuccess()){
+                QcresultDetail qcresultDetail = getQcresultDetail(approvedVo);
+                approvedVo.setQcresultDetailId(qcresultDetail.getId());
                 Boolean appealInfo = updateAppealInfo(approvedVo);
                 MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
                 medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.RECOVER.getKey());
@@ -204,19 +225,8 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
     }
 
     public Boolean updateAppealInfo (ApprovedVo approvedVo) {
-        QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", approvedVo.getHospitalId())
-                .eq("behospital_code", approvedVo.getBehospitalCode())
-                .eq("cases_entry_id", approvedVo.getQcResultAlgVO().getCasesEntryId())
-        );
-        QcCasesEntry qcCasesEntry = qcCasesEntryFacade.getOne(new QueryWrapper<QcCasesEntry>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", approvedVo.getQcResultAlgVO().getCasesEntryId())
-        );
         MedAppealInfo medAppealInfo = new MedAppealInfo();
-        medAppealInfo.setQcresultDetailId(qcresultDetail.getId());
-        medAppealInfo.setCasesEntryName(qcCasesEntry.getName());
+        medAppealInfo.setQcresultDetailId(approvedVo.getQcresultDetailId());
         medAppealInfo.setWorkFlowNodeId(approvedVo.getWorkFlowNodeId());
         boolean update = medAppealInfoManagementFacade.update(medAppealInfo, new UpdateWrapper<MedAppealInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -231,6 +241,17 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
         }
     }
 
+    public QcresultDetail getQcresultDetail (ApprovedVo approvedVo) {
+        QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", approvedVo.getHospitalId())
+                .eq("behospital_code", approvedVo.getBehospitalCode())
+                .eq("cases_entry_id", approvedVo.getQcResultAlgVO().getCasesEntryId())
+                .eq("grade_type",2)
+        );
+        return qcresultDetail;
+    }
+
     public void getAppealReviewExport(HttpServletResponse response, GetAppealReviewVO getAppealReviewVO, MedAppealExamineInfoServiceClient medAppealExamineInfoServiceClient) {
         getAppealReviewVO.setCurrent(1L);
         getAppealReviewVO.setSize(Long.MAX_VALUE);

+ 2 - 2
src/main/java/com/diagbot/vo/ApprovedVo.java

@@ -43,8 +43,8 @@ public class ApprovedVo {
 //    @ApiModelProperty(value = "申诉模块",required = true)
 //    private Long casesId;
 //
-//    @ApiModelProperty(value = "质控缺陷ID")
-//    private Long qcresultDetailId;
+    @ApiModelProperty(value = "质控缺陷ID")
+    private Long qcresultDetailId;
 //
 //    @ApiModelProperty(value = "条目ID")
 //    private Long casesEntryId;