|
|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.miniapp.bean.PayDetail;
|
|
|
import com.gree.mall.miniapp.bean.coupon.UserCouponBean;
|
|
|
import com.gree.mall.miniapp.bean.goods.AckGoodsBean;
|
|
|
+import com.gree.mall.miniapp.bean.goods.GoodsBean;
|
|
|
import com.gree.mall.miniapp.bean.goods.GoodsMaterialStockDTO;
|
|
|
import com.gree.mall.miniapp.bean.order.*;
|
|
|
import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
|
|
|
@@ -999,17 +1000,12 @@ public class OrderLogic {
|
|
|
public OrderAckBean ackOrder(OrderBuyBean orderBuyBean, HttpServletRequest request) throws InterruptedException {
|
|
|
OrderAckBean orderAckBean = this.ackOrder2(orderBuyBean,request);
|
|
|
|
|
|
- //运费
|
|
|
- BigDecimal freightAmountV2 = freightLogic.getFreightAmountV2(orderBuyBean,request);
|
|
|
-
|
|
|
- orderAckBean.setFreight(freightAmountV2);
|
|
|
orderAckBean.setTotalAmount(orderAckBean.getTotalAmount());
|
|
|
//实际支付金额
|
|
|
BigDecimal payAmount = orderAckBean.getTotalAmount()
|
|
|
.subtract(orderAckBean.getExchangeAmount())
|
|
|
.subtract(orderAckBean.getDiscountAmount())
|
|
|
- .subtract(orderAckBean.getPromotionFullPieceDiscountAmount())
|
|
|
- .add(orderAckBean.getFreight());
|
|
|
+ .subtract(orderAckBean.getPromotionFullPieceDiscountAmount());
|
|
|
if(payAmount.doubleValue() <= 0){
|
|
|
payAmount = BigDecimal.valueOf(0);
|
|
|
}
|
|
|
@@ -1029,6 +1025,8 @@ public class OrderLogic {
|
|
|
BigDecimal totalAmount = new BigDecimal(0);
|
|
|
//总的商品数量
|
|
|
Integer totalNum = 0;
|
|
|
+ //运费总额
|
|
|
+ BigDecimal totalFreight = BigDecimal.valueOf(0);
|
|
|
|
|
|
OrderAckBean orderAckBean = new OrderAckBean();
|
|
|
orderAckBean.setDiscountAmount(BigDecimal.valueOf(0));
|
|
|
@@ -1067,6 +1065,15 @@ public class OrderLogic {
|
|
|
ackGoodsBean.setSecKillId(buyGood.getSecKillId());
|
|
|
ackGoodsBean.setPromotionGroupId(buyGood.getPromotionGroupId());
|
|
|
|
|
|
+ BigDecimal freightAmountItem = goodsSpec.getFirstFee();
|
|
|
+ // 邮寄方式计算次件运费金额
|
|
|
+ if (buyGood.getNum() > 1) {
|
|
|
+ int surplusNum = buyGood.getNum() - 1;
|
|
|
+ BigDecimal continueAmountItem = new BigDecimal(surplusNum).multiply(goodsSpec.getContinueFee());
|
|
|
+ freightAmountItem = freightAmountItem.add(continueAmountItem);
|
|
|
+ }
|
|
|
+ totalFreight = totalFreight.add(freightAmountItem);
|
|
|
+
|
|
|
totalAmount = totalAmount.add(this.getChildTotalPrice(ackGoodsBean));
|
|
|
|
|
|
list.add(ackGoodsBean);
|
|
|
@@ -1079,6 +1086,7 @@ public class OrderLogic {
|
|
|
orderAckBean.setExchangeAmount(BigDecimal.valueOf(0));
|
|
|
}
|
|
|
|
|
|
+ orderAckBean.setFreight(totalFreight);
|
|
|
orderAckBean.setGoods(list);
|
|
|
orderAckBean.setTotalAmount(totalAmount);
|
|
|
orderAckBean.setTotalNum(totalNum);
|
|
|
@@ -1109,11 +1117,18 @@ public class OrderLogic {
|
|
|
|
|
|
for(BuyGood buyGood : buyGoods){
|
|
|
Goods goods = goodsLogic.getGoodsById(buyGood.getGoodsId());
|
|
|
+ final GoodsDetail goodsDetail = goodsLogic.getGoodsDetailById(buyGood.getGoodsId());
|
|
|
GoodsSpec goodsSpec = goodsLogic.getGoodsSpecById(buyGood.getGoodsSpecId());
|
|
|
if (goods == null || goodsSpec == null) {
|
|
|
throw new RemoteServiceException("商品不存在,请重新添加");
|
|
|
}
|
|
|
- buyGood.setGoods(goods);
|
|
|
+ GoodsBean goodsBean = new GoodsBean();
|
|
|
+ BeanUtils.copyProperties(goods, goodsBean);
|
|
|
+ goodsBean.setImgUrl(goodsDetail.getImgUrl());
|
|
|
+ goodsBean.setVedio(goodsDetail.getVedio());
|
|
|
+ goodsBean.setContent(goodsDetail.getContent());
|
|
|
+
|
|
|
+ buyGood.setGoods(goodsBean);
|
|
|
buyGood.setGoodsSpec(goodsSpec);
|
|
|
buyGood.setOrgPrice(goodsSpec.getOrgPrice());
|
|
|
buyGood.setPrice(goodsSpec.getPrice());
|