longz
2026-06-04 da780b14b8db78043d2c0f27d3bfd73111e6d550
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.stylefeng.guns;
 
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.WeChatUtil;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
 
import javax.annotation.Resource;
import java.io.InputStream;
 
@RunWith(SpringRunner.class)
@SpringBootTest
public class GunsApplicationTest {
 
   @Resource
   private IOrderTaxiService orderTaxiService;
    @Autowired
    private WeChatUtil weChatUtil;
 
    @Test
    public void test() {
       try {
           orderTaxiService.grabOrder(819, 14);
       } catch (Exception e) {
           throw new RuntimeException(e);
       }
   }
   @Test
    public void testWeChat(){
       Integer id = 474;
       StringBuilder sceneBuilder = new StringBuilder();
       sceneBuilder.append("id=").append(id);
       sceneBuilder.append("&f=").append("10");
       String scene = sceneBuilder.toString();
       // 4. 生成小程序码
       String page = "pages/scanOrder/scanOrder";  // 小程序跳转页面
       InputStream inputStream = null;
       try {
           inputStream = weChatUtil.getwxacodeunlimit(page, scene, "trial");
       } catch (Exception e) {
           throw new RuntimeException(e);
       }
   }
}