瀏覽代碼

产品线管理删除

wangyu 6 年之前
父節點
當前提交
df4e87bf9c

+ 6 - 3
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -196,9 +196,12 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "产品删除失败");
         }
-        if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-                    "产品令牌删除失败");
+        List<OpenedProducts> list = openedProductsFacade.getOpendById(openedProducts);
+        if(list.size() != 0){
+            if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                        "产品令牌删除失败");
+            }
         }
         return true;
     }

+ 1 - 1
diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml

@@ -214,7 +214,7 @@
         ORDER BY b.time desc
     </select>
 
-    <select id="getOpendById" resultMap="BaseResultMap" parameterType="java.util.List">
+    <select id="getOpendById" resultMap="BaseResultMap">
         SELECT * FROM `diag_opened_products` a where a.service_status ='1'
         <if test="productId != null and productId != ''">
             and a.product_id =#{productId}