| | |
| | | package com.gs.xky; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.gs.xky.config.*; |
| | | import com.gs.xky.dto.BarcodeDeliveryNo; |
| | | import com.gs.xky.dto.EmployeeInfo; |
| | | import com.gs.xky.dto.XkyDetail; |
| | | import com.gs.xky.dto.XkyEntity; |
| | | import com.gs.xky.entity.MesInvItemArn; |
| | | import com.gs.xky.service.*; |
| | | import com.gs.xky.service.VwCjScSjTsBbService; |
| | | import com.gs.xky.service.WorkWXService; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @SpringBootTest |
| | | class XkyApplicationTests { |
| | |
| | | |
| | | @Autowired |
| | | private VwCjScSjTsBbService vwCjScSjTsBbService; |
| | | |
| | | @Autowired |
| | | private WorkWXService workWXService; |
| | | |
| | | /** |
| | | * 测试导出生产数据并发送钉钉消息 |
| | |
| | | |
| | | System.out.println("=== 测试结束 ==="); |
| | | } |
| | | |
| | | /** |
| | | * 测试获取企业微信access_token |
| | | * 功能:调用企业微信API获取access_token |
| | | */ |
| | | @Test |
| | | void testGetWorkWXAccessToken() { |
| | | System.out.println("=== 开始测试获取企业微信access_token ==="); |
| | | |
| | | try { |
| | | String accessToken = workWXService.getAccessToken(); |
| | | |
| | | if (accessToken != null && !accessToken.isEmpty()) { |
| | | System.out.println("✓ 成功获取企业微信access_token"); |
| | | System.out.println(" - access_token: " + accessToken); |
| | | System.out.println(" - token长度: " + accessToken.length()); |
| | | } else { |
| | | System.out.println("✗ 获取的access_token为空"); |
| | | } |
| | | } catch (IOException e) { |
| | | System.out.println("✗ 获取access_token失败: " + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("=== 测试结束 ==="); |
| | | } |
| | | } |