添加了导出excel并发送邮件功能
修改了查询全部
Showing
31 changed files
with
564 additions
and
66 deletions
... | @@ -31,6 +31,13 @@ | ... | @@ -31,6 +31,13 @@ |
31 | <version>1.2.75</version> | 31 | <version>1.2.75</version> |
32 | </dependency> | 32 | </dependency> |
33 | 33 | ||
34 | <!--EasyExcel 阿里巴巴--> | ||
35 | <dependency> | ||
36 | <groupId>com.alibaba</groupId> | ||
37 | <artifactId>easyexcel</artifactId> | ||
38 | <version>2.2.0-beta2</version> | ||
39 | </dependency> | ||
40 | |||
34 | <dependency> | 41 | <dependency> |
35 | <groupId>io.springfox</groupId> | 42 | <groupId>io.springfox</groupId> |
36 | <artifactId>springfox-swagger2</artifactId> | 43 | <artifactId>springfox-swagger2</artifactId> |
... | @@ -54,6 +61,13 @@ | ... | @@ -54,6 +61,13 @@ |
54 | <artifactId>velocity-engine-core</artifactId> | 61 | <artifactId>velocity-engine-core</artifactId> |
55 | <version>2.0</version> | 62 | <version>2.0</version> |
56 | </dependency> | 63 | </dependency> |
64 | <!-- 邮件注解 --> | ||
65 | <dependency> | ||
66 | <groupId>javax.mail</groupId> | ||
67 | <artifactId>mail</artifactId> | ||
68 | <version>1.4.7</version> | ||
69 | </dependency> | ||
70 | |||
57 | 71 | ||
58 | 72 | ||
59 | <!--Mysql依赖包--> | 73 | <!--Mysql依赖包--> |
... | @@ -76,6 +90,12 @@ | ... | @@ -76,6 +90,12 @@ |
76 | <version>1.2.11</version> | 90 | <version>1.2.11</version> |
77 | </dependency> | 91 | </dependency> |
78 | 92 | ||
93 | <!-- 日志--> | ||
94 | <dependency> | ||
95 | <groupId>org.springframework.boot</groupId> | ||
96 | <artifactId>spring-boot-starter-logging</artifactId> | ||
97 | </dependency> | ||
98 | |||
79 | 99 | ||
80 | <dependency> | 100 | <dependency> |
81 | <groupId>org.projectlombok</groupId> | 101 | <groupId>org.projectlombok</groupId> |
... | @@ -91,6 +111,17 @@ | ... | @@ -91,6 +111,17 @@ |
91 | <groupId>org.springframework.boot</groupId> | 111 | <groupId>org.springframework.boot</groupId> |
92 | <artifactId>spring-boot-starter-web</artifactId> | 112 | <artifactId>spring-boot-starter-web</artifactId> |
93 | </dependency> | 113 | </dependency> |
114 | <dependency> | ||
115 | <groupId>repository.cn.hutool</groupId> | ||
116 | <artifactId>hutool-all</artifactId> | ||
117 | <version>5.4.0</version> | ||
118 | </dependency> | ||
119 | <dependency> | ||
120 | <groupId>org.testng</groupId> | ||
121 | <artifactId>testng</artifactId> | ||
122 | <version>RELEASE</version> | ||
123 | <scope>compile</scope> | ||
124 | </dependency> | ||
94 | </dependencies> | 125 | </dependencies> |
95 | 126 | ||
96 | <build> | 127 | <build> |
... | @@ -160,9 +191,18 @@ | ... | @@ -160,9 +191,18 @@ |
160 | </excludes> | 191 | </excludes> |
161 | </configuration> | 192 | </configuration> |
162 | </plugin> | 193 | </plugin> |
194 | <!-- 让maven不编译xls文件,但仍将其打包 --> | ||
195 | <plugin> | ||
196 | <groupId>org.apache.maven.plugins</groupId> | ||
197 | <artifactId>maven-resources-plugin</artifactId> | ||
198 | <configuration> | ||
199 | <nonFilteredFileExtensions> | ||
200 | <nonFilteredFileExtension>xls</nonFilteredFileExtension> | ||
201 | <nonFilteredFileExtension>xlsx</nonFilteredFileExtension> | ||
202 | </nonFilteredFileExtensions> | ||
203 | </configuration> | ||
204 | </plugin> | ||
163 | </plugins> | 205 | </plugins> |
164 | |||
165 | |||
166 | </build> | 206 | </build> |
167 | 207 | ||
168 | </project> | 208 | </project> | ... | ... |
... | @@ -3,8 +3,10 @@ package com.hui; | ... | @@ -3,8 +3,10 @@ package com.hui; |
3 | import org.mybatis.spring.annotation.MapperScan; | 3 | import org.mybatis.spring.annotation.MapperScan; |
4 | import org.springframework.boot.SpringApplication; | 4 | import org.springframework.boot.SpringApplication; |
5 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
6 | import org.springframework.scheduling.annotation.EnableScheduling; | ||
6 | 7 | ||
7 | @SpringBootApplication | 8 | @SpringBootApplication |
9 | @EnableScheduling//开启定时任务 | ||
8 | @MapperScan("com.hui") | 10 | @MapperScan("com.hui") |
9 | public class IqiyiApplication { | 11 | public class IqiyiApplication { |
10 | 12 | ... | ... |
... | @@ -7,13 +7,16 @@ import com.github.pagehelper.PageInfo; | ... | @@ -7,13 +7,16 @@ import com.github.pagehelper.PageInfo; |
7 | import com.hui.iqiyi.Util.ReturnBean; | 7 | import com.hui.iqiyi.Util.ReturnBean; |
8 | import com.hui.iqiyi.entity.Content; | 8 | import com.hui.iqiyi.entity.Content; |
9 | import com.hui.iqiyi.entity.Media; | 9 | import com.hui.iqiyi.entity.Media; |
10 | import com.hui.iqiyi.entity.Movie; | ||
10 | import com.hui.iqiyi.request.ContentRequest; | 11 | import com.hui.iqiyi.request.ContentRequest; |
11 | import com.hui.iqiyi.request.MediaRequest; | 12 | import com.hui.iqiyi.request.MediaRequest; |
13 | import com.hui.iqiyi.request.ProgramRequest; | ||
12 | import com.hui.iqiyi.response.ContentResponse; | 14 | import com.hui.iqiyi.response.ContentResponse; |
13 | import com.hui.iqiyi.service.IContentService; | 15 | import com.hui.iqiyi.service.IContentService; |
14 | import com.hui.iqiyi.service.IProgramService; | 16 | import com.hui.iqiyi.service.IProgramService; |
15 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
16 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
19 | import org.springframework.beans.factory.annotation.Autowired; | ||
17 | import org.springframework.web.bind.annotation.*; | 20 | import org.springframework.web.bind.annotation.*; |
18 | 21 | ||
19 | import javax.annotation.Resource; | 22 | import javax.annotation.Resource; |
... | @@ -35,6 +38,8 @@ import java.util.concurrent.LinkedBlockingQueue; | ... | @@ -35,6 +38,8 @@ import java.util.concurrent.LinkedBlockingQueue; |
35 | public class ContentController { | 38 | public class ContentController { |
36 | @Resource | 39 | @Resource |
37 | private IContentService iContentService; | 40 | private IContentService iContentService; |
41 | @Autowired | ||
42 | private IProgramService iProgramService; | ||
38 | 43 | ||
39 | @PostMapping("/selectAllSingle") | 44 | @PostMapping("/selectAllSingle") |
40 | @ApiOperation("查询单集") | 45 | @ApiOperation("查询单集") |
... | @@ -60,4 +65,23 @@ public class ContentController { | ... | @@ -60,4 +65,23 @@ public class ContentController { |
60 | return iContentService.selectAllCont(); | 65 | return iContentService.selectAllCont(); |
61 | } | 66 | } |
62 | 67 | ||
68 | @GetMapping("/selectAllIqIyDrama") | ||
69 | @ApiOperation("查询全部剧集信息") | ||
70 | @ResponseBody | ||
71 | public PageInfo<Content> selectAllIqIy(ContentRequest contentRequest) { | ||
72 | PageHelper.startPage(contentRequest.getPageNo(), contentRequest.getPageSize()); | ||
73 | ProgramRequest programRequest = new ProgramRequest(); | ||
74 | if (contentRequest.getType() == 0) { | ||
75 | return new PageInfo(iProgramService.selectAllProgra(programRequest)); | ||
76 | } | ||
77 | else if (contentRequest.getType() == 1) { | ||
78 | return new PageInfo(iContentService.selectAllContenten(contentRequest)); | ||
79 | } | ||
80 | |||
81 | return null ; | ||
82 | } | ||
83 | |||
84 | |||
85 | |||
86 | |||
63 | } | 87 | } | ... | ... |
... | @@ -8,6 +8,7 @@ import com.hui.iqiyi.request.MediaRequest; | ... | @@ -8,6 +8,7 @@ import com.hui.iqiyi.request.MediaRequest; |
8 | import com.hui.iqiyi.service.IMediaService; | 8 | import com.hui.iqiyi.service.IMediaService; |
9 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
10 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
11 | import lombok.extern.slf4j.Slf4j; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.web.bind.annotation.GetMapping; | 13 | import org.springframework.web.bind.annotation.GetMapping; |
13 | import org.springframework.web.bind.annotation.RequestMapping; | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
... | @@ -38,6 +39,7 @@ public class MediaController { | ... | @@ -38,6 +39,7 @@ public class MediaController { |
38 | @ResponseBody | 39 | @ResponseBody |
39 | public PageInfo<Media> selectAllIqIy(MediaRequest request) { | 40 | public PageInfo<Media> selectAllIqIy(MediaRequest request) { |
40 | PageHelper.startPage(request.getPageNo(), request.getPageSize()); | 41 | PageHelper.startPage(request.getPageNo(), request.getPageSize()); |
42 | |||
41 | return new PageInfo(iMediaService.selectAllIqIyList(request)); | 43 | return new PageInfo(iMediaService.selectAllIqIyList(request)); |
42 | } | 44 | } |
43 | 45 | ... | ... |
1 | package com.hui.iqiyi.controller; | 1 | package com.hui.iqiyi.controller; |
2 | 2 | ||
3 | 3 | ||
4 | import com.alibaba.excel.EasyExcel; | ||
5 | import com.alibaba.excel.ExcelWriter; | ||
6 | import com.alibaba.excel.write.metadata.WriteSheet; | ||
7 | import com.alibaba.excel.write.metadata.style.WriteCellStyle; | ||
4 | import com.github.pagehelper.PageHelper; | 8 | import com.github.pagehelper.PageHelper; |
5 | import com.github.pagehelper.PageInfo; | 9 | import com.github.pagehelper.PageInfo; |
10 | import com.hui.iqiyi.Util.TestFileUtil; | ||
6 | import com.hui.iqiyi.entity.Content; | 11 | import com.hui.iqiyi.entity.Content; |
7 | import com.hui.iqiyi.entity.Movie; | 12 | import com.hui.iqiyi.entity.Movie; |
13 | import com.hui.iqiyi.excel.*; | ||
8 | import com.hui.iqiyi.request.ContentRequest; | 14 | import com.hui.iqiyi.request.ContentRequest; |
9 | import com.hui.iqiyi.request.ProRequest; | 15 | import com.hui.iqiyi.request.ProRequest; |
16 | import com.hui.iqiyi.response.ContentResponse; | ||
10 | import com.hui.iqiyi.response.MovieResponse; | 17 | import com.hui.iqiyi.response.MovieResponse; |
11 | import com.hui.iqiyi.response.ProgramSyResponse; | 18 | import com.hui.iqiyi.response.ProgramSyResponse; |
12 | import com.hui.iqiyi.service.IMovieService; | 19 | import com.hui.iqiyi.service.IMovieService; |
20 | import com.hui.iqiyi.service.IProgramService; | ||
13 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
14 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
23 | import org.apache.poi.ss.usermodel.HorizontalAlignment; | ||
15 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
16 | import org.springframework.web.bind.annotation.*; | 25 | import org.springframework.web.bind.annotation.*; |
26 | import org.testng.collections.Lists; | ||
17 | 27 | ||
28 | import javax.annotation.Resource; | ||
29 | import java.util.ArrayList; | ||
18 | import java.util.List; | 30 | import java.util.List; |
19 | import java.util.Map; | 31 | import java.util.Map; |
20 | 32 | ||
... | @@ -31,22 +43,71 @@ import java.util.Map; | ... | @@ -31,22 +43,71 @@ import java.util.Map; |
31 | @RequestMapping("/iqiyi/movie") | 43 | @RequestMapping("/iqiyi/movie") |
32 | public class MovieController { | 44 | public class MovieController { |
33 | 45 | ||
46 | |||
34 | @Autowired | 47 | @Autowired |
35 | private IMovieService iMovieService; | 48 | private IMovieService iMovieService; |
49 | @Resource | ||
50 | private IProgramService iProgramService; | ||
36 | 51 | ||
37 | @GetMapping("/selectAllPopulation") | 52 | @GetMapping("/selectAllPopulation") |
38 | @ApiOperation("查询总下载") | 53 | @ApiOperation("查询总下载") |
39 | @ResponseBody | 54 | @ResponseBody |
40 | public List<Movie> selectAllPopulation(Movie Movie) { | 55 | public List<Movie> selectAllPopulation(Movie Movie) { |
41 | return iMovieService.selectAllPopulation(Movie); | 56 | return iMovieService.selectAllPopulation(); |
42 | } | 57 | } |
43 | 58 | ||
59 | // @GetMapping("/selectAllPopulationn") | ||
60 | // @ApiOperation("查询总下载") | ||
61 | // @ResponseBody | ||
62 | // public void selectAllPopulationn(Movie Movie) { | ||
63 | // | ||
64 | // try { | ||
65 | // String path = "D:\\java\\爱奇艺下载情况.xlsx\\"; | ||
66 | // //新建ExcelWriter | ||
67 | // ExcelWriter excelWriter = EasyExcel.write(path).build(); | ||
68 | // //获取sheet0对象 | ||
69 | // WriteSheet mainSheet = EasyExcel.writerSheet(0, "介质文件下载统计文件").head(DownloadExcel.class).build(); | ||
70 | // //向sheet0写入数据 传入空list这样只导出表头 | ||
71 | // excelWriter.write(iMovieService.selectAllPopulation(), mainSheet); | ||
72 | // | ||
73 | // //获取sheet1对象 | ||
74 | // WriteSheet detailSheet = EasyExcel.writerSheet(1, "吉林关注片单").head(ProgramsExcel.class).build(); | ||
75 | // //向sheet1写入数据 传入空list这样只导出表头 | ||
76 | // List<ProgramSyResponse> programSyResponses = new ArrayList<>(); | ||
77 | // programSyResponses.add(iProgramService.selectAllProgramCount()); | ||
78 | // excelWriter.write(programSyResponses, detailSheet); | ||
79 | // | ||
80 | // //获取sheet1对象 | ||
81 | // WriteSheet detailSheet1 = EasyExcel.writerSheet(2, "剧集单片数量").head(ProgramAllExcel.class).build(); | ||
82 | // //向sheet1写入数据 传入空list这样只导出表头 | ||
83 | // List<ContentResponse> contentResponses = new ArrayList<>(); | ||
84 | // contentResponses.add(iProgramService.selectAllPrograms()); | ||
85 | // excelWriter.write(contentResponses, detailSheet1); | ||
86 | // | ||
87 | // //获取sheet2对象 | ||
88 | // WriteSheet SevenSheetDownload = EasyExcel.writerSheet(3, "近七日下载情况").head(ProsevenDownload.class).build(); | ||
89 | // //向sheet0写入数据 传入空list这样只导出表头 | ||
90 | // ProRequest proRequest = new ProRequest(); | ||
91 | // excelWriter.write(iProgramService.selectAllSeven(proRequest), SevenSheetDownload); | ||
92 | // | ||
93 | // //获取sheet2对象 | ||
94 | // WriteSheet SevenSheetzation= EasyExcel.writerSheet(4, "近七日同步情况").head(MoveExcel.class).build(); | ||
95 | // //向sheet0写入数据 传入空list这样只导出表头 | ||
96 | // ProRequest proRequest1 = new ProRequest(); | ||
97 | // excelWriter.write(iMovieService.selectAllSevenxz(proRequest1), SevenSheetzation); | ||
98 | // //关闭流 | ||
99 | // excelWriter.finish(); | ||
100 | // } catch (Exception e) { | ||
101 | // System.out.println("导出异常"+ e.getMessage()); | ||
102 | // } | ||
103 | // } | ||
44 | 104 | ||
45 | @GetMapping("/selectAllSevenXz") | 105 | @GetMapping("/selectAllSevenXz") |
46 | @ApiOperation("近七日同步情况") | 106 | @ApiOperation("近七日同步情况") |
47 | @ResponseBody | 107 | @ResponseBody |
48 | public List<MovieResponse> selectAllSeven(ProRequest proRequest) { | 108 | public List<MovieResponse> selectAllSeven (ProRequest proRequest){ |
49 | return iMovieService.selectAllSevenxz(proRequest); | 109 | return iMovieService.selectAllSevenxz(proRequest); |
50 | } | 110 | } |
51 | 111 | ||
52 | } | 112 | |
113 | } | ... | ... |
1 | package com.hui.iqiyi.controller; | 1 | package com.hui.iqiyi.controller; |
2 | 2 | ||
3 | 3 | ||
4 | import com.alibaba.excel.EasyExcel; | ||
4 | import com.alibaba.fastjson.JSON; | 5 | import com.alibaba.fastjson.JSON; |
5 | import com.github.pagehelper.PageHelper; | 6 | import com.github.pagehelper.PageHelper; |
6 | import com.github.pagehelper.PageInfo; | 7 | import com.github.pagehelper.PageInfo; |
7 | import com.hui.iqiyi.Util.ReturnBean; | 8 | import com.hui.iqiyi.Util.ReturnBean; |
8 | import com.hui.iqiyi.entity.Content; | 9 | import com.hui.iqiyi.entity.Content; |
9 | import com.hui.iqiyi.entity.Program; | 10 | import com.hui.iqiyi.entity.Program; |
11 | import com.hui.iqiyi.excel.DownloadExcel; | ||
12 | import com.hui.iqiyi.excel.ProgramsExcel; | ||
13 | import com.hui.iqiyi.excel.ProsevenDownload; | ||
10 | import com.hui.iqiyi.request.ByIdsRequest; | 14 | import com.hui.iqiyi.request.ByIdsRequest; |
11 | import com.hui.iqiyi.request.ContentRequest; | 15 | import com.hui.iqiyi.request.ContentRequest; |
12 | import com.hui.iqiyi.request.ProRequest; | 16 | import com.hui.iqiyi.request.ProRequest; |
... | @@ -14,6 +18,7 @@ import com.hui.iqiyi.request.ProgramRequest; | ... | @@ -14,6 +18,7 @@ import com.hui.iqiyi.request.ProgramRequest; |
14 | import com.hui.iqiyi.response.ContentResponse; | 18 | import com.hui.iqiyi.response.ContentResponse; |
15 | import com.hui.iqiyi.response.ProgramResponse; | 19 | import com.hui.iqiyi.response.ProgramResponse; |
16 | import com.hui.iqiyi.response.ProgramSyResponse; | 20 | import com.hui.iqiyi.response.ProgramSyResponse; |
21 | import com.hui.iqiyi.response.ProgramXRespone; | ||
17 | import com.hui.iqiyi.service.IProgramService; | 22 | import com.hui.iqiyi.service.IProgramService; |
18 | import com.sun.org.apache.bcel.internal.generic.RETURN; | 23 | import com.sun.org.apache.bcel.internal.generic.RETURN; |
19 | import io.swagger.annotations.Api; | 24 | import io.swagger.annotations.Api; |
... | @@ -23,6 +28,7 @@ import org.springframework.beans.factory.annotation.Qualifier; | ... | @@ -23,6 +28,7 @@ import org.springframework.beans.factory.annotation.Qualifier; |
23 | import org.springframework.web.bind.annotation.*; | 28 | import org.springframework.web.bind.annotation.*; |
24 | 29 | ||
25 | import javax.annotation.Resource; | 30 | import javax.annotation.Resource; |
31 | import java.util.ArrayList; | ||
26 | import java.util.List; | 32 | import java.util.List; |
27 | 33 | ||
28 | /** | 34 | /** |
... | @@ -67,7 +73,7 @@ public class ProgramController { | ... | @@ -67,7 +73,7 @@ public class ProgramController { |
67 | @GetMapping("/selectAllSeven") | 73 | @GetMapping("/selectAllSeven") |
68 | @ApiOperation("近七日下载情况") | 74 | @ApiOperation("近七日下载情况") |
69 | @ResponseBody | 75 | @ResponseBody |
70 | public List<ProgramSyResponse> selectAllSeven(ProRequest proRequest) { | 76 | public List<ProgramXRespone> selectAllSeven(ProRequest proRequest) { |
71 | return iProgramService.selectAllSeven(proRequest); | 77 | return iProgramService.selectAllSeven(proRequest); |
72 | } | 78 | } |
73 | 79 | ||
... | @@ -79,5 +85,14 @@ public class ProgramController { | ... | @@ -79,5 +85,14 @@ public class ProgramController { |
79 | return iProgramService.selectAllProgramCount(); | 85 | return iProgramService.selectAllProgramCount(); |
80 | } | 86 | } |
81 | 87 | ||
88 | @GetMapping("/selectAllMonolithic") | ||
89 | @ApiOperation("查询全部单片信息") | ||
90 | @ResponseBody | ||
91 | public PageInfo<Program> selectAllIqIy(ProgramRequest programRequest) { | ||
92 | PageHelper.startPage(programRequest.getPageNo(), programRequest.getPageSize()); | ||
93 | return new PageInfo(iProgramService.selectAllProgra(programRequest)); | ||
94 | } | ||
95 | |||
96 | |||
82 | 97 | ||
83 | } | 98 | } | ... | ... |
... | @@ -186,7 +186,7 @@ public class Content implements Serializable { | ... | @@ -186,7 +186,7 @@ public class Content implements Serializable { |
186 | /** | 186 | /** |
187 | * 专辑已有视频的最大集数,不严格等于已上线的视频数量 | 187 | * 专辑已有视频的最大集数,不严格等于已上线的视频数量 |
188 | */ | 188 | */ |
189 | private Integer currCount; | 189 | private Long currCount; |
190 | 190 | ||
191 | /** | 191 | /** |
192 | * 是否收费 | 192 | * 是否收费 |
... | @@ -282,4 +282,11 @@ public class Content implements Serializable { | ... | @@ -282,4 +282,11 @@ public class Content implements Serializable { |
282 | * 扩展字段 | 282 | * 扩展字段 |
283 | */ | 283 | */ |
284 | private List<Long> ContentIdList; | 284 | private List<Long> ContentIdList; |
285 | /** | ||
286 | * 标识下载状态 | ||
287 | */ | ||
288 | private String downloadStatus; | ||
289 | |||
290 | |||
291 | |||
285 | } | 292 | } | ... | ... |
... | @@ -307,4 +307,9 @@ public class Program implements Serializable { | ... | @@ -307,4 +307,9 @@ public class Program implements Serializable { |
307 | * 更新时间 | 307 | * 更新时间 |
308 | */ | 308 | */ |
309 | private LocalDateTime updateTime; | 309 | private LocalDateTime updateTime; |
310 | |||
311 | /** | ||
312 | * 标识下载状态 | ||
313 | */ | ||
314 | private String downloadStatus; | ||
310 | } | 315 | } | ... | ... |
... | @@ -54,4 +54,13 @@ public interface ContentMapper extends BaseMapper<Content> { | ... | @@ -54,4 +54,13 @@ public interface ContentMapper extends BaseMapper<Content> { |
54 | List<Integer> selectAllCont(); | 54 | List<Integer> selectAllCont(); |
55 | 55 | ||
56 | 56 | ||
57 | /** | ||
58 | * 查询所有剧集 | ||
59 | * @param contentRequest | ||
60 | * @return | ||
61 | */ | ||
62 | |||
63 | List<Content> selectAllContenten(ContentRequest contentRequest); | ||
64 | |||
65 | |||
57 | } | 66 | } | ... | ... |
... | @@ -31,7 +31,7 @@ public interface MovieMapper extends BaseMapper<Movie> { | ... | @@ -31,7 +31,7 @@ public interface MovieMapper extends BaseMapper<Movie> { |
31 | 31 | ||
32 | //查询总体下载情况 | 32 | //查询总体下载情况 |
33 | 33 | ||
34 | List<Movie> selectAllPopulation(Movie movie); | 34 | List<Movie> selectAllPopulation(); |
35 | 35 | ||
36 | 36 | ||
37 | /** | 37 | /** |
... | @@ -42,4 +42,6 @@ public interface MovieMapper extends BaseMapper<Movie> { | ... | @@ -42,4 +42,6 @@ public interface MovieMapper extends BaseMapper<Movie> { |
42 | List<MovieResponse> selectAllSevenxz(@Param("proRequest") ProRequest proRequest); | 42 | List<MovieResponse> selectAllSevenxz(@Param("proRequest") ProRequest proRequest); |
43 | 43 | ||
44 | 44 | ||
45 | |||
46 | |||
45 | } | 47 | } | ... | ... |
1 | package com.hui.iqiyi.mapper; | 1 | package com.hui.iqiyi.mapper; |
2 | 2 | ||
3 | import com.hui.iqiyi.entity.Content; | ||
3 | import com.hui.iqiyi.entity.Program; | 4 | import com.hui.iqiyi.entity.Program; |
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 5 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
5 | import com.hui.iqiyi.request.ByIdsRequest; | 6 | import com.hui.iqiyi.request.ByIdsRequest; |
7 | import com.hui.iqiyi.request.ContentRequest; | ||
6 | import com.hui.iqiyi.request.ProRequest; | 8 | import com.hui.iqiyi.request.ProRequest; |
7 | import com.hui.iqiyi.request.ProgramRequest; | 9 | import com.hui.iqiyi.request.ProgramRequest; |
8 | import com.hui.iqiyi.response.*; | 10 | import com.hui.iqiyi.response.*; |
... | @@ -62,7 +64,7 @@ public interface ProgramMapper extends BaseMapper<Program> { | ... | @@ -62,7 +64,7 @@ public interface ProgramMapper extends BaseMapper<Program> { |
62 | * | 64 | * |
63 | * @return | 65 | * @return |
64 | */ | 66 | */ |
65 | List<ProgramSyResponse> selectAllSeven(@Param("proRequest") ProRequest proRequest); | 67 | List<ProgramXRespone> selectAllSeven(@Param("proRequest") ProRequest proRequest); |
66 | 68 | ||
67 | 69 | ||
68 | /** | 70 | /** |
... | @@ -72,5 +74,23 @@ public interface ProgramMapper extends BaseMapper<Program> { | ... | @@ -72,5 +74,23 @@ public interface ProgramMapper extends BaseMapper<Program> { |
72 | */ | 74 | */ |
73 | List<ProgramQBRequest> selectAllProgramCount(); | 75 | List<ProgramQBRequest> selectAllProgramCount(); |
74 | 76 | ||
77 | /** | ||
78 | * 全部片单信息 | ||
79 | * | ||
80 | * @param | ||
81 | * @return | ||
82 | */ | ||
83 | List<Integer> selectAllPrograms(); | ||
84 | |||
85 | |||
86 | /** | ||
87 | * 查询所有单片 | ||
88 | * @param programRequest | ||
89 | * @return | ||
90 | */ | ||
91 | |||
92 | List<Program> selectAllProgra(ProgramRequest programRequest); | ||
93 | |||
94 | |||
75 | 95 | ||
76 | } | 96 | } | ... | ... |
... | @@ -273,4 +273,24 @@ public class ContentRequest extends AppPagingRequest { | ... | @@ -273,4 +273,24 @@ public class ContentRequest extends AppPagingRequest { |
273 | */ | 273 | */ |
274 | private Integer SeriesFlag; | 274 | private Integer SeriesFlag; |
275 | 275 | ||
276 | |||
277 | |||
278 | //开始时间 | ||
279 | private String beginTime; | ||
280 | //结束时间 | ||
281 | private String EndTime; | ||
282 | |||
283 | /** | ||
284 | * 标识调用哪个方法 | ||
285 | * 0单片 | ||
286 | * 1剧集 | ||
287 | */ | ||
288 | private Long type; | ||
289 | |||
290 | /** | ||
291 | * 下载状态 | ||
292 | */ | ||
293 | private Integer downloadStatus; | ||
294 | |||
295 | |||
276 | } | 296 | } | ... | ... |
... | @@ -307,4 +307,15 @@ public class ProgramRequest extends AppPagingRequest { | ... | @@ -307,4 +307,15 @@ public class ProgramRequest extends AppPagingRequest { |
307 | * 下载状态 | 307 | * 下载状态 |
308 | */ | 308 | */ |
309 | private String localStatus; | 309 | private String localStatus; |
310 | |||
311 | |||
312 | /** | ||
313 | * 下载状态1 | ||
314 | */ | ||
315 | private Integer downloadStatus; | ||
316 | |||
317 | //开始时间 | ||
318 | private String beginTime; | ||
319 | //结束时间 | ||
320 | private String EndTime; | ||
310 | } | 321 | } | ... | ... |
... | @@ -11,7 +11,7 @@ public class ContentResponse { | ... | @@ -11,7 +11,7 @@ public class ContentResponse { |
11 | private Long num; | 11 | private Long num; |
12 | 12 | ||
13 | //剧集 | 13 | //剧集 |
14 | private Integer Drama; | 14 | private Integer drama; |
15 | //单片 | 15 | //单片 |
16 | private Integer monolithic; | 16 | private Integer monolithic; |
17 | 17 | ... | ... |
... | @@ -20,9 +20,9 @@ public class MovieResponse { | ... | @@ -20,9 +20,9 @@ public class MovieResponse { |
20 | private Integer Duration; | 20 | private Integer Duration; |
21 | 21 | ||
22 | 22 | ||
23 | private Date day1; | 23 | private String day1; |
24 | private Double TotlSize2; | 24 | private Double totlSize2; |
25 | private Long TotlFee3; | 25 | private Long totlFee3; |
26 | private Double TotlDuration4; | 26 | private Double totlDuration4; |
27 | 27 | ||
28 | } | 28 | } | ... | ... |
... | @@ -6,9 +6,8 @@ import lombok.Data; | ... | @@ -6,9 +6,8 @@ import lombok.Data; |
6 | @Data | 6 | @Data |
7 | public class ProgramSyResponse { | 7 | public class ProgramSyResponse { |
8 | 8 | ||
9 | private String day; | ||
10 | //剧集 | 9 | //剧集 |
11 | private Integer Drama; | 10 | private Integer drama; |
12 | //单片 | 11 | //单片 |
13 | private Integer monolithic; | 12 | private Integer monolithic; |
14 | //下载数量 | 13 | //下载数量 |
... | @@ -17,7 +16,6 @@ public class ProgramSyResponse { | ... | @@ -17,7 +16,6 @@ public class ProgramSyResponse { |
17 | private Double xzSize; | 16 | private Double xzSize; |
18 | //下载时长 | 17 | //下载时长 |
19 | private Double totlDuration; | 18 | private Double totlDuration; |
20 | |||
21 | //下载失败的数量 | 19 | //下载失败的数量 |
22 | private Long failSum; | 20 | private Long failSum; |
23 | //同步未下载数量 | 21 | //同步未下载数量 | ... | ... |
... | @@ -54,4 +54,18 @@ public interface IContentService extends IService<Content> { | ... | @@ -54,4 +54,18 @@ public interface IContentService extends IService<Content> { |
54 | ContentResponse selectAllCont(); | 54 | ContentResponse selectAllCont(); |
55 | 55 | ||
56 | 56 | ||
57 | /** | ||
58 | * 查询所有剧集 | ||
59 | * @param contentRequest | ||
60 | * @return | ||
61 | */ | ||
62 | |||
63 | List<Content> selectAllContenten(ContentRequest contentRequest); | ||
64 | |||
65 | |||
66 | |||
67 | |||
68 | |||
69 | |||
70 | |||
57 | } | 71 | } | ... | ... |
... | @@ -30,7 +30,7 @@ public interface IMovieService extends IService<Movie> { | ... | @@ -30,7 +30,7 @@ public interface IMovieService extends IService<Movie> { |
30 | 30 | ||
31 | //查询总体下载情况 | 31 | //查询总体下载情况 |
32 | 32 | ||
33 | List<Movie> selectAllPopulation(Movie movie); | 33 | List<Movie> selectAllPopulation(); |
34 | 34 | ||
35 | 35 | ||
36 | /** | 36 | /** |
... | @@ -39,4 +39,7 @@ public interface IMovieService extends IService<Movie> { | ... | @@ -39,4 +39,7 @@ public interface IMovieService extends IService<Movie> { |
39 | * @return | 39 | * @return |
40 | */ | 40 | */ |
41 | List<MovieResponse> selectAllSevenxz(ProRequest proRequest); | 41 | List<MovieResponse> selectAllSevenxz(ProRequest proRequest); |
42 | |||
43 | |||
44 | |||
42 | } | 45 | } | ... | ... |
... | @@ -7,10 +7,10 @@ import com.baomidou.mybatisplus.extension.service.IService; | ... | @@ -7,10 +7,10 @@ import com.baomidou.mybatisplus.extension.service.IService; |
7 | import com.hui.iqiyi.request.ByIdsRequest; | 7 | import com.hui.iqiyi.request.ByIdsRequest; |
8 | import com.hui.iqiyi.request.ProRequest; | 8 | import com.hui.iqiyi.request.ProRequest; |
9 | import com.hui.iqiyi.request.ProgramRequest; | 9 | import com.hui.iqiyi.request.ProgramRequest; |
10 | import com.hui.iqiyi.response.MovieResponse; | 10 | import com.hui.iqiyi.response.ContentResponse; |
11 | import com.hui.iqiyi.response.ProgramResponse; | 11 | import com.hui.iqiyi.response.ProgramResponse; |
12 | import com.hui.iqiyi.response.ProgramSyResponse; | 12 | import com.hui.iqiyi.response.ProgramSyResponse; |
13 | import org.springframework.context.annotation.Primary; | 13 | import com.hui.iqiyi.response.ProgramXRespone; |
14 | 14 | ||
15 | import java.util.List; | 15 | import java.util.List; |
16 | import java.util.Map; | 16 | import java.util.Map; |
... | @@ -59,7 +59,7 @@ public interface IProgramService extends IService<Program> { | ... | @@ -59,7 +59,7 @@ public interface IProgramService extends IService<Program> { |
59 | * | 59 | * |
60 | * @return | 60 | * @return |
61 | */ | 61 | */ |
62 | List<ProgramSyResponse> selectAllSeven(ProRequest proRequest); | 62 | List<ProgramXRespone> selectAllSeven(ProRequest proRequest); |
63 | 63 | ||
64 | 64 | ||
65 | /** | 65 | /** |
... | @@ -71,4 +71,23 @@ public interface IProgramService extends IService<Program> { | ... | @@ -71,4 +71,23 @@ public interface IProgramService extends IService<Program> { |
71 | ProgramSyResponse selectAllProgramCount(); | 71 | ProgramSyResponse selectAllProgramCount(); |
72 | 72 | ||
73 | 73 | ||
74 | |||
75 | /** | ||
76 | * 全部片单信息 | ||
77 | * | ||
78 | * @param | ||
79 | * @return | ||
80 | */ | ||
81 | ContentResponse selectAllPrograms(); | ||
82 | |||
83 | /** | ||
84 | * 查询所有单片 | ||
85 | * @param programRequest | ||
86 | * @return | ||
87 | */ | ||
88 | |||
89 | List<Program> selectAllProgra(ProgramRequest programRequest); | ||
90 | |||
91 | |||
92 | |||
74 | } | 93 | } | ... | ... |
... | @@ -2,10 +2,12 @@ package com.hui.iqiyi.service.impl; | ... | @@ -2,10 +2,12 @@ package com.hui.iqiyi.service.impl; |
2 | 2 | ||
3 | import com.hui.iqiyi.Util.ReturnBean; | 3 | import com.hui.iqiyi.Util.ReturnBean; |
4 | import com.hui.iqiyi.entity.Content; | 4 | import com.hui.iqiyi.entity.Content; |
5 | import com.hui.iqiyi.entity.Media; | ||
5 | import com.hui.iqiyi.entity.Movie; | 6 | import com.hui.iqiyi.entity.Movie; |
6 | import com.hui.iqiyi.entity.Program; | 7 | import com.hui.iqiyi.entity.Program; |
7 | import com.hui.iqiyi.mapper.ContentMapper; | 8 | import com.hui.iqiyi.mapper.ContentMapper; |
8 | import com.hui.iqiyi.request.ContentRequest; | 9 | import com.hui.iqiyi.request.ContentRequest; |
10 | import com.hui.iqiyi.request.ProgramRequest; | ||
9 | import com.hui.iqiyi.response.ContentResponse; | 11 | import com.hui.iqiyi.response.ContentResponse; |
10 | import com.hui.iqiyi.service.IContentService; | 12 | import com.hui.iqiyi.service.IContentService; |
11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 13 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
... | @@ -19,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -19,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional; |
19 | 21 | ||
20 | import javax.annotation.Resource; | 22 | import javax.annotation.Resource; |
21 | import java.util.List; | 23 | import java.util.List; |
24 | import java.util.stream.Collectors; | ||
22 | 25 | ||
23 | /** | 26 | /** |
24 | * <p> | 27 | * <p> |
... | @@ -81,5 +84,41 @@ public class ContentServiceImpl extends ServiceImpl<ContentMapper, Content> impl | ... | @@ -81,5 +84,41 @@ public class ContentServiceImpl extends ServiceImpl<ContentMapper, Content> impl |
81 | return response; | 84 | return response; |
82 | } | 85 | } |
83 | 86 | ||
87 | @Override | ||
88 | public List<Content> selectAllContenten(ContentRequest contentRequest) { | ||
89 | List<Content> list = null; | ||
90 | try { | ||
91 | list = contentMapper.selectAllContenten(contentRequest); | ||
92 | if (list.size() == 0) | ||
93 | return list; | ||
94 | ProgramRequest programRequest = new ProgramRequest(); | ||
95 | programRequest.setContentIdList(list.stream().map(Long -> Long.getId()).collect(Collectors.toList())); | ||
96 | List<ProgramRequest> listPro = iProgramService.selectDownload(programRequest); | ||
97 | for (Content content : list) { | ||
98 | for (ProgramRequest pro : listPro) { | ||
99 | if (content.getId().compareTo(pro.getIqiyiContentId()) == 0) { | ||
100 | //如果剧头的总集数与下载量一至则显示全部下载完成 | ||
101 | if (content.getCurrCount().compareTo(pro.getDownloadCount()) == 0) { | ||
102 | content.setDownloadStatus("全部下载完成"); | ||
103 | continue; | ||
104 | } | ||
105 | //如果剧头的总集数 大于 下载量 就显示未全部下载 | ||
106 | if (content.getCurrCount().compareTo(pro.getDownloadCount()) > 0) { | ||
107 | content.setDownloadStatus("未全部下载"); | ||
108 | continue; | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | //里面是关联查询匹配,如果没有下载记录,就塞入未下载 | ||
113 | if (ObjectUtils.isEmpty(content.getDownloadStatus())) | ||
114 | content.setDownloadStatus("未下载"); | ||
115 | } | ||
116 | } catch (Exception e) { | ||
117 | throw new RuntimeException("服务器错误,错误原因是:" + e.getMessage() + "请联系运维!"); | ||
118 | } | ||
119 | return list; | ||
120 | } | ||
121 | |||
122 | |||
84 | 123 | ||
85 | } | 124 | } | ... | ... |
... | @@ -63,7 +63,7 @@ public class MediaServiceImpl extends ServiceImpl<MediaMapper, Media> implements | ... | @@ -63,7 +63,7 @@ public class MediaServiceImpl extends ServiceImpl<MediaMapper, Media> implements |
63 | for (Media media : list) { | 63 | for (Media media : list) { |
64 | for (ProgramRequest pro : listPro) { | 64 | for (ProgramRequest pro : listPro) { |
65 | if (media.getId().compareTo(pro.getIqiyiContentId()) == 0) { | 65 | if (media.getId().compareTo(pro.getIqiyiContentId()) == 0) { |
66 | //如果剧头的总集数与下载量一直则显示全部下载完成 | 66 | //如果剧头的总集数与下载量一至则显示全部下载完成 |
67 | if (media.getCurrCount().compareTo(pro.getDownloadCount()) == 0) { | 67 | if (media.getCurrCount().compareTo(pro.getDownloadCount()) == 0) { |
68 | media.setDownloadStatus("全部下载完成"); | 68 | media.setDownloadStatus("全部下载完成"); |
69 | continue; | 69 | continue; | ... | ... |
1 | package com.hui.iqiyi.service.impl; | 1 | package com.hui.iqiyi.service.impl; |
2 | 2 | ||
3 | import com.alibaba.excel.EasyExcel; | ||
4 | import com.alibaba.fastjson.JSON; | ||
3 | import com.hui.iqiyi.Util.ReturnBean; | 5 | import com.hui.iqiyi.Util.ReturnBean; |
6 | import com.hui.iqiyi.Util.TestFileUtil; | ||
4 | import com.hui.iqiyi.entity.Movie; | 7 | import com.hui.iqiyi.entity.Movie; |
8 | import com.hui.iqiyi.excel.DownloadExcel; | ||
5 | import com.hui.iqiyi.mapper.MovieMapper; | 9 | import com.hui.iqiyi.mapper.MovieMapper; |
6 | import com.hui.iqiyi.request.MovieRequest; | 10 | import com.hui.iqiyi.request.MovieRequest; |
7 | import com.hui.iqiyi.request.ProRequest; | 11 | import com.hui.iqiyi.request.ProRequest; |
... | @@ -28,6 +32,7 @@ import java.util.List; | ... | @@ -28,6 +32,7 @@ import java.util.List; |
28 | @Primary | 32 | @Primary |
29 | public class MovieServiceImpl extends ServiceImpl<MovieMapper, Movie> implements IMovieService { | 33 | public class MovieServiceImpl extends ServiceImpl<MovieMapper, Movie> implements IMovieService { |
30 | 34 | ||
35 | |||
31 | @Autowired | 36 | @Autowired |
32 | private MovieMapper movieMapper; | 37 | private MovieMapper movieMapper; |
33 | 38 | ||
... | @@ -48,12 +53,21 @@ public class MovieServiceImpl extends ServiceImpl<MovieMapper, Movie> implements | ... | @@ -48,12 +53,21 @@ public class MovieServiceImpl extends ServiceImpl<MovieMapper, Movie> implements |
48 | 53 | ||
49 | 54 | ||
50 | @Override | 55 | @Override |
51 | public List<Movie> selectAllPopulation(Movie movie) { | 56 | public List<Movie> selectAllPopulation() { |
52 | return movieMapper.selectAllPopulation(movie); | 57 | List<Movie> list= movieMapper.selectAllPopulation(); |
58 | list.stream().forEach(item->{ | ||
59 | if (item.getLocalStatus() == 0) | ||
60 | item.setLocalStatuss("未下载"); | ||
61 | if (item.getLocalStatus() == 100) | ||
62 | item.setLocalStatuss("已下载"); | ||
63 | }); | ||
64 | System.out.printf(JSON.toJSONString(list)); | ||
65 | return list; | ||
53 | } | 66 | } |
54 | 67 | ||
55 | @Override | 68 | @Override |
56 | public List<MovieResponse> selectAllSevenxz(ProRequest proRequest) { | 69 | public List<MovieResponse> selectAllSevenxz(ProRequest proRequest) { |
57 | return movieMapper.selectAllSevenxz(proRequest); | 70 | return movieMapper.selectAllSevenxz(proRequest); |
58 | } | 71 | } |
72 | |||
59 | } | 73 | } | ... | ... |
... | @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; | ... | @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; |
5 | import com.github.pagehelper.PageInfo; | 5 | import com.github.pagehelper.PageInfo; |
6 | import com.hui.iqiyi.Util.ReturnBean; | 6 | import com.hui.iqiyi.Util.ReturnBean; |
7 | import com.hui.iqiyi.Util.ReturnProgram; | 7 | import com.hui.iqiyi.Util.ReturnProgram; |
8 | import com.hui.iqiyi.entity.Content; | ||
8 | import com.hui.iqiyi.entity.Movie; | 9 | import com.hui.iqiyi.entity.Movie; |
9 | import com.hui.iqiyi.entity.Program; | 10 | import com.hui.iqiyi.entity.Program; |
10 | import com.hui.iqiyi.mapper.ContentMapper; | 11 | import com.hui.iqiyi.mapper.ContentMapper; |
... | @@ -17,6 +18,7 @@ import com.hui.iqiyi.response.*; | ... | @@ -17,6 +18,7 @@ import com.hui.iqiyi.response.*; |
17 | import com.hui.iqiyi.service.IProgramService; | 18 | import com.hui.iqiyi.service.IProgramService; |
18 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 19 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
19 | import org.apache.commons.lang3.ObjectUtils; | 20 | import org.apache.commons.lang3.ObjectUtils; |
21 | import org.apache.xmlbeans.impl.xb.xsdschema.Public; | ||
20 | import org.springframework.beans.BeanUtils; | 22 | import org.springframework.beans.BeanUtils; |
21 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
22 | import org.springframework.context.annotation.Primary; | 24 | import org.springframework.context.annotation.Primary; |
... | @@ -24,7 +26,6 @@ import org.springframework.stereotype.Service; | ... | @@ -24,7 +26,6 @@ import org.springframework.stereotype.Service; |
24 | import org.springframework.transaction.annotation.Transactional; | 26 | import org.springframework.transaction.annotation.Transactional; |
25 | 27 | ||
26 | import javax.annotation.Resource; | 28 | import javax.annotation.Resource; |
27 | import java.math.BigDecimal; | ||
28 | import java.util.ArrayList; | 29 | import java.util.ArrayList; |
29 | import java.util.HashMap; | 30 | import java.util.HashMap; |
30 | import java.util.List; | 31 | import java.util.List; |
... | @@ -52,6 +53,8 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl | ... | @@ -52,6 +53,8 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl |
52 | @Resource | 53 | @Resource |
53 | private ContentMapper contentMapper; | 54 | private ContentMapper contentMapper; |
54 | 55 | ||
56 | public Long CurrCount; | ||
57 | |||
55 | @Override | 58 | @Override |
56 | @Transactional | 59 | @Transactional |
57 | public ReturnBean updateByProgramIds(List<ByIdsRequest> requests) { | 60 | public ReturnBean updateByProgramIds(List<ByIdsRequest> requests) { |
... | @@ -189,7 +192,7 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl | ... | @@ -189,7 +192,7 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl |
189 | } | 192 | } |
190 | 193 | ||
191 | @Override | 194 | @Override |
192 | public List<ProgramSyResponse> selectAllSeven(ProRequest proRequest) { | 195 | public List<ProgramXRespone> selectAllSeven(ProRequest proRequest) { |
193 | return programMapper.selectAllSeven(proRequest); | 196 | return programMapper.selectAllSeven(proRequest); |
194 | } | 197 | } |
195 | 198 | ||
... | @@ -222,4 +225,50 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl | ... | @@ -222,4 +225,50 @@ public class ProgramServiceImpl extends ServiceImpl<ProgramMapper, Program> impl |
222 | 225 | ||
223 | } | 226 | } |
224 | 227 | ||
228 | @Override | ||
229 | public ContentResponse selectAllPrograms() { | ||
230 | List<Integer> integers=programMapper.selectAllPrograms(); | ||
231 | ContentResponse response = new ContentResponse(); | ||
232 | response.setDrama(integers.get(0)); | ||
233 | response.setMonolithic(integers.get(1)); | ||
234 | return response; | ||
235 | } | ||
236 | |||
237 | @Override | ||
238 | public List<Program> selectAllProgra(ProgramRequest programRequest) { | ||
239 | CurrCount = 1L; | ||
240 | List<Program> list = null; | ||
241 | try { | ||
242 | list = programMapper.selectAllProgra(programRequest); | ||
243 | if (list.size() == 0) | ||
244 | return list; | ||
245 | ProgramRequest request = new ProgramRequest(); | ||
246 | programRequest.setContentIdList(list.stream().map(Long -> Long.getId()).collect(Collectors.toList())); | ||
247 | List<ProgramRequest> listPro = programMapper.selectDownload(programRequest); | ||
248 | for (Program program : list) { | ||
249 | for (ProgramRequest pro : listPro) { | ||
250 | if (program.getId().compareTo(pro.getIqiyiContentId()) == 0) { | ||
251 | //如果剧头的总集数与下载量一至则显示全部下载完成 | ||
252 | if (CurrCount.compareTo(pro.getDownloadCount()) == 0) { | ||
253 | program.setDownloadStatus("全部下载完成"); | ||
254 | continue; | ||
255 | } | ||
256 | //如果剧头的总集数 大于 下载量 就显示未全部下载 | ||
257 | if (CurrCount.compareTo(pro.getDownloadCount()) > 0) { | ||
258 | program.setDownloadStatus("未全部下载"); | ||
259 | continue; | ||
260 | } | ||
261 | } | ||
262 | } | ||
263 | //里面是关联查询匹配,如果没有下载记录,就塞入未下载 | ||
264 | if (ObjectUtils.isEmpty(program.getDownloadStatus())) | ||
265 | program.setDownloadStatus("未下载"); | ||
266 | } | ||
267 | } catch (Exception e) { | ||
268 | throw new RuntimeException("服务器错误,错误原因是:" + e.getMessage() + "请联系运维!"); | ||
269 | } | ||
270 | return list; | ||
271 | } | ||
272 | |||
273 | |||
225 | } | 274 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -14,11 +14,22 @@ spring: | ... | @@ -14,11 +14,22 @@ spring: |
14 | active: dev | 14 | active: dev |
15 | 15 | ||
16 | mybatis-plus: | 16 | mybatis-plus: |
17 | configuration: | 17 | configuration: |
18 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl | 18 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
19 | |||
19 | mvc: | 20 | mvc: |
20 | async: | 21 | async: |
21 | request-timeout: 200000 | 22 | request-timeout: 200000 |
22 | 23 | ||
23 | mybatis-plus: | 24 | mybatis-plus: |
24 | mapper-locations: classpath:mapper/iqiyi/*.xml | 25 | mapper-locations: classpath:mapper/iqiyi/*.xml |
26 | |||
27 | |||
28 | |||
29 | logging: | ||
30 | config: classpath:logback.xml | ||
31 | |||
32 | recievers: | ||
33 | shoujianren: jiaohui@topdraw.cn | ||
34 | |||
35 | filePath: D:\java\爱奇艺下载情况.xlsx\ | ... | ... |
src/main/resources/logback.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <!-- 从高到地低 OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL --> | ||
3 | <!-- 日志输出规则 根据当前ROOT 级别,日志输出时,级别高于root默认的级别时 会输出 --> | ||
4 | <!-- 以下 每个配置的 filter 是过滤掉输出文件里面,会出现高级别文件,依然出现低级别的日志信息,通过filter 过滤只记录本级别的日志--> | ||
5 | |||
6 | <!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位, | ||
7 | 默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> | ||
8 | <configuration scan="true" scanPeriod="60 seconds" debug="false"> | ||
9 | <!-- 定义日志文件 输入位置 --> | ||
10 | <property name="logPath" value="d:/test_log" /> | ||
11 | <!-- 日志最大的历史 30天 --> | ||
12 | <property name="maxHistory" value="30"/> | ||
13 | <logger name="com.hui.iqiyi.controller.MovieController" level="DEBUG" /> | ||
14 | |||
15 | <!-- 配置项, 通过此节点配置日志输出位置(控制台、文件、数据库)、输出格式等--> | ||
16 | <!-- ConsoleAppender代表输出到控制台 --> | ||
17 | <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"> | ||
18 | <!-- layout代表输出格式 --> | ||
19 | <layout class="ch.qos.logback.classic.PatternLayout"> | ||
20 | <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger -%msg%n</pattern> | ||
21 | </layout> | ||
22 | </appender> | ||
23 | <!-- 日志输出文件 --> | ||
24 | <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
25 | <encoder> | ||
26 | <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger -%msg%n</pattern> | ||
27 | </encoder> | ||
28 | <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender--> | ||
29 | <!-- 滚动策略,它根据时间来制定滚动策略.既负责滚动也负责触发滚动 --> | ||
30 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
31 | <!-- 输出路径 --> | ||
32 | <fileNamePattern>${logPath}/info/%d.log</fileNamePattern> | ||
33 | <!-- 可选节点,控制保留的归档文件的最大数量,超出数量就删除旧文件假设设置每个月滚动,且<maxHistory>是6, | ||
34 | 则只保存最近6个月的文件,删除之前的旧文件。注意,删除旧文件是,那些为了归档而创建的目录也会被删除--> | ||
35 | <maxHistory>${maxHistory}</maxHistory> | ||
36 | </rollingPolicy> | ||
37 | <!-- 按照固定窗口模式生成日志文件,当文件大于20MB时,生成新的日志文件。窗口大小是1到3,当保存了3个归档文件后,将覆盖最早的日志。 | ||
38 | <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
39 | <fileNamePattern>${logPath}/%d{yyyy-MM-dd}/.log.zip</fileNamePattern> | ||
40 | <minIndex>1</minIndex> | ||
41 | <maxIndex>3</maxIndex> | ||
42 | </rollingPolicy> --> | ||
43 | <!-- 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender 触发当前活动文件滚动 | ||
44 | <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
45 | <maxFileSize>5MB</maxFileSize> | ||
46 | </triggeringPolicy> --> | ||
47 | </appender> | ||
48 | <!-- 特殊记录Error日志 --> | ||
49 | <appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
50 | <!-- 只记录ERROR级别日志,添加范围过滤,可以将该类型的日志特殊记录到某个位置 --> | ||
51 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
52 | <level>ERROR</level> | ||
53 | </filter> | ||
54 | <encoder> | ||
55 | <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger -%msg%n</pattern> | ||
56 | </encoder> | ||
57 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
58 | <fileNamePattern>${logPath}/error/%d.log</fileNamePattern> | ||
59 | <!-- 日志最大的历史 60天 --> | ||
60 | <maxHistory>60</maxHistory> | ||
61 | </rollingPolicy> | ||
62 | </appender> | ||
63 | |||
64 | <!-- 根节点,表名基本的日志级别,里面可以由多个appender规则 --> | ||
65 | <!-- level="info"代表基础日志级别为info --> | ||
66 | <root level="info"> | ||
67 | <!-- 引入控制台输出规则 --> | ||
68 | <appender-ref ref="consoleLog" /> | ||
69 | <appender-ref ref="fileInfoLog" /> | ||
70 | <appender-ref ref="fileErrorLog" /> | ||
71 | </root> | ||
72 | </configuration> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -31,12 +31,46 @@ | ... | @@ -31,12 +31,46 @@ |
31 | group by contentType,cname order by contentType,cname | 31 | group by contentType,cname order by contentType,cname |
32 | </select> | 32 | </select> |
33 | <select id="selectAllCont" resultType="java.lang.Integer"> | 33 | <select id="selectAllCont" resultType="java.lang.Integer"> |
34 | |||
35 | select count(1) from iqiyi_content where platform_info like '%1%' | 34 | select count(1) from iqiyi_content where platform_info like '%1%' |
36 | union | 35 | union |
37 | select count(1) from iqiyi_program where series_flag = 0 and platform_info like '%1%' | 36 | select count(1) from iqiyi_program where series_flag = 0 and platform_info like '%1%' |
38 | 37 | ||
39 | </select> | 38 | </select> |
39 | <select id="selectAllContenten" resultType="com.hui.iqiyi.entity.Content" parameterType="com.hui.iqiyi.request.ContentRequest"> | ||
40 | |||
41 | select a.* | ||
42 | from iqiyi_content as a | ||
43 | where 1=1 | ||
44 | <if test="id != null and id != ''"> | ||
45 | and id = #{id} | ||
46 | </if> | ||
47 | <if test="cid != null and cid != ''"> | ||
48 | and cid = #{cid} | ||
49 | </if> | ||
50 | <if test="name!= null and name!= ''"> | ||
51 | AND name like #{name} | ||
52 | </if> | ||
53 | <if test="cname!= null and cname!= ''"> | ||
54 | AND cname = #{cname} | ||
55 | </if> | ||
56 | <if test="beginTime != null"> | ||
57 | and create_time >= #{beginTime} | ||
58 | </if> | ||
59 | <if test="EndTime != null"> | ||
60 | and create_time <= #{EndTime} | ||
61 | </if> | ||
62 | <if test="score != null"> | ||
63 | and score = #{score} | ||
64 | </if> | ||
65 | <if test="platformInfo != null"> | ||
66 | and platform_info = #{platformInfo} | ||
67 | </if> | ||
68 | <if test="downloadStatus !=null" > | ||
69 | and local_status=#{downloadStatus} | ||
70 | </if> | ||
71 | ORDER BY create_time desc | ||
72 | |||
73 | </select> | ||
40 | 74 | ||
41 | <sql id="Where_Cloumn"> | 75 | <sql id="Where_Cloumn"> |
42 | <where> | 76 | <where> | ... | ... |
... | @@ -6,8 +6,6 @@ | ... | @@ -6,8 +6,6 @@ |
6 | 6 | ||
7 | select im.* | 7 | select im.* |
8 | from iqiyi_media as im | 8 | from iqiyi_media as im |
9 | left join iqiyi_program as ip on im.id =ip.iqiyi_content_id | ||
10 | LEFT JOIN iqiyi_movie as i on ip.id=i.iqiyi_program_id | ||
11 | where 1=1 | 9 | where 1=1 |
12 | <if test="id != null and id != ''"> | 10 | <if test="id != null and id != ''"> |
13 | and id = #{id} | 11 | and id = #{id} |
... | @@ -36,7 +34,6 @@ | ... | @@ -36,7 +34,6 @@ |
36 | <if test="platformInfo != null"> | 34 | <if test="platformInfo != null"> |
37 | and platform_info = #{platformInfo} | 35 | and platform_info = #{platformInfo} |
38 | </if> | 36 | </if> |
39 | |||
40 | <if test="follow != null"> | 37 | <if test="follow != null"> |
41 | and platform_info is not null | 38 | and platform_info is not null |
42 | </if> | 39 | </if> |
... | @@ -61,32 +58,4 @@ | ... | @@ -61,32 +58,4 @@ |
61 | 58 | ||
62 | </select> | 59 | </select> |
63 | 60 | ||
64 | <!-- <select id="selectAllIqIy" resultType="com.hui.iqiyi.entity.Media" parameterType="com.hui.iqiyi.request.MediaRequest">--> | ||
65 | |||
66 | <!-- select im.*--> | ||
67 | <!-- from iqiyi_media as im--> | ||
68 | <!-- where 1=1--> | ||
69 | <!-- <if test="param2.type != null and param2.type != ''">--> | ||
70 | <!-- and type = #{param2.type}--> | ||
71 | <!-- </if>--> | ||
72 | <!-- <if test="param2.name!= null and param2.name!= ''">--> | ||
73 | <!-- AND name = #{param2.name}--> | ||
74 | <!-- </if>--> | ||
75 | <!-- <if test="param2.cname!= null and param2.cname!= ''">--> | ||
76 | <!-- AND cname = #{param2.cname}--> | ||
77 | <!-- </if>--> | ||
78 | <!-- <if test="param2.beginTime != null">--> | ||
79 | <!-- and create_time >= #{param2.beginTime}--> | ||
80 | <!-- </if>--> | ||
81 | <!-- <if test="param2.EndTime != null">--> | ||
82 | <!-- and create_time <= #{param2.EndTime}--> | ||
83 | <!-- </if>--> | ||
84 | <!-- <if test="param2.score != null">--> | ||
85 | <!-- and score = #{param2.score}--> | ||
86 | <!-- </if>--> | ||
87 | <!-- <if test="param2.platform_info != null">--> | ||
88 | <!-- and platform_info = #{param2.platform_info}--> | ||
89 | <!-- </if>--> | ||
90 | <!-- ORDER BY create_time--> | ||
91 | <!-- </select>--> | ||
92 | </mapper> | 61 | </mapper> | ... | ... |
... | @@ -23,16 +23,16 @@ | ... | @@ -23,16 +23,16 @@ |
23 | </update> | 23 | </update> |
24 | 24 | ||
25 | 25 | ||
26 | <select id="selectAllPopulation" resultType="com.hui.iqiyi.entity.Movie" parameterType="com.hui.iqiyi.entity.Movie"> | 26 | <select id="selectAllPopulation" resultType="com.hui.iqiyi.entity.Movie"> |
27 | select local_status, count(1) as'number',sum(file_size)/1024/1024/1024 as'capacity', sum(duration)/60/60 as'duration' | 27 | select local_status, count(1) as'number',sum(file_size)/1024/1024/1024 as'capacity', sum(duration)/60/60 as'duration' |
28 | from iqiyi_movie where local_status >= 0 | 28 | from iqiyi_movie where local_status >= 0 and vid > 0 |
29 | GROUP BY local_status; | 29 | GROUP BY local_status |
30 | </select> | 30 | </select> |
31 | 31 | ||
32 | 32 | ||
33 | <select id="selectAllSevenxz" resultType="com.hui.iqiyi.response.MovieResponse" parameterType="com.hui.iqiyi.request.ProRequest"> | 33 | <select id="selectAllSevenxz" resultType="com.hui.iqiyi.response.MovieResponse" parameterType="com.hui.iqiyi.request.ProRequest"> |
34 | SELECT DATE_FORMAT(p.update_time,"%Y-%m-%d")as day1 ,count(p.id) as TotlFee3 , | 34 | SELECT DATE_FORMAT(p.update_time,"%Y-%m-%d")as day1 ,count(p.id) as totlFee3 , |
35 | sum(m.file_size)/1024/1024/1024 as TotlSize2,sum(m.duration)/60/60 as TotlDuration4 | 35 | sum(m.file_size)/1024/1024/1024 as totlSize2,sum(m.duration)/60/60 as totlDuration4 |
36 | FROM iqiyi_program p left join iqiyi_movie m on p.id = m.iqiyi_program_id | 36 | FROM iqiyi_program p left join iqiyi_movie m on p.id = m.iqiyi_program_id |
37 | <where> | 37 | <where> |
38 | <if test="proRequest.startTime != null"> | 38 | <if test="proRequest.startTime != null"> | ... | ... |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | </select> | 53 | </select> |
54 | 54 | ||
55 | 55 | ||
56 | <select id="selectAllSeven" parameterType="com.hui.iqiyi.request.ProRequest" resultType="com.hui.iqiyi.response.ProgramSyResponse"> | 56 | <select id="selectAllSeven" parameterType="com.hui.iqiyi.request.ProRequest" resultType="com.hui.iqiyi.response.ProgramXRespone"> |
57 | 57 | ||
58 | SELECT DATE_FORMAT(update_time,"%Y-%m-%d")as day ,count(1) as TotlFee , | 58 | SELECT DATE_FORMAT(update_time,"%Y-%m-%d")as day ,count(1) as TotlFee , |
59 | sum(file_size)/1024/1024/1024 as TotlSize,sum(duration)/60/60 as TotlDuration | 59 | sum(file_size)/1024/1024/1024 as TotlSize,sum(duration)/60/60 as TotlDuration |
... | @@ -82,6 +82,53 @@ | ... | @@ -82,6 +82,53 @@ |
82 | group by local_status | 82 | group by local_status |
83 | 83 | ||
84 | </select> | 84 | </select> |
85 | <select id="selectAllPrograms" resultType="java.lang.Integer"> | ||
86 | |||
87 | select count(1) from iqiyi_content | ||
88 | union | ||
89 | select count(1) from iqiyi_program where series_flag = 0 | ||
90 | |||
91 | |||
92 | </select> | ||
93 | <select id="selectAllProgra" resultType="com.hui.iqiyi.entity.Program" parameterType="com.hui.iqiyi.request.ProgramRequest"> | ||
94 | |||
95 | select a.* | ||
96 | from iqiyi_program as a | ||
97 | LEFT JOIN iqiyi_movie as b on a.id=b.iqiyi_program_id | ||
98 | <where> | ||
99 | <if test="id != null and id != ''"> | ||
100 | and id = #{id} | ||
101 | </if> | ||
102 | <if test="cid != null and cid != ''"> | ||
103 | and cid = #{cid} | ||
104 | </if> | ||
105 | <if test="name!= null and name!= ''"> | ||
106 | AND name like #{name} | ||
107 | </if> | ||
108 | <if test="cname!= null and cname!= ''"> | ||
109 | AND cname = #{cname} | ||
110 | </if> | ||
111 | <if test="beginTime != null"> | ||
112 | and create_time >= #{beginTime} | ||
113 | </if> | ||
114 | <if test="EndTime != null"> | ||
115 | and create_time <= #{EndTime} | ||
116 | </if> | ||
117 | <if test="score != null"> | ||
118 | and score = #{score} | ||
119 | </if> | ||
120 | <if test="platformInfo != null"> | ||
121 | and platform_info = #{platformInfo} | ||
122 | </if> | ||
123 | <if test="downloadStatus !=null" > | ||
124 | and local_status=#{downloadStatus} | ||
125 | </if> | ||
126 | and series_flag=0 | ||
127 | </where> | ||
128 | ORDER BY create_time desc | ||
129 | |||
130 | |||
131 | </select> | ||
85 | 132 | ||
86 | 133 | ||
87 | <sql id="Pro_Cloumn"> | 134 | <sql id="Pro_Cloumn"> | ... | ... |
1 | package com.hui.iqiyi; | 1 | package com.hui.iqiyi; |
2 | 2 | ||
3 | import com.alibaba.excel.EasyExcel; | ||
4 | import com.hui.iqiyi.Util.TestFileUtil; | ||
5 | import com.hui.iqiyi.entity.Movie; | ||
6 | import com.hui.iqiyi.excel.DownloadExcel; | ||
7 | import com.hui.iqiyi.service.IMovieService; | ||
3 | import org.junit.jupiter.api.Test; | 8 | import org.junit.jupiter.api.Test; |
4 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
5 | import org.springframework.boot.test.context.SpringBootTest; | 10 | import org.springframework.boot.test.context.SpringBootTest; |
6 | 11 | ||
12 | import java.util.List; | ||
13 | |||
7 | @SpringBootTest | 14 | @SpringBootTest |
8 | class IqiyiApplicationTests { | 15 | class IqiyiApplicationTests { |
9 | 16 | ||
10 | |||
11 | @Test | 17 | @Test |
12 | void contextLoads() { | 18 | void contextLoads() { |
13 | 19 | ||
14 | 20 | ||
21 | |||
22 | |||
15 | } | 23 | } |
16 | 24 | ||
17 | } | 25 | } | ... | ... |
-
Please register or sign in to post a comment