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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package cn.kk.spring_simple_operation;
import cn.kk.spring_simple_operation.mapper.PhotoProgressMapper;
import cn.kk.spring_simple_operation.model.dto.BrandAccountDto;
import cn.kk.spring_simple_operation.model.dto.SkuPeopleNameDto;
import cn.kk.spring_simple_operation.model.vo.PhotoSkuInfo;
import cn.kk.spring_simple_operation.model.vo.PublishInfoVo;
import cn.kk.spring_simple_operation.service.*;
import cn.kk.spring_simple_operation.utils.ExcelUtil;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
/**
* @author kk
* @date 2025/2/19
*/
@SpringBootTest
public class ApplicationTest {
@Resource
private VisualPhotographerAPlusService visualPhotographerAPlusService;
@Resource
private VideoProductService videoProductService;
@Resource
private PhotoProgressService photoProgressService;
@Resource
private PhotoProgressMapper photoProgressMapper;
@Resource
private APlusProductService aPlusProductService;
@Resource
private BrandRecordToolService brandRecordToolService;
@Test
void contextLoads() throws Exception {
//visualPhotographerAPlusService.brushDataForExecutor();
//setUploadStatusIsDeleted();
//setAPlusProductUploadInfo();
//updateBrandId();
//updateBrandTransparencyPlan();
//getVideoSkuArea();
//brushSimpleVideoData();
exportAPlusPublishData();
}
private void exportAPlusPublishData() throws Exception {
List<PublishInfoVo> publishInfoVos = aPlusProductService.exportAPlusPublishData();
ExcelUtil<PublishInfoVo> util = new ExcelUtil<>(PublishInfoVo.class);
util.exportExcelFile(publishInfoVos, "运营导数据-20250618.xlsx");
}
//private void brushSimpleVideoData() {
// photoProgressService.brushSimpleVideoData();
//}
//private void setUploadStatusIsDeleted() throws Exception {
// File file = new File("已删除页面直接调整视频状态.xlsx");
// ExcelUtil<SkuSiteDTO> util = new ExcelUtil<SkuSiteDTO>(SkuSiteDTO.class);
// List<SkuSiteDTO> list = util.importExcel("精细视频", Files.newInputStream(file.toPath()));
// videoProductService.setUploadStatusIsDeleted(list);
// list = util.importExcel("简易视频", Files.newInputStream(file.toPath()));
// photoProgressService.setUploadStatusIsDeleted(list);
//}
//private void setAPlusProductUploadInfo() throws Exception {
// File file = new File("简版A+ AB测试.xlsx");
// ExcelUtil<SkuPeopleNameDto> util = new ExcelUtil<>(SkuPeopleNameDto.class);
// List<SkuPeopleNameDto> list = util.importExcel(Files.newInputStream(file.toPath()));
// aPlusProductService.setAPlusProductUploadInfo(list);
//}
//private void updateBrandId() throws Exception {
// File file = new File("2025-04-01_vpq0_品牌Brand ID核对.xlsx");
// ExcelUtil<BrandAccountDto> util = new ExcelUtil<>(BrandAccountDto.class);
// List<BrandAccountDto> list = util.importExcel(Files.newInputStream(file.toPath()));
// brandRecordToolService.updateBrandId(list);
//}
//private void updateBrandTransparencyPlan() throws Exception {
// File file = new File("2025-04-16_vlrd_高首批新品匹配透明计划账号.xlsx");
// ExcelUtil<BrandAccountDto> util = new ExcelUtil<>(BrandAccountDto.class);
// List<BrandAccountDto> list = util.importExcel(Files.newInputStream(file.toPath()));
//
// list.forEach(dto -> {
// System.out.printf("update brand_record_tool set is_transparency_plan = 1 where record_brand = '%s' and account = '%s' and is_delete = 0;\n", dto.getBrand(), dto.getAccount());
// });
//}
//private void getVideoSkuArea() {
//
// photoProgressService.getVideoSkuArea();
//}
}