| | |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.mall.vo.ApiLeaderListVo; |
| | | import cc.mrbird.febs.mall.vo.OrderDetailVo; |
| | | import cc.mrbird.febs.mall.vo.OrderListVo; |
| | | import cc.mrbird.febs.mall.vo.OrderRefundVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.pay.model.BrandWCPayRequestData; |
| | | import cc.mrbird.febs.pay.model.OrderStateDto; |
| | | import cc.mrbird.febs.pay.service.IPayService; |
| | |
| | | private final MallElectronicFenceMapper mallElectronicFenceMapper; |
| | | private final MallMemberWalletMapper mallMemberWalletMapper; |
| | | private final MallRollPerkMapper mallRollPerkMapper; |
| | | private final MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | orderInfo.setStatus(OrderStatusEnum.WAIT_PAY.getValue()); |
| | | orderInfo.setRemark(addOrderDto.getRemark()); |
| | | orderInfo.setOrderType(addOrderDto.getOrderType()); |
| | | orderInfo.setDeliveryType(2); |
| | | orderInfo.setDeliveryType(addOrderDto.getDeliveryType()); |
| | | if (CollUtil.isEmpty(addOrderDto.getItems())) { |
| | | throw new FebsException("参数错误"); |
| | | } |
| | |
| | | throw new FebsException("兑换券已使用"); |
| | | } |
| | | mallRollPerk.setState(2); |
| | | mallRollPerk.setUpdateTime(DateUtil.date()); |
| | | mallRollPerkMapper.updateById(mallRollPerk); |
| | | payResultStr = orderInfo.getOrderNo(); |
| | | |
| | |
| | | BigDecimal balanceThree = mallMemberWalletThree.getBalance(); |
| | | BigDecimal amountThree = orderInfo.getAmount(); |
| | | |
| | | int reduceThree = memberWalletService.reduce(balanceThree, member.getId(), "balance"); |
| | | if (reduceThree == 2) { |
| | | throw new FebsException("余额不足"); |
| | | } |
| | | mallMoneyFlowService.addMoneyFlow(member.getId(), balanceThree.negate(), MoneyFlowTypeEnum.PAY.getValue(), |
| | | orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue(),"余额支付",2); |
| | | // int reduceThree = memberWalletService.reduce(balanceThree, member.getId(), "balance"); |
| | | // if (reduceThree == 2) { |
| | | // throw new FebsException("余额不足"); |
| | | // } |
| | | // mallMoneyFlowService.addMoneyFlow(member.getId(), balanceThree.negate(), MoneyFlowTypeEnum.PAY.getValue(), |
| | | // orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue(),"余额支付",2); |
| | | |
| | | //实际支付余额 |
| | | BigDecimal amountActualThree = amountThree.subtract(balanceThree).setScale(2, BigDecimal.ROUND_DOWN); |
| | |
| | | } |
| | | wxResultStr = JSONUtil.toJsonStr(brandWCPayRequestDataThree); |
| | | payResultStr = brandWCPayRequestDataThree.getPrepay_id(); |
| | | orderInfo.setPayMethod("微信支付"); |
| | | orderInfo.setPayMethod("余额加微信"); |
| | | amountActualMsg = amountThree.toString(); |
| | | break; |
| | | /** |
| | |
| | | mallMoneyFlowService.addMoneyFlow(member.getId(), amountActualOne.negate(), MoneyFlowTypeEnum.PAY.getValue(), |
| | | orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue(),"余额支付",2); |
| | | amountActualMsg = amountActualOne.toString(); |
| | | |
| | | orderInfo.setPayMethod("积分加余额"); |
| | | mallMoneyFlowService.addMoneyFlow(member.getId(), scoreOne.negate(), |
| | | MoneyFlowTypeEnum.SCORE_PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue(),"积分支付",2); |
| | | break; |
| | |
| | | } |
| | | wxResultStr = JSONUtil.toJsonStr(brandWCPayRequestDataTwo); |
| | | payResultStr = brandWCPayRequestDataTwo.getPrepay_id(); |
| | | orderInfo.setPayMethod("微信支付"); |
| | | orderInfo.setPayMethod("积分加微信"); |
| | | amountActualMsg = amountActualTwo.toString(); |
| | | break; |
| | | default: |
| | |
| | | long remainTime = DateUtil.between(new Date(), endTime, DateUnit.SECOND, false); |
| | | orderDetailVo.setRemainTime(remainTime); |
| | | } |
| | | String orderNo = orderInfo.getOrderNo(); |
| | | List<MoneyFlowVo> moneyFlowVos = mallMoneyFlowMapper.selectMoneyFlowByOrderNo(orderNo,orderInfo.getMemberId()); |
| | | orderDetailVo.setMoneyFlowVos(moneyFlowVos); |
| | | return orderDetailVo; |
| | | } |
| | | |