|
@@ -1,9 +1,18 @@
|
|
|
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;
|
|
|
import com.diagbot.dto.GetConsoleOpenedDTO;
|
|
|
+import com.diagbot.dto.OpenProductCheckDTO;
|
|
|
import com.diagbot.dto.OpenUpOnTrialDTO;
|
|
|
import com.diagbot.dto.ProductServiceDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -27,16 +36,10 @@ import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.ModifyOpeningTimeVO;
|
|
|
+import com.diagbot.vo.OpenProductCheckVO;
|
|
|
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:已开通产品业务层
|
|
@@ -94,6 +97,12 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
|
|
|
}else{
|
|
|
i.setIsCreateToken(0);
|
|
|
}
|
|
|
+ if(DateUtil.parseDateTime(i.getEndTime()).getTime()<DateUtil.now().getTime()){
|
|
|
+ i.setIsExpire(0);
|
|
|
+ }else{
|
|
|
+ i.setIsExpire(1);
|
|
|
+ }
|
|
|
+ i.setEndTime(i.getEndTime().substring(0, 10));
|
|
|
}
|
|
|
|
|
|
return retList;
|
|
@@ -226,6 +235,44 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
|
|
|
|
|
|
return enShowOptionDTO;
|
|
|
}
|
|
|
+
|
|
|
+ public OpenProductCheckDTO openProductCheck(OpenProductCheckVO openProductCheckVO){
|
|
|
+ OpenProductCheckDTO openProductCheckDTO = new OpenProductCheckDTO();
|
|
|
+ openProductCheckDTO.setHasPermission(false);
|
|
|
+
|
|
|
+ LantoneProduct lantoneProduct =new LantoneProduct();
|
|
|
+ lantoneProduct.setId(openProductCheckVO.getProductId());
|
|
|
+ LantoneProduct lantoneProducts = lantoneProductFacade.getById(lantoneProduct);
|
|
|
+
|
|
|
+ if(openProductCheckVO.getOpenId()!=null){
|
|
|
+ OpenedProducts openedProducts = baseMapper.selectById(openProductCheckVO.getOpenId());
|
|
|
+ if(openedProducts==null){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "您的产品不存在,请刷新页面");
|
|
|
+ }
|
|
|
+ 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, "【"+lantoneProducts.getName()+"】已到期,请刷新页面");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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()+"】已停用,请刷新页面");
|
|
|
+ }
|
|
|
+
|
|
|
+ return openProductCheckDTO;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @param startAndendByUserIdVO
|