Browse Source

客户端---内业台账,下载打印功能

qianxb 2 years ago
parent
commit
b8bc17da97

+ 7 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/NeiYeLedgerVO.java

@@ -80,6 +80,12 @@ public class NeiYeLedgerVO {
     @ApiModelProperty(value = "是否关联试验 true为已关联")
     private Boolean isExperiment;
 
+    /**
+     *  资料主键
+     */
+    @ApiModelProperty(value = "information-query主键")
+    private String id;
+
     public NeiYeLedgerVO(String... values){
         this.unitProject = values[0];
         this.partProject = values[1];
@@ -93,6 +99,7 @@ public class NeiYeLedgerVO {
         this.isEvaluate = Boolean.parseBoolean(values[9]);
         this.isExperiment = Boolean.parseBoolean(values[10]);
         this.reportNumber = values[11];
+        this.id = values[12];
     }
 
     public NeiYeLedgerVO(){}

+ 18 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -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("选择的资料未生成文件");
         }
     }
 

+ 3 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/NeiYeController.java

@@ -243,7 +243,9 @@ public class NeiYeController {
                             new Integer("1").equals(vo.getStatus()) ? "待审批" : new Integer("2").equals(vo.getStatus()) ? "已审批" : "未上报",
                             vo.getEvaluate(),
                             vo.getIsExperiment(),
-                            vo.getReportNumber()));
+                            vo.getReportNumber(),
+                            vo.getInformationQueryId())
+                    );
                 }
                 //转换为page信息
                 Query query = new Query();