|
@@ -4,21 +4,31 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import com.diagbot.dto.EnShowOptionDTO;
|
|
|
import com.diagbot.dto.GetConsoleOnTrialDTO;
|
|
|
import com.diagbot.dto.GetConsoleOpenedDTO;
|
|
|
import com.diagbot.dto.OpenUpOnTrialDTO;
|
|
|
import com.diagbot.dto.ProductServiceDTO;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.OpenedProducts;
|
|
|
import com.diagbot.entity.ProductService;
|
|
|
import com.diagbot.entity.ServiceInfo;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.OpenedProductsServiceImpl;
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
+import com.diagbot.vo.ModifyOpeningTimeVO;
|
|
|
import com.diagbot.vo.OpenUpOnTrialVO;
|
|
|
import com.diagbot.vo.ProductServiceSaveVO;
|
|
|
+import com.diagbot.vo.StartAndendByUserIdVO;
|
|
|
|
|
|
/**
|
|
|
* @Description:已开通产品业务层
|
|
@@ -108,5 +118,59 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
|
|
|
|
|
|
return enShowOptionDTO;
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param startAndendByUserIdVO
|
|
|
+ * @return 根据用户id和产品id,删除开通信息
|
|
|
+ */
|
|
|
+ public RespDTO<StartAndendByUserIdVO> startAndendByuserIds(StartAndendByUserIdVO startAndendByUserIdVO) {
|
|
|
+ OpenedProducts openedProducts = new OpenedProducts();
|
|
|
+ openedProducts.setUserId(startAndendByUserIdVO.getUserId());
|
|
|
+ openedProducts.setProductId(startAndendByUserIdVO.getProductId());
|
|
|
+ openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
+ openedProducts.setGmtCreate(DateUtil.now());
|
|
|
+ openedProducts.setServiceStatus(startAndendByUserIdVO.getServiceStatus());
|
|
|
+ boolean res =startAndendByuserId(openedProducts);
|
|
|
+ if (!res){
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(res);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param userId
|
|
|
+ * @param productId
|
|
|
+ * @return 根据用户id和产品id,删除开通信息
|
|
|
+ */
|
|
|
+ public RespDTO delInformationAvailables(Long userId, Long productId) {
|
|
|
+ OpenedProducts openedProducts = new OpenedProducts();
|
|
|
+ openedProducts.setUserId(userId);
|
|
|
+ openedProducts.setProductId(productId);
|
|
|
+ openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
+ openedProducts.setGmtCreate(DateUtil.now());
|
|
|
+ boolean res =delInformationAvailable(openedProducts);
|
|
|
+ if (!res){
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(res);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param modifyOpeningTimeVO
|
|
|
+ * @return 根据用户id和产品id,修改开通时间
|
|
|
+ */
|
|
|
+ public RespDTO<ModifyOpeningTimeVO> modifyOpeningTimes(ModifyOpeningTimeVO modifyOpeningTimeVO) {
|
|
|
+ OpenedProducts openedProducts = new OpenedProducts();
|
|
|
+ openedProducts.setUserId(modifyOpeningTimeVO.getUserId());
|
|
|
+ openedProducts.setProductId(modifyOpeningTimeVO.getProductId());
|
|
|
+ openedProducts.setStartTime(DateUtil.parseDate(modifyOpeningTimeVO.getStartTime()));
|
|
|
+ openedProducts.setEndTime(DateUtil.parseDate(modifyOpeningTimeVO.getEndTime()));
|
|
|
+ openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
+ openedProducts.setGmtCreate(DateUtil.now());
|
|
|
+ boolean res = modifyOpeningTime(openedProducts);
|
|
|
+ if (!res){
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(res);
|
|
|
+ }
|
|
|
}
|