| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.event.ConfirmDeliveryEvent; |
| | | import com.ruoyi.order.mapper.OrderGoodMapper; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.jetbrains.annotations.Nullable; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.time.LocalDateTime; |
| | | import java.time.OffsetDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | private AppUserGiveawayTemporaryClient appUserGiveawayTemporaryClient; |
| | | @Resource |
| | | private ShopGiveawayTemporaryClient shopGiveawayTemporaryClient; |
| | | @Resource |
| | | private ApplicationEventPublisher applicationEventPublisher; |
| | | |
| | | |
| | | @Override |
| | |
| | | order.setExpressResult(JSON.toJSONString(mapTrackKD100Vo)); |
| | | this.updateById(order); |
| | | |
| | | |
| | | String s = HttpUtils.sendGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxdeed472c98e42a54&secret=c89c697c981452480e0781fb82d4284c"); |
| | | JSONObject jsonObject2 = JSONObject.parseObject(s); |
| | | System.out.println(jsonObject.getString("access_token")); |
| | | |
| | | // 发布事件 |
| | | applicationEventPublisher.publishEvent(new ConfirmDeliveryEvent(order.getId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String a = "{\n" + |
| | | " \"access_token\": \"90_4PJ8b5aLJa2M7aCtoskALEzfoap1me291Jc3ogi18NGH0Ts-Tol7K3COLLvkQ1JLcouvew11ORqcHf6mH5LA2KSC08NxiDhsjRPKuRh14mpvQRHmeFvwr-wKWjkANLdACAUHF\",\n" + |
| | | " \"order_key\": {\n" + |
| | | " \"order_number_type\": 1\n" + |
| | | " },\n" + |
| | | " \"logistics_type\": 1,\n" + |
| | | " \"delivery_mode\": 1,\n" + |
| | | " \"shipping_list\": [\n" + |
| | | " {\n" + |
| | | " \"item_desc\": \"这是一个测试\"\n" + |
| | | " }\n" + |
| | | " ],\n" + |
| | | " \"upload_time\": \"2022-12-15T13:29:35.120+08:00\",\n" + |
| | | " \"payer\": {\n" + |
| | | " \"openid\": \"ooOrs63KYDHcyhnUmTFpprHc6sb4\"\n" + |
| | | " }\n" + |
| | | "}"; |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(a); |
| | | System.out.println(jsonObject); |
| | | } |
| | | |
| | | |
| | | public static void importExpress2(String filePath) throws MalformedURLException { |