Explorar o código

质控类型提示语修改

chengyao %!s(int64=4) %!d(string=hai) anos
pai
achega
c75467a9e0

+ 0 - 2
common/src/main/java/com/diagbot/exception/CommonErrorCode.java

@@ -12,9 +12,7 @@ public enum CommonErrorCode implements ErrorCode {
     OK("0", "操作成功"),
     FAIL("00000001", "操作失败"),
     RPC_ERROR("00000002", "远程调度失败"),
-    CANCEL_SUCCESSFUL("00000003","解绑成功"),
     CHECK_CONNECTION("00000005","是否解除绑定"),
-    CHECKMAIN_CONNECTION("00000006","是否解除绑定"),
     SAVE_SUCCESSFUL("00000007","添加成功"),
     ALTER_SUCCESSFUL("00000009","修改成功"),
     PARAM_ERROR("00029999", "%s"), //参数错误

+ 19 - 25
mrman-service/src/main/java/com/diagbot/facade/QcTypeFacade.java

@@ -22,6 +22,7 @@ import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.*;
@@ -68,28 +69,21 @@ public class QcTypeFacade extends QcTypeServiceImpl {
             parTypelist.forEach(qcType -> {
                 parTypeIdSet.add(qcType.getParentTypeId());
             });
-            //修改
-        if(null != qcTypeVO.getId()){
-                list = this.list(new QueryWrapper<QcType>()
-                        .eq("hospital_id", qcTypeVO.getHospitalId())
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .notIn("id",parTypeIdSet)
-                        .ne("id",qcTypeVO.getId())
-                        .isNull("parent_type_id")
-                        .orderByAsc("name"));
-        }else{
-            //新增操作
-            //未质控的质控id包含了父类
+        };
 
-                list = this.list(new QueryWrapper<QcType>()
-                        .eq("hospital_id", qcTypeVO.getHospitalId())
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .notIn("id",parTypeIdSet)
-                        .isNull("parent_type_id")
-                        .orderByAsc("name"));
+            QueryWrapper<QcType> qcTypeQueryWrapper = new QueryWrapper<>();
+            qcTypeQueryWrapper.eq("hospital_id", qcTypeVO.getHospitalId());
+            qcTypeQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            if(!CollectionUtils.isEmpty(parTypeIdSet)){
+                qcTypeQueryWrapper.notIn("id",parTypeIdSet);
             }
+            qcTypeQueryWrapper.isNull("parent_type_id");
+        //修改 非此判断为新增
+        if(null != qcTypeVO.getId()) {
+            qcTypeQueryWrapper.ne("id", qcTypeVO.getId());
         }
-
+            qcTypeQueryWrapper.orderByAsc("name");
+            list = this.list(qcTypeQueryWrapper);
         return RespDTO.onSuc(list);
     }
     /**
@@ -118,16 +112,16 @@ public class QcTypeFacade extends QcTypeServiceImpl {
                         .eq("id", qcType.getParentTypeId()));
                 RespDTO respDTO = new RespDTO();
                 respDTO.code = "00000005";
-                respDTO.msg = "该类型已被" + "\"" + qcTypeMain.getName() + "\"" + "类型绑定,确定需要解绑?";
+                respDTO.msg = "该质控类型已被" + "\"" + qcTypeMain.getName() + "\"" + "类型绑定,需先将其解绑";
                return respDTO;
                //父类存在关联  一对多给出提示
-            }else if(ListUtil.isNotEmpty(parentList)){
+            }else if(ListUtil.isNotEmpty(parentList)&&1==cancelTypeVO.getOper()){
                 RespDTO respDTO = new RespDTO();
-                respDTO.code = "00000006";
-                respDTO.msg = "该质控类型已被关联,删除将解绑其关联类型,是否删除?";
+                respDTO.code = "00000005";
+                respDTO.msg = "该质控类型存在绑定的子类型,需先将其解绑";
                 return respDTO;
             }
-        //如果父类关联子类,同样提示
+    
         }
         //删除关联状态
         if(cancelTypeVO.getCancel() != null && 1 == cancelTypeVO.getCancel()){
@@ -149,7 +143,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
                 );
             }
             RespDTO respDTO = new RespDTO();
-            respDTO.code = "00000005";
+            respDTO.code = "0";
             respDTO.msg = "解绑成功";
             return respDTO;
 

+ 2 - 0
mrman-service/src/main/java/com/diagbot/vo/CancelTypeVO.java

@@ -15,4 +15,6 @@ public class CancelTypeVO {
     private Long hospitalId;
     //是否解除相关质控类型绑定(0-不解除 1-解除)
     private Integer cancel = 0;
+    //操作标示(0-修改 1-删除)
+    private Integer oper = 1;
 }