admin
2019-11-12 ca3e865a9e3c22fc24c7ca4b67ad8c25d3f2ef18
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
@@ -140,6 +140,10 @@
      order.setOrderNo(orderNo);
      banLiShopOrderMapper.updateByPrimaryKeySelective(update);
      // 增加销量
      banLiShopGoodsSetService.addSalesCount(order.getGoodsSet().getId(), 1);
      banLiShopGoodsService.addSalesCount(order.getGoods().getId(), 1);
      // 订单添加成功 ,延时通知后续
      sendPlaceOrderMsg(order.getId(), order.getUid());
   }
@@ -186,12 +190,12 @@
   @Override
   public List<BanLiShopOrder> listByUid(Long uid, int page, int pageSize) {
      return banLiShopOrderMapper.listByUid(null, uid, (page - 1) * pageSize, pageSize);
      return banLiShopOrderMapper.listByUidAndState(null, uid, (page - 1) * pageSize, pageSize);
   }
   @Override
   public long countByUid(Long uid) {
      return banLiShopOrderMapper.countByUid(null, uid);
      return banLiShopOrderMapper.countByUidAndState(null, uid);
   }
   @Override
@@ -389,6 +393,7 @@
         update.setState(BanLiShopOrder.STATE_REJECT);
         update.setStateDesc(msg);
         update.setUpdateTime(new Date());
         update.setRejectTime(new Date());
         banLiShopOrderMapper.updateByPrimaryKeySelective(update);
         transactionManager.commit(transactionStatus);
      } catch (Exception e) {
@@ -415,7 +420,12 @@
      }
      if (pay.getHongBaoPrice() != null && pay.getHongBaoPrice().compareTo(new BigDecimal(0)) > 0) {
         BigDecimal money = redPackBalanceService.getBalance(uid);
         BigDecimal money = null;
         try {
            money = redPackBalanceService.getBalance(uid);
         } catch (RedPackBalanceException e) {
            throw new BanLiShopOrderException(25, "红包功能异常");
         }
         if (money.compareTo(pay.getHongBaoPrice()) < 0) {
            throw new BanLiShopOrderException(24, "红包余额不足");
         }
@@ -452,4 +462,14 @@
      return banLiShopOrderMapper.selectByOrderNo(orderNo);
   }
   @Override
   public List<BanLiShopOrder> listByUidAndState(Long uid, List<Integer> stateList, int page, int pageSize) {
      return banLiShopOrderMapper.listByUidAndState(stateList, uid, (page - 1) * pageSize, pageSize);
   }
   @Override
   public long countByUidAndState(Long uid, List<Integer> stateList) {
      return banLiShopOrderMapper.countByUidAndState(stateList, uid);
   }
}