Forráskód Böngészése

Merge remote-tracking branch 'origin/dev/one' into dev/one

zhoutg 6 éve
szülő
commit
6a3c824cda

+ 15 - 9
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -236,6 +236,11 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         return enShowOptionDTO;
     }
     
+    /**
+     * 控制台-已开通产品状态校验
+     * @param openProductCheckVO
+     * @return
+     */
     public OpenProductCheckDTO openProductCheck(OpenProductCheckVO openProductCheckVO){
     	OpenProductCheckDTO openProductCheckDTO = new OpenProductCheckDTO();
     	openProductCheckDTO.setHasPermission(false);
@@ -247,6 +252,12 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
     	if(lantoneProduct==null){
     		throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该产品不存在,请刷新页面");
     	}
+    	if(lantoneProduct.getIsDeleted().equals("Y")){
+			 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "【"+lantoneProduct.getName()+"】已删除,请刷新页面");
+		}
+    	if(lantoneProduct.getServiceStatus()==StatusEnum.Disable.getKey()){
+			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "【"+lantoneProduct.getName()+"】已停用,请刷新页面");
+		}
     	
     	Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
     	if(openProductCheckVO.getOpenId()!=null){
@@ -260,20 +271,15 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
     		if(openedProducts.getIsDeleted().equals("Y")){
     			 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品已删除,请刷新页面");
     		}
-    		if(openedProducts.getServiceStatus()==StatusEnum.Disable.getKey()){
-    			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品已停用,请刷新页面");
-    		}
     		if(openedProducts.getEndTime().getTime()<DateUtil.now().getTime()){
     			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "【"+lantoneProduct.getName()+"】已到期,请刷新页面");
     		}
+    		if(openedProducts.getServiceStatus()==StatusEnum.Disable.getKey()){
+    			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品已停用,请刷新页面");
+    		}
     	}
     	
-    	if(lantoneProduct.getIsDeleted().equals("Y")){
-			 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "【"+lantoneProduct.getName()+"】已删除,请刷新页面");
-		}
-    	if(lantoneProduct.getServiceStatus()==StatusEnum.Disable.getKey()){
-			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "【"+lantoneProduct.getName()+"】已停用,请刷新页面");
-		}
+    	
     	
     	openProductCheckDTO.setHasPermission(true);
     	return openProductCheckDTO;

+ 1 - 1
diagbotman-service/src/main/java/com/diagbot/web/ProductOrderController.java

@@ -105,7 +105,7 @@ public class ProductOrderController {
         return RespDTO.onSuc(productOrderFacade.waitExamOrderCou());
     }
     
-    @ApiOperation(value = "已开通产品状态校验[by:rengb]", notes = "已开通产品状态校验")
+    @ApiOperation(value = "控制台-已开通产品状态校验[by:rengb]", notes = "控制台-已开通产品状态校验")
     @PostMapping("/openProductCheck")
     @SysLogger("openProductCheck")
     public RespDTO<OpenProductCheckDTO> openProductCheck(@RequestBody OpenProductCheckVO openProductCheckVO) {