Преглед изворни кода

Merge remote-tracking branch 'origin/master' into master

yangyj пре 1 година
родитељ
комит
3eaa7e3d1b

+ 26 - 26
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveOfflineVersionInfoServiceImpl.java

@@ -290,15 +290,15 @@ public class ArchiveOfflineVersionInfoServiceImpl extends BaseServiceImpl<Archiv
         if (list != null && list.size() > 0) {
             String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/localArchive/localClient/local_archives/alilib/";
             for (ArchiveFile file : list) {
-                if (StringUtil.isNotBlank(file.getFileUrl())) {
-                    String fileUrl = file.getFileUrl();
-                    String fileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
-                    InputStream file_out = CommonUtil.getOSSInputStream(fileUrl);
-                    if (file_out != null) {
-                        CommonUtil.inputStreamToFile(file_out, new File(localUrl + fileName));
-                        file.setFileUrl(fileName);
-                    }
-                }
+//                if (StringUtil.isNotBlank(file.getFileUrl())) {
+//                    String fileUrl = file.getFileUrl();
+//                    String fileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
+//                    InputStream file_out = CommonUtil.getOSSInputStream(fileUrl);
+//                    if (file_out != null) {
+//                        CommonUtil.inputStreamToFile(file_out, new File(localUrl + fileName));
+//                        file.setFileUrl(fileName);
+//                    }
+//                }
                 if (StringUtil.isNotBlank(file.getPdfFileUrl())) {
                     String pdfFileUrl = file.getPdfFileUrl();
                     String fileName = pdfFileUrl.substring(pdfFileUrl.lastIndexOf('/') + 1);
@@ -402,23 +402,23 @@ public class ArchiveOfflineVersionInfoServiceImpl extends BaseServiceImpl<Archiv
         if (list != null && list.size() > 0) {
             String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/localArchive/localClient/local_archives/alilib/";
             //拼接档案里文件的pdf设置allPdf
-            for (ArchivesAutoDTO dto : list) {
-                List<ArchiveFile> files = fileClient.getArchiveFileByArchivesId(dto.getId() + "", "");
-                if (files != null && files.size() > 0) {
-                    List<String> urlList = new ArrayList<>();
-                    for (ArchiveFile file : files) {
-                        if (StringUtil.isNotBlank(file.getPdfFileUrl())) {
-                            urlList.add(file.getPdfFileUrl());
-                        }
-                    }
-                    if (urlList.size() > 0) {
-                        Long id = SnowFlakeUtil.getId();
-                        FileUtils.mergePdfPublicMethods(urlList, localUrl + id + ".pdf");
-                        dto.setAllFilePdf(id + ".pdf");
-                    }
-                }
-
-            }
+//            for (ArchivesAutoDTO dto : list) {
+//                List<ArchiveFile> files = fileClient.getArchiveFileByArchivesId(dto.getId() + "", "");
+//                if (files != null && files.size() > 0) {
+//                    List<String> urlList = new ArrayList<>();
+//                    for (ArchiveFile file : files) {
+//                        if (StringUtil.isNotBlank(file.getPdfFileUrl())) {
+//                            urlList.add(file.getPdfFileUrl());
+//                        }
+//                    }
+//                    if (urlList.size() > 0) {
+//                        Long id = SnowFlakeUtil.getId();
+//                        FileUtils.mergePdfPublicMethods(urlList, localUrl + id + ".pdf");
+//                        dto.setAllFilePdf(id + ".pdf");
+//                    }
+//                }
+//
+//            }
             try {
                 Connection conn = data.dataSource().getConnection();
                 //清空数据

+ 30 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -24,6 +24,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
+import org.jsoup.nodes.Node;
 import org.jsoup.select.Elements;
 import org.springblade.business.entity.ContractLog;
 import org.springblade.business.entity.InformationQuery;
@@ -2408,11 +2409,35 @@ public class ExcelTabController extends BladeController {
                                                 pic.setHeight(Height);
                                                 sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
 
-                                            } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
-                                                CellRange cell = sheet.getCellRange(y1, x1);
-                                                String exceVal = cell.getText().replaceAll(" ", "");
-                                                cell.getCellStyle().getExcelFont().setFontName("EUDC");
-                                                cell.setText(exceVal.replace("□", "\u2611"));
+                                            } else if (data.html().indexOf("hc-form-checkbox-group") >= 0) {
+                                                 CellRange cellRange = sheet.getCellRange(y1, x1);
+                                                 String exceVal = cellRange.getValue().replaceAll(" ", "");
+                                                //如果有□ 代表 自动生成  如果没有 代表后期添加 需要显示html 中的值
+                                                if (exceVal.indexOf("□") >= 0) {
+                                                    if (myData.equals("1")) {
+                                                        cellRange.setValue(exceVal.replace("□", "\u2611"));
+                                                    }
+                                                } else {
+                                                    List<Node> nodes = data.childNodes();
+                                                    Node node = nodes.get(nodes.size() -1);
+                                                    String dataJson = node.attr(":objs");
+                                                    if (StringUtils.isNotEmpty(dataJson)) {
+                                                        JSONArray jsonArray = JSONArray.parseArray(dataJson);
+                                                        List<Integer> idList = Func.toIntList(myData);
+                                                        int indexx = 0;
+                                                        if (idList.get(0) >= 1) {
+                                                            indexx = idList.get(0) - 1;
+                                                        }
+
+                                                        String dataInfo = jsonArray.getJSONObject(indexx).getString("name");
+                                                        for (int inx = 1; inx < idList.size(); inx++) {
+                                                            int valIndex = idList.get(inx) - 1;
+                                                            dataInfo = dataInfo + "," + jsonArray.getJSONObject(valIndex).getString("name");
+                                                        }
+                                                        cellRange.setValue(dataInfo);
+                                                    }
+
+                                                }
                                             } else {
                                                 final CellRange cellRange = sheet.getCellRange(y1, x1);
                                                 cellRange.setText(myData);