Kaynağa Gözat

20240904 导出任务修改

lwhhszx 1 yıl önce
ebeveyn
işleme
0676b8326f

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/PatentStarListDTO.java

@@ -64,4 +64,6 @@ public class PatentStarListDTO {
 
     private String redisKey;
 
+    private Integer projectId ;
+    private String SearchSetting;
 }

+ 14 - 0
src/main/java/cn/cslg/pas/domain/business/RetrieveRecord.java

@@ -59,4 +59,18 @@ public class RetrieveRecord extends BaseEntity<RetrieveRecord> {
      */
     @TableField(value = "update_time")
     private Date updateTime;
+
+
+    /**
+     * 是否手动更新
+     */
+    @TableField(value = "if_by_system")
+    private Boolean ifBySystem;
+
+    /**
+     * 前端配置
+     */
+    @TableField(value = "search_setting")
+    private Boolean searchSetting;
+
 }

+ 35 - 0
src/main/java/cn/cslg/pas/domain/business/novelty/AssoRetrieveRecordProject.java

@@ -0,0 +1,35 @@
+package cn.cslg.pas.domain.business.novelty;
+
+import cn.cslg.pas.domain.BaseEntity;
+import cn.cslg.pas.domain.business.AdminProceed;
+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 asso_retrieve_record_project
+ */
+@TableName(value ="asso_retrieve_record_project")
+@Data
+public class AssoRetrieveRecordProject extends BaseEntity<AssoRetrieveRecordProject> {
+    /**
+     * ID
+     */
+    private Integer id;
+
+    /**
+     * 检索记录id
+     */
+    private Integer retrieveRecordId;
+
+    /**
+     * 项目id
+     */
+    private Integer projectId;
+
+
+}

+ 1 - 18
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -83,14 +83,7 @@ public class PatentStarApiService {
     private WebVOTransformService webVOTransformService;
 
     public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
-        RetrieveRecord retrieveRecord = new RetrieveRecord();
-        retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
-
-        if (patentStarListDTO.getRetrieveRecordId() != null) {
-            retrieveRecord = retrieveRecordService.getById(patentStarListDTO.getRetrieveRecordId());
-            patentStarListDTO.setCurrentQuery(retrieveRecord.getConditions());
-            patentStarListDTO.setDBType(retrieveRecord.getDbType());
-        }
+       RetrieveRecord retrieveRecord =retrieveRecordService.setRetrieveRecord(patentStarListDTO);
         long start = System.currentTimeMillis();
         Map<String, Object> map = this.patentStarSearchApi(patentStarListDTO);
         long end = System.currentTimeMillis();
@@ -98,18 +91,8 @@ public class PatentStarApiService {
         if (map == null) {
             ThrowException.throwXiaoShiException("检索失败,请检查检索式");
         }
-
-        //记录检索历史
-        retrieveRecord.setRetrieveTime(new Date());
         retrieveRecord.setTotalNum(Integer.parseInt(map.get("total").toString()));
-        retrieveRecord.setDbType(patentStarListDTO.getDBType());
-
         if (patentStarListDTO.getRetrieveRecordId() == null) {
-            //获取创建人信息
-            PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
-            retrieveRecord.setCreateTime(new Date());
-            retrieveRecord.setCreateId(personnelVO.getId());
-            retrieveRecord.setTenantId(personnelVO.getTenantId());
             retrieveRecord.insert();
         } else {
             retrieveRecord.updateById();

+ 27 - 0
src/main/java/cn/cslg/pas/service/common/RetrieveRecordService.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.service.common;
 
 
+import cn.cslg.pas.common.dto.PatentStarListDTO;
 import cn.cslg.pas.common.dto.RetrieveRecordDTO;
 import cn.cslg.pas.common.dto.RetrieveRecordDeDTO;
 import cn.cslg.pas.common.dto.RetrieveRecordQueryDTO;
@@ -127,4 +128,30 @@ public class RetrieveRecordService extends ServiceImpl<RetrieveRecordMapper, Ret
         records.setTotal(retrieveRecords.getTotal());
         return records;
     }
+
+    public RetrieveRecord setRetrieveRecord(PatentStarListDTO patentStarListDTO) {
+        RetrieveRecord retrieveRecord = new RetrieveRecord();
+        retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
+        Integer id = patentStarListDTO.getRetrieveRecordId();
+
+
+        if (id != null) {
+            retrieveRecord = this.getById(id);
+            patentStarListDTO.setCurrentQuery(retrieveRecord.getConditions());
+            patentStarListDTO.setDBType(retrieveRecord.getDbType());
+        }
+
+        retrieveRecord.setRetrieveTime(new Date());
+        retrieveRecord.setDbType(patentStarListDTO.getDBType());
+
+        if (patentStarListDTO.getRetrieveRecordId() == null) {
+            //获取创建人信息
+            PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+            retrieveRecord.setCreateTime(new Date());
+            retrieveRecord.setCreateId(personnelVO.getId());
+            retrieveRecord.setTenantId(personnelVO.getTenantId());
+        }
+
+        return retrieveRecord;
+    }
 }

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

@@ -60,7 +60,7 @@ spring:
     job-store-type: jdbc
     #初始化表结构
     jdbc:
-      initialize-schema:  never
+      initialize-schema:  always
 authorUrl: http://localhost:8885
 PCSUrl: http://localhost:8885
 #OPSUrl: http://192.168.2.24:5001