瀏覽代碼

Merge branch '20210512_yw_check' into test

songxinlu 4 年之前
父節點
當前提交
5c9cedd918

+ 34 - 1
src/main/java/com/diagbot/facade/AlgorithmFacade.java

@@ -1,6 +1,8 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.AlgorithmDTO;
+import com.diagbot.entity.QcresultDetail;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.BeanUtil;
@@ -32,6 +34,8 @@ public class AlgorithmFacade {
 
     @Autowired
     private SysHospitalSetFacade sysHospitalSetFacade;
+    @Autowired
+    private QcresultDetailFacade qcresultDetailFacade;
 
     /**
      * 获取评分结果和等级
@@ -196,7 +200,7 @@ public class AlgorithmFacade {
 
         }
         //删除
-        else if (algorithmVO.getType().equals(2)) {
+        else if (algorithmVO.getType().equals(2)||(algorithmVO.getType().equals(4)&&0==algorithmVO.getDelStatus())) {
             if (null == algorithmVO.getOptResultAlgVO()) {
                 throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "删除操作条目不能为空!");
             }
@@ -216,6 +220,35 @@ public class AlgorithmFacade {
                 }
             }
         }
+        //恢复
+        else if (algorithmVO.getType().equals(4)&&1==algorithmVO.getDelStatus()) {
+            if (null == algorithmVO.getOptResultAlgVO()) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "恢复操作条目不能为空!");
+            }
+            //操作数据
+            if (ListUtil.isNotEmpty(qcResultAlgVOList)) {
+                Boolean hasData = false;
+                Long optId = algorithmVO.getOptResultAlgVO().getId(); // 操作id
+                QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
+                        .eq("id",optId));
+                if(qcresultDetail!=null)
+                {
+                    QcResultAlgVO qcResultAlgVO = new QcResultAlgVO();
+                    qcResultAlgVO.setScore(qcresultDetail.getScore());
+                    qcResultAlgVO.setId(qcresultDetail.getId());
+                    qcResultAlgVO.setCasesEntryId(qcresultDetail.getCasesEntryId());
+                    qcResultAlgVO.setCasesId(qcresultDetail.getCasesId());
+                    qcResultAlgVO.setMsg(qcresultDetail.getMsg());
+                    qcResultAlgVO.setIsReject(qcresultDetail.getIsReject());
+                    qcResultAlgVOList.add(qcResultAlgVO);
+                    hasData = true;
+                }
+                if (!hasData) {
+                    throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "恢复的条目不存在!");
+                }
+            }
+        }
+
         //修改
         else if (algorithmVO.getType().equals(3)) {
             if (null == algorithmVO.getOptResultAlgVO()) {

+ 1 - 0
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -110,6 +110,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         algorithmVO.setHospitalId(hospitalId);
         algorithmVO.setBehospitalCode(qcresultVO.getBehospitalCode());
         algorithmVO.setIsPlacefile(behospitalInfos.get(0).getIsPlacefile());
+        algorithmVO.setDelStatus(qcresultVO.getDelStatus());
         AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
         //更新质控评分结果信息
         AnalyzeVO analyzeVO = new AnalyzeVO();

+ 3 - 1
src/main/java/com/diagbot/vo/AlgorithmVO.java

@@ -14,8 +14,10 @@ import java.util.List;
 @Getter
 @Setter
 public class AlgorithmVO {
-    //操作类型(0:基础评分,1:新增条目评分,2:删除条目,3:修改条目)
+    //操作类型(0:基础评分,1:新增条目评分,2:删除条目,3:修改条目,4:逻辑删除、恢复条目)
     private Integer type;
+    //0删除 1恢复
+    private Integer delStatus;
     //操作条目
     private QcResultAlgVO optResultAlgVO;
     //扣分条目