|
@@ -899,6 +899,13 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 20)
|
|
|
@ApiOperation(value = "批量打印")
|
|
|
public R<String> batchPrint(@RequestParam String ids) {
|
|
|
+ //判断是否未生成文件
|
|
|
+ List<String> list = Arrays.asList(ids.split(","));
|
|
|
+ for (String s : list) {
|
|
|
+ if (StringUtils.isBlank(s)){
|
|
|
+ return R.fail("选择的资料未生成文件");
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取勾选的数据
|
|
|
List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(ids.split(",")));
|
|
|
//pdf集合
|
|
@@ -952,8 +959,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@PostMapping("/batchDownloadFileToZip")
|
|
|
@ApiOperationSupport(order = 19)
|
|
|
@ApiOperation(value = "批量下载")
|
|
|
- public void batchDownloadFileToZip(String ids, HttpServletResponse response) {
|
|
|
+ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response) {
|
|
|
if (StringUtils.isNotEmpty(ids)) {
|
|
|
+ //判断是否未生成文件
|
|
|
+ List<String> list = Arrays.asList(ids.split(","));
|
|
|
+ for (String s : list) {
|
|
|
+ if (StringUtils.isBlank(s)){
|
|
|
+ return R.fail("选择的资料未生成文件");
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取文件
|
|
|
List<InformationQuery> result = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, Arrays.asList(ids.split(","))));
|
|
|
if (result != null && result.size() > 0) {
|
|
@@ -968,6 +982,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
FileUtils.batchDownloadFileToZip(urls, response);
|
|
|
}
|
|
|
}
|
|
|
+ return R.success("下载成功");
|
|
|
+ }else {
|
|
|
+ return R.fail("选择的资料未生成文件");
|
|
|
}
|
|
|
}
|
|
|
|