소스 검색

修改bug

lwhhszx 2 년 전
부모
커밋
d41d373224

+ 13 - 0
PAS/src/main/java/cn/cslg/pas/common/model/dto/ProjectCopyDTO.java

@@ -0,0 +1,13 @@
+package cn.cslg.pas.common.model.dto;
+
+import lombok.Data;
+
+@Data
+public class ProjectCopyDTO {
+    private Integer id;
+    private Integer tenantId;
+    private Integer areaId;
+    private String provinceName;
+    private String cityName;
+    private String areaName;
+}

+ 5 - 4
PAS/src/main/java/cn/cslg/pas/common/model/vo/PatentVO.java

@@ -22,10 +22,7 @@ public class PatentVO extends BaseVO {
     private String rightContent;
     private String rightContentSql;
     private List<Field> field;
-    private List<Field> mField;
-    private List<Field> textField;
-    private List<Field> treeField0;
-    private List<Field> treeField1;
+    private List<Field> selfField;
     private List<Integer> selected;
     private Integer startNumber;
     private Integer endNumber;
@@ -97,6 +94,7 @@ public class PatentVO extends BaseVO {
     private String patentNo;
     private List<String> notInPatentNos;
     private Integer sizeCount;
+    private List<Integer> cids;
 
     @Data
     public static class Sort {
@@ -110,11 +108,14 @@ public class PatentVO extends BaseVO {
         private String key;
         private String type;
         private Integer classId;
+        private  Boolean isNull;
+        private List<String>  notInIds ;
     }
 
     @Data
     public static class Tree {
         private String key;
         private List<String> node;
+
     }
 }

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

@@ -35,7 +35,7 @@ public class OAuth2Controller {
 
     @GetMapping("permissions")
     @Operation(summary = "获取用户专题库权限")
-    public String getPermissions() {
+    public String getPermissions() throws IOException {
         return Response.success(oAuth2Service.getPermissions());
     }
 

+ 12 - 3
PAS/src/main/java/cn/cslg/pas/controller/ProjectController.java

@@ -2,6 +2,7 @@ package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.annotation.Permission;
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.dto.ProjectCopyDTO;
 import cn.cslg.pas.common.model.vo.ProjectVO;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.utils.StringUtils;
@@ -57,7 +58,7 @@ public class ProjectController {
     @PostMapping("add")
     @Operation(summary = "新增专题库")
     public String add(@RequestBody Project project) throws IOException {
-        String projectId;
+        Integer projectId;
         try {
             projectId = projectService.add(project);
         } catch (XiaoShiException e) {
@@ -104,13 +105,13 @@ public class ProjectController {
 
     @GetMapping("/status/total")
     @Operation(summary = "专题库状态统计数据")
-    public String getProjectStatusTotal() {
+    public String getProjectStatusTotal() throws IOException {
         return Response.success(projectService.getProjectStatusTotal());
     }
 
     @GetMapping("/type/total")
     @Operation(summary = "专题库调查类型统计数据")
-    public String getProjectTypeTotal(String scenario) {
+    public String getProjectTypeTotal(String scenario) throws IOException {
         return Response.success(projectService.getProjectTypeTotal(scenario));
     }
 
@@ -143,4 +144,12 @@ public class ProjectController {
     public void exportProjectList(HttpServletResponse response) {
         projectService.exportProject(response);
     }
+
+
+    @PostMapping("copy")
+    @Operation(summary = "复制专题库")
+    public String copy(@RequestBody ProjectCopyDTO projectCopyDTO) throws IOException {
+          Integer  projectId = projectService.copy(projectCopyDTO);
+        return Response.success(projectId);
+    }
 }

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

@@ -10,7 +10,6 @@ import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.domain.Patent;
 import cn.cslg.pas.domain.ProjectField;
 import cn.cslg.pas.domain.SystemDict;
-import cn.cslg.pas.domain.Task;
 import cn.cslg.pas.mapper.PatentMapper;
 import cn.cslg.pas.service.*;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -70,7 +69,11 @@ public class SystemController {
     public String getConPantentNos(@RequestBody QueryPatentVO params) {
         return patentService.getConPantentNos(params);
     }
-
+    @PostMapping("getConPantents")
+    @Operation(summary = "获得条件过滤的专利")
+    public String getConPantents(@RequestBody QueryPatentVO params) {
+        return patentService.getConPantents(params);
+    }
 
     @PostMapping("getPatentDTOListForRMS")
     @Operation(summary = "获得所有对比文件详细信息")

+ 0 - 1
PAS/src/main/java/cn/cslg/pas/domain/Project.java

@@ -168,7 +168,6 @@ public class Project extends BaseEntity<Project> {
      */
     @TableField(exist = false)
     private String productName;
-
     //事件
     @TableField(exist = false)
     private List<EventAddNewDTO> eventAddNewDTOs;

+ 2 - 0
PAS/src/main/java/cn/cslg/pas/mapper/PatentMapper.java

@@ -56,5 +56,7 @@ public interface PatentMapper extends BaseMapper<Patent> {
     List<Patent> getPatent(@Param("patentNo")List<String> patentNo,@Param("n")int n,@Param("p")int p);
     int getPatentNumber(@Param("patentNo")List<String> patentNo);
     List<String> getConPantentNos(@Param("params") QueryPatentVO params);
+    List<Patent> getConPantents(@Param("params") QueryPatentVO params);
+
 }
 

+ 184 - 0
PAS/src/main/java/cn/cslg/pas/service/CopyService.java

@@ -0,0 +1,184 @@
+package cn.cslg.pas.service;
+
+import cn.cslg.pas.domain.*;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.sound.sampled.Port;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 用来复制的service
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class CopyService {
+        private final ProjectFieldService projectFieldService;
+        private final ProjectFieldTextService projectFieldTextService;
+        private final ProjectFieldPatentLinkService projectFieldPatentLinkService;
+        private final ProjectFieldOptionService projectFieldOptionService;
+        private final ProjectFieldTreeService projectFieldTreeService;
+        private final ProjectFolderService projectFolderService;
+        private final ProjectFolderPatentLinkService projectFolderPatentLinkService;
+    //复制标引信息
+    @Transactional(rollbackFor = Exception.class)
+    public void CopyPatentLabels(Integer oldProjectId,Integer newProjectId) {
+        //复制父报告自定义栏位
+        LambdaQueryWrapper<ProjectField> fieldWrapper = new LambdaQueryWrapper<>();
+        fieldWrapper.eq(ProjectField::getProjectId,oldProjectId);
+        List<ProjectField> fields = projectFieldService.list(fieldWrapper);
+        String re = JSONObject.toJSON(fields).toString();
+        List<ProjectField> oldFields = JSONArray.parseArray(re, ProjectField.class);
+        if (fields.size() != 0) {
+            for (ProjectField reportField : fields) {
+                reportField.setId(null);
+                reportField.setProjectId(newProjectId);
+            }
+            projectFieldService.saveBatch(fields);
+        }
+        for (int i = 0; i < oldFields.size(); i++) {
+            ProjectField field = oldFields.get(i);
+            ProjectField newField = fields.get(i);
+            //当字段类型为文本类型时
+            if (Arrays.asList(1, 2).contains(field.getType())) {
+                //获得自定义字段值
+                LambdaQueryWrapper<ProjectFieldText> textWrapper = new LambdaQueryWrapper<>();
+                textWrapper.eq(ProjectFieldText::getFieldId, field.getId());
+                List<ProjectFieldText> fieldTexts = projectFieldTextService.list(textWrapper);
+                //遍历复制值
+                for (ProjectFieldText texts : fieldTexts) {
+                    Integer oldId = texts.getId();
+                    texts.setId(null);
+                    texts.setFieldId(newField.getId());
+                    texts.insert();
+                    //复制值和专利关系
+                    LambdaQueryWrapper<ProjectFieldPatentLink> linkWrapper = new LambdaQueryWrapper<>();
+                    linkWrapper.eq(ProjectFieldPatentLink::getFieldId, field.getId())
+                            .eq(ProjectFieldPatentLink::getOptionId, oldId)
+                            .eq(ProjectFieldPatentLink::getProjectId, field.getProjectId());
+                    List<ProjectFieldPatentLink> links = projectFieldPatentLinkService.list(linkWrapper);
+                    links.forEach(item -> {
+                        item.setFieldId(newField.getId());
+                        item.setOptionId(texts.getId());
+                        item.setProjectId(newField.getProjectId());
+                        item.setId(null);
+                    });
+                    projectFieldPatentLinkService.saveBatch(links);
+                }
+            }
+            //当字段类型为选项类型时
+            if (Arrays.asList(4, 5).contains(field.getType())) {
+                //获得自定义字段值
+                LambdaQueryWrapper<ProjectFieldOption> optionWrapper = new LambdaQueryWrapper<>();
+                optionWrapper.eq(ProjectFieldOption::getFieldId, field.getId());
+                List<ProjectFieldOption> fieldOptions = projectFieldOptionService.list(optionWrapper);
+                //遍历复制值
+                for (ProjectFieldOption options : fieldOptions) {
+                    Integer oldId = options.getId();
+                    options.setId(null);
+                    options.setFieldId(newField.getId());
+                    options.insert();
+                    //复制值和专利关系
+                    LambdaQueryWrapper<ProjectFieldPatentLink> linkWrapper = new LambdaQueryWrapper<>();
+                    linkWrapper.eq(ProjectFieldPatentLink::getFieldId, field.getId())
+                            .eq(ProjectFieldPatentLink::getOptionId, oldId)
+                            .eq(ProjectFieldPatentLink::getProjectId, field.getProjectId());
+                    List<ProjectFieldPatentLink> links = projectFieldPatentLinkService.list(linkWrapper);
+                    links.forEach(item -> {
+                        item.setFieldId(newField.getId());
+                        item.setOptionId(options.getId());
+                        item.setProjectId(newField.getProjectId());
+                        item.setId(null);
+                    });
+                    projectFieldPatentLinkService.saveBatch(links);
+                }
+            }
+            //当字段类型为树类型时
+            if (Arrays.asList(6).contains(field.getType())) {
+                //获得自定义字段值
+                LambdaQueryWrapper<ProjectFieldTree> treeWrapper = new LambdaQueryWrapper<>();
+                treeWrapper.eq(ProjectFieldTree::getFieldId, field.getId());
+                List<ProjectFieldTree> fieldTrees = projectFieldTreeService.list(treeWrapper);
+                //遍历复制值
+                for (ProjectFieldTree tree : fieldTrees) {
+                    Integer oldId = tree.getId();
+                    tree.setId(null);
+                    tree.setFieldId(newField.getId());
+                    tree.insert();
+                    //复制值和专利关系
+                    LambdaQueryWrapper<ProjectFieldPatentLink> linkWrapper = new LambdaQueryWrapper<>();
+                    linkWrapper.eq(ProjectFieldPatentLink::getFieldId, field.getId())
+                            .eq(ProjectFieldPatentLink::getOptionId, oldId)
+                            .eq(ProjectFieldPatentLink::getProjectId, field.getProjectId());
+                    List<ProjectFieldPatentLink> links = projectFieldPatentLinkService.list(linkWrapper);
+                    links.forEach(item -> {
+                        item.setFieldId(newField.getId());
+                        item.setOptionId(tree.getId());
+                        item.setProjectId(newField.getProjectId());
+                        item.setId(null);
+                    });
+                    projectFieldPatentLinkService.saveBatch(links);
+                    //更新
+                    fieldTrees.forEach(item -> {
+                        if (item.getParentId().equals(oldId)) {
+                            item.setParentId(tree.getId());
+                        }
+                        String[] strs = item.getPath().split("/");
+                        List<String> lists = new ArrayList<>(Arrays.asList(strs));
+                        Collections.replaceAll(lists, oldId + "", tree.getId() + "");
+                        String paths = String.join("/", lists);
+                        item.setPath(paths);
+                    });
+                }
+                projectFieldTreeService.updateBatchById(fieldTrees);
+            }
+        }
+    }
+
+    /**
+     * 复制专题库文件夹
+     */
+    public void CopyProjectFolder(Integer oldProjectId,Integer newProjectId){
+        LambdaQueryWrapper<ProjectFolder> projectFolderWrapper = new LambdaQueryWrapper<>();
+        projectFolderWrapper.eq(ProjectFolder::getProjectId, oldProjectId);
+        List<ProjectFolder> projectFolderList = projectFolderService.list(projectFolderWrapper);
+        projectFolderList.forEach(
+                item -> {
+                    Integer oldFolderId =item.getId();
+                    item.setProjectId(newProjectId);
+                    item.setId(null);
+                    item.insert();
+                    projectFolderList.forEach(tem->{
+                        if(tem.getParentId().equals(oldFolderId)){
+                            tem.setParentId(item.getId());
+                        }
+                    });
+                    LambdaQueryWrapper<ProjectFolderPatentLink> patentLinkWrapper = new LambdaQueryWrapper<>();
+                    patentLinkWrapper.eq(ProjectFolderPatentLink::getProjectId, oldProjectId)
+                            .eq(ProjectFolderPatentLink::getFolderId,oldFolderId);
+                    List<ProjectFolderPatentLink> linkList = projectFolderPatentLinkService.list(patentLinkWrapper);
+                    linkList.forEach(
+                            tem -> {
+                                tem.setProjectId(newProjectId);
+                                tem.setId(null);
+                                tem.setFolderId(item.getId());
+                            }
+                    );
+                    projectFolderPatentLinkService.saveBatch(linkList);
+                }
+        );
+
+        projectFolderService.updateBatchById(projectFolderList);
+
+    }
+}

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

@@ -59,7 +59,7 @@ public class OAuth2Service {
         return personnelVO;
     }
 
-    public Map<Integer, Integer> getPermissions() {
+    public Map<Integer, Integer> getPermissions() throws IOException {
         log.info("开始获得权限");
         Map<Integer, Integer> result = new HashMap<>();
         PersonnelVO user = this.getUserinfo();

+ 34 - 53
PAS/src/main/java/cn/cslg/pas/service/PatentService.java

@@ -227,11 +227,10 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
     }
 
     private void setQueryPatentParams(PatentVO params) {
-        params.setTextField(new ArrayList<>());
-        params.setTreeField0(new ArrayList<>());
-        params.setTreeField1(new ArrayList<>());
-        params.setMField(new ArrayList<>());
+        params.setSelfField(new ArrayList<>());
         List<String> customIds = new ArrayList<>();
+        List<String> notInIds =new ArrayList<>();
+        params.setCids(new ArrayList<>());
         if (StringUtils.isNotEmpty(params.getName())) {
             params.setNameSql(PatentUtils.formatTextQuerySql(params.getName(), "a.name"));
         }
@@ -359,62 +358,27 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
                     params.setWhereLabel(queryList);
                     break;
                 default:
+                    //判断值里面是否含空
+                        params.getField().get(i).setIsNull(queryList.stream().anyMatch(item -> item.equals("null")));
+                        params.getSelfField().add(params.getField().get(i));
                     customIds.add(String.valueOf(field.get(0)));
-                    if (fieldType.equals("6")) {
-                        if (field.get(1).equals(1)) {
-                            params.setQueryTreeType1(true);
-                            params.setWhereTreeType1(queryList);
-                            params.setQueryTreeType0(false);
-                            params.setWhereTreeType0(null);
-                            List<PatentVO.Field> tem =new ArrayList<>(params.getTreeField1());
-                            tem.add(params.getField().get(i));
-                            params.setTreeField1(tem);
-                        } else {
-                            params.setQueryTreeType0(true);
-                            params.setWhereTreeType0(queryList);
-                            params.setQueryTreeType1(false);
-                            params.setWhereTreeType1(null);
-                            List<PatentVO.Field> tem =new ArrayList<>(params.getTreeField0());
-                            tem.add(params.getField().get(i));
-                            params.setTreeField0(tem);
-                        }
-
-                    } else if (fieldType.equals("0") || fieldType.equals("1") || fieldType.equals("2")) {
-                        params.setWhereFieldText(queryList);
-                        params.setWhereFieldTextNull(queryList.stream().anyMatch(item -> item.equals("null")));
-                        List<PatentVO.Field> tem =new ArrayList<>(params.getTextField());
-                        tem.add(params.getField().get(i));
-                        params.setQueryFieldText(true);
-                        params.setTextField(tem);
-                    } else {
-                        params.setQueryFieldMultiple(true);
-                        params.setWhereFieldMultiple(queryList);
-                        params.setWhereFieldMultipleNull(queryList.stream().anyMatch(item -> item.equals("null")));
-                        List<PatentVO.Field> tem =new ArrayList<>(params.getMField());
-                        tem.add(params.getField().get(i));
-                        params.setMField(tem);
+                    if(params.getField().get(i).getIsNull()==null||!params.getField().get(i).getIsNull()){
+                        params.getCids().add(field.get(0));
+                    }
+                    else if(params.getField().get(i).getIsNull()&&queryList.size()==1){
+                        notInIds.add(String.valueOf(field.get(0)));
                     }
+
             }
         }
         if (customIds.size() != 0) {
             params.setCustomIds(customIds);
         }
-        Integer msize =params.getMField().size();
-        Integer textSize =params.getTextField().size();
-        Integer tree0Size =params.getTreeField0().size();
-        Integer tree1Size =params.getTreeField1().size();
-        if(msize>textSize&&msize>tree0Size&&msize>tree1Size){
-            params.setSizeCount(msize-1);
-        }
-        else if(textSize>msize&&textSize>tree0Size&&textSize>tree1Size){
-            params.setSizeCount(textSize-1);
-        }
-        else if(tree1Size>msize&&tree1Size>tree0Size&&tree1Size>tree0Size) {
-            params.setSizeCount(tree1Size-1);
-        }
-        else {
-            params.setSizeCount(tree0Size-1);
-        }
+        params.getField().forEach(item->{
+            List<String> temIds =new ArrayList<>(notInIds);
+            temIds.remove(item.getKey());
+            item.setNotInIds(temIds);
+        });
     }
 
     public List<Integer> getPatentListIds(PatentVO params) {
@@ -504,6 +468,15 @@ public class PatentService extends ServiceImpl<PatentMapper, Patent> {
         return pageList;
     }
     public IPage<PatentDTO> getPageListForRMS(QueryPatentVO params) {
+        if(params.getObligeeName()!=null) {
+            String obligeeName = params.getObligeeName().replace("(", "\\(");
+            obligeeName = obligeeName.replace(")", "\\)");
+            params.setObligeeName(obligeeName);
+        }
+        if(params.getApplicationName()!=null) {
+        String applicationName =params.getApplicationName().replace("(","\\(");
+        applicationName =applicationName.replace(")","\\)");
+        params.setApplicationName(applicationName);}
         IPage<Patent> dataPage = baseMapper.getPageListForRMS2(new Page<>(params.getCurrent(), params.getSize()),params);
 
         IPage<PatentDTO> pageList = new Page<>();
@@ -665,6 +638,14 @@ public String getConPantentNos(QueryPatentVO params){
     List<String> patents = baseMapper.getConPantentNos(params);
     return Response.success(patents);
 }
+    // 获得带筛选条件的专利
+    public String getConPantents(QueryPatentVO params){
+        if(params.getStartNumber()!=null&&params.getEndNumber()!=null){
+            params.setEndNumber(params.getEndNumber()-params.getStartNumber()+1);
+        }
+        List<Patent> patents = baseMapper.getConPantents(params);
+        return Response.success(patents);
+    }
     public PatentDTO getPatentDTOById(Integer id, Integer projectId) {
         Patent patent = baseMapper.selectById(id);
         PatentDTO patentDTO = new PatentDTO();

+ 114 - 73
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -3,10 +3,7 @@ package cn.cslg.pas.service;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.core.exception.CustomException;
 import cn.cslg.pas.common.model.PersonnelVO;
-import cn.cslg.pas.common.model.dto.ClientDTO;
-import cn.cslg.pas.common.model.dto.EventAddNewDTO;
-import cn.cslg.pas.common.model.dto.ProjectEventAddNewDTO;
-import cn.cslg.pas.common.model.dto.UploadFileDTO;
+import cn.cslg.pas.common.model.dto.*;
 import cn.cslg.pas.common.model.vo.*;
 import cn.cslg.pas.common.utils.*;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
@@ -109,7 +106,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     private final ProjectMapper projectMapper;
     private final IEventService eventService;
     private final IAssoEventProjectService assoEventProjectService;
-
+    private final CopyService copyService;
     public Project getProjectByName(String name) {
         LambdaQueryWrapper<Project> queryWrapper = new LambdaQueryWrapper<>();
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
@@ -140,66 +137,12 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         IPage<Project> pageList = baseMapper.getPageList(new Page<>(params.getCurrent(), params.getSize()), params);
 
         List<Project> dataList = pageList.getRecords();
-        List<Integer> clientIds = dataList.stream().map(Project::getClientId).collect(Collectors.toList());
-
-        try {
-            //获取所属部门对应信息
-            String jsonObject = requestService.getDepartmentFromPCS(dataList);
-            JSONArray jsonArray1 = JSON.parseArray(jsonObject);
-            List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);
-            for (Project project : dataList) {
-                Integer productId = project.getProductId();
-                if (productId != null) {
-                    ProductVO queryResult = productMapper.getStandardById(productId);
-                    String productName = queryResult.getProductName();
-                    project.setProductName(productName);
-                }
-                for (ProjectVO.Department department : departmentList) {
-                    if (project.getDepartmentId() != null) {
-                        if (project.getDepartmentId().equals(department.getId())) {
-                            project.setDepartmentName(department.getDepartmentName());
-                        }
-                    }
-                }
-            }
-
-            //获取专题库负责人对应信息
-            String jsonObject1 = requestService.getPersonnelFromPCS(dataList);
-            JSONArray jsonArray = JSON.parseArray(jsonObject1);
-            List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
-            //获取专题库委托方对应信息
-            List<ClientDTO> clientList = new ArrayList<>();
-            if (clientIds.size() > 0) {
-                String jsonObject2 = requestService.getClientByIds(clientIds);
-                JSONArray jsonArray2 = JSON.parseArray(jsonObject2);
-                clientList = jsonArray2.toJavaList(ClientDTO.class);
-            }
-            for (Project project : dataList) {
-                for (ProjectVO.Personnel personnel : personnelList) {
-                    if (project.getPersonnelId() != null) {
-                        if (project.getPersonnelId().equals(personnel.getId())) {
-                            project.setPersonnelName(personnel.getPersonnelName());
-                        }
-                    }
-                }
-                for (ClientDTO clientDTO : clientList) {
-                    if (project.getClientId() != null) {
-                        if (project.getClientId().equals(clientDTO.getId())) {
-                            project.setClientName(clientDTO.getName());
-                        }
-                    }
-                }
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
         this.setDataList(dataList);
         pageList.setRecords(dataList);
         return pageList;
     }
 
-    public List<Project> getProjectByIds(List<Integer> ids) {
+    public List<Project> getProjectByIds(List<Integer> ids) throws IOException {
         if (ids == null || ids.size() == 0) {
             return new ArrayList<>();
         }
@@ -232,9 +175,9 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
                     }
                 }
             }
-
+        List<Integer> personnelIds =dataList.stream().map(Project::getPersonnelId).collect(Collectors.toList());
             //获取专题库负责人对应信息
-            String jsonObject1 = requestService.getPersonnelFromPCS(dataList);
+            String jsonObject1 = requestService.getPersonnelFromPCS(personnelIds);
             JSONArray jsonArray = JSON.parseArray(jsonObject1);
             List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
             for (Project project : dataList) {
@@ -269,13 +212,78 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
                 project.setClientName(clientList.get(0).getName());
             }
         } catch (Exception e) {
-
         }
 
         return project;
     }
 
-    private void setDataList(List<Project> dataList) {
+    private void setDataList(List<Project> dataList) throws IOException {
+        //获得委托方的id集合
+        List<Integer> clientIds = dataList.stream().map(Project::getClientId).collect(Collectors.toList());
+        //获得负责人的id集合
+        List<Integer> personIds =dataList.stream().map(Project::getPersonnelId).collect(Collectors.toList());
+        //获得创建人的id集合
+        List<Integer> createIds =dataList.stream().map(Project::getCreateBy).collect(Collectors.toList());
+        personIds.addAll(createIds);
+            //获取所属部门对应信息
+            String jsonObject = requestService.getDepartmentFromPCS(dataList);
+            JSONArray jsonArray1 = JSON.parseArray(jsonObject);
+            List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);
+            //获取专题库负责人对应信息
+            String jsonObject1 = requestService.getPersonnelFromPCS(personIds);
+            JSONArray jsonArray = JSON.parseArray(jsonObject1);
+            List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
+            //获取专题库委托方对应信息
+            List<ClientDTO> clientList = new ArrayList<>();
+            if (clientIds.size() > 0) {
+                String jsonObject2 = requestService.getClientByIds(clientIds);
+                JSONArray jsonArray2 = JSON.parseArray(jsonObject2);
+                clientList = jsonArray2.toJavaList(ClientDTO.class);
+            }
+            for (Project project : dataList) {
+                //装载负责人名
+                for (ProjectVO.Personnel personnel : personnelList) {
+                    if (project.getPersonnelId() != null) {
+                        if (project.getPersonnelId().equals(personnel.getId())) {
+                            project.setPersonnelName(personnel.getPersonnelName());
+                        }
+                    }
+                    //装载创建人名
+                    if(project.getCreateBy()!=null){
+                        if (project.getCreateBy().equals(personnel.getId())) {
+                            project.setCreateName(personnel.getPersonnelName());
+                        }
+                    }
+
+                    }
+
+                //装载委托方名
+                for (ClientDTO clientDTO : clientList) {
+                    if (project.getClientId() != null) {
+                        if (project.getClientId().equals(clientDTO.getId())) {
+                            project.setClientName(clientDTO.getName());
+                        }
+                    }
+                }
+                Integer productId = project.getProductId();
+                //装载产品id
+                if (productId != null) {
+                    ProductVO queryResult = productMapper.getStandardById(productId);
+                    String productName = queryResult.getProductName();
+                    project.setProductName(productName);
+                }
+                //装载部门
+                for (ProjectVO.Department department : departmentList) {
+                    if (project.getDepartmentId() != null) {
+                        if (project.getDepartmentId().equals(department.getId())) {
+                            project.setDepartmentName(department.getDepartmentName());
+                        }
+                    }
+                }
+
+            }
+
+
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList(Constants.ENTERPRISE_APPLICATION_SCENARIO, Constants.INVESTIGATION_TYPE));
         dataList.forEach(item -> {
             if (StringUtils.isNotEmpty(item.getScenario())) {
@@ -293,7 +301,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         });
     }
 
-    public List<Project> getAllProjectByMySelf() {
+    public List<Project> getAllProjectByMySelf() throws IOException {
         ProjectVO params = new ProjectVO();
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
         if (personnelVO.getRoleType() == null || personnelVO.getRoleType() != 1) {
@@ -307,13 +315,13 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         return projectList;
     }
 
-    public Map<Object, Object> getProjectStatusTotal() {
+    public Map<Object, Object> getProjectStatusTotal() throws IOException {
         Map<Object, Object> map = new HashMap<>();
         List<Project> projectList = this.getAllProjectByMySelf();
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.ENTERPRISE_APPLICATION_SCENARIO));
         for (SystemDict systemDict : systemDictList) {
             Map<String, Object> result = new HashMap<>();
-            List<Project> tempList = projectList.stream().filter(item ->item.getScenarioList()!=null&& item.getScenarioList().contains(Integer.parseInt(systemDict.getValue()))).collect(Collectors.toList());
+            List<Project> tempList = projectList.stream().filter(item -> item.getScenarioList() != null && item.getScenarioList().contains(Integer.parseInt(systemDict.getValue()))).collect(Collectors.toList());
             result.put("completed", tempList.stream().filter(item -> item.getStatus().equals("1")).count());
             result.put("unfinished", tempList.stream().filter(item -> item.getStatus().equals("0")).count());
             map.put(systemDict.getLabel(), result);
@@ -321,7 +329,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         return map;
     }
 
-    public Map<String, Object> getProjectTypeTotal(String scenario) {
+    public Map<String, Object> getProjectTypeTotal(String scenario) throws IOException {
         Map<String, Object> map = new HashMap<>();
         List<Project> projectList = this.getAllProjectByMySelf();
         projectList = projectList.stream().filter(item -> item.getScenarioName().contains(scenario)).collect(Collectors.toList());
@@ -350,7 +358,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         systemDictList.forEach(systemDict -> {
             switch (systemDict.getType()) {
                 case Constants.ENTERPRISE_APPLICATION_SCENARIO:
-                    scenario.put(systemDict.getLabel(), projectList.stream().filter(item ->item.getScenarioList()!=null && item.getScenarioList().contains(Integer.parseInt(systemDict.getValue()))).count());
+                    scenario.put(systemDict.getLabel(), projectList.stream().filter(item -> item.getScenarioList() != null && item.getScenarioList().contains(Integer.parseInt(systemDict.getValue()))).count());
                     break;
                 case Constants.INVESTIGATION_TYPE:
                     type.put(systemDict.getLabel(), projectList.stream().filter(item -> item.getTypeList().contains(Integer.parseInt(systemDict.getValue()))).count());
@@ -434,14 +442,14 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     }
 
     @Transactional
-    public String add(Project project) throws IOException {
+    public Integer add(Project project) throws IOException {
         PersonnelVO user = cacheUtils.getLoginUserPersonnel(loginUtils.getId());
         //检查专题库名称是否被占用
         Project temp = this.getProjectByName(project.getName());
         if (temp != null) {
             ThrowException.throwXiaoShiException("专题库名称已存在");
         }
-        if (project.getClientId() == null || project.getClientId() == -1) {
+        if ((project.getClientId() == null || project.getClientId() == -1)&&project.getClientName()!=null&&project.getClientName()!="") {
             ClientDTO clientDTO = new ClientDTO();
             clientDTO.setName(project.getClientName());
             clientDTO.setTenantId(user.getTenantId());
@@ -470,7 +478,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         }
 
         log.info("新增专题库完成");
-        return Response.success(project.getId());
+        return project.getId();
     }
 
     @Transactional
@@ -481,7 +489,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         ProjectStandardVO queryResult = projectMapper.getStandardById(projectId);
         Integer oldProductId = queryResult.getProductId();
         //若当前产品id和原产品id不一致,则表示当前的修改要修改产品
-        if (!newProductId.equals(oldProductId)) {
+        if (newProductId!=null&&!newProductId.equals(oldProductId)) {
             //检查当前专题库产品架构是否已标引,若已标引则不允许修改产品
             int count = assoStructurePatentMapper.countByProjectId(projectId);
             if (count > 0) {
@@ -964,4 +972,37 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
             e.printStackTrace();
         }
     }
+
+    /**
+     * @param projectCopyDTO
+     * @return
+     * @throws IOException
+     * @deprecated 复制专题库
+     */
+    @Transactional
+    public Integer copy(ProjectCopyDTO projectCopyDTO) throws IOException {
+        Integer oldId = projectCopyDTO.getId();
+        //复制专题库基本信息
+        Project project = this.getById(oldId);
+        project.setTenantId(projectCopyDTO.getTenantId());
+        project.setId(null);
+        project.insert();
+        //复制专题库专利
+        LambdaQueryWrapper<ProjectPatentLink> patentLinkWrapper = new LambdaQueryWrapper<>();
+        patentLinkWrapper.eq(ProjectPatentLink::getProjectId, oldId);
+        List<ProjectPatentLink> projectPatentLinkList = projectPatentLinkService.list(patentLinkWrapper);
+        projectPatentLinkList.forEach(
+                item -> {
+                    item.setProjectId(project.getId());
+                    item.setId(null);
+                }
+        );
+        projectPatentLinkService.saveBatch(projectPatentLinkList);
+        //复制专题库标引信息
+        copyService.CopyPatentLabels(oldId,project.getId());
+        //复制专题库文件夹
+        copyService.CopyProjectFolder(oldId,project.getId());
+        return project.getId();
+    }
+
 }

+ 2 - 2
PAS/src/main/java/cn/cslg/pas/service/RequestService.java

@@ -40,9 +40,9 @@ public class RequestService {
     }
 
     //从权限系统获取专题库负责人对应信息
-    public String getPersonnelFromPCS(List<Project> dataList) throws IOException {
+    public String getPersonnelFromPCS(List<Integer> personnelIds) throws IOException {
         Map<String, Object> map1 = new HashMap<>();
-        map1.put("personnelId", dataList.stream().map(Project::getPersonnelId).collect(Collectors.toList()));
+        map1.put("personnelId", personnelIds);
         return apiUtils.invokeApi(new JSONObject(map1), "/permission/api/system/getPersonnelById", "post", "data");
     }
 

+ 1 - 3
PAS/src/main/resources/application-prodNetIn.yml

@@ -23,6 +23,4 @@ spring:
         login-password: Cslg2022+
       web-stat-filter:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-springdoc:
-  api-docs:
-    enabled: false
+authorUrl: http://localhost:8871

+ 1 - 4
PAS/src/main/resources/application-prodNetOut.yml

@@ -1,6 +1,6 @@
 spring:
   redis:
-    host: 192.168.1.24
+    host: 47.101.137.223
     port: 6379
     database: 3
     password: Xx0GWxdWQJxx6Swe
@@ -23,7 +23,4 @@ spring:
         login-password: Cslg2022+
       web-stat-filter:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-springdoc:
-  api-docs:
-    enabled: false
 authorUrl: http://localhost:8871

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

@@ -23,4 +23,4 @@ spring:
         login-password: 123456
       web-stat-filter:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-authorUrl: http://localhost:8880
+authorUrl: http://localhost:8871

+ 183 - 107
PAS/src/main/resources/mapper/PatentMapper.xml

@@ -111,54 +111,9 @@
         <if test="params.queryClassNumberLoc == true">
             left join os_patent_typeno q4 on q4.pid = a.id
         </if>
-        <if test="params.queryFieldMultiple == true">
-            left join os_patent_field_patent_link a2 on a2.pid = a.id and a2.cid IN
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            left join os_patent_field_multiple b2 on b2.cid in
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            and a2.fid = b2.id
-        </if>
-        <if test="params.queryFieldText == true">
-            left join os_patent_field_patent_link a3 on a3.pid = a.id and a3.cid IN
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            left join os_patent_field_text b1 on b1.cid in
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            and a3.fid = b1.id
-        </if>
-        <if test="params.queryTreeType0 == true">
-            left join os_patent_field_patent_link a4 on a4.pid = a.id and a4.cid IN
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            left join os_patent_field_tree b3 on b3.cid in
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            and a4.fid = b3.id
-        </if>
-        <if test="params.queryTreeType1 == true">
-            left join os_patent_field_patent_link a1 on a1.pid = a.id and a1.cid IN
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            left join os_patent_field_tree b4 on b4.cid in
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            and (a1.fid = b4.id or (a1.fid in (select id from os_patent_field_tree where cid in
-            <foreach collection="params.customIds" item="item" separator="," open="(" close=")">
-                #{item}
-            </foreach>
-            and find_in_set(b4.id , replace(path , '/', ',')))))
-            and a1.fid = b4.id
+        <if test="params.selfField !=null and params.selfField.size()>0">
+            left join os_patent_field_patent_link a2 on a2.pid = a.id
+
         </if>
         <where>
             <if test="params.read == 'read'">
@@ -416,70 +371,29 @@
                     #{item}
                 </foreach>
             </if>
-            <if test="params.whereFieldMultiple != null">
-                and(
-                <foreach collection="params.mField" item="item" separator="or" open="(" close=")">
-                    (a2.cid =#{item.key}
-                    and
-                    a2.fid in
-                    <foreach collection="item.value" item="item2" separator="," open="(" close=")">
-                        #{item2}
-                    </foreach>
-                    <if test="params.whereFieldMultipleNull == true">
-                        or a2.id is null
-                    </if>
-                    )
-                </foreach>
-                )
-            </if>
-            <if test="params.whereFieldText != null">
-                and(
-                <foreach collection="params.textField" item="item" separator="or" open="(" close=")">
-                    (a3.cid
-                    =#{item.key} and(
-                    a3.fid in
-                    <foreach collection="item.value" item="item2" separator="," open="(" close=")">
-                        #{item2}
-                    </foreach>
-                    <if test="params.whereFieldTextNull == true">
-                        or a3.id is null
-                    </if>
-                        )
-                    )
-                </foreach>
-                )
-            </if>
-            <if test="params.whereTreeType0 != null">
-                and(
-                <foreach collection="params.tree0Field" item="item" separator="or" open="(" close=")">
-                    (a4.cid
-                    =#{item.key} and
-                    a4.fid in
-                    <foreach collection="item.value" item="item2" separator="," open="(" close=")">
-                        #{item2}
-                    </foreach>
-                    )
-                </foreach>
-                )
-            </if>
-            <if test="params.whereTreeType1 != null">
-                and(
-                <foreach collection="params.tree1Field" item="item" separator="or" open="(" close=")">
-                    (a1.cid
-                    =#{item.key} and
-                    a1.fid in
-                    <foreach collection="item.value" item="item2" separator="," open="(" close=")">
-                        #{item2}
-                    </foreach>
+            <if test="params.selfField != null and params.selfField.size()>0">
+            and
+                <foreach collection="params.selfField" item="item" separator=" and " open="(" close=")">
+                    a.id in (
+                    select distinct a3.id from os_patent a3 left join os_patent_field_patent_link a4
+                     on a4.pid = a3.id
+                    and a4.cid=#{item.key}
+                    <where>
+                        a4.fid in
+                        <foreach collection="item.value" item="item2" separator="," open="(" close=")">
+                            #{item2}
+                        </foreach>
+                        <if test="item.isnull==true">
+                            or a4.id is null
+                        </if>
+                    </where>
                     )
                 </foreach>
-                )
+
             </if>
+
         </where>
         group by a.id
-        <if test="params.sizeCount >0">
-            having count(*) >#{params.sizeCount}
-        </if>
         order by
         <if test="params.sort.prop == 'id'">a.id</if>
         <if test="params.sort.prop == 'name'">a.name</if>
@@ -1748,7 +1662,168 @@
                     <if test="params.startNumber!=null and params.endNumber!=null">
                         limit #{params.startNumber} , #{params.endNumber}
                     </if>
+                </when>
+
+                <otherwise>
+                    1!=1
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+
+    <select id="getConPantents" parameterType="cn.cslg.pas.common.model.QueryPatentVO" resultType="cn.cslg.pas.domain.Patent">
+        select DISTINCT a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path,
+        a.abstract as
+        abstract_str, a.abstractout as abstract_out,
+        a.publicno as public_no, a.publicdate as public_date, a.simple_family, a.inpadoc_family, a.applicationno as
+        application_no, a.appdate as application_date,
+        a.`status` as simple_status, a.type, a.publictodate as public_accredit_date, a.fpublicdate as first_public_date,
+        a.prioritydate as priority_date,
+        a.agencyid as agency_id, a.num2 as right_num, a.quoteno as quote_num, a.quotedno as quoted_num,
+        a.patsnap_family as patSnapFamily, a.patsnapfamilynum as patSnapFamilyNum
+        from os_patent a
+        <if test="params.applicationName !=null ">
+            left join os_applicant_attr b on a.id=b.pid and b.type =1
+            left join os_patent_applicant c on c.id=b.applicantid
+        </if>
+        <if test=" params.obligeeName !=null">
+            left join os_applicant_attr d on a.id=d.pid and d.type =2
+            left join os_patent_applicant e on e.id=d.applicantid
+        </if>
+        <if test="params.numberIpc!=null ">
+            left join os_patent_typeno f on f.pid =a.id and f.type =1
+        </if>
+        <if test=" params.numberCpc!=null ">
+            left join os_patent_typeno g on g.pid =a.id and g.type =2
+        </if>
+        <if test=" params.numberUpc!=null">
+            left join os_patent_typeno h on h.pid =a.id and h.type =3
+        </if>
+        <if test="params.projectId != null and params.pasOptions !=null and params.pasOptions.size()!=0">
+            left join os_thematic_pid i on i.pid=a.id left join os_patent_field_patent_link j on a.id=j.pid
+        </if>
+        <where>
+            <choose>
+                <when test="params.projectId != null or (params.patentNos != null and params.patentNos.size()!=0) or (params.importTaskId != null and params.importTaskId.size()!=0)">
+                    <if test="params.projectId != null">
+                        and ( a.id in (select pid from os_thematic_pid where zid = #{params.projectId})
+                        <if test="params.patentNos != null and params.patentNos.size()!=0">
+                            or patentno in
+                            <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                     close=")">
+                                #{item}
+                            </foreach>
+                        </if>
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+                    </if>
+                    <if test="params.projectId == null and params.patentNos != null and params.patentNos.size()!=0">
+                        (patentno in
+                        <foreach item="item" collection="params.patentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                        <if test="params.importTaskId != null and params.importTaskId.size()!=0">
+                            or patentno in
+                            ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                            <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                     close=") ">
+                                #{item}
+                            </foreach>
+                            )
+                        </if>
+                        )
+                    </if>
+                    <if test="params.projectId == null and (params.patentNos == null or params.patentNos.size()==0) and params.importTaskId != null and params.importTaskId.size()!=0">
+                        patentno in
+                        ( select PATENT_NO from ASSO_IMPORTTASK_PATENT where IMPORTTASK_ID in
+                        <foreach item="item" collection="params.importTaskId" index="index" open="(" separator=","
+                                 close=") ">
+                            #{item}
+                        </foreach>
+                        )
+                    </if>
+                    <if test="params.notInPatentNos != null and params.notInPatentNos.size!=0">
+                        and patentno not in
+                        <foreach item="item" collection="params.notInPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="params.conPatentNos != null and params.conPatentNos.size!=0">
+                        and patentno in
+                        <foreach item="item" collection="params.conPatentNos" index="index" open="(" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
+
+                    <if test="params.applicationName !=null and params.applicationName !=''  ">
+                        and c.name REGEXP #{params.applicationName}
+                    </if>
+                    <if test="params.obligeeName !=null and params.obligeeName!=''">
+                        and e.name REGEXP #{params.obligeeName}
+                    </if>
+                    <if test="params.numberIpc !=null and params.numberIpc!=''">
+                        and f.code like concat("%", #{params.numberIpc}, "%")
+                    </if>
+                    <if test="params.numberCpc !=null and params.numberCpc!=''">
+                        and g.code like concat("%", #{params.numberCpc}, "%")
+                    </if>
+                    <if test="params.numberUpc !=null and params.numberUpc!=''">
+                        and h.code like concat("%", #{params.numberUpc}, "%")
+                    </if>
+                    <if test="params.patentNo !=null and params.patentNo !=''">
+                        and a.patentNo REGEXP #{params.patentNo}
+                    </if>
+                    <if test="params.applicationNo !=null and params.applicationNo !=''">
+                        and a.applicationNo like concat("%", #{params.applicationNo}, "%")
+                    </if>
+                    <if test="params.abstractStr !=null and params.abstractStr !=''">
+                        and a.abstract like concat("%", #{params.abstractStr}, "%")
+                    </if>
+                    <if test="params.patentName !=null and params.patentName !=''">
+                        and a.`name` like concat("%", #{params.patentName}, "%")
+                    </if>
+                    <if test="params.PasOptions !=null and params.PasOptions.size()!=0">
+                        and (
+                        <foreach item="item" collection="params.PasOptions" index="index" open="(" separator="or"
+                                 close=")">
+                            <if test="item.key !=null">
+                                (j.cid=#{item.fieldId} and j.fid =#{item.key})
+                            </if>
+                            <if test="item.key ==null">
+                                (j.cid is null or j.cid !=#{item.fieldId})
+                            </if>
+                        </foreach>
+                        )
+                    </if>
 
+
+                    <if test="params.orderItem!=null and params.orderItem!='SysOrder'">
+                        order by #{params.orderItem}
+                        <if test="params.orderType!=null">
+                            #{params.orderType}
+                        </if>
+                    </if>
+                    <if test="params.orderItem==null">
+                        order by a.patentno
+                    </if>
+                    <if test="params.orderItem=='SysOrder' and params.patentNos != null and params.patentNos.size()!=0">
+                        order by field (a.patentno,
+                        <foreach item="item" collection="params.patentNos" index="index" open="" separator=","
+                                 close=")">
+                            #{item}
+                        </foreach>
+                    </if>
                     <if test="params.startNumber!=null and params.endNumber!=null">
                         limit #{params.startNumber} , #{params.endNumber}
                     </if>
@@ -1760,6 +1835,7 @@
             </choose>
         </where>
     </select>
+
     <select id="getPatent" parameterType="java.util.List" resultType="cn.cslg.pas.domain.Patent">
         select a.id, a.`name` as name, a.nameout as name_out, a.patentno as patent_no, a.abstract_path, a.abstract as
         abstract_str, a.abstractout as abstract_out,

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

@@ -24,27 +24,17 @@
     <update id="updateById">
         update product
         <set>
-            <if test="productName != null">
+
                 product_name = #{productName},
-            </if>
-            <if test="marketTime != null">
                 market_time = #{marketTime},
-            </if>
-            <if test="companyName != null">
                 company_name = #{companyName},
-            </if>
             <if test="tenantId != null">
                 tenant_id = #{tenantId},
             </if>
-            <if test="productExplain != null">
                 product_explain = #{productExplain},
-            </if>
-            <if test="productCategoryId != null">
                 product_category_id = #{productCategoryId},
-            </if>
-            <if test="licenseRate != null">
                 license_rate = #{licenseRate},
-            </if>
+
         </set>
         where id = #{id}
     </update>

+ 1 - 10
PAS/src/main/resources/mapper/ProductMarketDataMapper.xml

@@ -27,21 +27,12 @@
             <if test="productId != null">
                 product_id = #{productId},
             </if>
-            <if test="saleTime != null">
                 sale_time = #{saleTime},
-            </if>
-            <if test="saleArea != null">
                 sale_area = #{saleArea},
-            </if>
-            <if test="saleCount != null">
                 sale_count = #{saleCount},
-            </if>
-            <if test="saleMoney != null">
                 sale_money = #{saleMoney},
-            </if>
-            <if test="customLicenseRate != null">
                 custom_license_rate = #{customLicenseRate},
-            </if>
+
         </set>
         where id = #{id}
     </update>

+ 2 - 2
PAS/src/main/resources/mapper/ProjectMapper.xml

@@ -51,7 +51,7 @@
             <if test="params.PersonnelId!=null">
                 and a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
                 <if test="params.tenantId!=null">
-                    and a.tenantId = #{params.tenantId}
+                    or a.tenantId = #{params.tenantId}
                 </if>
             </if>
         </where>
@@ -71,7 +71,7 @@
             <if test="params.PersonnelId!=null">
                 and a.id in (select tid from os_distribution_doing where uid=#{params.PersonnelId} )
                 <if test="params.tenantId!=null">
-                    and a.tenantId = #{params.tenantId}
+                    or a.tenantId = #{params.tenantId}
                 </if>
             </if>
         </where>