فهرست منبع

产品停用多人操作判断

wangyu 6 سال پیش
والد
کامیت
5f2c965494

+ 8 - 0
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -135,6 +135,14 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
      */
     public Boolean stopProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
+        if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "该产品已启用,启用失败");
+        }
+        if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Disable.getKey()){
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "该产品已停用,停用失败");
+        }
         BeanUtil.copyProperties(updateProductVO, lantoneProduct);
         lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
         lantoneProduct.setGmtModified(DateUtil.now());

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

@@ -18,7 +18,6 @@ import com.diagbot.enums.VisibleIdTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.idc.VisibleIdCreater;
-import com.diagbot.service.UserRenewalsService;
 import com.diagbot.service.impl.UserRenewalsServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -54,8 +53,6 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
     @Autowired
     private OpenedProductsFacade openedProductsFacade;
     @Autowired
-    private UserRenewalsService userRenewalsService;
-    @Autowired
     private UserRenewalsFacade userRenewalsFacade;
 
     /**
@@ -201,7 +198,6 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
      * @return
      */
     public int getUserWaitingRenewal(UserRenewals userRenewals){
-    	
-    	return userRenewalsService.getUserWaitingRenewal(userRenewals);
+    	return this.getUserWaitingRenewal(userRenewals);
     }
 }