예제 #1
0
  @Transactional(propagation = Propagation.REQUIRED)
  public void updateOrderPayState(int orderId) {
    OrderBean orderBean = orderDao.get(orderId);
    Map<String, String> queryOrderResult = null;
    if (orderBean != null) {
      try {
        queryOrderResult =
            unionpayQueryService.queryPayState(
                orderBean.getOrderSequence(), orderBean.getCreateTime());
      } catch (InterruptedException e) {
        throw new CannotUpdateOrderPayState("查询银联订单支付结果发生错误!", e);
      }
    }
    Integer currentOrderState =
        queryOrderResult != null ? Integer.parseInt(queryOrderResult.get("respCode")) : null;
    if (currentOrderState != null) {
      if (currentOrderState.equals("00") || currentOrderState.equals("A6")) {
        currentOrderState = OrderPayStateEnum.SUCCESS.val();
      } else if (currentOrderState.equals("03")
          || currentOrderState.equals("04")
          || currentOrderState.equals("05")
          || currentOrderState.equals("01")
          || currentOrderState.equals("12")
          || currentOrderState.equals("34")
          || currentOrderState.equals("60")) {
        currentOrderState = OrderPayStateEnum.PAYING.val();
      } else {
        currentOrderState = OrderPayStateEnum.FAIL.val();
      }
    } else {
      logger.error(
          "查询银联订单支付结果没有获取到任何信息!订单ID:{}创建时间:{}接口返回消息:{}",
          new Object[] {
            orderBean.getOrderSequence(), orderBean.getCreateTime(), queryOrderResult.toString()
          });
      throw new CannotUpdateOrderPayState("查询银联订单支付结果没有获取到任何信息!");
    }

    // 更新支付状态
    orderDao.updateOrderPayState(orderBean.getId(), currentOrderState);
    if (currentOrderState.equals(OrderPayStateEnum.FAIL.val())) {
      diagnoseTimeService.updateDiagnoseNumbalance(orderBean.getTimeId());
    }
  }
예제 #2
0
 @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
 public List<OrderBean> findOrderByParam(Map<String, Object> param) {
   return orderDao.findOrderByParam(param);
 }
예제 #3
0
 @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
 public List<OrderBean> findOrderByTimeIdForPage(int timeId) {
   return orderDao.findOrderByTimeIdForPage(timeId);
 }
예제 #4
0
 @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
 public OrderBean findFirstOrderByTimeId(int timeId) {
   return orderDao.findFirstOrderByTimeId(timeId);
 }
예제 #5
0
 @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
 public OrderBean get(int id) {
   return orderDao.get(id);
 }
예제 #6
0
 @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
 public List<OrderBean> list() {
   return orderDao.list();
 }
예제 #7
0
 @Transactional(propagation = Propagation.REQUIRED)
 public int delete(int id) {
   return orderDao.delete(id);
 }