111
Administrator
2025-11-18 30613a5c9e36e4c60f1f77793739ac954dfbe522
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
50
51
52
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 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;
 
    /**
     * 测试导出生产数据并发送钉钉消息
     * 功能:查询VW_CJ_SC_SJ_TS_BB表数据 -> 导出Excel -> 发送钉钉文件消息
     */
    @Test
    void testExportAndSendProductionData() throws Exception {
        System.out.println("=== 开始测试导出生产数据并发送钉钉 ===");
 
//        try {
//            boolean result = vwCjScSjTsBbService.exportAndSendToDingtalk();
//
//            if (result) {
//                System.out.println("✓ 生产数据导出并发送成功");
//                System.out.println("  - 数据已从 VW_CJ_SC_SJ_TS_BB 表查询");
//                System.out.println("  - Excel 文件已生成并保存到 D:\\BIFile\\");
//                System.out.println("  - 钉钉文件消息已发送");
//            } else {
//                System.out.println("✗ 生产数据导出或发送失败");
//            }
//        } catch (Exception e) {
//            System.out.println("✗ 导出并发送时发生异常: " + e.getMessage());
//            e.printStackTrace();
//        }
 
        System.out.println("=== 测试结束 ===");
    }
}