Преглед на файлове

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

lwhhszx преди 1 година
родител
ревизия
d73d6ec835

+ 2 - 2
src/main/java/com/example/xiaoshiweixinback/controller/ImportPatentController.java

@@ -24,8 +24,8 @@ public class ImportPatentController {
     private final GetOPSFileByExcelService getOPSFileByExcelService;
 private final GetPatentFromSzService getPatentFromSzService;
     @Operation(summary = "查询会员")
-    @GetMapping("/import")
-    private Response importPatent(String path) throws Exception {
+    @GetMapping("/importFromSz")
+    private Response importFromSz(String path) throws Exception {
         getPatentFromSzService.test(path);
         return Response.success("records");
     }

+ 1 - 1
src/main/java/com/example/xiaoshiweixinback/controller/PatentController.java

@@ -56,7 +56,7 @@ public class PatentController {
 
     //--------------------------- 导入  --------------------------
     @Operation(summary = "导入专利")
-    @GetMapping(value = "/importPatent")
+    @PostMapping(value = "/importPatent")
     public Response queryPatent(@RequestBody ImportTaskAMVO importTaskAMVO) {
         try {
             importFromWebToEsService.ImportTask(importTaskAMVO);

+ 1 - 1
src/main/java/com/example/xiaoshiweixinback/controller/ProductController.java

@@ -116,7 +116,7 @@ public class ProductController {
 
     @checkLogin
     @Operation(summary = "查看单个产品详情")
-    @PostMapping("/queryHotProductDetail")
+    @GetMapping("/queryHotProductDetail")
     public Response queryHotProductDetail(Integer id) {
         ProductVO productVO = productService.queryHotProductDetail(id);
         Records records = new Records();

+ 40 - 8
src/main/java/com/example/xiaoshiweixinback/service/MonitorRecordService.java

@@ -9,6 +9,8 @@ import com.example.xiaoshiweixinback.domain.Monitor;
 import com.example.xiaoshiweixinback.domain.MonitorRecord;
 import com.example.xiaoshiweixinback.domain.PatentUpdateRecord;
 import com.example.xiaoshiweixinback.domain.Product;
+import com.example.xiaoshiweixinback.domain.es.Patent;
+import com.example.xiaoshiweixinback.entity.dto.patent.PatentColumnDTO;
 import com.example.xiaoshiweixinback.entity.dto.patent.PatentDTO;
 import com.example.xiaoshiweixinback.entity.patent.QueryRequest;
 import com.example.xiaoshiweixinback.entity.patent.StringRequest;
@@ -38,11 +40,11 @@ public class MonitorRecordService extends ServiceImpl<MonitorRecordMapper, Monit
 
     public Records getMonitorRecords(Integer monitorId) {
         Monitor monitor = monitorService.getById(monitorId);
-        Integer projectId =monitor.getProductId();
+        Integer projectId = monitor.getProductId();
 
         LambdaQueryWrapper<MonitorRecord> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(MonitorRecord::getProductId, projectId)
-                 .ge(MonitorRecord::getStartDate,monitor.getCreateTime());
+                .ge(MonitorRecord::getStartDate, monitor.getCreateTime());
         Page<MonitorRecord> monitorRecords = this.page(new Page<>(1, 10), queryWrapper);
         Records records = new Records();
         records.setData(monitorRecords.getRecords());
@@ -61,24 +63,54 @@ public class MonitorRecordService extends ServiceImpl<MonitorRecordMapper, Monit
 
 
     public void addMonitorRecords() {
-        //获取最新的更新记录
-        PatentUpdateRecord patentUpdateRecord = patentUpdateRecordService.getLastRecord();
         //获取所有被监控的产品
         List<Product> products = monitorService.getAllMonitorProducts();
         for (Product product : products) {
             Integer productId = product.getId();
             MonitorRecord monitorRecord = this.getLastMonitorRecord(product.getId());
-            Date startTime = patentUpdateRecord.getStartTime();
-            Date endTime = patentUpdateRecord.getEndTime();
-            if(monitorRecord!=null){
-                startTime =monitorRecord.getEndDate();
+            Date startTime = new Date();
+            Date endTime = new Date();
+
+            if (monitorRecord != null) {
+                startTime = monitorRecord.getEndDate();
+            }
+            else {
+                LambdaQueryWrapper<Monitor> queryWrapper =new LambdaQueryWrapper<>();
+                queryWrapper.eq(Monitor::getProductId,product.getId());
+                Monitor monitor= monitorService.getOne(queryWrapper,false);
+                if(monitor==null){
+                    continue;
+                }
+                startTime =monitor.getCreateTime();
             }
+
             String condition = product.getSearchCondition();
+            StringRequest stringRequest1 = new StringRequest();
+            stringRequest1.setSearchQuery(condition);
+
+            try {
 
+                PatentDTO patentDTO2 = esPatentService.esSearch(stringRequest1);
+                if (patentDTO2 != null && patentDTO2.getPatents() != null && patentDTO2.getPatents().size() > 0) {
+                    PatentColumnDTO patent = patentDTO2.getPatents().get(0);
+                    if (patent.getPublicDate() != null) {
+                        endTime = patent.getPublicDate();
+                    } else if (patent.getGrantDate() != null) {
+                         endTime=patent.getGrantDate();
+                    }
+                    else {
+                        continue;
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
             String newCondition = condition + " AND " + "PD=" + FormatUtil.getTimeStringYYMMdd(startTime) + "~" + FormatUtil.getTimeStringYYMMdd(endTime);
             StringRequest stringRequest = new StringRequest();
             stringRequest.setSearchQuery(newCondition);
             try {
+                if(endTime==null||startTime.compareTo(endTime)>=0)
+                {continue;}
                 PatentDTO patentDTO = esPatentService.esSearch(stringRequest);
                 Long total = patentDTO.getTotal();
                 if (total != null && total > 0) {

+ 16 - 0
src/main/java/com/example/xiaoshiweixinback/service/importPatent/CommonService.java

@@ -56,5 +56,21 @@ public class CommonService {
         }
     }
 
+    public static File getFile(String fileName) {
+        String json = "";
+        try {
+            ApplicationHome ah = new ApplicationHome(XiaoshiWeixinbackApplication.class);
+            //获取 applicationHome 内的路径 ...\target\classes 到这一层级下
+            File fileTem = ah.getSource();
+            //获取 file的parentFile 即最后一级之前的所有层级路径(包括盘符) 这里能获得到的最终层级为  ...\target 后续用FILE_SEPARATOR(系统路径分割通配符 即 "\") 以及fileName拼接生成存放文件的目录层级 即为根目录 root
+            String rootPath = fileTem.getParentFile().toString() + FileUtils.FILE_SEPARATOR ;
+//            String filePath = fileUtils.getPath("/11.docx");
+            File file = new File(rootPath + fileName);
 
+            return file;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
 }

+ 7 - 3
src/main/java/com/example/xiaoshiweixinback/service/importPatent/EsDenseVectorService.java

@@ -124,9 +124,7 @@ public class EsDenseVectorService {
             //2. 从es中检索数据
             q = formatQueryService.EsQueryToQuery((operateNode) tree, "patentVector", null);
         }
-        if (q == null) {
-            throw new BusinessException("608", "检索式错误,请重新输入");
-        }
+
         GetImageVO imageVO = this.getImageList(dto.getProductId(), file, dto.getDescription());
         List<Float> imageList = null;
         List<String> getGuids = imageVO.getGetGuids();
@@ -143,8 +141,14 @@ public class EsDenseVectorService {
                 query = QueryBuilders.scriptScore(i -> i.script(script)
                         .query(org.springframework.data.elasticsearch.client.elc.QueryBuilders.matchAllQueryAsQuery()));
             }
+            if (query == null) {
+                throw new BusinessException("608", "检索式错误,请重新输入");
+            }
             builder.query(query);
         } else {
+            if (q == null) {
+                throw new BusinessException("608", "检索式错误,请重新输入");
+            }
             builder.query(q);
         }
         //根据申请号去重

+ 10 - 10
src/main/java/com/example/xiaoshiweixinback/service/importPatent/EsPatentService.java

@@ -532,12 +532,12 @@ public class EsPatentService {
         builder.query(q);
 
         //排序
-//        List<SortOptions> optionsList = new ArrayList<>();
-//
-//            SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field("public_date").order(SortOrder.Desc).missing(-1)));
-//            optionsList.add(sortOptions);
-//
-//        builder.sort(optionsList);
+        List<SortOptions> optionsList = new ArrayList<>();
+
+            SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field("public_date").order(SortOrder.Desc).missing(-1)));
+            optionsList.add(sortOptions);
+
+        builder.sort(optionsList);
 
 //        //分页
 //        if (current != null && size != null && current > 0 && size > 0) {
@@ -554,10 +554,10 @@ public class EsPatentService {
             List<Hit<Patent>> hits = response.hits().hits();
             total = response.hits().total().value();
             for (Hit<Patent> hit : hits) {
-//                String id = hit.id();
-//                Patent esMess = hit.source();
-//                PatentColumnDTO columnDTO = this.getPatentColumnDTO(esMess, projectId, id);
-//                list.add(columnDTO);
+                String id = hit.id();
+                Patent esMess = hit.source();
+                PatentColumnDTO columnDTO = this.getPatentColumnDTO(esMess, projectId, id);
+                list.add(columnDTO);
             }
 
 

+ 3 - 5
src/main/java/com/example/xiaoshiweixinback/service/importPatent/GetPatentPictureFromWebService.java

@@ -80,7 +80,7 @@ public class GetPatentPictureFromWebService {
             List<File> files = opsService.getImageFiles(infoVO, appNo);
             if (files != null && files.size() > 0) {
                 for (int i = 0; i < files.size(); i++) {
-                    String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
+                    String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getPatent().getAppNo());
                     File file = files.get(i);
                     fileManagerService.uploadFileWithGuid(file, guid);
                     PatentVector patentVectorOrg = esService.getVectorByIndex(patent.getAppNo(), 0);
@@ -98,7 +98,7 @@ public class GetPatentPictureFromWebService {
 
 
     public void addPatentVector(UploadPatentWebDTO uploadPatentWebDTO, File file, Integer index) throws Exception {
-        String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
+        String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getPatent().getAppNo());
 
         Patent patent = uploadPatentWebDTO.getPatent();
         PatentVector patentVector = new PatentVector();
@@ -108,9 +108,7 @@ public class GetPatentPictureFromWebService {
         patentVector.setAppDate(patent.getAppDate());
         patentVector.setAbstractStr(patent.getAbstractStr());
         patentVector.setAppCountry(patent.getAppCountry());
-        PatentClassify patentClassify = new PatentClassify();
-        patentClassify.setLevel1(uploadPatentWebDTO.getStarPatentVO().getMainIpc());
-        patentVector.setLoc(Arrays.asList(patentClassify));
+        patentVector.setLoc(uploadPatentWebDTO.getPatent().getIpc());
         patentVector.setImageIndex(index);
         patentVector.setGuid(guid);
         List<String> stringList = getVectorService.getVectorByFile(file);

+ 24 - 32
src/main/java/com/example/xiaoshiweixinback/service/importPatent/excel/GetPatentFromSzService.java

@@ -11,9 +11,7 @@ import com.example.xiaoshiweixinback.domain.es.Patent;
 import com.example.xiaoshiweixinback.domain.es.PatentVector;
 import com.example.xiaoshiweixinback.entity.dto.importTaskModel.ImportTaskText;
 import com.example.xiaoshiweixinback.entity.dto.patent.UploadPatentWebDTO;
-import com.example.xiaoshiweixinback.service.importPatent.GetPatentFromExcelService;
-import com.example.xiaoshiweixinback.service.importPatent.GetPatentPictureFromExcelService;
-import com.example.xiaoshiweixinback.service.importPatent.SavePatentToEsService;
+import com.example.xiaoshiweixinback.service.importPatent.*;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.ss.usermodel.Drawing;
 import org.apache.poi.ss.usermodel.PictureData;
@@ -37,20 +35,24 @@ public class GetPatentFromSzService {
     private GetPatentPictureFromExcelService getPatentPictureFromExcelService;
     @Autowired
     private SavePatentToEsService savePatentToEsService;
+    @Autowired
+    private GetPatentPictureFromWebService getPatentPictureFromWebService;
 
     public void test(String pathStr) throws Exception {
-        String[] paths = pathStr.split(",");
-        for (int t = 0; t < paths.length; t++) {
-            String path = paths[t];
-
-            File tempFile = new File(path);
+       File file= CommonService.getFile("importFile");
+       if(file==null||file.listFiles().length==0){
+           return;
+       }
+       File[] files =file.listFiles();
+        for (int t = 0; t < files.length; t++) {
+            File tempFile = files[t];
 
             Sheet sheet = ReadExcelUtils.readExcel(tempFile);
             int total = sheet.getPhysicalNumberOfRows() - 1;
             Row firstRow = sheet.getRow(0);
             int columns = firstRow.getLastCellNum();
 
-            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "",null);
+            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "", null);
 
             for (int r = 0; r < total; r++) {
                 Row needRow = sheet.getRow(r + 1);
@@ -60,29 +62,19 @@ public class GetPatentFromSzService {
                 }
                 UploadParamsVO uploadParamsVO = UploadPatentBatchUtil.processData(map, jsonData);
                 getPatentFromExcelService.loadPatent(uploadParamsVO);
-
-                List<PictureData> pictureDatas = ReadExcelUtils.getPictures((XSSFSheet) sheet, r + 1);
-
-                for (int i = 0; i < pictureDatas.size(); i++) {
-                    PictureData pictureData = pictureDatas.get(i);
-                    String ext = pictureData.suggestFileExtension();
-                    byte[] data = pictureData.getData();
-                    String picName = IdUtil.simpleUUID();
-                    File file = FileUtils.getFileByBytes(data, picName, "." + ext);
-                    getPatentPictureFromExcelService.tem(file, uploadParamsVO.getPatent(), i);
-                }
                 UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                 uploadPatentWebDTO.setPatent(uploadParamsVO.getPatent());
+                getPatentPictureFromWebService.getWdPatentPicture(uploadPatentWebDTO);
                 savePatentToEsService.saveOrUpdate(uploadPatentWebDTO);
                 System.out.println(r);
             }
             System.out.println("完成" + t);
             //获得总列数
 
+
         }
     }
 
-
     public void test2(String pathStr) throws Exception {
         String[] paths = pathStr.split(",");
         for (int t = 0; t < paths.length; t++) {
@@ -94,7 +86,7 @@ public class GetPatentFromSzService {
             Row firstRow = sheet.getRow(0);
             int columns = firstRow.getLastCellNum();
 
-            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "",null);
+            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "", null);
 
             for (int r = 0; r < total; r++) {
                 Row needRow = sheet.getRow(r + 1);
@@ -128,21 +120,21 @@ public class GetPatentFromSzService {
         for (int t = 0; t < paths.length; t++) {
             String path = paths[t];
             String rootPath = "D:\\usa_patent\\202205-3498\\";
-            String a =path.replace(".xlsx","");
-            path =rootPath+path;
+            String a = path.replace(".xlsx", "");
+            path = rootPath + path;
             File tempFile = new File(path);
 
             Sheet sheet = ReadExcelUtils.readExcel(tempFile);
             int total = sheet.getPhysicalNumberOfRows() - 1;
             Row firstRow = sheet.getRow(0);
             int columns = firstRow.getLastCellNum();
-            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "",null);
+            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(5 + "", null);
 
-            String picturePath= "D:\\patentImage\\";
+            String picturePath = "D:\\patentImage\\";
 
-       File temFile =new File(picturePath+a);
+            File temFile = new File(picturePath + a);
             File[] files = temFile.listFiles();
-            for (int r =0; r < total; r++) {
+            for (int r = 0; r < total; r++) {
                 Row needRow = sheet.getRow(r + 1);
                 Map<Object, Object> map = new HashMap<>();
                 for (int i = 0; i < columns; i++) {
@@ -151,13 +143,13 @@ public class GetPatentFromSzService {
                 UploadParamsVO uploadParamsVO = UploadPatentBatchUtil.processData(map, jsonData);
                 getPatentFromExcelService.loadPatent(uploadParamsVO);
                 String appNo = uploadParamsVO.getPatent().getAppNo();
-           List<File> files1=     Arrays.stream(files).filter(item -> item.getName().contains(appNo)).collect(Collectors.toList());
+                List<File> files1 = Arrays.stream(files).filter(item -> item.getName().contains(appNo)).collect(Collectors.toList());
 
                 for (int i = 0; i < files1.size(); i++) {
                     File file = files1.get(i);
-                 String numStr=   file.getName().substring(file.getName().indexOf("_")+1,file.getName().indexOf("."));
-                 Integer index =Integer.parseInt(numStr);
-                    getPatentPictureFromExcelService.tem(file, uploadParamsVO.getPatent(),index+1 );
+                    String numStr = file.getName().substring(file.getName().indexOf("_") + 1, file.getName().indexOf("."));
+                    Integer index = Integer.parseInt(numStr);
+                    getPatentPictureFromExcelService.tem(file, uploadParamsVO.getPatent(), index + 1);
                 }
                 UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                 uploadPatentWebDTO.setPatent(uploadParamsVO.getPatent());

+ 2 - 4
src/main/java/com/example/xiaoshiweixinback/service/quartzService/ImportJobService.java

@@ -32,17 +32,15 @@ public class ImportJobService extends QuartzJobBean {
         if (parameter != null) {
             List<UpdatePatentDTO> updatePatentDTOS = JSONArray.parseArray(parameter, UpdatePatentDTO.class);
             for (UpdatePatentDTO updatePatentDTO : updatePatentDTOS) {
-//            PatentUpdateRecord patentUpdateRecord= patentUpdateRecordService.addLastRecord(updatePatentDTO.getDbType(),updatePatentDTO.getSearchCondition());
+            PatentUpdateRecord patentUpdateRecord= patentUpdateRecordService.addLastRecord(updatePatentDTO.getDbType(),updatePatentDTO.getSearchCondition());
                 ImportTaskAMVO importTaskAMVO = new ImportTaskAMVO();
                 importTaskAMVO.setSearchCondition(updatePatentDTO.getSearchCondition());
-                importTaskAMVO.setOrderBy("AD");
+                importTaskAMVO.setOrderBy("PD");
                 importTaskAMVO.setOrderByType("DESC");
                 importTaskAMVO.setDbType(updatePatentDTO.getDbType());
                 importFromWebToEsService.ImportTask(importTaskAMVO);
-
             }
 
-
         }
 
     }

+ 369 - 0
src/main/resources/jsons/webSearchConfig.json

@@ -0,0 +1,369 @@
+[
+  {
+    "name": "TX",
+    "type": "Integer",
+    "value": "TX",
+    "field": "TX",
+    "sqlField": "TX",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "TI",
+    "type": "Integer",
+    "value": "TI",
+    "field": "TI",
+    "sqlField": "TI",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "CL",
+    "type": "Integer",
+    "value": "CL",
+    "field": "CL",
+    "sqlField": "CL",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "AB",
+    "type": "Integer",
+    "value": "AB",
+    "field": "AB",
+    "sqlField": "AB",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "AN",
+    "type": "Integer",
+    "value": "AN",
+    "field": "AN",
+    "sqlField": "AN",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "ANO",
+    "type": "Integer",
+    "value": "ANO",
+    "field": "ANO",
+    "sqlField": "TX",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "GN",
+    "type": "Integer",
+    "value": "GN",
+    "field": "GN",
+    "sqlField": "GN",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  }
+  ,
+  {
+    "name": "PN",
+    "type": "Integer",
+    "value": "PN",
+    "field": "PN",
+    "sqlField": "PN",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "PR",
+    "type": "Integer",
+    "value": "PR",
+    "field": "PR",
+    "sqlField": "PR",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "PT",
+    "type": "Integer",
+    "value": "PT",
+    "field": "PT",
+    "sqlField": "PT",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "LG",
+    "type": "Integer",
+    "value": "LG",
+    "field": "LG",
+    "sqlField": "LG",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "IC",
+    "type": "Integer",
+    "value": "IC",
+    "field": "IC",
+    "sqlField": "IC",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "MC",
+    "type": "Integer",
+    "value": "MC",
+    "field": "MC",
+    "sqlField": "MC",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "CT",
+    "type": "Integer",
+    "value": "CT",
+    "field": "CT",
+    "sqlField": "CT",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "AD",
+    "type": "Integer",
+    "value": "AD",
+    "field": "AD",
+    "sqlField": "AD",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "GD",
+    "type": "Integer",
+    "value": "GD",
+    "field": "GD",
+    "sqlField": "GD",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "PD",
+    "type": "Integer",
+    "value": "PD",
+    "field": "PD",
+    "sqlField": "PD",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  }
+,
+  {
+    "name": "IN",
+    "type": "Integer",
+    "value": "IN",
+    "field": "IN",
+    "sqlField": "IN",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "FI",
+    "type": "Integer",
+    "value": "FI",
+    "field": "FI",
+    "sqlField": "FI",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "PA",
+    "type": "Integer",
+    "value": "PA",
+    "field": "PA",
+    "sqlField": "PA",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "FP",
+    "type": "Integer",
+    "value": "FP",
+    "field": "FP",
+    "sqlField": "FP",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "PE",
+    "type": "Integer",
+    "value": "PE",
+    "field": "PE",
+    "sqlField": "PE",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "AT",
+    "type": "Integer",
+    "value": "AT",
+    "field": "AT",
+    "sqlField": "AT",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "AGN",
+    "type": "Integer",
+    "value": "AGN",
+    "field": "AGN",
+    "sqlField": "AGN",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "DZ",
+    "type": "Integer",
+    "value": "DZ",
+    "field": "DZ",
+    "sqlField": "DZ",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "CO",
+    "type": "Integer",
+    "value": "CO",
+    "field": "CO",
+    "sqlField": "CO",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  }
+,
+  {
+    "name": "CC",
+    "type": "Integer",
+    "value": "CC",
+    "field": "CC",
+    "sqlField": "CC",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  },
+  {
+    "name": "UCC",
+    "type": "Integer",
+    "value": "UCC",
+    "field": "UCC",
+    "sqlField": "UCC",
+    "sqlClass": "getWebQuerySql",
+    "orderClass": "",
+    "groupClass": "",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "false"
+  }
+]

+ 5 - 6
src/test/java/com/example/xiaoshiweixinback/ImportProductTests.java

@@ -1,5 +1,7 @@
 package com.example.xiaoshiweixinback;
 
+import com.example.xiaoshiweixinback.business.utils.DateUtil;
+import com.example.xiaoshiweixinback.business.utils.FormatUtil;
 import com.example.xiaoshiweixinback.business.utils.parseQueryToTree.expressManager;
 import com.example.xiaoshiweixinback.business.utils.parseQueryToTree.treeNode;
 import com.example.xiaoshiweixinback.entity.ops.ImagesInfoVO;
@@ -7,11 +9,13 @@ import com.example.xiaoshiweixinback.entity.ops.PubNo;
 import com.example.xiaoshiweixinback.service.common.OPSService;
 import com.example.xiaoshiweixinback.service.importPatent.excel.GetPatentFromSzService;
 import com.example.xiaoshiweixinback.service.importPatent.excel.ImportProductService;
+import org.joda.time.format.FormatUtils;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.Lazy;
 
+import java.util.Date;
 import java.util.List;
 
 
@@ -28,12 +32,7 @@ class ImportProductTests {
     private OPSService opsService;
     @Test
     void contextLoads() {
-        String condition ="TI=ni $W5 (hao OR ya)";
-        try {
-            treeNode tree = expressManager.getInstance().Parse(condition, false);
-System.out.println(tree);
-        }
-        catch (Exception e){}
+
     }
 
     @Test