lwhhszx 2 yıl önce
ebeveyn
işleme
7aa8ab8a5b

+ 2 - 2
PAS/src/main/java/cn/cslg/pas/controller/PatentController.java

@@ -84,8 +84,8 @@ public class PatentController {
 
     @GetMapping("patentNo")
     @Operation(summary = "根据专利号获取专利所有信息")
-    public String getPatentIdByPatentNo(String patentNo) {
-        PatentDTO patentDTO =patentService.getPatentDTOById(patentNo);
+    public String getPatentIdByPatentNo(String patentNo,Integer projectId) {
+        PatentDTO patentDTO =patentService.getPatentDTOById(patentNo,projectId);
         return Response.success(patentDTO);
     }
 

+ 3 - 1
PAS/src/main/java/cn/cslg/pas/controller/ProjectExportController.java

@@ -14,6 +14,8 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.IOException;
+
 /**
  * <p>
  * 专题库 前端控制器
@@ -45,7 +47,7 @@ public class ProjectExportController {
 
     @GetMapping("list")
     @Operation(summary = "导出记录列表")
-    public String getExportPageList(ProjectExportVO params) {
+    public String getExportPageList(ProjectExportVO params) throws IOException {
         return Response.success(projectExportService.getPageList(params));
     }
 

+ 1 - 3
PAS/src/main/java/cn/cslg/pas/service/PatentRightService.java

@@ -443,7 +443,7 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
         //独立权利要求
         String selfContent = params.getSelfContent();
         if (StringUtils.isNotEmpty(content)) {
-            this.deleteByPatentId(params.getPatentId());
+             this.deleteByPatentId(params.getPatentId());
 //            String[] contentArray = null;
 //            String[] contentOutArray = null;
 //            String[] selfContentArray = null;
@@ -518,7 +518,6 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
             } else {
                 regex = "";
             }
-
             Pattern compile = Pattern.compile(regex);
             Matcher matcher = compile.matcher(content);
             Matcher matcherOut = compile.matcher(contentOut);
@@ -534,7 +533,6 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
                 }
             }
             String[] strsOut = contentOut.split("\n");
-
             //定义父权要排序号
             String regex1 = "权利要求[0-9]+";
             String regex2 = "权利要求[0-9]+[至或~-]+[0-9]+";

+ 4 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -717,7 +717,7 @@ public String getConPantentNos(QueryPatentVO params){
         return patentDTO;
     }
 
-    public PatentDTO getPatentDTOById(String patentNo) {
+    public PatentDTO getPatentDTOById(String patentNo,Integer projectId) {
         LambdaQueryWrapper<Patent> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Patent::getPatentNo, patentNo);
         List<Patent> patents =this.list(wrapper);
@@ -792,6 +792,9 @@ public String getConPantentNos(QueryPatentVO params){
         patentDTO.setType(systemDictList.stream().filter(systemDict -> systemDict.getType().equals(Constants.PATENT_TYPE) && systemDict.getValue().equals(String.valueOf(patent.getType()))).findFirst().orElse(new SystemDict()).getLabel());
         patentDTO.setApplicant(patentApplicantService.getPatentApplicantByPatentId(patent.getId()));
         patentDTO.setInventor(patentInventorService.getPatentInventorByPatentId(patent.getId()));
+        if(projectId!=null) {
+            patentDTO.setLabel(patentLabelService.getPatentLabelByPatentIdAndProjectId(patent.getId(), projectId));
+        }
         if (StringUtils.isNotEmpty(patent.getAgencyId())) {
             patentDTO.setAgency(patentAgencyService.getPatentAgencyById(Integer.parseInt(patent.getAgencyId())));
         } else {

+ 17 - 6
PAS/src/main/java/cn/cslg/pas/service/ProjectExportService.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.model.vo.ProjectExportVO;
+import cn.cslg.pas.common.model.vo.ProjectVO;
 import cn.cslg.pas.common.utils.FileUtils;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
@@ -9,6 +10,8 @@ import cn.cslg.pas.domain.User;
 import cn.cslg.pas.mapper.ProjectExportMapper;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -18,6 +21,8 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -32,19 +37,25 @@ import java.util.stream.Collectors;
 public class ProjectExportService extends ServiceImpl<ProjectExportMapper, ProjectExport> {
 
     private final FileUtils fileUtils;
-    private final UserService userService;
     private final LoginUtils loginUtils;
-    public IPage<ProjectExport> getPageList(ProjectExportVO params) {
+    private  final  RequestService requestService;
+    public IPage<ProjectExport> getPageList(ProjectExportVO params) throws IOException {
         LambdaQueryWrapper<ProjectExport> queryWrapper = new LambdaQueryWrapper<>();
         if (params.getProjectId() != null) {
             queryWrapper.eq(ProjectExport::getProjectId, params.getProjectId());
         }
         queryWrapper.orderByDesc(ProjectExport::getCreateTime);
         IPage<ProjectExport> pageList = this.page(new Page<>(params.getCurrent(), params.getSize()), queryWrapper);
-        List<User> userList = userService.getUserByIds(pageList.getRecords().stream().map(ProjectExport::getCreateBy).collect(Collectors.toList()));
-        pageList.getRecords().forEach(data -> {
-            data.setCreateName(userList.stream().filter(item -> item.getId().equals(data.getCreateBy())).findFirst().orElse(new User()).getName());
-        });
+       List<Integer> personIds = pageList.getRecords().stream().map(ProjectExport::getCreateBy).collect(Collectors.toList());
+        List<ProjectVO.Personnel> personnelList =new ArrayList<>();
+       if(personIds.size()!=0){
+           String jsonObject1 = requestService.getPersonnelFromPCS(personIds);
+           JSONArray jsonArray = JSON.parseArray(jsonObject1);
+           personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
+       }
+            for(ProjectExport data: pageList.getRecords()) {
+                data.setCreateName(personnelList.stream().filter(item -> item.getId().equals(data.getCreateBy())).findFirst().orElse(new ProjectVO.Personnel()).getPersonnelName());
+            }
         return pageList;
     }
 

+ 0 - 6
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -120,11 +120,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         List<Integer> projectIds = new ArrayList<Integer>() {{
             add(-1);
         }};
-        if (params.getMyself()) {
-            projectIds.addAll(projectUserService.getProIdByUserId(loginUtils.getId()));
-        }
-        params.setProIds(projectIds);
-        params.setCreateBy(loginUtils.getId());
         //TODO 代码控制不同类型的角色查询权限
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
         if (personnelVO.getRoleType() == null || personnelVO.getRoleType() != 1) {
@@ -135,7 +130,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         }
         //分页查询专题库列表
         IPage<Project> pageList = baseMapper.getPageList(new Page<>(params.getCurrent(), params.getSize()), params);
-
         List<Project> dataList = pageList.getRecords();
         this.setDataList(dataList);
         pageList.setRecords(dataList);

+ 1 - 1
PAS/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:

+ 3 - 7
PAS/src/main/resources/mapper/ProjectMapper.xml

@@ -32,12 +32,6 @@
                     #{item}
                 </foreach>
             </if>
-            <if test="params.myself == true">
-                and ((a.id in
-                <foreach item="item" index="index" collection="params.proIds" open="(" separator="," close=")">
-                    #{item}
-                </foreach>) or a.creat_id = #{params.createBy})
-            </if>
             <if test="params.type != null and params.type.size() != 0">
                 <foreach item="item" index="index" collection="params.type" open=" and (" separator="or" close=")">
                     FIND_IN_SET(#{item}, a.typeid)
@@ -49,10 +43,12 @@
                 </foreach>
             </if>
             <if test="params.PersonnelId!=null">
-                and a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
+                and (a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
+                or a.creat_id = #{params.PersonnelId}
                 <if test="params.tenantId!=null">
                     or a.tenantId = #{params.tenantId}
                 </if>
+                    )
             </if>
         </where>
         order by a.`${params.sort.prop}` ${params.sort.order}