ApplicationTest.java 3.65 KB
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();
	//}


}