| | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DatePattern; |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.common.utlis.wx.WXPayUtil; |
| | | import com.panzhihua.service_community.config.RabbitmqConfig; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComShopFlowerOrderService; |
| | | import com.panzhihua.service_community.util.WxMaConfiguration; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | |
| | | |
| | | @Value("${hcMin.app.isTest}") |
| | |
| | | } catch (Exception e) { |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | | } |
| | | //发送消息到mq |
| | | rabbitTemplate.convertAndSend(RabbitmqConfig.SHOP_ORDER_EXCHANGE, RabbitmqConfig.SHOP_ORDER_ROUTING_KEY, shopOrderVO, message -> { |
| | | message.getMessageProperties().setHeader("x-delay", dateToSecond(DateUtil.endOfDay(DateUtil.date())) * 1000 * 60); |
| | | return message; |
| | | }); |
| | | return R.ok(shopOrderVO); |
| | | } |
| | | |
| | | private Long dateToSecond(Date expireTime){ |
| | | return DateUtil.between(new Date(),expireTime, DateUnit.MS); |
| | | } |
| | | |
| | | /** |
| | |
| | | comShopFlowerOrderDeliveryNoListVO.setPage(orderPageVOIPage); |
| | | return R.ok(comShopFlowerOrderDeliveryNoListVO); |
| | | } |
| | | |
| | | } |