Przeglądaj źródła

状态修改接口前端传参数接收不到处理

zhangyang 2 lat temu
rodzic
commit
f1ecfdcd66

+ 10 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoTetherController.java

@@ -251,9 +251,13 @@ public class PoTetherController extends BaseController
         }
         }
 
 
         TetherVo tetherVo = poTetherService.selectPoTetherByTetherIdWithCollection(tetherId);
         TetherVo tetherVo = poTetherService.selectPoTetherByTetherIdWithCollection(tetherId);
-        if (tetherVo.getCochain() == 0){
+        if (tetherVo.getCochain() == 0 && cochain == 0){
             return error("禁止重复上链");
             return error("禁止重复上链");
         }
         }
+        if (tetherVo.getCochain() == 1 && cochain == 1){
+            return error("禁止重复下链");
+        }
+
         return toAjax(poTetherService.updatePoTetherIsCochain(cochain,tetherId));
         return toAjax(poTetherService.updatePoTetherIsCochain(cochain,tetherId));
     }
     }
     /**
     /**
@@ -269,13 +273,16 @@ public class PoTetherController extends BaseController
         }
         }
         TetherVo tetherVo = poTetherService.selectPoTetherByTetherIdWithCollection(tetherId);
         TetherVo tetherVo = poTetherService.selectPoTetherByTetherIdWithCollection(tetherId);
 
 
-        if (tetherVo.getCochain() == 0 ){
+        if (tetherVo.getCochain() == 0){
 
 
             return error("此套系为上链状态禁止上架");
             return error("此套系为上链状态禁止上架");
         }
         }
-        if (tetherVo.getGrounding() == 0){
+        if (tetherVo.getGrounding() == 0  && grounding == 0 ){
             return error("禁止重复上架");
             return error("禁止重复上架");
         }
         }
+        if (tetherVo.getGrounding() == 1  && grounding == 1 ){
+            return error("禁止重复下架");
+        }
         return toAjax(poTetherService.updatePoTetherIsGrounding(grounding,tetherId));
         return toAjax(poTetherService.updatePoTetherIsGrounding(grounding,tetherId));
     }
     }
 
 

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoTetherMapper.java

@@ -136,7 +136,7 @@ public interface PoTetherMapper extends BaseMapper<PoTether>
      * @param tetherId
      * @param tetherId
      * @return
      * @return
      */
      */
-    boolean updatePoTetherIsGrounding(Integer grounding, Long tetherId);
+    boolean updatePoTetherIsGrounding(@Param("grounding")Integer grounding,@Param("tetherId") Long tetherId);
 
 
     /**
     /**
      * 更新种类
      * 更新种类