admin
2019-02-27 7506a36913607608777d0312e2d13cd1cba2ff5e
免单券相关修改
2个文件已修改
25 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java
@@ -710,7 +710,7 @@
        if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
            BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
            // 查询是否有免单计划
            boolean mianDan = false;
            BigDecimal mianDanMoney = null;
            if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
                List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
                        commonOrder.getOrderNo());
@@ -724,17 +724,21 @@
                    if (goods != null) {
                        try {
                            mianDan = userSystemCouponService.updateCouponRecordUsed(commonOrder.getUserInfo().getId(),
                                    commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId()));
                            if (mianDan)
                                fanliRate = new BigDecimal(100);
                            if (userSystemCouponService.updateCouponRecordUsed(commonOrder.getUserInfo().getId(),
                                    commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId())))
                                mianDanMoney = payMent;
                        } catch (NumberFormatException e) {
                            throw new HongBaoException(10, "免单商品处理出错");
                        } catch (Exception e) {
                            e.printStackTrace();
                            throw new HongBaoException(11, "免单商品处理出错");
                        }
                    }
                }
            } else if (commonOrder.getState() == CommonOrder.STATE_SX) {//设置失效
//                userSystemCouponService.updateS
            }
            HongBaoV2 hongBao = new HongBaoV2();
@@ -754,9 +758,14 @@
            } else if (commonOrder.getState() == CommonOrder.STATE_SX) {
                hongBao.setState(HongBaoV2.STATE_SHIXIAO);
                hongBao.setMoney(new BigDecimal(0));
            } else {
                throw new HongBaoException(3, "维权订单不能创建红包");
            }
            if (mianDanMoney != null)
                hongBao.setMoney(mianDanMoney);
            UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
            hongBao.setUrank(user.getRank());
            hongBaoV2Mapper.insertSelective(hongBao);
@@ -785,7 +794,7 @@
            }
            UserInfo boss = threeSaleSerivce.getBoss(user.getId());
            if (boss != null && hongBao.getState() != HongBaoV2.STATE_SHIXIAO && !mianDan) {// 1级BOSS存在且红包未失效,免单不支持多级分销
            if (boss != null && hongBao.getState() != HongBaoV2.STATE_SHIXIAO && mianDanMoney==null) {// 1级BOSS存在且红包未失效,免单不支持多级分销
                // 插入一级子红包
                BigDecimal firstRate = hongBaoManageService
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -1107,10 +1107,6 @@
    public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment,
            Long auctionId) throws  Exception{
        
        //只处理付款金额小于10的
        if(payment==null||payment.compareTo(new BigDecimal(10))<0)
            return false;
        boolean isfree = false;
        
        if (uid == null || payment == null || auctionId == null || orderNo == null ||