コード例 #1
0
  public String updateSendStatus() {
    if (IDUtils.isNotCorrect(id)) {
      json.setCode(JsonModel.CODE_ILL_ARGS);
      json.setDetail("dcome.promotion.award.id.required");
      return SUCCESS;
    }

    DcPromotionAwardSendStatusEnums statusEnums =
        DcPromotionAwardSendStatusEnums.getInstance(status);

    if (statusEnums == DcPromotionAwardSendStatusEnums.UNKNOWN) {
      json.setCode(JsonModel.CODE_ILL_ARGS);
      json.setDetail("dcome.promotion.award.status.required");
      return SUCCESS;
    }

    try {
      int effectCount = dcPromotionAwardService.updateSendStatusById(id, statusEnums);
      if (effectCount > 0) {}

      json.setCode(JsonModel.CODE_SUCCESS);
    } catch (Exception e) {
      log.error(e.getMessage(), e);
      json.setCode(JsonModel.CODE_FAIL);
      json.setDetail(e.getMessage());
    }

    return SUCCESS;
  }
コード例 #2
0
  /**
   * 更新审核状态
   *
   * @return
   */
  public String updateReviewStatus() {

    if (IDUtils.isNotCorrect(id)) {
      json.setCode(JsonModel.CODE_ILL_ARGS);
      json.setDetail("dcome.promotion.award.id.required");
      return SUCCESS;
    }

    DcPromotionAwardReviewStatusEnums statusEnums =
        DcPromotionAwardReviewStatusEnums.getInstance(status);

    if (statusEnums == DcPromotionAwardReviewStatusEnums.UNKNOWN) {
      json.setCode(JsonModel.CODE_ILL_ARGS);
      json.setDetail("dcome.promotion.award.status.required");
      return SUCCESS;
    }
    try {
      int effectCount = dcPromotionAwardService.updateReviewStatusById(id, statusEnums);
      if (effectCount > 0) {
        // 更新该会员的未读消息
        DcPromotionAwardDTO awardDO = dcPromotionAwardService.getAwardById(id);
        if (awardDO != null) {
          Long userId = awardDO.getUserId();
          if (IDUtils.isCorrect(userId)) {
            dcUserService.incrUnreadMsgCountByUser(userId, 1); // 添加一条未读消息
          }
        }
      }
      json.setCode(JsonModel.CODE_SUCCESS);
    } catch (Exception e) {
      log.error(e.getMessage(), e);
      json.setCode(JsonModel.CODE_FAIL);
      json.setDetail(e.getMessage());
    }

    return SUCCESS;
  }