//package net.northking;
//
//import jdk.nashorn.internal.parser.Token;
//import net.northking.cctp.common.cache.EntityNameCache;
//import net.northking.cctp.common.cache.EntityNameCatalog;
//import net.northking.cctp.common.http.ResultWrapper;
//import net.northking.cctp.testbug.TestBugApplication;
//import net.northking.cctp.testbug.api.service.*;
//import net.northking.cctp.testbug.db.entity.BugStatisticsChart;
//import net.northking.cctp.testbug.dto.BugOverallTendencyChartAddDto;
//import net.northking.cctp.testbug.dto.BugStatisticsChartAddDto;
//import net.northking.cctp.testbug.dto.dict.DictItem;
//import net.northking.cctp.testbug.dto.project.CpProjectDetailDto;
//import net.northking.cctp.testbug.feign.server.PlatFormFeignServer;
//import net.northking.cctp.testbug.feign.server.ProjectsFeignServer;
//import net.northking.cctp.testbug.util.HTMLToText;
//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 java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//
///**
// * @author: puchao.ma
// * @date: 2021/10/20 11:57
// */
//@RunWith(SpringRunner.class)
//@SpringBootTest(classes = TestBugApplication.class)
//public class Test {
//
//    @org.junit.Test
//    public void test1() {
//        String content = HTMLToText.getContent("<p>333</p>");
//
//        System.out.println(content);
//    }
//
//    @Autowired
//    BugManagementApiService apiService;
//    @Autowired
//    BugOverallTendencyChartApiService bugOverallTendencyChartApiService;
//    @Autowired
//    PlatFormFeignServer platFormFeignServer;
//    @Autowired
//    EntityNameCache entityNameCache;
//    @Autowired
//    BugStatisticsChartApiService bugStatisticsChartApiService;
//    @Autowired
//    ProjectsFeignServer projectsFeignServer;
//    /**
//     * 获取缺陷趋势图信息
//     * 间隔30秒
//     * @return List<String> 缺陷趋势图主键集合
//     */
////    @Scheduled(fixedRate = 30000)
//    @org.junit.Test
//    public void searchBugMessageByStautus() {
//
//        ResultWrapper<List<String>> wrapper=new ResultWrapper<>();
////        List<String> l=new ArrayList<>();
////        l.add("bugStatus");
////
////        Map<String,Object>m=platFormFeignServer.queryDict(l);
////        //todo 调基础平台的接口获取缺陷状态
////        List<String> statusList=new ArrayList<>();
////        statusList.add("9");
////        statusList.add("10");
////        List<BugOverallTendencyChartAddDto> bugOverallTendencyChartList=apiService.queryBugByStatus(statusList);
////        //新增跨项目的缺陷趋势信息
////        List<String> strings=null;
////        if(bugOverallTendencyChartList.size()>0&&null!=bugOverallTendencyChartList){
////         strings = bugOverallTendencyChartApiService.addBatch(bugOverallTendencyChartList);
////        }
//        //获取所有的项目id
////        List<DictItem> dictItems=new ArrayList<>();
////        DictItem d1=new DictItem();
////        DictItem d2=new DictItem();
////        DictItem d3=new DictItem();
////        d1.setItemCode("1");
////        d1.setItemName("新建");
////        dictItems.add(d1);
////        d2.setItemCode("2");
////        d2.setItemName("打开");
////        dictItems.add(d2);
////        d3.setItemCode("3");
////        d3.setItemName("已分配");
////        dictItems.add(d3);
////        //  从缺陷表中查询
////        List<BugStatisticsChartAddDto> bugStatisticsChartAddDtoList=apiService.queryBugByDicItems(dictItems);
////        //获取中文名
////        bugStatisticsChartAddDtoList.forEach(bugStatisticsChartAddDto->{
////            if (null!=bugStatisticsChartAddDto.getReceiverName()){
////                bugStatisticsChartAddDto.setReceiverName(entityNameCache.translateById(EntityNameCatalog.USERNAME, bugStatisticsChartAddDto.getReceiverName())==null?null:entityNameCache.
////                                translateById(EntityNameCatalog.USERNAME, bugStatisticsChartAddDto.getReceiverName()));
////            }
////        });
////        //添加记录到缺陷状态统计
////        bugStatisticsChartApiService.addBatch(bugStatisticsChartAddDtoList);
////        int Integer =bugOverallTendencyChartApiService.deleteAll();
////        //清空缺陷状态信息
////        int Integer =bugStatisticsChartApiService.deleteAll();
//        System.out.println( wrapper.success(null));
//
//    }
//}
