| | |
| | | import com.yeshi.buwan.exception.order.OrderException; |
| | | import com.yeshi.buwan.exception.order.PayException; |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.exception.vip.VideoBuyRecordException; |
| | | import com.yeshi.buwan.pptv.PPTVVipManager; |
| | | import com.yeshi.buwan.service.inter.order.OrderService; |
| | | import com.yeshi.buwan.service.manager.GoldCornManager; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public OrderRecord createOrder(OrderRecord record) throws OrderException { |
| | | if (record.getMoney() == null || (record.getType() == null && record.getVideoInfoId() == null) || record.getOrderType() == null || record.getUid() == null) { |
| | | if (record.getMoney() == null || (record.getType() == null && record.getVideoCid() == null) || record.getOrderType() == null || record.getUid() == null) { |
| | | throw new OrderException(1, "参数不完整"); |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | // @GlobalTransactional(timeoutMills = 30000, name = "buwan-order", rollbackFor = Exception.class) |
| | | @Override |
| | | public PayWayInfoDTO payOrder(OrderRecord record) throws OrderException, GoldCornException, PayException, VIPException, PPTVException { |
| | | public PayWayInfoDTO payOrder(OrderRecord record) throws OrderException, GoldCornException, PayException, VIPException, PPTVException, VideoBuyRecordException { |
| | | String orderNo = VIPOrderUtil.getOutOrderNo(record.getOrderType(), record.getId()); |
| | | switch (record.getPayWay()) { |
| | | case OrderRecord |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public OrderRecord paySuccess(String id, int payWay, BigDecimal payMoney, Date payTime) throws |
| | | VIPException, PPTVException { |
| | | VIPException, PPTVException, VideoBuyRecordException, OrderException { |
| | | orderLogger.info("订单支付成功目的执行:id-{},支付方式-{},支付金额-{},支付时间-{}", id, payWay, payMoney, payTime.getTime()); |
| | | |
| | | Session session = vipOrderRecordDao.getSession(); |
| | |
| | | Query query = session.createSQLQuery("select * from wk_vip_order_record r where r.id=? for update").addEntity(OrderRecord.class).setCacheable(false).setParameter(0, id); |
| | | List<OrderRecord> list = query.list(); |
| | | if (list == null || list.size() == 0) |
| | | throw new VIPException(10, "订单不存在"); |
| | | throw new OrderException(10, "订单不存在"); |
| | | |
| | | OrderRecord record = list.get(0); |
| | | if (record.getState() != OrderRecord.STATE_NOT_PAY) |
| | | throw new VIPException(1, "订单未处于待支付状态"); |
| | | throw new OrderException(1, "订单未处于待支付状态"); |
| | | |
| | | |
| | | if (payWay != OrderRecord.PAY_WAY_GOLDCORN) { |