public PaymentRefundCondition getCondition() {
    PaymentRefundCondition paymentRefundCondition = new PaymentRefundCondition();
    paymentRefundCondition.setPageSize(this.getPageSize());
    paymentRefundCondition.setPageIndex(this.getPageIndex());
    if ("query".equals(this.showAllList)) {
      paymentRefundCondition.setSalesNos(null);
    } else {
      List<Integer> workmate = UserHelper.getUserCache().getWorkMate();
      String workMateString = "";
      if (workmate != null) {
        workmate.add(UserHelper.getUserCache().getUserId());
        workMateString = StringHelper.listToString(workmate);
      } else {
        workMateString = String.valueOf(UserHelper.getUserCache().getUserId());
      }
      List<Sales> salesList = SalesModel.getListByEmps(workMateString);
      List<Integer> salesNos = new ArrayList<Integer>();
      for (Sales sales : salesList) {
        salesNos.add(sales.getId());
      }
      paymentRefundCondition.setSalesNos(StringHelper.listToString(salesNos));
    }

    if (!StringHelper.isNullOrEmpty(this.getIsTest())) {
      paymentRefundCondition.setIsTest(Byte.valueOf(this.getIsTest()));
    } else {
      paymentRefundCondition.setIsTest((byte) 0);
    }
    if (!StringHelper.isNullOrEmpty(this.byP2pProduct)) {
      paymentRefundCondition.setP2pProductNo(Integer.valueOf(this.byP2pProduct));
    }
    if (!StringHelper.isNullOrEmpty(this.byStatus)) {
      paymentRefundCondition.setStatus(Byte.valueOf(this.byStatus));
    }
    if (!StringHelper.isNullOrEmpty(this.byStartRepayIssue)) {
      paymentRefundCondition.setByStartRepayIssue(this.byStartRepayIssue);
    }
    if (!StringHelper.isNullOrEmpty(this.byEndRepayIssue)) {
      paymentRefundCondition.setByEndRepayIssue(this.byEndRepayIssue);
    }
    if (!StringHelper.isNullOrEmpty(this.smsStatus)) {
      paymentRefundCondition.setSmsStatus(Integer.parseInt(this.smsStatus));
    } else {
      paymentRefundCondition.setSmsStatus(-1);
    }
    if (!StringHelper.isNullOrEmpty(this.byPayType)) {
      paymentRefundCondition.setPayType(Byte.valueOf(this.byPayType));
    }
    List<SortItem> sortItemList = new ArrayList<SortItem>();
    SortItem sortItem = new SortItem();
    sortItem.setSortFeild(this.getSidx());
    sortItem.setSortType(this.getSortType());
    sortItemList.add(sortItem);
    paymentRefundCondition.setSortItemList(sortItemList);
    return paymentRefundCondition;
  }
  public String ajaxSendSms() {

    if (StringHelper.isNullOrEmpty(this.ids)) {
      this.setErrCode("NoID");
      this.setErrDesc("请选择数据");
      return SUCCESS;
    } else {
      String[] ids = this.ids.split(",");
      List<String> idList = Arrays.asList(ids);
      for (String id : idList) {
        PaymentRefund paymentRefund = PaymentRefundModel.getInfo(Integer.parseInt(id));
        String cellphone = "";
        try {
          if (paymentRefund.getPayType() == 1) {
            cellphone = P2pCustomerModel.getInfo(paymentRefund.getP2pCustomerNo()).getCellphone();
          } else {
            cellphone =
                CustomerPersonalModel.getInfo(paymentRefund.getCustomerNo()).getCellphone1();
          }
        } catch (Exception e) {
          this.setErrCode("0000");
          this.setErrDesc("没有手机号");
        }
        String productName = P2pProductModel.getInfo(paymentRefund.getP2pProductNo()).getName();
        int times = PaymentRefundModel.getTimesIsUseBySalesNo(paymentRefund.getSalesNo());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        int result = 0;
        if (Integer.parseInt(this.type) == 1) {
          String money = Double.toString(paymentRefund.getPayMoney());
          if (paymentRefund.getTimes() == times) {
            result =
                SmsModel.smsProductExpire(
                    cellphone, sdf.format(paymentRefund.getActualPayTime()), productName, money);
          } else {
            result =
                SmsModel.smsProductInterest(
                    cellphone,
                    sdf.format(paymentRefund.getActualPayTime()),
                    productName,
                    money,
                    String.valueOf(paymentRefund.getTimes()));
          }
        }
        if (Integer.parseInt(this.type) == 2) {
          result =
              SmsModel.smsContinueInvestment(
                  cellphone,
                  sdf.format(paymentRefund.getActualPayTime()),
                  productName,
                  String.valueOf(paymentRefund.getInterest()),
                  String.valueOf(paymentRefund.getSalesMoney()));
        }
        if (result > 0) {
          paymentRefund.setIsSendSms(2);
          PaymentRefundModel.update(paymentRefund);
          this.setErrCode("0000");
          this.setErrDesc("操作成功");
          if (paymentRefund.getTimes()
              == PaymentRefundModel.getTimesIsUseBySalesNo(paymentRefund.getSalesNo())) {
            SalesModel.updateStatus(paymentRefund.getSalesNo(), SalesStatus.payment);
          }
        } else {
          this.setErrDesc("操作失败");
        }
      }
    }
    return SUCCESS;
  }