jyy
2021-03-22 a17a3616fb0b59d61cda0f97c5005c18d97cdbee
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java
@@ -126,6 +126,7 @@
    }
    private ShopOrder createOrder(CreateSecKillDTO secKillDTO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId());
        if (shopReceiveAddress == null) {
            throw new GlobleException("请选择正确的收获地址");
@@ -177,6 +178,7 @@
        shopOrder.setUpdateBy("微信小程序生成");
        shopOrder.setCommodityPrice(secKillDTO.getPrice());
        shopOrder.setPurchaseQuantity(1);
        shopOrder.setCompanyId(bizUser.getCompanyId());
        //购买方式
        shopOrder.setShippingMethod(secKillDTO.getShippingMethod());
        //生成订单号
@@ -201,15 +203,15 @@
        shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY);
        //如果没有提交购买方式或配送方式不是物流
        //获取邮费
        BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getAddressId(), secKillDTO.getPrice());
        BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),bizUser.getCompanyId());
        shopOrder.setPostage(postPrice);
        BigDecimal payPrice = secKillDTO.getPrice().multiply(BigDecimal.valueOf(secKillDTO.getCount())).add(shopOrder.getPostage());
        shopOrder.setOrderMoney(payPrice);
        DiscountExplain discountExplain = new DiscountExplain();
        discountExplain.setPayPrice(payPrice);
        discountExplain.setPostage(postPrice);
        discountExplain.setActivity(BigDecimal.ZERO);
        discountExplain.setCoupon(BigDecimal.ZERO);
        discountExplain.setActivityPrice(BigDecimal.ZERO);
        discountExplain.setCouponPrice(BigDecimal.ZERO);
        discountExplain.setBillPrice(payPrice);
        Gson g = new GsonBuilder().create();
        shopOrder.setDiscountExplain(g.toJson(discountExplain));