| | |
| | | package com.hxh.spring.test.vip; |
| | | |
| | | import com.yeshi.buwan.domain.vip.UserVIPInfo; |
| | | import com.yeshi.buwan.domain.vip.OrderRecord; |
| | | import com.yeshi.buwan.domain.vip.VIPPrice; |
| | | import com.yeshi.buwan.domain.vip.VIPPriceType; |
| | | import com.yeshi.buwan.domain.vip.*; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.exception.ParamsException; |
| | | import com.yeshi.buwan.exception.order.OrderException; |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.exception.vip.VideoBuyRecordException; |
| | | import com.yeshi.buwan.job.OrderJob; |
| | | import com.yeshi.buwan.pptv.PPTVVipManager; |
| | | import com.yeshi.buwan.service.inter.order.OrderService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPPriceService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPService; |
| | | import com.yeshi.buwan.service.inter.vip.VideoBuyRecordService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.HttpUtil; |
| | | import org.junit.Test; |
| | |
| | | |
| | | @Resource |
| | | private OrderJob orderJob; |
| | | |
| | | @Resource |
| | | private VideoBuyRecordService videoBuyRecordService; |
| | | |
| | | @Test |
| | | public void addVIPPrice() { |
| | |
| | | |
| | | @Test |
| | | public void listRecord() { |
| | | List<OrderRecord> list = orderService.listOrderRecord(null, null,null, 1, 10); |
| | | long count = orderService.countOrderRecord(null, null,null); |
| | | List<OrderRecord> list = orderService.listOrderRecord(null, null, null, 1, 10); |
| | | long count = orderService.countOrderRecord(null, null, null); |
| | | |
| | | |
| | | list = orderService.listOrderRecord(766693 + "", null,null, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "", null,null); |
| | | list = orderService.listOrderRecord(766693 + "", null, null, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "", null, null); |
| | | |
| | | |
| | | list = orderService.listOrderRecord(766693 + "", null,OrderRecord.STATE_NOT_PAY, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "", null,OrderRecord.STATE_NOT_PAY); |
| | | list = orderService.listOrderRecord(766693 + "", null, OrderRecord.STATE_NOT_PAY, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "", null, OrderRecord.STATE_NOT_PAY); |
| | | |
| | | list = orderService.listOrderRecord(766693 + "", null,OrderRecord.STATE_PAY, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "",null, OrderRecord.STATE_PAY); |
| | | list = orderService.listOrderRecord(766693 + "", null, OrderRecord.STATE_PAY, 1, 10); |
| | | count = orderService.countOrderRecord(766693 + "", null, OrderRecord.STATE_PAY); |
| | | |
| | | System.out.println(list); |
| | | } |
| | |
| | | } |
| | | |
| | | @Test |
| | | public void cancelOrder(){ |
| | | public void cancelOrder() { |
| | | try { |
| | | orderJob.cancelOrder("1000140"); |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void addBuyVideoRecord() { |
| | | VideoBuyRecord record = new VideoBuyRecord(); |
| | | record.setId("123123"); |
| | | record.setGoodsNo("123123123"); |
| | | record.setStartTime(new Date()); |
| | | record.setEndTime(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24L)); |
| | | record.setLoginUid("766693"); |
| | | record.setInfoId("381072"); |
| | | record.setCid("32459137"); |
| | | try { |
| | | videoBuyRecordService.addRecord(record); |
| | | } catch (ParamsException e) { |
| | | e.printStackTrace(); |
| | | } catch (VideoBuyRecordException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void buyVideo() { |
| | | try { |
| | | pptvVipManager.buyVideo(orderService.getOrderRecord("1000155")); |
| | | } catch (PPTVException e) { |
| | | e.printStackTrace(); |
| | | } catch (OrderException e) { |
| | | e.printStackTrace(); |
| | | } catch (VideoBuyRecordException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |