Переглянути джерело

Merge remote-tracking branch 'origin/master'

zero 1 рік тому
батько
коміт
0809d97af5
32 змінених файлів з 1210 додано та 176 видалено
  1. 8 4
      src/main/java/com/example/xiaoshiweixinback/business/utils/FormatUtil.java
  2. 8 4
      src/main/java/com/example/xiaoshiweixinback/controller/MonitoringController.java
  3. 1 1
      src/main/java/com/example/xiaoshiweixinback/controller/PatentController.java
  4. 49 0
      src/main/java/com/example/xiaoshiweixinback/controller/QuartzTaskController.java
  5. 2 1
      src/main/java/com/example/xiaoshiweixinback/controller/SearchRecordController.java
  6. 2 0
      src/main/java/com/example/xiaoshiweixinback/domain/Monitor.java
  7. 2 2
      src/main/java/com/example/xiaoshiweixinback/domain/MonitorRecord.java
  8. 49 0
      src/main/java/com/example/xiaoshiweixinback/domain/PatentUpdateRecord.java
  9. 42 0
      src/main/java/com/example/xiaoshiweixinback/domain/QuartzTask.java
  10. 1 1
      src/main/java/com/example/xiaoshiweixinback/entity/dto/patent/PatentDTO.java
  11. 17 51
      src/main/java/com/example/xiaoshiweixinback/entity/quartz/QrtzTaskDTO.java
  12. 9 0
      src/main/java/com/example/xiaoshiweixinback/entity/quartzTask/UpdatePatentDTO.java
  13. 18 0
      src/main/java/com/example/xiaoshiweixinback/mapper/PatentUpdateRecordMapper.java
  14. 18 0
      src/main/java/com/example/xiaoshiweixinback/mapper/QuartzTaskMapper.java
  15. 105 1
      src/main/java/com/example/xiaoshiweixinback/service/MonitorRecordService.java
  16. 45 20
      src/main/java/com/example/xiaoshiweixinback/service/MonitorService.java
  17. 48 0
      src/main/java/com/example/xiaoshiweixinback/service/PatentUpdateRecordService.java
  18. 2 1
      src/main/java/com/example/xiaoshiweixinback/service/ProductService.java
  19. 22 3
      src/main/java/com/example/xiaoshiweixinback/service/common/OPSService.java
  20. 0 2
      src/main/java/com/example/xiaoshiweixinback/service/exportPatent/PatentExportService.java
  21. 16 0
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/CommonService.java
  22. 65 2
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/EsDenseVectorService.java
  23. 97 6
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/EsPatentService.java
  24. 82 30
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/GetPatentPictureFromWebService.java
  25. 3 3
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/ImportFromWebToEsService.java
  26. 24 32
      src/main/java/com/example/xiaoshiweixinback/service/importPatent/excel/GetPatentFromSzService.java
  27. 40 6
      src/main/java/com/example/xiaoshiweixinback/service/quartzService/ImportJobService.java
  28. 12 3
      src/main/java/com/example/xiaoshiweixinback/service/quartzService/JobService.java
  29. 51 0
      src/main/java/com/example/xiaoshiweixinback/service/quartzService/QuartzTaskService.java
  30. 1 1
      src/main/resources/application.yml
  31. 369 0
      src/main/resources/jsons/webSearchConfig.json
  32. 2 2
      src/main/resources/mapper/ProductMapper.xml

+ 8 - 4
src/main/java/com/example/xiaoshiweixinback/business/utils/FormatUtil.java

@@ -6,10 +6,8 @@ import org.springframework.beans.BeanWrapperImpl;
 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 public class FormatUtil {
 
@@ -106,4 +104,10 @@ public class FormatUtil {
         return  strs;
     }
 
+
+    public static String getTimeStringYYMMdd(Date startDate){
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
+        String dateString = formatter.format(startDate);
+        return dateString;
+    }
 }

+ 8 - 4
src/main/java/com/example/xiaoshiweixinback/controller/MonitoringController.java

@@ -14,10 +14,7 @@ import com.example.xiaoshiweixinback.service.MonitorService;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -63,4 +60,11 @@ public class MonitoringController {
         return Response.success(records);
     }
 
+
+    @Operation(summary = "添加记录")
+    @GetMapping("/add")
+    public Response add() {
+      monitorRecordService.addMonitorRecords();
+        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);

+ 49 - 0
src/main/java/com/example/xiaoshiweixinback/controller/QuartzTaskController.java

@@ -0,0 +1,49 @@
+package com.example.xiaoshiweixinback.controller;
+
+
+import com.example.xiaoshiweixinback.business.common.Constants;
+import com.example.xiaoshiweixinback.business.common.Response;
+import com.example.xiaoshiweixinback.business.common.base.Records;
+import com.example.xiaoshiweixinback.entity.dto.searchRecord.AddSearchRecordDTO;
+import com.example.xiaoshiweixinback.entity.quartz.QrtzTaskDTO;
+import com.example.xiaoshiweixinback.service.quartzService.QuartzTaskService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@RequestMapping(Constants.XIAOSHI_WEIXINBACK + "/quartzTask")
+@RestController
+@RequiredArgsConstructor
+public class QuartzTaskController {
+    @Autowired
+    private QuartzTaskService quartzTaskService;
+    @Operation(summary = "添加定时任务")
+    @PostMapping("/add")
+    public Response add(@RequestBody QrtzTaskDTO qrtzTaskDTO) {
+        Records records = new Records();
+        try {
+           quartzTaskService.addQuartzTask(qrtzTaskDTO);
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
+        }
+        return Response.success(records);
+    }
+
+
+
+    @Operation(summary = "删除定时任务")
+    @GetMapping("/remove")
+    public Response remove(Integer id) {
+        Records records = new Records();
+        try {
+            quartzTaskService.deleteQuartzTask(id);
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
+        }
+        return Response.success(records);
+    }
+
+}

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

@@ -59,7 +59,8 @@ public class SearchRecordController {
         try {
             List<Integer> idList = searchRecordService.removeSearchRecords(ids);
             records.setData(idList);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             return Response.error(e.getMessage());
         }
 

+ 2 - 0
src/main/java/com/example/xiaoshiweixinback/domain/Monitor.java

@@ -15,6 +15,7 @@ import lombok.Data;
 @TableName(value ="monitor")
 @Data
 public class Monitor extends BaseEntity<Monitor> {
+    private Integer id;
 
     /**
      * 
@@ -35,5 +36,6 @@ public class Monitor extends BaseEntity<Monitor> {
      * 
      */
     private Date createTime;
+    private Boolean ifDelete;
 
 }

+ 2 - 2
src/main/java/com/example/xiaoshiweixinback/domain/MonitorRecord.java

@@ -19,7 +19,7 @@ public class MonitorRecord extends BaseEntity<MonitorRecord> {
     /**
      * 
      */
-    private Integer monitorId;
+    private Integer productId;
 
     /**
      * 
@@ -39,7 +39,7 @@ public class MonitorRecord extends BaseEntity<MonitorRecord> {
     /**
      * 
      */
-    private Integer num;
+    private Long num;
     private String searchCondition;
 
 }

+ 49 - 0
src/main/java/com/example/xiaoshiweixinback/domain/PatentUpdateRecord.java

@@ -0,0 +1,49 @@
+package com.example.xiaoshiweixinback.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 专利更新记录表
+ * @TableName patent_update_record
+ */
+@TableName(value ="patent_update_record")
+@Data
+public class PatentUpdateRecord extends BaseEntity<PatentUpdateRecord> {
+    /**
+     * ID
+     */
+    private Integer id;
+
+    /**
+     * 
+     */
+    private Date startTime;
+
+    /**
+     * 
+     */
+    private Date endTime;
+
+    /**
+     * 
+     */
+    private String searchCondition;
+
+    /**
+     * 
+     */
+    private Date createTime;
+
+    /**
+     * 
+     */
+    private String dbType;
+
+}

+ 42 - 0
src/main/java/com/example/xiaoshiweixinback/domain/QuartzTask.java

@@ -0,0 +1,42 @@
+package com.example.xiaoshiweixinback.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * 定时任务
+ * @TableName quartz_task
+ */
+@TableName(value ="quartz_task")
+@Data
+public class QuartzTask extends BaseEntity<QuartzTask> {
+    /**
+     * ID
+     */
+    private Integer id;
+
+    /**
+     * 任务类型 0专利导入定时任务
+     */
+    private Integer taskType;
+
+    /**
+     * 参数
+     */
+    private String parameter;
+
+    /**
+     * 
+     */
+    private String cron;
+
+    /**
+     * 是否运行
+     */
+    private Integer ifRun;
+  private String jobClass;
+}

+ 1 - 1
src/main/java/com/example/xiaoshiweixinback/entity/dto/patent/PatentDTO.java

@@ -13,5 +13,5 @@ public class PatentDTO {
 
     private Long pageSize;
 
-//    private List<PatentColumnDTO> patents;
+    private List<PatentColumnDTO> patents;
 }

+ 17 - 51
src/main/java/com/example/xiaoshiweixinback/entity/quartz/QrtzTaskDTO.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import lombok.experimental.Accessors;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -15,66 +16,31 @@ import java.util.Date;
  * @Author chenyu
  * @Date 2023/3/27
  */
-@Accessors(chain = true)
 @Data
-public class QrtzTaskDTO {
-    private Integer id;
-    private Integer projectId;
-
-    private String taskName;
-
-
-    private Integer taskType;
-    /**
-     * 状态(0等待中 1进行中 2成功 3失败 4等待下一次执行 5取消 6暂停)
-     */
-    @TableField(value = "task_state")
-    private Integer taskState;
-    /**
-     * 检索信息
-     */
-    @TableField(value = "conditions")
-    private String conditions;
-    /**
-     * cron表达式
-     */
-    @TableField(value = "crons")
-    private String crons;
-    /**
-     * 下载字段
-     */
-    @TableField(value = "config_cells")
-    private String configCells;
+public class QrtzTaskDTO  implements Serializable {
     /**
-     * 网站id
+     * ID
      */
-    @TableField(value = "config_id")
-    private Integer configId;
+    private Integer id;
+
     /**
-     * 创建人id
+     * 任务类型 0专利导入定时任务
      */
-    @TableField(value = "create_person_id")
-    private Integer createPersonId;
+    private Integer taskType;
+
     /**
-     * 创建人名称
+     * 参数
      */
-    @TableField(value = "create_person_name")
-    private String createName;
-    @TableField(value = "tenant_id")
-    private Integer tenantId;
+    private String parameter;
+
     /**
-     * 创建时间
+     *
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @TableField(value = "create_time")
-    private Date createTime;
+    private String cron;
+
     /**
-     * 最后修改时间
+     * 是否运行
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @TableField(value = "modified_time")
-    private Date modifiedTime;
-
+    private Integer ifRun;
+    private String jobClass;
 }

+ 9 - 0
src/main/java/com/example/xiaoshiweixinback/entity/quartzTask/UpdatePatentDTO.java

@@ -0,0 +1,9 @@
+package com.example.xiaoshiweixinback.entity.quartzTask;
+
+import lombok.Data;
+
+@Data
+public class UpdatePatentDTO {
+    private String dbType;
+    private String searchCondition;
+}

+ 18 - 0
src/main/java/com/example/xiaoshiweixinback/mapper/PatentUpdateRecordMapper.java

@@ -0,0 +1,18 @@
+package com.example.xiaoshiweixinback.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.xiaoshiweixinback.domain.PatentUpdateRecord;
+
+/**
+* @author admin
+* @description 针对表【patent_update_record(专利更新记录表)】的数据库操作Mapper
+* @createDate 2024-05-06 11:29:12
+* @Entity xiaoshiweixinback.domain.PatentUpdateRecord
+*/
+public interface PatentUpdateRecordMapper extends BaseMapper<PatentUpdateRecord> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/example/xiaoshiweixinback/mapper/QuartzTaskMapper.java

@@ -0,0 +1,18 @@
+package com.example.xiaoshiweixinback.mapper;
+
+import com.example.xiaoshiweixinback.domain.QuartzTask;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author admin
+* @description 针对表【quartz_task(定时任务)】的数据库操作Mapper
+* @createDate 2024-05-06 13:58:36
+* @Entity xiaoshiweixinback.domain.QuartzTask
+*/
+public interface QuartzTaskMapper extends BaseMapper<QuartzTask> {
+
+}
+
+
+
+

+ 105 - 1
src/main/java/com/example/xiaoshiweixinback/service/MonitorRecordService.java

@@ -4,10 +4,24 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.example.xiaoshiweixinback.business.common.base.Records;
+import com.example.xiaoshiweixinback.business.utils.FormatUtil;
+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;
 import com.example.xiaoshiweixinback.mapper.MonitorRecordMapper;
+import com.example.xiaoshiweixinback.service.importPatent.EsPatentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -17,16 +31,106 @@ import java.util.List;
  */
 @Service
 public class MonitorRecordService extends ServiceImpl<MonitorRecordMapper, MonitorRecord> {
+    @Autowired
+    private PatentUpdateRecordService patentUpdateRecordService;
+    @Autowired
+    private MonitorService monitorService;
+    @Autowired
+    private EsPatentService esPatentService;
 
     public Records getMonitorRecords(Integer monitorId) {
+        Monitor monitor = monitorService.getById(monitorId);
+        Integer projectId = monitor.getProductId();
+
         LambdaQueryWrapper<MonitorRecord> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(MonitorRecord::getMonitorId, monitorId);
+        queryWrapper.eq(MonitorRecord::getProductId, projectId)
+                .ge(MonitorRecord::getStartDate, monitor.getCreateTime());
         Page<MonitorRecord> monitorRecords = this.page(new Page<>(1, 10), queryWrapper);
         Records records = new Records();
         records.setData(monitorRecords.getRecords());
         records.setTotal(monitorRecords.getTotal());
         return records;
     }
+
+    public MonitorRecord getLastMonitorRecord(Integer productId) {
+        LambdaQueryWrapper<MonitorRecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(MonitorRecord::getProductId, productId)
+                .orderByDesc(MonitorRecord::getCreateTime);
+        MonitorRecord monitorRecord = this.getOne(queryWrapper, false);
+        return monitorRecord;
+
+    }
+
+
+    public void addMonitorRecords() {
+        //获取所有被监控的产品
+        List<Product> products = monitorService.getAllMonitorProducts();
+        for (Product product : products) {
+            Integer productId = product.getId();
+            MonitorRecord monitorRecord = this.getLastMonitorRecord(product.getId());
+            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) {
+                    MonitorRecord monitorRecord1 = new MonitorRecord();
+                    monitorRecord1.setProductId(productId);
+                    monitorRecord1.setStartDate(startTime);
+                    monitorRecord1.setEndDate(endTime);
+                    monitorRecord1.setSearchCondition(product.getSearchCondition());
+                    monitorRecord1.setNum(total);
+                    monitorRecord1.insert();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+
+            }
+        }
+
+    }
+
+
 }
 
 

+ 45 - 20
src/main/java/com/example/xiaoshiweixinback/service/MonitorService.java

@@ -8,6 +8,7 @@ import com.example.xiaoshiweixinback.business.utils.CacheUtil;
 import com.example.xiaoshiweixinback.business.utils.LoginUtils;
 import com.example.xiaoshiweixinback.domain.Monitor;
 
+import com.example.xiaoshiweixinback.domain.Product;
 import com.example.xiaoshiweixinback.entity.dto.AssoPersonProductDTO;
 import com.example.xiaoshiweixinback.entity.dto.GetProductDTO;
 import com.example.xiaoshiweixinback.entity.dto.monitoring.AddMonitoringDTO;
@@ -26,7 +27,9 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author admin
@@ -40,9 +43,10 @@ public class MonitorService extends ServiceImpl<MonitorMapper, Monitor> {
     private final AssoPersonProductService assoPersonProductService;
     @Lazy
     @Autowired
-    private  ProductService productService;
+    private ProductService productService;
     private final CacheUtil cacheUtil;
     private final ProductMapper productMapper;
+
     /**
      * 添加监控
      *
@@ -67,15 +71,17 @@ public class MonitorService extends ServiceImpl<MonitorMapper, Monitor> {
             BeanUtils.copyProperties(addMonitoringDTO, productAddDTO);
             productId = productService.addOrUpdateProduct(productAddDTO);
         }
-          LambdaQueryWrapper<Monitor> queryWrapper =new LambdaQueryWrapper<>();
-        queryWrapper.eq(Monitor::getCreateId,personnelVO.getUuid())
-                    .eq(Monitor::getProductId,productId);
-        Monitor monitor =this.getOne(queryWrapper,false);
-        if(monitor!=null){
+        LambdaQueryWrapper<Monitor> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Monitor::getCreateId, personnelVO.getUuid())
+                .eq(Monitor::getProductId, productId);
+        Monitor monitor = this.getOne(queryWrapper, false);
+        if (monitor != null) {
+            monitor.setIfDelete(false);
+            monitor.updateById();
             return productId;
         }
         //添加监控
-         monitor = new Monitor();
+        monitor = new Monitor();
         monitor.setCreateId(personnelVO.getUuid());
         monitor.setMonitorPeriod(monitorPeriod);
         monitor.setProductId(productId);
@@ -111,34 +117,38 @@ public class MonitorService extends ServiceImpl<MonitorMapper, Monitor> {
         LambdaQueryWrapper<Monitor> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(Monitor::getProductId, productIds)
                 .eq(Monitor::getCreateId, personnelVO.getUuid());
-        this.remove(queryWrapper);
+        List<Monitor> monitors = this.list(queryWrapper);
+        monitors.forEach(item -> {
+            item.setIfDelete(true);
+            item.updateById();
+        });
         return productIds;
 
     }
 
     /**
      * 查询监控信息
+     *
      * @param selectMonitoringDTO
      * @return
      */
     public Records selectMonitoring(SelectMonitoringDTO selectMonitoringDTO) {
-        Long current =selectMonitoringDTO.getCurrent();
-        Long size =selectMonitoringDTO.getSize();
+        Long current = selectMonitoringDTO.getCurrent();
+        Long size = selectMonitoringDTO.getSize();
         PersonnelVO personnelVO = cacheUtil.getLoginUser(LoginUtils.getToken());
-        GetProductDTO getProductDTO =new GetProductDTO();
+        GetProductDTO getProductDTO = new GetProductDTO();
         getProductDTO.setSize(size);
         getProductDTO.setCurrent(current);
         getProductDTO.setPersonUuid(personnelVO.getUuid());
         List<ProductVO> productVOS = productMapper.getMonitoringProduct(getProductDTO);
-          Long total =productMapper.getMonitoringProductCount(getProductDTO);
-          try {
-              productService.loadProduct(productVOS, false);
-
-          }
-          catch (Exception e){
-              throw new BusinessException("607","装载错误");
-          }
-        Records records =new Records();
+        Long total = productMapper.getMonitoringProductCount(getProductDTO);
+        try {
+            productService.loadProduct(productVOS, false);
+
+        } catch (Exception e) {
+            throw new BusinessException("607", "装载错误");
+        }
+        Records records = new Records();
         records.setTotal(total);
         records.setData(productVOS);
         records.setSize(size);
@@ -147,6 +157,21 @@ public class MonitorService extends ServiceImpl<MonitorMapper, Monitor> {
     }
 
 
+    public List<Product> getAllMonitorProducts() {
+        List<Product> products = new ArrayList<>();
+        LambdaQueryWrapper<Monitor> queryWrapper = new LambdaQueryWrapper<>();
+        List<Monitor> monitors = this.list(queryWrapper);
+        if (monitors.size() == 0) {
+            return products;
+        }
+        List<Integer> productIds = monitors.stream().map(Monitor::getProductId).distinct().collect(Collectors.toList());
+        if (productIds != null && productIds.size() > 0) {
+            LambdaQueryWrapper<Product> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.in(Product::getId, productIds);
+            products = productService.list(queryWrapper1);
+        }
+        return products;
+    }
 }
 
 

+ 48 - 0
src/main/java/com/example/xiaoshiweixinback/service/PatentUpdateRecordService.java

@@ -0,0 +1,48 @@
+package com.example.xiaoshiweixinback.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.xiaoshiweixinback.domain.PatentUpdateRecord;
+import com.example.xiaoshiweixinback.mapper.PatentUpdateRecordMapper;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+* @author admin
+* @description 针对表【patent_update_record(专利更新记录表)】的数据库操作Service实现
+* @createDate 2024-05-06 11:29:12
+*/
+@Service
+public class PatentUpdateRecordService extends ServiceImpl<PatentUpdateRecordMapper, PatentUpdateRecord>{
+    public PatentUpdateRecord getLastRecord(String dbType){
+        LambdaQueryWrapper<PatentUpdateRecord> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.orderByDesc(PatentUpdateRecord::getCreateTime)
+                .eq(PatentUpdateRecord::getDbType,dbType);
+        PatentUpdateRecord patentUpdateRecord =  this.getOne(queryWrapper,false);
+         return patentUpdateRecord;
+
+    }
+
+    public PatentUpdateRecord addLastRecord(String dbType,String searchCondition){
+        PatentUpdateRecord patentUpdateRecord =new PatentUpdateRecord();
+        PatentUpdateRecord lastRecord =this.getLastRecord(dbType);
+        patentUpdateRecord.setDbType(dbType);
+        patentUpdateRecord.setStartTime(lastRecord.getStartTime());
+        patentUpdateRecord.setEndTime(new Date());
+        patentUpdateRecord.setSearchCondition(searchCondition);
+        patentUpdateRecord.insert();
+        return  patentUpdateRecord;
+    }
+
+    public PatentUpdateRecord getLastRecord(){
+        LambdaQueryWrapper<PatentUpdateRecord> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.orderByDesc(PatentUpdateRecord::getEndTime);
+        PatentUpdateRecord patentUpdateRecord =this.getOne(queryWrapper,false);
+         return  patentUpdateRecord;
+    }
+}
+
+
+
+

+ 2 - 1
src/main/java/com/example/xiaoshiweixinback/service/ProductService.java

@@ -132,7 +132,8 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> {
             if (personnelVO != null) {
                 LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
                 monitorLambdaQueryWrapper.in(Monitor::getProductId, ids)
-                        .eq(Monitor::getCreateId, personnelVO.getUuid());
+                        .eq(Monitor::getCreateId, personnelVO.getUuid())
+                        .eq(Monitor::getIfDelete,false);
                 monitors = monitorService.list(monitorLambdaQueryWrapper);
             }
         }

+ 22 - 3
src/main/java/com/example/xiaoshiweixinback/service/common/OPSService.java

@@ -98,9 +98,9 @@ public class OPSService {
                 getFuTuParamsDTO.setType("application/tiff");
                 getFuTuParamsDTO.setLink(image.getUrlLink());
                 byte[] buffer = this.getPatentFile(getFuTuParamsDTO);
-               BufferedImage bufferedImage= ImageUtil.getByByte(buffer);
-               String name =rootPath + publicNo + "_" + (i - 1) + ".jpg";
-                ImageUtil.cutImage(bufferedImage,0,300,name);
+                BufferedImage bufferedImage = ImageUtil.getByByte(buffer);
+                String name = rootPath + publicNo + "_" + (i - 1) + ".jpg";
+                ImageUtil.cutImage(bufferedImage, 0, 300, name);
             }
         } else {
             return;
@@ -108,5 +108,24 @@ public class OPSService {
 
     }
 
+    public List<File> getImageFiles(ImagesInfoVO image, String publicNo) throws Exception {
+        List<File> files = new ArrayList<>();
+        if (image != null) {
+            Integer num = image.getNumberOfPages();
+            for (int i = 1; i < num + 1; i++) {
+                GetFuTuParamsDTO getFuTuParamsDTO = new GetFuTuParamsDTO();
+                getFuTuParamsDTO.setPage(i);
+                getFuTuParamsDTO.setType("application/tiff");
+                getFuTuParamsDTO.setLink(image.getUrlLink());
+                byte[] buffer = this.getPatentFile(getFuTuParamsDTO);
+                BufferedImage bufferedImage = ImageUtil.getByByte(buffer);
+                String name = publicNo + "_" + (i - 1) + ".jpg";
+                File file = ImageUtil.cutImage(bufferedImage, 0, 300, name);
+                files.add(file);
+            }
+        }
+        return files;
+
+    }
 
 }

+ 0 - 2
src/main/java/com/example/xiaoshiweixinback/service/exportPatent/PatentExportService.java

@@ -50,7 +50,6 @@ public class PatentExportService {
      * @return
      * @throws IOException
      */
-    @Async
     public String exportPatent(List<String> patentNos) throws IOException {
         try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
             String patentExportJson = ExcuteConfigUtils.excuteConfigJson();
@@ -86,7 +85,6 @@ public class PatentExportService {
                 cell.setCellValue(headers.get(i));
             }
 
-
             Integer total = patentNos.size();
             Integer defaultNum = 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;
+        }
+    }
 }

+ 65 - 2
src/main/java/com/example/xiaoshiweixinback/service/importPatent/EsDenseVectorService.java

@@ -97,7 +97,7 @@ public class EsDenseVectorService {
     @Value("${ES.patent}")
     private String patentMapName;
 
-    /**
+    /**R
      * 根据图片排序获取列表
      *
      * @param dto
@@ -126,7 +126,7 @@ public class EsDenseVectorService {
         }
 
         GetImageVO imageVO = this.getImageList(dto.getProductId(), file, dto.getDescription());
-        List<Float> imageList = imageVO.getImageList();
+        List<Float> imageList = null;
         List<String> getGuids = imageVO.getGetGuids();
         if (!CollectionUtils.isEmpty(imageList)) {
             String source = "cosineSimilarity(params.queryVector, 'my_vector') + 1.0";
@@ -371,4 +371,67 @@ public class EsDenseVectorService {
         return s;
     }
 
+
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
+    public Records getPatents(EsPatentVectorDTO dto) throws Exception {
+        Long pageNum = dto.getPageNum();
+        Long pageSize = dto.getPageSize();
+        Boolean ifAddSearchRecord = dto.getIfAddSearchRecord();
+
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index(patentVectorName);
+        Query q = null;
+        String condition = this.appendCondition(dto.getProductId(), dto.getKey(), dto.getAppCountry(), dto.getCompanyName());
+
+        if (StringUtils.isNotEmpty(condition)) {
+            //1. 解析检索条件
+            treeNode tree = expressManager.getInstance().Parse(condition, false);
+            //2. 从es中检索数据
+            q = formatQueryService.EsQueryToQuery((operateNode) tree, "patentVector", null);
+        }
+
+        if (q == null) {
+            throw new BusinessException("608", "检索式错误,请重新输入");
+        }
+
+        builder.query(q);
+
+        //根据申请号去重
+        FieldCollapse collapse = FieldCollapse.of(i -> i.field("app_no"));
+        builder.collapse(collapse);
+        //统计总数
+        Aggregation aggregation = AggregationBuilders.cardinality(i -> i.field("app_no"));
+        builder.aggregations("count", aggregation);
+
+        //分页
+        if (pageNum != null && pageSize != null && pageNum > 0 && pageSize > 0) {
+            builder.from((pageNum.intValue() - 1) * pageSize.intValue()).size(pageSize.intValue());
+        }
+
+        //解除最大条数限制
+        builder.trackTotalHits(i -> i.enabled(true));
+        SearchResponse<PatentVector> response = client.search(builder.build(), PatentVector.class);
+        List<Hit<PatentVector>> hits = response.hits().hits();
+        List<EsPatentVectorVo> vectorVos = new ArrayList<>();
+        for (Hit<PatentVector> hit : hits) {
+            PatentVector vector = hit.source();
+            EsPatentVectorVo vectorVo = new EsPatentVectorVo();
+            BeanUtil.copy(vector, vectorVo);
+            PatentColumnDTO columnDTO = esPatentService.selectPatentByAppNo(vector.getAppNo());
+            vectorVo.setPatentNo(columnDTO.getPatentNo());
+            vectorVos.add(vectorVo);
+        }
+
+        Aggregate aggregate = response.aggregations().get("count");
+        long total = aggregate.cardinality().value();
+        Records records = new Records();
+        records.setCurrent(pageNum);
+        records.setSize(pageSize);
+        records.setData(vectorVos);
+        records.setTotal(total);
+
+        return records;
+    }
+
 }

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

@@ -3,8 +3,9 @@ package com.example.xiaoshiweixinback.service.importPatent;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
 import co.elastic.clients.elasticsearch._types.InlineScript;
 import co.elastic.clients.elasticsearch._types.Script;
-import co.elastic.clients.elasticsearch._types.aggregations.Aggregation;
-import co.elastic.clients.elasticsearch._types.aggregations.AggregationBuilders;
+import co.elastic.clients.elasticsearch._types.SortOptions;
+import co.elastic.clients.elasticsearch._types.SortOrder;
+import co.elastic.clients.elasticsearch._types.aggregations.*;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
 import co.elastic.clients.elasticsearch.core.SearchRequest;
@@ -12,6 +13,7 @@ import co.elastic.clients.elasticsearch.core.SearchResponse;
 import co.elastic.clients.elasticsearch.core.search.FieldCollapse;
 import co.elastic.clients.elasticsearch.core.search.Hit;
 import co.elastic.clients.json.JsonData;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.example.xiaoshiweixinback.business.common.base.Records;
 import com.example.xiaoshiweixinback.business.exception.BusinessException;
@@ -27,6 +29,9 @@ import com.example.xiaoshiweixinback.domain.AssoPersonProduct;
 import com.example.xiaoshiweixinback.domain.es.*;
 import com.example.xiaoshiweixinback.entity.dto.esPicture.EsPictureNoDTO;
 import com.example.xiaoshiweixinback.entity.dto.patent.*;
+import com.example.xiaoshiweixinback.entity.patent.MapRequest;
+import com.example.xiaoshiweixinback.entity.patent.QueryRequest;
+import com.example.xiaoshiweixinback.entity.patent.StringRequest;
 import com.example.xiaoshiweixinback.entity.vo.PersonnelVO;
 import com.example.xiaoshiweixinback.entity.vo.esPicture.EsPatentVectorVo;
 import com.example.xiaoshiweixinback.entity.vo.esPicture.EsPictureNoVo;
@@ -45,13 +50,13 @@ import org.springframework.util.CollectionUtils;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
+
+
 public class EsPatentService {
 
     private final ElasticsearchClient client;
@@ -78,9 +83,10 @@ public class EsPatentService {
     private FormatQueryService formatQueryService;
 
     @Value("${ES.patentVector}")
-    private  String patentVectorName;
+    private String patentVectorName;
     @Value("${ES.patent}")
     private String patentMapName;
+
     /**
      * 收藏专利
      *
@@ -93,9 +99,12 @@ public class EsPatentService {
         Integer productId = patentDTO.getProductId();
         //获取用户
         PersonnelVO personnelVO = cacheUtils.getLoginUser(LoginUtils.getToken());
+
+
         if (ToolUtil.isEmpty(personnelVO)) {
             throw new BusinessException(ExceptionEnum.THE_GET_INFORMATION_TOKEN_INVALID);
         }
+
         String uuid = personnelVO.getUuid();
         //获取人员产品关联表id
         AssoPersonProduct assoPersonProduct = assoPersonProductMapper.selectOne(new LambdaQueryWrapper<AssoPersonProduct>()
@@ -332,6 +341,7 @@ public class EsPatentService {
 
     /**
      * 查询专利(用于导出专利数据)
+     *
      * @param patentDTO
      * @param file
      * @return
@@ -377,6 +387,7 @@ public class EsPatentService {
 
     /**
      * 获取图片专利里的信息
+     *
      * @param patentDTO
      * @param file
      * @return
@@ -456,6 +467,7 @@ public class EsPatentService {
 
     /**
      * 根据申请号查询专利信息
+     *
      * @param appNo
      * @return
      * @throws IOException
@@ -477,4 +489,83 @@ public class EsPatentService {
         return columnDTO;
     }
 
+
+    /**
+     * Es检索
+     *
+     * @param queryRequest 检索条件
+     * @return
+     */
+    public PatentDTO esSearch(QueryRequest queryRequest) throws Exception {
+        PatentDTO dto = new PatentDTO();
+        String searchCondition = "";
+        Integer projectId = queryRequest.getProjectId();
+        Long current = queryRequest.getCurrent();
+        Long size = queryRequest.getSize();
+
+        //判断表达式
+        if (queryRequest instanceof StringRequest) {
+            searchCondition = ((StringRequest) queryRequest).getSearchQuery();
+        } else if (queryRequest instanceof MapRequest) {
+            Map<String, Object> map = ((MapRequest) queryRequest).getSearchQuery();
+            StringBuilder stringBuilder = new StringBuilder();
+            for (String key : map.keySet()) {
+                Object value = map.get(key);
+                if (!"".contentEquals(stringBuilder)) {
+                    stringBuilder = stringBuilder.append(" AND ").append(key).append("=").append(value);
+                } else {
+                    stringBuilder = stringBuilder.append(key).append("=").append(value);
+                }
+            }
+            searchCondition = stringBuilder.toString();
+        }
+
+        String condition = searchCondition;
+
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index("wxpatent");
+        //1. 解析检索条件
+        treeNode tree = expressManager.getInstance().Parse(condition, false);
+        //3. 从es中检索数据
+        Query q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
+        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);
+
+//        //分页
+//        if (current != null && size != null && current > 0 && size > 0) {
+//            builder.from((current.intValue() - 1) * size.intValue()).size(size.intValue());
+//        } else {
+//            builder.from(1).size(99999);
+//        }
+
+        //解除最大条数限制
+        builder.trackTotalHits(i -> i.enabled(true));
+        SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
+        List<PatentColumnDTO> list = new ArrayList<>();
+        long total = 0L;
+            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);
+            }
+
+
+        dto.setTotal(total);
+        dto.setPatents(list);
+        dto.setPageNum(current);
+        dto.setPageSize(size);
+        return dto;
+    }
+
 }

+ 82 - 30
src/main/java/com/example/xiaoshiweixinback/service/importPatent/GetPatentPictureFromWebService.java

@@ -2,16 +2,22 @@ package com.example.xiaoshiweixinback.service.importPatent;
 
 import com.example.xiaoshiweixinback.business.utils.FileUtils;
 import com.example.xiaoshiweixinback.business.utils.FormatUtil;
+import com.example.xiaoshiweixinback.business.utils.ImageUtil;
 import com.example.xiaoshiweixinback.domain.es.Patent;
 import com.example.xiaoshiweixinback.domain.es.PatentClassify;
 import com.example.xiaoshiweixinback.domain.es.PatentVector;
 import com.example.xiaoshiweixinback.entity.dto.patent.UploadPatentWebDTO;
+import com.example.xiaoshiweixinback.entity.ops.GetFuTuParamsDTO;
+import com.example.xiaoshiweixinback.entity.ops.ImagesInfoVO;
 import com.example.xiaoshiweixinback.service.common.FileManagerService;
 import com.example.xiaoshiweixinback.service.common.GetVectorService;
+import com.example.xiaoshiweixinback.service.common.OPSService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.awt.image.BufferedImage;
 import java.io.File;
+import java.io.FileFilter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -27,42 +33,62 @@ public class GetPatentPictureFromWebService {
     private EsService esService;
     @Autowired
     private GetVectorService getVectorService;
+    @Autowired
+    private OPSService opsService;
 
     public void getPatentPicture(UploadPatentWebDTO uploadPatentWebDTO) {
+       String appNo=uploadPatentWebDTO.getPatent().getAppNo();
+       if(appNo.contains("CN")){
+           this.getCNPatentPicture(uploadPatentWebDTO);
+       }
+       else {
+           this.getWdPatentPicture(uploadPatentWebDTO);
+       }
+    }
+
+    public void getCNPatentPicture(UploadPatentWebDTO uploadPatentWebDTO) {
         try {
 
-            String pictureUrl = patentStarApiService.getPictureApi(uploadPatentWebDTO.getStarPatentVO().getRowApplicationNo());
+            List<String> pictureUrls = patentStarApiService.getExternalFigure(uploadPatentWebDTO.getStarPatentVO().getRowApplicationNo());
+            Patent patent = uploadPatentWebDTO.getPatent();
+            if (pictureUrls != null && pictureUrls.size()>0) {
+                for (int i=0;i<pictureUrls.size();i++){
+                    String pictureUrl =pictureUrls.get(i);
+                    File file = FileUtils.getPictureFileByUrl(pictureUrl);
+                    String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
+                    fileManagerService.uploadFileWithGuid(file, guid);
+                    PatentVector patentVectorOrg = esService.getVectorByIndex(patent.getAppNo(), 0);
+                    if (patentVectorOrg != null) {
+                        return;
+                    }
+                    this.addPatentVector(uploadPatentWebDTO, file, i);
+                }
+
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void getWdPatentPicture(UploadPatentWebDTO uploadPatentWebDTO) {
+        try {
             Patent patent = uploadPatentWebDTO.getPatent();
-            if (pictureUrl != null && !pictureUrl.contains("408")) {
-                File file = FileUtils.getPictureFileByUrl(pictureUrl);
-                String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getApplicationNo());
-                fileManagerService.uploadFileWithGuid(file, guid);
-              PatentVector patentVectorOrg =  esService.getVectorByIndex(patent.getAppNo(),0);
-                if(patentVectorOrg!=null){
-                    return;
+            String appNo = patent.getAppNo();
+            List<ImagesInfoVO> imagesInfoVOS = opsService.getImageInfos(patent.getPublicNo());
+            ImagesInfoVO infoVO = imagesInfoVOS.stream().filter(item -> item.getImageType().equals("Drawing")).findFirst().orElse(null);
+            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.getPatent().getAppNo());
+                    File file = files.get(i);
+                    fileManagerService.uploadFileWithGuid(file, guid);
+                    PatentVector patentVectorOrg = esService.getVectorByIndex(patent.getAppNo(), 0);
+                    if (patentVectorOrg != null) {
+                        return;
+                    }
+                    this.addPatentVector(uploadPatentWebDTO, file, i);
                 }
-                PatentVector patentVector = new PatentVector();
-                patentVector.setAppNo(patent.getAppNo());
-                patentVector.setTitle(patent.getTitle());
-                patentVector.setRightHolder(patent.getRightHolder());
-                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.setImageIndex(0);
-                patentVector.setGuid(guid);
-                List<String> stringList = getVectorService.getVectorByFile(file);
-                List<Float> floats =new ArrayList<>();
-                stringList.forEach(item->{
-                    Float a =Float.parseFloat(item);
-                    floats.add(a);
-
-                });
-                org.apache.commons.io.FileUtils.deleteQuietly(file);
-                patentVector.setMyVector(floats);
-                esService.addPatentVector(patentVector);
             }
 
         } catch (Exception e) {
@@ -71,4 +97,30 @@ public class GetPatentPictureFromWebService {
     }
 
 
+    public void addPatentVector(UploadPatentWebDTO uploadPatentWebDTO, File file, Integer index) throws Exception {
+        String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getPatent().getAppNo());
+
+        Patent patent = uploadPatentWebDTO.getPatent();
+        PatentVector patentVector = new PatentVector();
+        patentVector.setAppNo(patent.getAppNo());
+        patentVector.setTitle(patent.getTitle());
+        patentVector.setRightHolder(patent.getRightHolder());
+        patentVector.setAppDate(patent.getAppDate());
+        patentVector.setAbstractStr(patent.getAbstractStr());
+        patentVector.setAppCountry(patent.getAppCountry());
+        patentVector.setLoc(uploadPatentWebDTO.getPatent().getIpc());
+        patentVector.setImageIndex(index);
+        patentVector.setGuid(guid);
+        List<String> stringList = getVectorService.getVectorByFile(file);
+        List<Float> floats = new ArrayList<>();
+        stringList.forEach(item -> {
+            Float a = Float.parseFloat(item);
+            floats.add(a);
+
+        });
+        org.apache.commons.io.FileUtils.deleteQuietly(file);
+        patentVector.setMyVector(floats);
+        esService.addPatentVector(patentVector);
+    }
+
 }

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

@@ -34,11 +34,11 @@ private GetPatentPictureFromWebService getPatentPictureFromWebService;
 private GetFiguresService getFiguresService;
     public Boolean ImportTask(ImportTaskAMVO importTaskAMVO) {
 
-        return excuteLessThan10000(importTaskAMVO);
+        return importToEs(importTaskAMVO);
     }
 
 
-    private Boolean excuteLessThan10000(ImportTaskAMVO importTaskAMVO) {
+    private Boolean importToEs(ImportTaskAMVO importTaskAMVO) {
         Boolean ifHaveGet = false;
         try {
             String orderBy = importTaskAMVO.getOrderBy();  //排序字段
@@ -131,7 +131,6 @@ private GetFiguresService getFiguresService;
                         getCataloguingFromWebService.loadPatentMessage(uploadPatentWebDTO);
                          savePatentToEsService.saveOrUpdate(uploadPatentWebDTO);
                          getPatentPictureFromWebService.getPatentPicture(uploadPatentWebDTO);
-                        getFiguresService.getFigures(uploadPatentWebDTO);
                         ifHaveGet = true;
                         index += 1;
                         System.out.println(index);
@@ -141,6 +140,7 @@ private GetFiguresService getFiguresService;
                 }
 
             }
+            System.out.println("ImportTaskDone");
             return ifHaveGet;
         } catch (Exception e) {
             e.printStackTrace();

+ 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());

+ 40 - 6
src/main/java/com/example/xiaoshiweixinback/service/quartzService/ImportJobService.java

@@ -1,13 +1,47 @@
 package com.example.xiaoshiweixinback.service.quartzService;
 
-public class ImportJobService {
+import com.alibaba.fastjson.JSONArray;
+import com.example.xiaoshiweixinback.domain.PatentUpdateRecord;
+import com.example.xiaoshiweixinback.entity.dto.patent.ImportTaskAMVO;
+import com.example.xiaoshiweixinback.entity.quartz.QrtzTaskDTO;
+import com.example.xiaoshiweixinback.entity.quartz.QuartzVO;
+import com.example.xiaoshiweixinback.entity.quartzTask.UpdatePatentDTO;
+import com.example.xiaoshiweixinback.service.PatentUpdateRecordService;
+import com.example.xiaoshiweixinback.service.importPatent.ImportFromWebToEsService;
+import lombok.RequiredArgsConstructor;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+import org.springframework.stereotype.Service;
 
-    /**
-     * 定时导入专利
-     */
-    public  void timingImportPatent(){
-       //获取上次导入的信息
+import java.util.List;
 
+@DisallowConcurrentExecution
+@RequiredArgsConstructor
+public class ImportJobService extends QuartzJobBean {
+    private final ImportFromWebToEsService importFromWebToEsService;
+    private final PatentUpdateRecordService patentUpdateRecordService;
+
+    @Override
+    public void executeInternal(JobExecutionContext context) throws JobExecutionException {
+        JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
+        QrtzTaskDTO qrtzTask = (QrtzTaskDTO) jobDataMap.get("qrtzTask");
+        String parameter = qrtzTask.getParameter();
+        if (parameter != null) {
+            List<UpdatePatentDTO> updatePatentDTOS = JSONArray.parseArray(parameter, UpdatePatentDTO.class);
+            for (UpdatePatentDTO updatePatentDTO : updatePatentDTOS) {
+            PatentUpdateRecord patentUpdateRecord= patentUpdateRecordService.addLastRecord(updatePatentDTO.getDbType(),updatePatentDTO.getSearchCondition());
+                ImportTaskAMVO importTaskAMVO = new ImportTaskAMVO();
+                importTaskAMVO.setSearchCondition(updatePatentDTO.getSearchCondition());
+                importTaskAMVO.setOrderBy("PD");
+                importTaskAMVO.setOrderByType("DESC");
+                importTaskAMVO.setDbType(updatePatentDTO.getDbType());
+                importFromWebToEsService.ImportTask(importTaskAMVO);
+            }
+
+        }
 
     }
 }

+ 12 - 3
src/main/java/com/example/xiaoshiweixinback/service/quartzService/JobService.java

@@ -1,6 +1,7 @@
 package com.example.xiaoshiweixinback.service.quartzService;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.example.xiaoshiweixinback.business.exception.BusinessException;
 import com.example.xiaoshiweixinback.entity.quartz.QrtzTaskDTO;
 import com.example.xiaoshiweixinback.entity.quartz.QuartzVO;
 import lombok.RequiredArgsConstructor;
@@ -67,7 +68,7 @@ public class JobService {
         JobDataMap jobDataMap = new JobDataMap();
         jobDataMap.put("qrtzTask", qrtzTask);
         TriggerKey oldTriggerKey = TriggerKey.triggerKey(quartzVO.getTriggerName(), quartzVO.getTriggerGroupName());
-        CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(qrtzTask.getCrons());
+        CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(qrtzTask.getCron());
         CronTrigger cronTrigger = TriggerBuilder.newTrigger()
                 .withIdentity(oldTriggerKey).usingJobData(jobDataMap).withSchedule(scheduleBuilder).build();
         try {
@@ -85,12 +86,20 @@ public class JobService {
     @Transactional
     public void addJob(QrtzTaskDTO qrtzTask) throws SchedulerException {
         //添加一条任务记录
+        Class  jobClass= null;
+        try {
+              jobClass  = Class.forName(qrtzTask.getJobClass());
+
+        }
+        catch (Exception e){
+            throw new BusinessException("607","未找到类");
+        }
         QuartzVO quartzVO = this.generateQuartzVO(qrtzTask.getId());
         JobDataMap jobDataMap = new JobDataMap();
         jobDataMap.put("qrtzTask", qrtzTask);
-        CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(qrtzTask.getCrons());
+        CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(qrtzTask.getCron());
         JobDetail jobDetail = JobBuilder
-                .newJob(TaskAddJob.class)
+                .newJob(jobClass)
                 .withIdentity(quartzVO.getJobName(), quartzVO.getJobGroupName())
                 .build();
         Trigger trigger = TriggerBuilder

+ 51 - 0
src/main/java/com/example/xiaoshiweixinback/service/quartzService/QuartzTaskService.java

@@ -0,0 +1,51 @@
+package com.example.xiaoshiweixinback.service.quartzService;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.xiaoshiweixinback.business.exception.BusinessException;
+import com.example.xiaoshiweixinback.domain.QuartzTask;
+import com.example.xiaoshiweixinback.entity.quartz.QrtzTaskDTO;
+import com.example.xiaoshiweixinback.mapper.QuartzTaskMapper;
+import com.example.xiaoshiweixinback.service.quartzService.JobService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author admin
+ * @description 针对表【quartz_task(定时任务)】的数据库操作Service实现
+ * @createDate 2024-05-06 13:58:36
+ */
+@Service
+public class QuartzTaskService extends ServiceImpl<QuartzTaskMapper, QuartzTask> {
+    @Autowired
+    private JobService jobService;
+@Transactional(rollbackFor = Exception.class)
+    public void addQuartzTask(QrtzTaskDTO qrtzTaskDTO) {
+        QuartzTask quartzTask = new QuartzTask();
+        BeanUtils.copyProperties(qrtzTaskDTO, quartzTask);
+        quartzTask.insert();
+        qrtzTaskDTO.setId(quartzTask.getId());
+        try {
+            jobService.addJob(qrtzTaskDTO);
+
+        } catch (Exception e) {
+            throw new BusinessException("607", "添加定时任务失败");
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteQuartzTask(Integer taskId) {
+        this.removeById(taskId);
+        try {
+            jobService.deleteJob(taskId);
+        } catch (Exception e) {
+            throw new BusinessException("607", "删除失败");
+        }
+
+    }
+}
+
+
+
+

+ 1 - 1
src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
       max-file-size: 1000MB
       max-request-size: 1000MB
   profiles:
-    active: prodNetOut
+    active: dev
   jackson:
     default-property-inclusion: non_null
     serialization:

+ 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"
+  }
+]

+ 2 - 2
src/main/resources/mapper/ProductMapper.xml

@@ -145,7 +145,7 @@
         left join product as p on app.product_id =p.id
         left join person as pe on p.create_id =pe.uuid
         <where>
-            app.create_id  = #{getProductDTO.personUuid}
+            app.create_id  = #{getProductDTO.personUuid} and if_delete=false
             <if test="getProductDTO.name!=null and getProductDTO.name!=''">
                 and p.name like CONCAT('%',#{getProductDTO.name},'%')
             </if>
@@ -174,7 +174,7 @@
         left join product as p on app.product_id =p.id
         left join person as pe on p.create_id =pe.uuid
         <where>
-            app.create_id = #{getProductDTO.personUuid}
+            app.create_id = #{getProductDTO.personUuid} and if_delete=false
             <if test="getProductDTO.name!=null and getProductDTO.name!=''">
                 and p.name like CONCAT('%',#{getProductDTO.name},'%')
             </if>