| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | */
|
| | | private void paySuccess(BanLiShopOrder order) {
|
| | | ThreadUtil.run(new Runnable() {
|
| | | |
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | long[] targetUids = new long[] { 3L, 4L };
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void refund(Long orderId) throws BanLiShopOrderException {
|
| | | // 订单退款
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void invalidOrderByOrderId(Long orderId, String stateDesc) throws BanLiShopOrderException {
|
| | |
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | | if (order == null)
|
| | | return;
|
| | | // 退款
|
| | | if (order.getState() == BanLiShopOrder.STATE_NO_PAY) {// 状态还是未支付
|
| | | // 退款红包
|
| | | if (order.getHongBaoPaymentState() != null
|
| | | && order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID) {
|
| | | BanLiShopGoods goods = banLiShopGoodsService.selectByPrimaryKey(order.getGoods().getId());
|
| | | BanLiShopGoodsClass goodsClass = banLiShopGoodsClassService
|
| | | .selectByPrimaryKey(goods.getGoodsClass().getId());
|
| | | BanLiShopGoodsSets set = banLiShopGoodsSetService.selectByPrimaryKey(order.getGoodsSet().getId());
|
| | | // 红包退款
|
| | | RedPackDetail detail = null;
|
| | | try {
|
| | | detail = RedPackDetailFactory.createShopOrderDrawBack(orderId, order.getUid(), goodsClass.getName(),
|
| | | set.getName(), order.getHongBaoPayment());
|
| | | } catch (RedPackDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (detail == null)
|
| | | throw new BanLiShopOrderException(4, "红包详情失败");
|
| | | try {
|
| | | redPackBalanceService.addRedPack(order.getUid(), order.getHongBaoPayment(), detail);
|
| | | } catch (RedPackBalanceException e) {
|
| | | throw new BanLiShopOrderException(5, "红包退款失败");
|
| | | }
|
| | |
|
| | | BanLiShopOrder update = new BanLiShopOrder(order.getId());
|
| | | update.setHongBaoPaymentState(BanLiShopOrder.PAY_STATE_REFUND);
|
| | | update.setUpdateTime(new Date());
|
| | | banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
|
| | | }
|
| | |
|
| | | banLiShopOrderService.invalidOrderByOrderId(orderId, stateDesc);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|