Переглянути джерело

修改评分接口-原人工评分删除接口修改

songxinlu 3 роки тому
батько
коміт
9109cbb501
1 змінених файлів з 24 додано та 14 видалено
  1. 24 14
      src/main/java/com/diagbot/facade/QcresultInfoFacade.java

+ 24 - 14
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -149,7 +149,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
             try {
                 useId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
             } catch (Exception e) {
-            //analyze_run运行质控没有登录认证   所以会获取不到
+                //analyze_run运行质控没有登录认证   所以会获取不到
                 useId = 952795279527L;
             }
         }
@@ -204,7 +204,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 List<QcresultDetail> oldQcresultDetails = qcresultDetailServiceImpl.list(new QueryWrapper<QcresultDetail>()
                         .eq("hospital_id", analyzeVO.getHospitalId())
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("grade_type","2")
+                        .eq("grade_type", "2")
                         .eq("behospital_code", analyzeVO.getBehospitalCode()));
 
                 qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
@@ -217,7 +217,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 //
                 //批量插入新的数据
                 List<QcresultDetail> qcresultDetailList = new ArrayList<>();
-                if(ListUtil.isNotEmpty(oldQcresultDetails)){
+                if (ListUtil.isNotEmpty(oldQcresultDetails)) {
                     qcresultDetailList.addAll(oldQcresultDetails);
                     qcresultDetailList.forEach(qcresultDetail -> {
                         //原手动添加缺陷绑定新机器评分id
@@ -277,11 +277,11 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                         .set("msg", algorithmVO.getOptResultAlgVO().getMsg())
                         .set("score", algorithmVO.getOptResultAlgVO().getScore())
                         .set("opt_type", 3)
-                        .set("grade_type",2)
+                        .set("grade_type", 2)
                         .set("modifier", useId)
                         .set("qcresult_info_id", newId)
                         .set("gmt_modified", now)
-                        .set("explain_info",algorithmVO.getOptResultAlgVO().getExplainInfo())
+                        .set("explain_info", algorithmVO.getOptResultAlgVO().getExplainInfo())
                 );
                 break;
             case 4:
@@ -299,15 +299,14 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
 //                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户不是分配的核查人员");
 //                }
                 //逻辑删除质控明细 0删除
-                if(analyzeVO.getDelStatus()==0)
-                {
+                if (analyzeVO.getDelStatus() == 0) {
                     qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
                             .eq("id", algorithmVO.getOptResultAlgVO().getId())
                             .eq("is_deleted", IsDeleteEnum.N.getKey())
                             .eq("hospital_id", analyzeVO.getHospitalId())
                             .eq("behospital_code", analyzeVO.getBehospitalCode())
                             .set("is_deleted", IsDeleteEnum.Y.getKey())
-                            .set("grade_type",2)
+                            .set("grade_type", 2)
                             .set("opt_type", 2)
                             .set("qcresult_info_id", newId)
                             .set("modifier", useId)
@@ -315,8 +314,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                     );
                 }
                 //1恢复
-                else if(analyzeVO.getDelStatus()==1)
-                {
+                else if (analyzeVO.getDelStatus() == 1) {
                     //该条目是机器插入条目
                     qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
                             .eq("id", algorithmVO.getOptResultAlgVO().getId())
@@ -324,15 +322,14 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                             .eq("hospital_id", analyzeVO.getHospitalId())
                             .eq("behospital_code", analyzeVO.getBehospitalCode())
                             .set("is_deleted", IsDeleteEnum.N.getKey())
-                            .set("grade_type",2)
+                            .set("grade_type", 2)
                             .set("opt_type", 1)
                             .set("qcresult_info_id", newId)
                             .set("modifier", useId)
                             .set("remark", null)
                             .set("gmt_modified", now)
                     );
-                }
-                else {
+                } else {
                     throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "delStatus参数错误");
                 }
 
@@ -345,15 +342,28 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
 
 
         //修改原条目id
+        //1.上一次手动评分的
+        if (qcresultInfoOld != null && qcresultInfoOld.getId() != null) {
+            qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+                    .eq("id", qcresultInfoOld.getId())
+                    .eq("hospital_id", analyzeVO.getHospitalId())
+                    .eq("behospital_code", analyzeVO.getBehospitalCode())
+                    .set("qcresult_info_id", newId)
+                    .set("modifier", useId)
+                    .set("gmt_modified", now)
+            );
+        }
+        //2.上一次未删除的
         qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", analyzeVO.getHospitalId())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
-                .set("qcresult_info_id",newId)
+                .set("qcresult_info_id", newId)
                 .set("modifier", useId)
                 .set("gmt_modified", now)
         );
 
+
         //质控模块评分数据
         //统一为长兴的算法
         //逻辑删除数据