Pu Zhibing
2024-12-26 a988a89e6b0cd75a5df4691eb8196c0ef9513a05
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -175,10 +175,11 @@
            area.setCityCode(appUser.getCityCode());
            area.setProvinceCode(appUser.getProvinceCode());
            area.setVip(appUser.getVipId());
            area.setGoodsId(goodsId);
            GoodsArea goodsArea = goodsAreaClient.getGoodsArea(area).getData();
            if(null == goodsArea){
               //没有地区价格,则使用会员价格
               GoodsVip goodsVip = goodsVipClient.getGoodsVip(appUser.getVipId()).getData();
               GoodsVip goodsVip = goodsVipClient.getGoodsVip(goodsId, appUser.getVipId()).getData();
               if(null == goodsVip){
                  //没有配置价格,直接使用原始基础价格
                  return null;
@@ -191,6 +192,7 @@
                  price.setSuperiorSubcommission(goodsVip.getSuperiorSubcommission());
                  price.setSuperiorRebatePoints(goodsVip.getSuperiorRebatePoints());
                  price.setSuperiorType(goodsVip.getSuperiorType());
                  price.setSuperiorPriceType(goodsVip.getSuperiorPriceType());
                  price.setServuceShopCharges(goodsVip.getServuceShopCharges());
                  price.setServuceShopPoints(goodsVip.getServuceShopPoints());
                  price.setTechnicianPoints(goodsVip.getTechnicianPoints());
@@ -208,6 +210,7 @@
               price.setSuperiorSubcommission(goodsArea.getSuperiorSubcommission());
               price.setSuperiorRebatePoints(goodsArea.getSuperiorRebatePoints());
               price.setSuperiorType(goodsArea.getSuperiorType());
               price.setSuperiorPriceType(goodsArea.getSuperiorPriceType());
               price.setServuceShopCharges(goodsArea.getServuceShopCharges());
               price.setServuceShopPoints(goodsArea.getServuceShopPoints());
               price.setTechnicianPoints(goodsArea.getTechnicianPoints());
@@ -232,6 +235,7 @@
            price.setSuperiorSubcommission(goodsArea.getSuperiorSubcommission());
            price.setSuperiorRebatePoints(goodsArea.getSuperiorRebatePoints());
            price.setSuperiorType(goodsArea.getSuperiorType());
            price.setSuperiorPriceType(goodsArea.getSuperiorPriceType());
            price.setServuceShopCharges(goodsArea.getServuceShopCharges());
            price.setServuceShopPoints(goodsArea.getServuceShopPoints());
            price.setTechnicianPoints(goodsArea.getTechnicianPoints());
@@ -258,7 +262,8 @@
         price.setEarnSpendingPoints(goodsSeckill.getEarnSpendingPoints());
         price.setSuperiorSubcommission(goodsSeckill.getSuperiorSubcommission());
         price.setSuperiorRebatePoints(goodsSeckill.getSuperiorRebatePoints());
         price.setSuperiorType(String.valueOf(goodsSeckill.getSuperiorType()));
         price.setSuperiorType(goodsSeckill.getSuperiorType());
         price.setSuperiorPriceType(goodsSeckill.getSuperiorPriceType());
         price.setServuceShopCharges(goodsSeckill.getServuceShopCharges());
         price.setServuceShopPoints(goodsSeckill.getServuceShopPoints());
         price.setTechnicianPoints(goodsSeckill.getTechnicianPoints());
@@ -375,8 +380,10 @@
      confirmOrderVo.setResidualPoint(appUser.getLavePoint().intValue());
      //获取默认收货地址
      UserAddress userAddress = userAddressClient.getDefaultUserAddress(userid).getData();
      userAddress.setIdStr(userAddress.getId().toString());
      confirmOrderVo.setUserAddress(userAddress);
      if(null != userAddress){
         userAddress.setIdStr(userAddress.getId().toString());
         confirmOrderVo.setUserAddress(userAddress);
      }
      confirmOrderVo.setPaymentType(confirmOrder.getPaymentType());
      //获取用户优惠券,用户全部优惠券,不能使用的需要标识出来置灰展示
      PaymentUserCoupon paymentUserCoupon = new PaymentUserCoupon();
@@ -424,19 +431,19 @@
      //获取快递策略
      SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData();
      JSONObject jsonObject = JSON.parseObject(systemConfig.getContent());
      confirmOrderVo.setExpressFee(jsonObject.getBigDecimal("expressFee"));
      List<Integer> vip = jsonObject.getJSONArray("vip").toList(Integer.class);
      confirmOrderVo.setExpressFee(jsonObject.getBigDecimal("freight"));
      List<String> vip = Arrays.asList(jsonObject.getString("freeVip").split(","));
      //包邮条件(所有会员或者满足条件的会员)
      if(vip.get(0) == -1 || vip.contains(appUser.getVipId())){
      if(vip.get(0).equals("0") || vip.contains(appUser.getVipId().toString())){
         if(confirmOrder.getPaymentType() == 1){
            //现金支付,支付金额满足包邮条件
            BigDecimal cash = jsonObject.getBigDecimal("cash");
            BigDecimal cash = jsonObject.getBigDecimal("freeFreight");
            if(confirmOrderVo.getPayMoney().compareTo(cash) >= 0){
               confirmOrderVo.setExpressFee(BigDecimal.ZERO);
            }
         }else{
            //积分支付,支付积分是否满足包邮条件
            Integer point = jsonObject.getInteger("point");
            Integer point = jsonObject.getInteger("freeIntegral");
            if(confirmOrderVo.getOrderPoint().compareTo(point) >= 0){
               confirmOrderVo.setExpressFee(BigDecimal.ZERO);
            }
@@ -514,6 +521,7 @@
         vo.setSuperiorSubcommission(price.getSuperiorSubcommission());
         vo.setSuperiorRebatePoints(price.getSuperiorRebatePoints());
         vo.setSuperiorType(price.getSuperiorType());
         vo.setSuperiorPriceType(price.getSuperiorPriceType());
         vo.setServuceShopCharges(price.getServuceShopCharges());
         vo.setServuceShopPoints(price.getServuceShopPoints());
         vo.setTechnicianPoints(price.getTechnicianPoints());
@@ -734,19 +742,19 @@
         SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData();
         JSONObject jsonObject = JSON.parseObject(systemConfig.getContent());
         //快递费
         expressFee = jsonObject.getBigDecimal("expressFee");
         List<Integer> vip = jsonObject.getJSONArray("vip").toList(Integer.class);
         expressFee = jsonObject.getBigDecimal("freight");
         List<String> vip = Arrays.asList(jsonObject.getString("freeVip").split(","));
         //包邮条件(所有会员或者满足条件的会员)
         if(vip.get(0) == -1 || vip.contains(appUser.getVipId())){
         if(vip.get(0).equals("0") || vip.contains(appUser.getVipId().toString())){
            if(shoppingCartPayment.getPaymentType() != 3){
               //现金支付,支付金额满足包邮条件
               BigDecimal cash = jsonObject.getBigDecimal("cash");
               BigDecimal cash = jsonObject.getBigDecimal("freeFreight");
               if(paymentMoney.compareTo(cash) >= 0){
                  expressFee = BigDecimal.ZERO;
               }
            }else{
               //积分支付,支付积分是否满足包邮条件
               Integer point = jsonObject.getInteger("point");
               Integer point = jsonObject.getInteger("freeIntegral");
               if(orderPoint.compareTo(point) >= 0){
                  expressFee = BigDecimal.ZERO;
               }
@@ -844,6 +852,7 @@
         orderGood.setSuperiorSubcommission(myShoppingCartVo.getSuperiorSubcommission());
         orderGood.setSuperiorRebatePoints(myShoppingCartVo.getSuperiorRebatePoints());
         orderGood.setSuperiorType(myShoppingCartVo.getSuperiorType());
         orderGood.setSuperiorPriceType(myShoppingCartVo.getSuperiorPriceType());
         orderGood.setServuceShopCharges(myShoppingCartVo.getServuceShopCharges());
         orderGood.setServuceShopPoints(myShoppingCartVo.getServuceShopPoints());
         orderGood.setTechnicianPoints(myShoppingCartVo.getTechnicianPoints());