| | |
| | | } |
| | | |
| | | private ShopOrder createOrder(CreateSecKillDTO secKillDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId()); |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(secKillDTO.getPrice()); |
| | | shopOrder.setPurchaseQuantity(1); |
| | | shopOrder.setCompanyId(bizUser.getCompanyId()); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod(secKillDTO.getShippingMethod()); |
| | | //生成订单号 |
| | |
| | | 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); |