| | |
| | | confirmOrderVo.setResidualPoint(appUser.getLavePoint().intValue()); |
| | | //获取默认收货地址 |
| | | UserAddress userAddress = userAddressClient.getDefaultUserAddress(userid).getData(); |
| | | if(null != userAddress){ |
| | | userAddress.setIdStr(userAddress.getId().toString()); |
| | | confirmOrderVo.setUserAddress(userAddress); |
| | | } |
| | | confirmOrderVo.setPaymentType(confirmOrder.getPaymentType()); |
| | | //获取用户优惠券,用户全部优惠券,不能使用的需要标识出来置灰展示 |
| | | PaymentUserCoupon paymentUserCoupon = new PaymentUserCoupon(); |
| | |
| | | //获取快递策略 |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | } |