| | |
| | | import com.mzl.flower.mapper.supplier.StationMapper; |
| | | import com.mzl.flower.mapper.system.UserWechatMapper; |
| | | import com.mzl.flower.mapper.warehouse.WarehouseLocationMapper; |
| | | import com.mzl.flower.pay.SybPayService; |
| | | import com.mzl.flower.service.BaseService; |
| | | import com.mzl.flower.service.comment.FlowerCommentService; |
| | | import com.mzl.flower.service.coupon.CouponRecordService; |
| | |
| | | |
| | | @Autowired |
| | | private UserPaymentV3Service paymentV3Service; |
| | | |
| | | @Autowired |
| | | private UserPaymentSybService paymentSybService; |
| | | |
| | | @Autowired |
| | | private SequenceNo sequenceNo; |
| | |
| | | } |
| | | } |
| | | |
| | | public Map commitOrder(OrderCommitDTO dto, PreOrderDTO p, Map<Long, PriceDTO> priceMap) { |
| | | public Map commitOrder(OrderCommitDTO dto, PreOrderDTO p, Map<Long, PriceDTO> priceMap) throws Exception { |
| | | String userId = SecurityUtils.getUserId(); |
| | | p.getFlowers().forEach(flower -> { |
| | | // 限购数量 鲜花数量校验 |
| | |
| | | } |
| | | }); |
| | | |
| | | /* 替换支付修改 |
| | | WxMaJscode2SessionResult session = null; |
| | | try { |
| | | session = weChatService.getWxMaSessionInfo(dto.getWxcode()); |
| | |
| | | if (StringUtils.isBlank(openId)) { |
| | | throw new ValidationException("微信登录失败"); |
| | | } |
| | | */ |
| | | |
| | | Address address = addressMapper.selectById(dto.getAddressId()); |
| | | List<TransportOrderDTO> tLs = transportService.getPreOrderTransportList(address |
| | |
| | | } |
| | | totalAmount = totalAmount.add(p.getPacking()).add(transportFee); |
| | | if(totalAmount.doubleValue() <= 0){//假如总价小于等于0,则支付0.01元 |
| | | totalAmount = new BigDecimal(0.01); |
| | | totalAmount = new BigDecimal("0.01"); |
| | | } |
| | | order.setTotalAmount(totalAmount); |
| | | |
| | |
| | | } |
| | | |
| | | order.setOrderNo(getOrderNo()); |
| | | order.setPayOpenid(openId); |
| | | //order.setPayOpenid(openId);替换支付修改 |
| | | orderMapper.insert(order); |
| | | |
| | | //处理积分商品兑换券 |
| | |
| | | } |
| | | } |
| | | |
| | | Map map = paymentV3Service.wxPrepay(order); |
| | | map.put("_testV2OrderId", order.getId()); |
| | | return map; |
| | | return paymentSybService.prepay(order); |
| | | } |
| | | |
| | | private void usePointGoods(String orderId, List<Long> goodsRecordIdList){ |
| | |
| | | return dto; |
| | | } |
| | | |
| | | public void processAbnormalOrder(String id) { |
| | | public void processAbnormalOrder(String id) throws Exception { |
| | | Order o = orderMapper.selectById(id); |
| | | String transferId = o.getTransferId(); |
| | | if (StringUtils.isNotEmpty(transferId)) { |
| | |
| | | |
| | | transferId = "NoNeedRefund"; |
| | | if (deductAmount.doubleValue() > 0) { |
| | | transferId = paymentV3Service.refundOrderSub(o, deductAmount); |
| | | transferId = paymentSybService.refundOrderSub(o, deductAmount); |
| | | } |
| | | o.setTransferId(transferId); |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | | public void processLevelDown(OrderReduceDTO dto) { |
| | | public void processLevelDown(OrderReduceDTO dto) throws Exception { |
| | | Order o = orderMapper.selectById(dto.getId()); |
| | | String transferId = o.getTransferId(); |
| | | if (StringUtils.isNotEmpty(transferId)) { |
| | |
| | | } |
| | | |
| | | BigDecimal amount = dto.getAmount(); |
| | | transferId = paymentV3Service.refundOrderSub(o, amount); |
| | | transferId = paymentSybService.refundOrderSub(o, amount); |
| | | o.setTransferId(transferId); |
| | | o.setTransferTime(LocalDateTime.now()); |
| | | o.update(SecurityUtils.getUserId()); |