@Override public String execute() throws Exception { PagedList<PaymentRefund> paymentRefundPagedList = PaymentRefundModel.getPagingList(this.getCondition()); List<PaymentRefund> list = new ArrayList<PaymentRefund>(); list = paymentRefundPagedList.getResultList(); PaymentRefund paymentRefund = new PaymentRefund(); P2pProduct p2pProduct = new P2pProduct(); Product product = new Product(); for (int i = 0; i < list.size(); i++) { paymentRefund = list.get(i); if (paymentRefund.getProductType() == 5) { p2pProduct = P2pProductModel.getP2pByProductNo(paymentRefund.getProductNo()); if (p2pProduct != null) { list.get(i).setEditComment(p2pProduct.getName()); } else { list.get(i).setEditComment(""); } } else { product = ProductModel.getInfo(paymentRefund.getProductNo()); if (product != null) { list.get(i).setEditComment(product.getName()); } else { list.get(i).setEditComment(""); } } } this.setResultList(list); this.setPageCount(paymentRefundPagedList.getPagingInfo().getPageCount()); this.setPageIndex(paymentRefundPagedList.getPagingInfo().getPageIndex()); this.setRecordCount(paymentRefundPagedList.getPagingInfo().getTotalCount()); return SUCCESS; }
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; }
public String edit() { info.setEditUserNo(UserHelper.getEditUserNo()); int id = 0; if (this.getOper().equalsIgnoreCase("add")) { info.setInUserNo(UserHelper.getEditUserNo()); id = PaymentRefundModel.add(info); if (id > 0) { this.setErrDesc(String.valueOf(id)); } else { this.setErrCode("add failed"); this.setErrDesc("add failed"); } } else { if (info.getId() == 0) { this.setErrCode("NoID"); this.setErrDesc("NoID"); } else { if (this.getOper().equalsIgnoreCase("edit")) { PaymentRefund paymentRefund = PaymentRefundModel.getInfo(info.getId()); info.setSalesNo(paymentRefund.getSalesNo()); info.setP2pProductNo(paymentRefund.getP2pProductNo()); // info.setP2pCustomerNo(paymentRefund.getP2pCustomerNo()); info.setCustomerNo(paymentRefund.getCustomerNo()); info.setPayerNo(paymentRefund.getPayerNo()); if (PaymentRefundModel.update(info) > 0) { this.setErrDesc(String.valueOf(info.getId())); } else { this.setErrCode("update failed"); this.setErrDesc("update failed"); } } } } return SUCCESS; }