| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | import com.panzhihua.service_community.service.McsOrderService; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | @Override |
| | | public R detail(Long id) { |
| | | return R.ok(this.baseMapper.detail(id)); |
| | | McsOrderVO detail = this.baseMapper.detail(id); |
| | | Date cancelAt = DateUtils.addMinutes(detail.getCreateTime(), 30); |
| | | Date nowDate = new Date(); |
| | | detail.setCancelCountdown(cancelAt.getTime() - nowDate.getTime()); |
| | | return R.ok(detail); |
| | | } |
| | | |
| | | @Override |
| | |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | // 调用wx支付 |
| | | String result= WxPayUtils.h5pay(appid, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(), |
| | | String result = WxPayUtils.h5pay(appid, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(), |
| | | mcsOrder.getOrderNo(), money,mcsOrderVO.getTradeType()); |
| | | if (mcsOrderVO.getTradeType().equals("NATIVE")) { |
| | | JSONObject jsonObjectResult = JSONObject.parseObject(result); |
| | | result = QRCodeUtil.getBase64QRCode(jsonObjectResult.get("codeUrl").toString()); |
| | | } |
| | | return R.ok(result); |
| | | } catch (Exception e) { |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | |
| | | @Transactional |
| | | public R notify(McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrderBase=this.baseMapper.selectOne(new QueryWrapper<McsOrder>().lambda().eq(McsOrder::getOrderNo,mcsOrderVO.getOrderNo())); |
| | | mcsOrderBase.setStatus(2); |
| | | mcsOrderBase.setStatus(1); |
| | | mcsOrderBase.setPayNo(mcsOrderVO.getPayNo()); |
| | | mcsOrderBase.setPayTime(mcsOrderVO.getPayTime()); |
| | | int i=this.baseMapper.updateById(mcsOrderBase); |