| | |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | bigDecimal = bigDecimal.add(myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber()))); |
| | | myShoppingCartVo.setEarnSpendingPoints(myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber()); |
| | | } |
| | | confirmOrderVo.setOrderMoney(bigDecimal); |
| | | }else{ |
| | | int sum = 0; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | sum += ((null != myShoppingCartVo.getPoint() ? myShoppingCartVo.getPoint() : 0) * myShoppingCartVo.getNumber()); |
| | | myShoppingCartVo.setEarnSpendingPoints((null != myShoppingCartVo.getEarnSpendingPoints() ? myShoppingCartVo.getEarnSpendingPoints() : 0) * myShoppingCartVo.getNumber()); |
| | | } |
| | | confirmOrderVo.setOrderPoint(sum); |
| | | } |
| | |
| | | BigDecimal paymentMoney = orderMoney; |
| | | //总优惠金额 |
| | | BigDecimal activityAmount = BigDecimal.ZERO; |
| | | |
| | | |
| | | BaseSetting baseSetting = baseSettingClient.getBaseSetting(4).getData(); |
| | | confirmOrderVo.setUseSimultaneously(JSON.parseObject(baseSetting.getContent()).getInteger("status") == 1); |
| | |
| | | BigDecimal goodsMoney = BigDecimal.ZERO; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | String goodsId = myShoppingCartVo.getGoodsId().toString(); |
| | | BigDecimal cash = myShoppingCartVo.getCash(); |
| | | BigDecimal cash = myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber())); |
| | | if(parseArray.contains(goodsId)){ |
| | | goodsMoney = goodsMoney.add(cash); |
| | | }else{ |
| | |
| | | vo.setPurchaseLimitNum(goods.getPurchaseLimit() - sum); |
| | | } |
| | | vo.setDistributionMode(goods.getDistributionMode()); |
| | | vo.setEarnSpendingPoints(price.getEarnSpendingPoints()); |
| | | vo.setSuperiorSubcommission(price.getSuperiorSubcommission()); |
| | | vo.setSuperiorRebatePoints(price.getSuperiorRebatePoints()); |
| | | vo.setEarnSpendingPoints(price.getEarnSpendingPoints() * shoppingCart.getNumber()); |
| | | vo.setSuperiorSubcommission(price.getSuperiorSubcommission().multiply(new BigDecimal(shoppingCart.getNumber()))); |
| | | vo.setSuperiorRebatePoints(price.getSuperiorRebatePoints() * shoppingCart.getNumber()); |
| | | vo.setSuperiorType(price.getSuperiorType()); |
| | | vo.setSuperiorPriceType(price.getSuperiorPriceType()); |
| | | vo.setServuceShopCharges(price.getServuceShopCharges()); |
| | | vo.setServuceShopPoints(price.getServuceShopPoints()); |
| | | vo.setTechnicianPoints(price.getTechnicianPoints()); |
| | | vo.setBoundShopCharges(price.getBoundShopCharges()); |
| | | vo.setBoundShopPoints(price.getBoundShopPoints()); |
| | | vo.setBoundShopSuperiorsCharges(price.getBoundShopSuperiorsCharges()); |
| | | vo.setBoundShopSuperiorsPoints(price.getBoundShopSuperiorsPoints()); |
| | | vo.setServuceShopCharges(price.getServuceShopCharges().multiply(new BigDecimal(shoppingCart.getNumber()))); |
| | | vo.setServuceShopPoints(price.getServuceShopPoints() * shoppingCart.getNumber()); |
| | | vo.setTechnicianPoints(price.getTechnicianPoints() * shoppingCart.getNumber()); |
| | | vo.setBoundShopCharges(price.getBoundShopCharges().multiply(new BigDecimal(shoppingCart.getNumber()))); |
| | | vo.setBoundShopPoints(price.getBoundShopPoints() * shoppingCart.getNumber()); |
| | | vo.setBoundShopSuperiorsCharges(price.getBoundShopSuperiorsCharges().multiply(new BigDecimal(shoppingCart.getNumber()))); |
| | | vo.setBoundShopSuperiorsPoints(price.getBoundShopSuperiorsPoints() * shoppingCart.getNumber()); |
| | | page.add(vo); |
| | | } |
| | | return page; |
| | |
| | | BigDecimal goodsMoney = BigDecimal.ZERO; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | String goodsId = myShoppingCartVo.getGoodsId().toString(); |
| | | BigDecimal cash = myShoppingCartVo.getCash(); |
| | | BigDecimal cash = myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber())); |
| | | if(parseArray.contains(goodsId)){ |
| | | goodsMoney = goodsMoney.add(cash); |
| | | }else{ |
| | |
| | | //可获得的消费积分 |
| | | int earnPoint = 0; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | earnPoint += (myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber()); |
| | | earnPoint += myShoppingCartVo.getEarnSpendingPoints(); |
| | | } |
| | | |
| | | //获取快递策略,计算快递费 |
| | |
| | | } |
| | | } |
| | | } |
| | | paymentMoney = paymentMoney.add(expressFee); |
| | | if(BigDecimal.ZERO.compareTo(paymentMoney) > 0){ |
| | | paymentMoney = BigDecimal.ZERO; |
| | | } |
| | |
| | | if(earnPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPoint.setChangeDirection(1); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | |
| | | if(earnPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(appUser.getLavePoint() - earnPoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPoint.setChangeDirection(1); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | |
| | | balanceChangeRecord.setVipId(appUser.getVipId()); |
| | | balanceChangeRecord.setOrderId(order.getId()); |
| | | balanceChangeRecord.setChangeType(5); |
| | | balanceChangeRecord.setBeforeAmount(balance.add(paymentMoney)); |
| | | balanceChangeRecord.setChangeAmount(paymentMoney); |
| | | balanceChangeRecord.setAfterAmount(balance); |
| | | balanceChangeRecord.setDelFlag(0); |
| | | balanceChangeRecord.setCreateTime(LocalDateTime.now()); |
| | | balanceChangeRecord.setChangeDirection(-1); |
| | | balanceChangeRecordClient.saveBalanceChangeRecord(balanceChangeRecord); |
| | | //修改订支付状态 |
| | | order.setPayStatus(2); |
| | |
| | | if(orderPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPoint.setChangeDirection(-1); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | |
| | |
| | | balanceChangeRecord.setVipId(appUser.getVipId()); |
| | | balanceChangeRecord.setOrderId(order.getId()); |
| | | balanceChangeRecord.setChangeType(5); |
| | | balanceChangeRecord.setBeforeAmount(balance.add(expressFee)); |
| | | balanceChangeRecord.setChangeAmount(expressFee); |
| | | balanceChangeRecord.setAfterAmount(balance); |
| | | balanceChangeRecord.setDelFlag(0); |
| | | balanceChangeRecord.setCreateTime(LocalDateTime.now()); |
| | | balanceChangeRecord.setChangeDirection(-1); |
| | | balanceChangeRecordClient.saveBalanceChangeRecord(balanceChangeRecord); |
| | | //修改订支付状态 |
| | | order.setPayStatus(2); |
| | |
| | | if(earnPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPoint.setChangeDirection(1); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | |
| | | if(orderPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPoint.setChangeDirection(-1); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | |