|
|
|
|
|
|
|
|
public void status(PromoteStatusReqDTO req) throws ManagerException { |
|
|
public void status(PromoteStatusReqDTO req) throws ManagerException { |
|
|
IssueProductPromotion promotion = issueProductPromotionRepo.findById(req.getId()).orElse(null); |
|
|
IssueProductPromotion promotion = issueProductPromotionRepo.findById(req.getId()).orElse(null); |
|
|
if (promotion == null) throw new ManagerException("要变更的推广产品不存在"); |
|
|
if (promotion == null) throw new ManagerException("要变更的推广产品不存在"); |
|
|
|
|
|
if (promotion.getExamine() != 0) throw new ManagerException("推广产品未审核通过,不可改变状态"); |
|
|
IssueProduct product = issueProductRepo.findByReleaseId(promotion.getReleaseId()); |
|
|
IssueProduct product = issueProductRepo.findByReleaseId(promotion.getReleaseId()); |
|
|
if (EnableStatus.ENABLE.equals(req.getStatus()) && EnableStatus.DISABLE.equals(product.getStatus())) { |
|
|
if (EnableStatus.ENABLE.equals(req.getStatus()) && EnableStatus.DISABLE.equals(product.getStatus())) { |
|
|
throw new ManagerException("此产品已停用,不可启用推广"); |
|
|
throw new ManagerException("此产品已停用,不可启用推广"); |