admin
2021-03-20 ad3ac53da1c3a11a96ae62d790aa61a81b9eab91
src/test/java/com/hxh/spring/test/PPTVTest.java
@@ -175,7 +175,7 @@
            Sheet sheet = rwb.getSheet(sheetNum);
            for (int c = 1; c < sheet.getRows(); c++) {
                String infoId = sheet.getCell(0, c).getContents().trim();
                String name = sheet.getCell(2, c).getContents().trim();
                String name = sheet.getCell(1, c).getContents().trim();
                String del = sheet.getCell(21, c).getContents().trim();
                if (!StringUtil.isNullOrEmpty(infoId) && StringUtil.isNullOrEmpty(del)) {
                    videoList.add(new String[]{infoId, name, del});
@@ -194,31 +194,37 @@
        List<String[]> list1 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 0);
        List<String[]> list2 = getPPTVVideos(new File("C:\\Users\\Administrator\\Desktop\\全量.xls"), 1);
        Map<String, String[]> map = new TreeMap<>();
        Set<String> sets = new HashSet<>();
        for (String[] sts : list1) {
            map.put(sts[0], sts);
            sets.add(sts[1]);
        }
        for (String[] sts : list2) {
            map.put(sts[0], sts);
            sets.add(sts[1]);
        }
        List<PPTVSeries> list = pptvSeriesDao.list(0, 10000);
        Set<String> infoIds = new HashSet<>();
        for (PPTVSeries s : list) {
            infoIds.add(s.getInfoID());
        }
//        List<PPTVSeries> list = pptvSeriesDao.list(0, 10000);
//        Set<String> infoIds = new HashSet<>();
//        for (PPTVSeries s : list) {
//            infoIds.add(s.getInfoID());
//        }
//
//        for (String infoId : infoIds) {
//            map.remove(infoId);
//        }
        for (String infoId : infoIds) {
            map.remove(infoId);
        }
        for (String code : sets)
            getDetail(code);
        try {
            save(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
//        try {
//            save(map);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
        System.out.println(map);
//        System.out.println(map);
    }
    private void save(Map<String, String[]> data) throws Exception {
@@ -251,11 +257,10 @@
        }
    }
    @Test
    public void getDetail() {
        PPTVSeries series = PPTVApiUtil.getDetail("32385373");
//    @Test
    public void getDetail(String sCode) {
        PPTVSeries series = PPTVApiUtil.getDetail(sCode);
        pptvService.save(series);
        System.out.println(series);
    }