|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //订单范围内才允许下单 | 
|---|
|  |  |  | MallAddressInfo address = mallAddressInfoMapper.selectAddressInfoByMemberIdAndId(member.getId(), addOrderDto.getAddressId()); | 
|---|
|  |  |  | if(ObjectUtil.isEmpty(address)){ | 
|---|
|  |  |  | throw new FebsException("请重新选择提货人信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        MallElectronicFence mallElectronicFence = mallElectronicFenceMapper.selectByTeamLeaderCode(mallTeamLeader.getUniqueCode()); | 
|---|
|  |  |  | //        if(ObjectUtil.isNotEmpty(mallElectronicFence)){ | 
|---|
|  |  |  | //            String inStr = iMallElectronicFenceService.fenceToLocation(mallElectronicFence.getGKey(), | 
|---|
|  |  |  | 
|---|
|  |  |  | orderInfo.setCarriage(delivaryAmount); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderInfo.setAmount(total); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | orderInfo.setAddressId(address.getId()); | 
|---|
|  |  |  | orderInfo.setName(address.getName()); | 
|---|
|  |  |  | orderInfo.setPhone(address.getPhone()); | 
|---|
|  |  |  | orderInfo.setIsHome(addOrderDto.getIsHome()); | 
|---|
|  |  |  | //订单金额大于50,且选择送货上门,订单需要选择地址信息 | 
|---|
|  |  |  | if(1 == addOrderDto.getIsHome()){ | 
|---|
|  |  |  | //        if(1 == addOrderDto.getIsHome()){ | 
|---|
|  |  |  | if (StrUtil.isBlank(address.getLatitude())||StrUtil.isBlank(address.getLongitude())) { | 
|---|
|  |  |  | throw new FebsException("请添加地址"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderInfo.setAddress(address.getArea() + address.getAddress()); | 
|---|
|  |  |  | orderInfo.setLatitude(address.getLatitude()); | 
|---|
|  |  |  | orderInfo.setLongitude(address.getLongitude()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | this.baseMapper.updateById(orderInfo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | agentProducer.sendOrderCancelDelayMsg(orderInfo.getId(), 15 * 60 * 1000L); | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new FebsException("购买商品或sku不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (sku.getStock() < mallOrderItem.getCnt()) { | 
|---|
|  |  |  | throw new FebsException(sku.getSkuName() + "库存不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                    if (sku.getStock() < mallOrderItem.getCnt()) { | 
|---|
|  |  |  | //                        throw new FebsException(sku.getSkuName() + "库存不足"); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId()); | 
|---|
|  |  |  | Integer goodsResult = mallGoodsMapper.updateStockAndVolumeByGoodsId(mallGoods.getId(), mallOrderItem.getCnt()); | 
|---|