zero 1 anno fa
parent
commit
daff3c16ba

+ 14 - 0
src/main/java/cn/cslg/pas/common/dto/ExportDTO.java

@@ -0,0 +1,14 @@
+package cn.cslg.pas.common.dto;
+
+import lombok.Data;
+
+@Data
+public class ExportDTO {
+    private String condition;
+    private String estimatedTree;
+    private String actualTree;
+    private String treeFlag;
+    private String estimatedQuery;
+    private String actualQuery;
+    private String queryFlag;
+}

+ 52 - 19
src/main/java/cn/cslg/pas/common/utils/FileUtils.java

@@ -4,14 +4,11 @@ package cn.cslg.pas.common.utils;
 import cn.cslg.pas.Application;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSON;
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.springframework.boot.system.ApplicationHome;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.*;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
 
@@ -28,13 +25,11 @@ public class FileUtils {
         //获取 applicationHome 内的路径 ...\target\classes 到这一层级下
         File file = ah.getSource();
         //获取 file的parentFile 即最后一级之前的所有层级路径(包括盘符) 这里能获得到的最终层级为  ...\target 后续用FILE_SEPARATOR(系统路径分割通配符 即 "\") 以及fileName拼接生成存放文件的目录层级 即为根目录 root
-        String rootPath =null;
+        String rootPath = null;
 
-        if (fileName!=null&&!fileName.equals(""))
-        {
-            rootPath= file.getParentFile().toString() + FILE_SEPARATOR + fileName;
-        }
-        else {
+        if (fileName != null && !fileName.equals("")) {
+            rootPath = file.getParentFile().toString() + FILE_SEPARATOR + fileName;
+        } else {
             rootPath = file.getParentFile().toString();
         }
         //根据上方生成的根目录路径 生成对应文件夹 没有就新建
@@ -77,7 +72,7 @@ public class FileUtils {
         return last.toString();
     }
 
-    public static   File  getFileByBytes(byte[] bytes, String prefix, String suffix) {
+    public static File getFileByBytes(byte[] bytes, String prefix, String suffix) {
         BufferedOutputStream bos = null;
         FileOutputStream fos = null;
         File file = null;
@@ -111,12 +106,12 @@ public class FileUtils {
                     e.printStackTrace();
                 }
             }
-            return  file;
+            return file;
         }
     }
 
 
-    public static  File getFileByUrl(String dataUrl) throws IOException {
+    public static File getFileByUrl(String dataUrl) throws IOException {
 
         URL url = new URL(dataUrl);  //想要读取的url地址
         InputStream in = url.openStream();
@@ -133,7 +128,8 @@ public class FileUtils {
         in.close();
         return file;
     }
-    public static  File getPictureFileByUrl(String dataUrl) throws IOException {
+
+    public static File getPictureFileByUrl(String dataUrl) throws IOException {
 
         URL url = new URL(dataUrl);  //想要读取的url地址
         InputStream in = url.openStream();
@@ -150,9 +146,11 @@ public class FileUtils {
         in.close();
         return file;
     }
+
     public String getPath(String url) {
         return getStaticPath(COMMON_FILE) + url;
     }
+
     public String getDirectoryName() {
         return DateUtils.getNowTimeFormat("yyyyMMdd");
     }
@@ -160,6 +158,7 @@ public class FileUtils {
     public String getSavePath(String directoryName) {
         return getStaticPath(COMMON_FILE) + FILE_SEPARATOR + directoryName + FILE_SEPARATOR;
     }
+
     public String createDirectory() {
         String directoryName = this.getDirectoryName();
         String savePath = this.getSavePath(directoryName);
@@ -169,8 +168,9 @@ public class FileUtils {
         }
         return directoryName;
     }
+
     public String createRandomDirectory() {
-        String directoryName =  IdUtil.simpleUUID();
+        String directoryName = IdUtil.simpleUUID();
         String savePath = this.getSavePath(directoryName);
         File directory = new File(savePath);
         if (!directory.exists()) {
@@ -178,6 +178,7 @@ public class FileUtils {
         }
         return directoryName;
     }
+
     public static FileInputStream byteToFile(byte[] bytes) {
         String fileName = IdUtil.simpleUUID() + ".png";
         File file = new File(fileName);
@@ -209,13 +210,16 @@ public class FileUtils {
     public String getDirectory(String fileName) {
         return FILE_SEPARATOR + this.createDirectory() + FILE_SEPARATOR + fileName;
     }
+
     public String getSystemPath(String url) {
         return getStaticPath(COMMON_FILE) + FILE_SEPARATOR + url;
     }
+
     public static String getSystemPath2(String url) {
         return getStaticPath(COMMON_FILE) + FILE_SEPARATOR + url;
     }
-    public  static void  writeFile(String json, String FilePath) {
+
+    public static void writeFile(String json, String FilePath) {
 
         try {
             File file = new File(FilePath);
@@ -238,6 +242,7 @@ public class FileUtils {
             e.printStackTrace();
         }
     }
+
     public static File getFileByName(File file, String name) {
         for (File file1 : file.listFiles()) {
             if (file1.getName().equals(name)) {
@@ -248,10 +253,9 @@ public class FileUtils {
     }
 
 
-    public  static void  writeFile(Object object,File file) {
-       String json = JSON.toJSONString(object);
+    public static void writeFile(Object object, File file) {
+        String json = JSON.toJSONString(object);
         try {
-
             // if file doesnt exists, then create it
             if (!file.exists()) {
                 file.createNewFile();
@@ -259,7 +263,6 @@ public class FileUtils {
                 file.delete();
                 file.createNewFile();
             }
-
             // true = append file
             FileWriter fileWritter = new FileWriter(file, false);
             BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
@@ -270,4 +273,34 @@ public class FileUtils {
             e.printStackTrace();
         }
     }
+
+    public static File multipartFileToFile(MultipartFile file) throws Exception {
+        File toFile = null;
+        if (file == null || file.equals("") || file.getSize() <= 0) {
+            file = null;
+        } else {
+            InputStream ins = null;
+            ins = file.getInputStream();
+            toFile = new File(file.getOriginalFilename());
+            inputStreamToFile(ins, toFile);
+            ins.close();
+        }
+        return toFile;
+    }
+
+    //获取流文件
+    private static void inputStreamToFile(InputStream ins, File file) {
+        try {
+            OutputStream os = new FileOutputStream(file);
+            int bytesRead = 0;
+            byte[] buffer = new byte[8192];
+            while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            ins.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 39 - 0
src/main/java/cn/cslg/pas/controller/ExportController.java

@@ -0,0 +1,39 @@
+package cn.cslg.pas.controller;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.utils.FileUtils;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.service.business.es.EsExportService;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+
+@RequestMapping(Constants.API_XiaoSHI + "/export")
+@RestController
+public class ExportController {
+
+    @Autowired
+    private EsExportService esExportService;
+
+    @Operation(summary = "导出二叉树")
+    @PostMapping("/export")
+    public Response exportTree(@RequestParam(value = "multipartFile", required = false) MultipartFile multipartFile) throws Exception {
+        Records records = new Records();
+        File file = FileUtils.multipartFileToFile(multipartFile);
+        try {
+            esExportService.exportTree(file);
+            records.setData("导出成功");
+        } catch (Exception e) {
+            records.setData("导出失败");
+
+        }
+        return Response.success(records);
+    }
+}

+ 3 - 7
src/main/java/cn/cslg/pas/factorys/EsBuilderFactory/DateQueryBuilder.java

@@ -150,11 +150,9 @@ public class DateQueryBuilder implements IQueryBuilder {
             String[] dates = value.split("~");
             String date1 = dates[0];
             String date2 = dates[1];
-          String  findate1=this.formatDateString(date1);
-         String    findate2 =this.formatDateString(date2);
-           query = QueryBuilders
-                    .range(range -> range.field(field).gte(JsonData.of(findate1)).lte(JsonData.of(findate2)));
-
+            String findDate1 = this.formatDateString(date1);
+            String findDate2 = this.formatDateString(date2);
+            query = QueryBuilders.range(range -> range.field(field).gte(JsonData.of(findDate1)).lte(JsonData.of(findDate2)));
         } else {
             query = this.getSingle();
         }
@@ -257,7 +255,6 @@ public class DateQueryBuilder implements IQueryBuilder {
 
     private Query getSingle() throws ParseException {
         Query query = null;
-
         if (value != null && !"".equals(value)) {
             Calendar calendar = Calendar.getInstance();
             if (value.length() == YEAR) {
@@ -371,6 +368,5 @@ public class DateQueryBuilder implements IQueryBuilder {
             }
         }
         return query;
-
     }
 }

+ 114 - 56
src/main/java/cn/cslg/pas/factorys/EsBuilderFactory/PrioritiesNestedQueryBuilder.java

@@ -27,6 +27,116 @@ public class PrioritiesNestedQueryBuilder implements IQueryBuilder{
     @Override
     public Query creteQuery() throws ParseException {
         Query query = null;
+        if (value.contains("~")) {
+            String[] dates = value.split("~");
+            String date1 = dates[0];
+            String date2 = dates[1];
+            String findDate1 = this.formatDateString(date1);
+            String findDate2 = this.formatDateString(date2);
+            query = QueryBuilders.range(range -> range.field(field).gte(JsonData.of(findDate1)).lte(JsonData.of(findDate2)));
+        } else {
+            query = this.getSingle();
+        }
+        Query finalQuery = query;
+        Query nestedQuery = QueryBuilders.nested(z -> z.path(path).query(finalQuery));
+        return nestedQuery;
+    }
+
+    @Override
+    public String getField() {
+        return field;
+    }
+
+    @Override
+    public void setField(String field) {
+        this.field = field;
+    }
+
+    @Override
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    @Override
+    public String getOperator() {
+        return operator;
+    }
+
+    @Override
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    @Override
+    public String getPath() {
+        return path;
+    }
+
+    @Override
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    @Override
+    public Integer getProjectId() {
+        return projectId;
+    }
+
+    @Override
+    public void setProjectId(Integer projectId) {
+        this.projectId = projectId;
+    }
+
+    private String formatDateString(String dateStr) throws ParseException {
+        Calendar calendar = Calendar.getInstance();
+        String formatedTime = "";
+        if (dateStr.length() == YEAR) {
+            SimpleDateFormat format = new SimpleDateFormat("yyyy");
+            Date year = format.parse(dateStr);
+            calendar.setTime(year);
+            String yearTime = String.valueOf(calendar.getTime().getTime());
+            formatedTime = yearTime;
+        } else if (dateStr.length() == MONTH || dateStr.length() == MONTHONE) {
+            Date month = new Date();
+            if (dateStr.contains("-")) {
+                SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM");
+                month = format2.parse(dateStr);
+            } else if (dateStr.contains("/")) {
+                SimpleDateFormat format3 = new SimpleDateFormat("yyyy/MM");
+                month = format3.parse(dateStr);
+            } else {
+                SimpleDateFormat format1 = new SimpleDateFormat("yyyyMM");
+                month = format1.parse(dateStr);
+            }
+            calendar.setTime(month);
+            String monthTime = String.valueOf(calendar.getTime().getTime());
+            formatedTime = monthTime;
+        } else if (dateStr.length() == DAY || dateStr.length() == DAYONE) {
+            Date day = new Date();
+            if (dateStr.contains("-")) {
+                SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
+                day = format2.parse(dateStr);
+            } else if (dateStr.contains("/")) {
+                SimpleDateFormat format3 = new SimpleDateFormat("yyyy/MM/dd");
+                day = format3.parse(dateStr);
+            } else {
+                SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
+                day = format1.parse(dateStr);
+            }
+            calendar.setTime(day);
+            String dayTime = String.valueOf(day.getTime());
+            formatedTime = dayTime;
+        }
+        return formatedTime;
+    }
+
+    private Query getSingle() throws ParseException {
+        Query query = null;
         if (value != null && !"".equals(value)) {
             Calendar calendar = Calendar.getInstance();
             if (value.length() == YEAR) {
@@ -55,7 +165,7 @@ public class PrioritiesNestedQueryBuilder implements IQueryBuilder{
                         break;
                     default:
                         query = QueryBuilders
-                                .range(range -> range.field(field).gte(JsonData.of(yearTime)).lte(JsonData.of(yearNextTime)));
+                                .range(range -> range.field(field).gte(JsonData.of(yearTime)).lt(JsonData.of(yearNextTime)));
                         break;
                 }
             } else if (value.length() == MONTH || value.length() == MONTHONE) {
@@ -93,7 +203,7 @@ public class PrioritiesNestedQueryBuilder implements IQueryBuilder{
                         break;
                     default:
                         query = QueryBuilders
-                                .range(range -> range.field(field).gte(JsonData.of(monthTime)).lte(JsonData.of(monthNextTime)));
+                                .range(range -> range.field(field).gte(JsonData.of(monthTime)).lt(JsonData.of(monthNextTime)));
                         break;
                 }
             } else if (value.length() == DAY || value.length() == DAYONE) {
@@ -131,7 +241,7 @@ public class PrioritiesNestedQueryBuilder implements IQueryBuilder{
                         break;
                     default:
                         query = QueryBuilders
-                                .range(range -> range.field(field).gte(JsonData.of(dayTime)).lte(JsonData.of(nextDayTime)));
+                                .range(range -> range.field(field).gte(JsonData.of(dayTime)).lt(JsonData.of(nextDayTime)));
                         break;
                 }
             } else {
@@ -139,58 +249,6 @@ public class PrioritiesNestedQueryBuilder implements IQueryBuilder{
                         .range(range -> range.field(field).gte(JsonData.of(1)).lte(JsonData.of(2)));
             }
         }
-        Query finalQuery = query;
-        Query nestedQuery = QueryBuilders.nested(z -> z.path(path).query(finalQuery));
-        return nestedQuery;
-    }
-
-    @Override
-    public String getField() {
-        return field;
-    }
-
-    @Override
-    public void setField(String field) {
-        this.field = field;
-    }
-
-    @Override
-    public String getValue() {
-        return value;
-    }
-
-    @Override
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    @Override
-    public String getOperator() {
-        return operator;
-    }
-
-    @Override
-    public void setOperator(String operator) {
-        this.operator = operator;
-    }
-
-    @Override
-    public String getPath() {
-        return path;
-    }
-
-    @Override
-    public void setPath(String path) {
-        this.path = path;
-    }
-
-    @Override
-    public Integer getProjectId() {
-        return projectId;
-    }
-
-    @Override
-    public void setProjectId(Integer projectId) {
-        this.projectId = projectId;
+        return query;
     }
 }

+ 177 - 0
src/main/java/cn/cslg/pas/service/business/es/EsExportService.java

@@ -0,0 +1,177 @@
+package cn.cslg.pas.service.business.es;
+
+import cn.cslg.pas.common.dto.ExportDTO;
+import cn.cslg.pas.common.utils.ExcelUtils;
+import cn.cslg.pas.common.utils.FileUtils;
+import cn.cslg.pas.common.utils.ReadExcelUtils;
+import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
+import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
+import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
+import cn.cslg.pas.common.vo.PatentData;
+import cn.cslg.pas.service.query.FormatQueryService;
+import co.elastic.clients.elasticsearch._types.query_dsl.Query;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class EsExportService {
+
+    @Autowired
+    private FormatQueryService formatQueryService;
+
+    public void exportTree(File file) throws Exception {
+        Sheet sheet = ReadExcelUtils.readExcel(file);
+        int total = sheet.getPhysicalNumberOfRows() - 1;
+        List<ExportDTO> list = new ArrayList<>();
+        for (int i = 0; i < total; i++) {
+            PatentData patentData = ReadExcelUtils.readExcelOneRow(file, sheet, i + 1);
+            Map<Object, Object> patentDataMap = patentData.getMap();
+            String condition = patentDataMap.get("检索条件").toString();
+            String estimatedTree = patentDataMap.get("预期二叉树").toString();
+            String estimatedQuery = patentDataMap.get("预期Query").toString();
+            ExportDTO exportDTO = new ExportDTO();
+            exportDTO.setCondition(condition);
+            if (StringUtils.isNotEmpty(estimatedTree)) {
+                exportDTO.setEstimatedTree(estimatedTree);
+            }
+            if (StringUtils.isNotEmpty(estimatedQuery)) {
+                exportDTO.setEstimatedQuery(estimatedQuery);
+            }
+            list.add(exportDTO);
+        }
+        for (ExportDTO exportDTO : list) {
+            if (StringUtils.isNotEmpty(exportDTO.getEstimatedTree())) {
+                treeNode tree = null;
+                try {
+                    tree = expressManager.getInstance().Parse(exportDTO.getCondition(), false);
+                } catch (Exception e) {
+                    System.out.println(exportDTO.getCondition() + "转换二叉树表达式错误");
+                }
+                String treeJson = JSONObject.toJSONString(tree, SerializerFeature.DisableCircularReferenceDetect);
+                exportDTO.setActualTree(treeJson);
+                if (treeJson == null || exportDTO.getEstimatedTree() == null || !treeJson.equalsIgnoreCase(exportDTO.getEstimatedTree().trim())) {
+                    exportDTO.setTreeFlag("F");
+                } else {
+                    exportDTO.setTreeFlag("T");
+                }
+                Query query = null;
+                try {
+                    query = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", 331);
+                } catch (ParseException e) {
+                    System.out.println(exportDTO.getCondition() + "转换es表达式错误");
+                }
+                String queryStr = query.toString();
+                exportDTO.setActualQuery(queryStr);
+                if (queryStr == null || exportDTO.getEstimatedQuery() == null || !queryStr.equalsIgnoreCase(exportDTO.getEstimatedQuery().trim())) {
+                    exportDTO.setQueryFlag("F");
+                } else {
+                    exportDTO.setQueryFlag("T");
+                }
+            }
+        }
+        if (!CollectionUtils.isEmpty(list)) {
+            this.loadExportTree(list);
+        }
+    }
+
+    public void loadExportTree(List<ExportDTO> list) throws FileNotFoundException {
+        try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+            List<String> headers = Arrays.asList("检索条件", "预期二叉树", "实际二叉树", "二叉树是否一致", "预期Query", "实际Query","Query是否一致 ");
+            HSSFWorkbook hssfWorkbook = new HSSFWorkbook();//新建工作簿
+            HSSFSheet sheet = hssfWorkbook.createSheet();//新建sheet页
+            sheet.setDefaultColumnWidth(30);
+            HSSFRow headerRow = sheet.createRow(0);//新建标头行
+            headerRow.setHeight((short) 500);
+            HSSFCellStyle headerCellStyle = hssfWorkbook.createCellStyle();//新建标头行格式
+            HSSFCellStyle commonCellStyle = hssfWorkbook.createCellStyle();//新建普通行格式
+            for (int i = 0; i < headers.size(); i++) {//遍历设置标头
+                HSSFCell cell = headerRow.createCell(i);
+                ExcelUtils.setExcelCellStyle(headerCellStyle);
+                headerCellStyle.setAlignment(HorizontalAlignment.CENTER);
+                headerCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+                headerCellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.SKY_BLUE.getIndex());
+                headerCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+                headerCellStyle.setWrapText(true);
+                cell.setCellStyle(headerCellStyle);
+                cell.setCellValue(headers.get(i));
+            }
+            for (int i = 0; i < list.size(); i++) {
+                ExportDTO exportDTO = list.get(i);
+                HSSFRow row = sheet.createRow(i + 1);//新建一普通行
+                row.setHeight((short) 800);
+                HSSFCell cell = row.createCell(0);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell.setCellStyle(commonCellStyle);
+                cell.setCellValue(exportDTO.getCondition());
+                HSSFCell cell1 = row.createCell(1);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell1.setCellStyle(commonCellStyle);
+                cell1.setCellValue(exportDTO.getEstimatedTree());
+                HSSFCell cell2 = row.createCell(2);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell2.setCellStyle(commonCellStyle);
+                cell2.setCellValue(exportDTO.getActualTree());
+                HSSFCell cell3 = row.createCell(3);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell3.setCellStyle(commonCellStyle);
+                cell3.setCellValue(exportDTO.getTreeFlag());
+                HSSFCell cell4 = row.createCell(4);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell4.setCellStyle(commonCellStyle);
+                cell4.setCellValue(exportDTO.getEstimatedQuery());
+                HSSFCell cell5 = row.createCell(5);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell5.setCellStyle(commonCellStyle);
+                cell5.setCellValue(exportDTO.getActualQuery());
+                HSSFCell cell6 = row.createCell(6);
+                ExcelUtils.setExcelCellStyle(commonCellStyle);
+                commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
+                commonCellStyle.setWrapText(true);
+                cell6.setCellStyle(commonCellStyle);
+                cell6.setCellValue(exportDTO.getQueryFlag());
+            }
+            hssfWorkbook.write(out);
+            byte[] bytes = out.toByteArray();
+            FileUtils.getFileByBytes(bytes, "检索条件", ".xlsx");
+        } catch (FileNotFoundException e) {
+            throw new FileNotFoundException();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 2 - 2
src/main/resources/application-dev.yml

@@ -61,8 +61,8 @@ spring:
     #初始化表结构
     jdbc:
       initialize-schema: always
-authorUrl: http://localhost:8885
-PCSUrl: http://localhost:8885
+authorUrl: http://localhost:8871
+PCSUrl: http://localhost:8871
 #OPSUrl: http://192.168.2.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8879