Browse Source

朗通后台续费判断

wangyu 6 years ago
parent
commit
f9160beb73

+ 12 - 8
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -1,13 +1,5 @@
 package com.diagbot.facade;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.EnShowOptionDTO;
 import com.diagbot.dto.GetConsoleOnTrialDTO;
@@ -38,6 +30,13 @@ import com.diagbot.vo.ModifyOpeningTimeVO;
 import com.diagbot.vo.OpenUpOnTrialVO;
 import com.diagbot.vo.ProductServiceSaveVO;
 import com.diagbot.vo.StartAndendByUserIdVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description:已开通产品业务层
@@ -311,6 +310,11 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         map.put("productId",modifyOpeningTimeVO.getProductId());
         List<OpenedProducts> opendList = openedProductsFacade.selectOpenedProducts(map);
         List<Long> renewalsList = userRenewalsFacade.selectProductIdByUserId(map);
+        for (OpenedProducts opened:opendList) {
+            if(opened.getServiceStatus().intValue() == StatusEnum.Disable.getKey()){
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "用户产品已停用,请刷新页面");
+            }
+        }
         if(!renewalsList.contains(modifyOpeningTimeVO.getProductId())){
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "续费单已审核,请刷新重试");
         }

+ 4 - 4
diagbotman-service/src/main/java/com/diagbot/facade/UserRenewalsFacade.java

@@ -90,10 +90,10 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
         if(this.selectProductIdByUserId(map).contains(addRenewalsInfoVO.getProductId())){
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请勿重复提交申请");
         }
-        OpenedProducts openedProducts =new OpenedProducts();
-        openedProducts.setServiceStatus(StatusEnum.Disable.getKey());
-        if(openedProductsList.contains(openedProducts.getServiceStatus())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品已停用,请刷新页面");
+        for (OpenedProducts openedProducts:openedProductsList) {
+            if(openedProducts.getServiceStatus().intValue() == StatusEnum.Disable.getKey()){
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品已停用,请刷新页面");
+            }
         }
         userRenewals.setProductId(addRenewalsInfoVO.getProductId());
         return RespDTO.onSuc(this.save(userRenewals));