| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createOrder(AddOrderDto addOrderDto) { |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | |
| | | String takeUniqueCode = addOrderDto.getTakeUniqueCode(); |
| | | if(StrUtil.isEmpty(takeUniqueCode)){ |
| | | throw new FebsException("请选择自提点"); |
| | | } |
| | | MallAddressInfo address = mallAddressInfoMapper.selectAddressInfoByMemberIdAndId(member.getId(), addOrderDto.getAddressId()); |
| | | if (address == null) { |
| | | throw new FebsException("地址不存在"); |
| | |
| | | } |
| | | |
| | | String payResultStr = ""; |
| | | String wxResultStr = ""; |
| | | switch (payOrderDto.getType()) { |
| | | case "1": |
| | | // orderInfo.setPayOrderNo(payOrderDto.getPayOrderNo()); |
| | |
| | | } catch (Exception e) { |
| | | throw new FebsException("支付失败"); |
| | | } |
| | | wxResultStr = JSONUtil.toJsonStr(brandWCPayRequestData); |
| | | payResultStr = brandWCPayRequestData.getPrepay_id(); |
| | | orderInfo.setPayMethod("微信支付"); |
| | | agentProducer.sendOrderReturn(orderInfo.getId()); |
| | |
| | | map.put("orderInfo", payResultStr); |
| | | map.put("orderNo", orderInfo.getOrderNo()); |
| | | map.put("orderId", orderInfo.getId()); |
| | | map.put("wxResultStr", wxResultStr); |
| | | |
| | | return map; |
| | | } |