Ver código fonte

Merge remote-tracking branch 'origin/dev2' into dev2

lwhhszx 2 anos atrás
pai
commit
a954291b61

+ 4 - 2
PAS/src/main/java/cn/cslg/pas/common/model/dto/ProductQueryPageDTO.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.common.model.dto;
 
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 /**
@@ -9,6 +10,7 @@ import lombok.experimental.Accessors;
  * @Author chenyu
  * @Date 2023/3/8
  */
+@EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @Data
 public class ProductQueryPageDTO extends PageDTO2 {
@@ -37,8 +39,8 @@ public class ProductQueryPageDTO extends PageDTO2 {
      */
     private String groupBy;
     /**
-     * 租户id
+     * 产品创建人所属租户id
      */
-    private Integer tenantId;
+    private Integer createPersonTenantId;
 
 }

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/common/model/vo/ProjectVO.java

@@ -33,6 +33,10 @@ public class ProjectVO extends BaseVO {
    登录人租户Id
     */
     private Integer tenantId;
+    /**
+     * 事件id
+     */
+    private Integer eventId;
 
     @Data
     public static class Sort {

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

@@ -149,7 +149,7 @@ public class ProjectController {
     @PostMapping("copy")
     @Operation(summary = "复制专题库")
     public String copy(@RequestBody ProjectCopyDTO projectCopyDTO) throws IOException {
-          Integer  projectId = projectService.copy(projectCopyDTO);
+        Integer projectId = projectService.copy(projectCopyDTO);
         return Response.success(projectId);
     }
 }

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/domain/PermissionRecord.java

@@ -56,6 +56,10 @@ public class PermissionRecord implements Serializable {
      */
     private Integer licenseType;
     /**
+     * 租户id
+     */
+    private Integer tenantId;
+    /**
      * 创建人id
      */
     private Integer createPersonId;

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/domain/Product.java

@@ -39,6 +39,10 @@ public class Product implements Serializable {
      */
     private Integer tenantId;
     /**
+     * 产品创建人所属租户id
+     */
+    private Integer createPersonTenantId;
+    /**
      * 产品说明
      */
     private String productExplain;

+ 2 - 1
PAS/src/main/java/cn/cslg/pas/mapper/PermissionRecordMapper.java

@@ -43,9 +43,10 @@ public interface PermissionRecordMapper {
      * 根据专利号patentNo分页查询许可记录表数据
      *
      * @param patentNo 专利号
+     * @param tenantId 租户id
      * @return 返回查询到的数据
      */
-    List<PermissionRecordVO> queryAllInfo(String patentNo);
+    List<PermissionRecordVO> queryAllInfo(String patentNo, Integer tenantId);
 
 
     /**

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/mapper/ProjectMapper.java

@@ -22,7 +22,7 @@ import java.util.List;
 @Repository
 public interface ProjectMapper extends BaseMapper<Project> {
 
-    IPage<Project> getPageList(Page<Project> page, ProjectVO params);
+    IPage<Project>  getPageList(Page<Project> page, ProjectVO params);
 
     List<Project> getListForCount(@Param("params") ProjectVO params);
 

+ 176 - 80
PAS/src/main/java/cn/cslg/pas/service/PatentRightService.java

@@ -431,19 +431,15 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
     }
 
     public void updatePatentRight(PatentRightParams params) {
-//        List<PatentRight> patentRightList = new ArrayList<>();
 //        获取国家 公开号前两位
-//        String country = PatentUtils.getPatentCountry(params.getPatentNo());
-//        String code;
-
+        String country = PatentUtils.getPatentCountry(params.getPatentNo());
         //权利要求原文
         String content = params.getContent();
         //权利要求译文
         String contentOut = params.getContentOut();
-        //独立权利要求
-        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;
@@ -490,9 +486,8 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
 //                        patentRight.setType(1);
 //                    }
 //                }
-//                patentRightList.add(patentRight);
             ArrayList<PatentRight> patentRights = new ArrayList<>();
-            //先去掉所有换行符,使原文连起来
+            //先去掉所有换行符,使所有内容连起来
             if (content.contains("\r\n")) {
                 content = content.replaceAll("\r\n", "");
             } else {
@@ -506,101 +501,202 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
             } else {
                 contentOut = contentOut.replaceAll("\n", "");
             }
-
-            //根据专利所属国家,定义序号规则
-            String regex;
-            if (content.contains("1.")) {
-                regex = "[0-9]+[.]";
-            } else if (content.contains("1、")) {
-                regex = "[0-9]+[、]";
-            } else if (content.contains("[001]")) {
-                regex = "\\[[0-9]+]";
-            } else {
-                regex = "";
-            }
-            Pattern compile = Pattern.compile(regex);
-            Matcher matcher = compile.matcher(content);
-            Matcher matcherOut = compile.matcher(contentOut);
-            while (matcher.find()) {
-                if (!matcher.group().equals("1.") && !matcher.group().equals("1、") && !matcher.group().equals("[001]")) {
-                    content = content.replaceFirst(matcher.group(), "\n" + matcher.group());
+            //去掉译文的所有空格
+            contentOut = contentOut.replaceAll(" +", "");
+
+            //中文专利的权要拆分 ↓
+            if (country.equals("CN") || country.equals("JP")) {
+                String regex;
+                if (content.contains("1.")) {
+                    regex = "。[0-9]+\\.";
+                } else if (content.contains("1、")) {
+                    regex = "。[0-9]+[、]";
+                } else if (content.contains("[001]")) {
+                    regex = "\\[[0-9]+]";
+                } else {
+                    regex = "";
                 }
-            }
-            String[] strs = content.split("\n");
-            while (matcherOut.find()) {
-                if (!matcherOut.group().equals("1.") && !matcherOut.group().equals("1、") && !matcherOut.group().equals("[001]")) {
-                    contentOut = contentOut.replaceFirst(matcherOut.group(), "\n" + matcherOut.group());
+                Matcher matcher = Pattern.compile(regex).matcher(content);
+                Matcher matcherOut = Pattern.compile(regex).matcher(contentOut);
+                while (matcher.find()) {
+                    if (matcher.group().contains(".")) {
+                        String matcherGroup = matcher.group().replace(".", "\\.");
+                        content = content.replaceFirst(matcherGroup, "。\n" + matcherGroup.substring(matcherGroup.indexOf("。") + 1, matcherGroup.indexOf("\\")) + ".");
+                    } else if (matcher.group().contains("、")) {
+                        content = content.replaceFirst(matcher.group(), "。\n" + matcher.group().substring(matcher.group().indexOf("。") + 1));
+                    }
                 }
-            }
-            String[] strsOut = contentOut.split("\n");
-            //定义父权要排序号
-            String regex1 = "权利要求[0-9]+";
-            String regex2 = "权利要求[0-9]+[至或~-]+[0-9]+";
-            for (int i = 0; i < strs.length; i++) {
-                if (strs[i].contains("权利要求")) {
-                    Pattern compile1 = Pattern.compile(regex1);
-                    Matcher matcher1 = compile1.matcher(strs[i]);
-                    Pattern compile2 = Pattern.compile(regex2);
-                    Matcher matcher2 = compile2.matcher(strs[i]);
-                    if (matcher2.find()) {
-                        String parentNum = matcher2.group().substring(matcher2.group().indexOf("求") + 1);
-                        String[] parentNums;
-                        if (parentNum.contains("~")) {
-                            parentNums = parentNum.split("~");
-                        } else if (parentNum.contains("-")) {
-                            parentNums = parentNum.split("-");
-                        } else if (parentNum.contains("至")) {
-                            parentNums = parentNum.split("至");
-                        } else if (parentNum.contains("或")) {
-                            parentNums = parentNum.split("或");
-                        } else {
-                            parentNums = new String[0];
-                        }
-                        StringBuilder builder = new StringBuilder();
-                        for (int j = Integer.parseInt(parentNums[0]) - 1; j < Integer.parseInt(parentNums[parentNums.length - 1]); j++) {
-                            if ((builder + "").equals("")) {
-                                builder.append(j);
+                String[] strs = content.split("\n");
+                while (matcherOut.find()) {
+                    if (matcherOut.group().contains(".")) {
+                        String matcherOutGroup = matcherOut.group().replace(".", "\\.");
+                        contentOut = contentOut.replaceFirst(matcherOutGroup, "。\n" + matcherOutGroup.substring(matcherOutGroup.indexOf("。") + 1, matcherOutGroup.indexOf("\\")) + ".");
+                    } else if (matcherOut.group().contains("、")) {
+                        contentOut = contentOut.replaceFirst(matcherOut.group(), "。\n" + matcherOut.group().substring(matcherOut.group().indexOf("。") + 1));
+                    }
+                }
+                String[] strsOut = contentOut.split("\n");
+                //定义父权要排序号
+                String regex1 = "权利要求[0-9]+";
+                String regex2 = "权利要求[0-9]+[至或~-]+[0-9]+";
+                for (int i = 0; i < strs.length; i++) {
+                    if (strs[i].contains("权利要求")) {
+                        Matcher matcher1 = Pattern.compile(regex1).matcher(strs[i]);
+                        Matcher matcher2 = Pattern.compile(regex2).matcher(strs[i]);
+                        if (matcher2.find()) {
+                            String parentNum = matcher2.group().substring(matcher2.group().indexOf("求") + 1);
+                            String[] parentNums;
+                            if (parentNum.contains("~")) {
+                                parentNums = parentNum.split("~");
+                            } else if (parentNum.contains("-")) {
+                                parentNums = parentNum.split("-");
+                            } else if (parentNum.contains("至")) {
+                                parentNums = parentNum.split("至");
+                            } else if (parentNum.contains("或")) {
+                                parentNums = parentNum.split("或");
                             } else {
-                                builder.append(",").append(j);
+                                parentNums = new String[0];
+                            }
+                            StringBuilder builder = new StringBuilder();
+                            for (int j = Integer.parseInt(parentNums[0]) - 1; j < Integer.parseInt(parentNums[parentNums.length - 1]); j++) {
+                                if ((builder + "").equals("")) {
+                                    builder.append(j);
+                                } else {
+                                    builder.append(",").append(j);
+                                }
+                            }
+                            PatentRight patentRight = new PatentRight()
+                                    .setPatentId(params.getPatentId())
+                                    .setType(1)
+                                    .setContent(strs[i])
+                                    .setSort(i)
+                                    .setParentSort(builder + "");
+                            if (strsOut.length - 1 >= i) {
+                                patentRight.setContentOut(strsOut[i]);
+                            }
+                            patentRights.add(patentRight);
+                        } else if (matcher1.find()) {
+                            String parentNum = matcher1.group().substring(matcher1.group().indexOf("求") + 1);
+                            PatentRight patentRight = new PatentRight()
+                                    .setPatentId(params.getPatentId())
+                                    .setType(1)
+                                    .setContent(strs[i])
+                                    .setSort(i)
+                                    .setParentSort((Integer.parseInt(parentNum) - 1) + "");
+                            if (strsOut.length - 1 >= i) {
+                                patentRight.setContentOut(strsOut[i]);
                             }
+                            patentRights.add(patentRight);
                         }
+
+                    } else {
                         PatentRight patentRight = new PatentRight()
                                 .setPatentId(params.getPatentId())
-                                .setType(1)
+                                .setType(0)
                                 .setContent(strs[i])
                                 .setSort(i)
-                                .setParentSort(builder + "");
+                                .setParentSort("-1");
                         if (strsOut.length - 1 >= i) {
                             patentRight.setContentOut(strsOut[i]);
                         }
                         patentRights.add(patentRight);
-                    } else if (matcher1.find()) {
-                        String parentNum = matcher1.group().substring(matcher1.group().indexOf("求") + 1);
+                    }
+                }
+
+                //英文专利的权要拆分 ↓
+            } else {
+                content = content.substring(content.indexOf("1."));
+                contentOut = contentOut.substring(contentOut.indexOf("1."));
+                String regex;
+                if (content.contains("1.")) {
+                    regex = "\\.[0-9]+\\. ";
+                } else if (content.contains("1、")) {
+                    regex = "\\.[0-9]+\\. ";
+                } else if (content.contains("[001]")) {
+                    regex = "\\[[0-9]+]";
+                } else {
+                    regex = "";
+                }
+                Matcher matcher = Pattern.compile(regex).matcher(content);
+                Matcher matcherOut = Pattern.compile("。[0-9]+\\.").matcher(contentOut);
+                while (matcher.find()) {
+                    String matcherGroup = matcher.group().replace(".", "\\.");
+                    content = content.replaceFirst(matcherGroup, ".\n" + matcherGroup.substring(matcherGroup.indexOf(".") + 1, matcherGroup.lastIndexOf("\\")) + ". ");
+                }
+                String[] strs = content.split("\n");
+                while (matcherOut.find()) {
+                    String matcherOutGroup = matcherOut.group().replace(".", "\\.");
+                    contentOut = contentOut.replaceFirst(matcherOutGroup, "。\n" + matcherOutGroup.substring(matcherOutGroup.indexOf("。") + 1, matcherOutGroup.indexOf("\\")) + ".");
+                }
+                String[] strsOut = contentOut.split("\n");
+                //定义父权要排序号
+                String regex1 = "claim [0-9]+";
+                String regex2 = "claims [0-9]+ or [0-9]+";
+                for (int i = 0; i < strs.length; i++) {
+                    if (strs[i].contains("claim")) {
+                        Matcher matcher1 = Pattern.compile(regex1).matcher(strs[i]);
+                        Matcher matcher2 = Pattern.compile(regex2).matcher(strs[i]);
+                        if (matcher2.find()) {
+                            String parentNum = matcher2.group().substring(matcher2.group().indexOf("s") + 2);
+                            String[] parentNums;
+                            if (parentNum.contains(" or ")) {
+                                parentNums = parentNum.split(" or ");
+                            } else if (parentNum.contains(" - ")) {
+                                parentNums = parentNum.split(" - ");
+                            } else if (parentNum.contains(" to ")) {
+                                parentNums = parentNum.split(" to ");
+                            } else if (parentNum.contains("或")) {
+                                parentNums = parentNum.split("或");
+                            } else {
+                                parentNums = new String[0];
+                            }
+                            StringBuilder builder = new StringBuilder();
+                            for (int j = Integer.parseInt(parentNums[0]) - 1; j < Integer.parseInt(parentNums[parentNums.length - 1]); j++) {
+                                if ((builder + "").equals("")) {
+                                    builder.append(j);
+                                } else {
+                                    builder.append(",").append(j);
+                                }
+                            }
+                            PatentRight patentRight = new PatentRight()
+                                    .setPatentId(params.getPatentId())
+                                    .setType(1)
+                                    .setContent(strs[i])
+                                    .setSort(i)
+                                    .setParentSort(builder + "");
+                            if (strsOut.length - 1 >= i) {
+                                patentRight.setContentOut(strsOut[i]);
+                            }
+                            patentRights.add(patentRight);
+                        } else if (matcher1.find()) {
+                            String parentNum = matcher1.group().substring(matcher1.group().indexOf("m") + 2);
+                            PatentRight patentRight = new PatentRight()
+                                    .setPatentId(params.getPatentId())
+                                    .setType(1)
+                                    .setContent(strs[i])
+                                    .setSort(i)
+                                    .setParentSort((Integer.parseInt(parentNum) - 1) + "");
+                            if (strsOut.length - 1 >= i) {
+                                patentRight.setContentOut(strsOut[i]);
+                            }
+                            patentRights.add(patentRight);
+                        }
+
+                    } else {
                         PatentRight patentRight = new PatentRight()
                                 .setPatentId(params.getPatentId())
-                                .setType(1)
+                                .setType(0)
                                 .setContent(strs[i])
                                 .setSort(i)
-                                .setParentSort((Integer.parseInt(parentNum) - 1) + "");
+                                .setParentSort("-1");
                         if (strsOut.length - 1 >= i) {
                             patentRight.setContentOut(strsOut[i]);
                         }
                         patentRights.add(patentRight);
                     }
-
-                } else {
-                    PatentRight patentRight = new PatentRight()
-                            .setPatentId(params.getPatentId())
-                            .setType(0)
-                            .setContent(strs[i])
-                            .setSort(i)
-                            .setParentSort("-1");
-                    if (strsOut.length - 1 >= i) {
-                        patentRight.setContentOut(strsOut[i]);
-                    }
-                    patentRights.add(patentRight);
                 }
             }
+
             this.saveOrUpdateBatch(patentRights);
         }
     }

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

@@ -326,7 +326,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     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());
+        projectList = projectList.stream().filter(item -> item.getScenarioName() != null &&item.getScenarioName().contains(scenario)).collect(Collectors.toList());
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.INVESTIGATION_TYPE));
         for (SystemDict systemDict : systemDictList) {
             map.put(systemDict.getLabel(), projectList.stream().filter(item -> item.getTypeList().contains(Integer.parseInt(systemDict.getValue()))).count());

+ 7 - 2
PAS/src/main/java/cn/cslg/pas/service/impl/PermissionRecordServiceImpl.java

@@ -51,6 +51,7 @@ public class PermissionRecordServiceImpl implements IPermissionRecordService {
         //给实体类赋值登陆人id和姓名
         permissionRecord.setCreatePersonId(personnelVO.getId());
         permissionRecord.setCreatePersonName(personnelVO.getName());
+        permissionRecord.setTenantId(personnelVO.getTenantId());
         //数据入表
         log.info("数据入表");
         int rows = permissionRecordMapper.add(permissionRecord);
@@ -92,7 +93,9 @@ public class PermissionRecordServiceImpl implements IPermissionRecordService {
      */
     @Override
     public List<PermissionRecordVO> queryAllInfo(String patentNo) {
-        return permissionRecordMapper.queryAllInfo(patentNo);
+        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        Integer tenantId = personnelVO.getTenantId();
+        return permissionRecordMapper.queryAllInfo(patentNo, tenantId);
     }
 
     /**
@@ -100,8 +103,10 @@ public class PermissionRecordServiceImpl implements IPermissionRecordService {
      */
     @Override
     public List<PermissionRecordVO> findAllByPage(QueryPREntity queryPREntity) {
+        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        Integer tenantId = personnelVO.getTenantId();
         PageHelper.startPage(queryPREntity.getCurrent(), queryPREntity.getSize());
-        List<PermissionRecordVO> lists = permissionRecordMapper.queryAllInfo(queryPREntity.getPatentNo());
+        List<PermissionRecordVO> lists = permissionRecordMapper.queryAllInfo(queryPREntity.getPatentNo(), tenantId);
         return lists;
     }
 

+ 17 - 11
PAS/src/main/java/cn/cslg/pas/service/impl/ProductServiceImpl.java

@@ -97,7 +97,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
         product
                 .setCreatePersonId(personnelVO.getId())
-                .setCreatePersonName(personnelVO.getName());
+                .setCreatePersonName(personnelVO.getName())
+                .setCreatePersonTenantId(personnelVO.getTenantId());
         //数据入产品表
         log.info("数据入产品表");
         int rows = productMapper.insert(product);
@@ -227,7 +228,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         log.info("开始处理【查询产品】的业务,参数为:{}", productQueryPageDTO);
 
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
-        productQueryPageDTO.setTenantId(personnelVO.getTenantId());
+        productQueryPageDTO.setCreatePersonTenantId(personnelVO.getTenantId());
 
         Integer current = productQueryPageDTO.getCurrent();
         Integer size = productQueryPageDTO.getSize();
@@ -318,16 +319,21 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         wrapper.eq(Structure::getProductId, id);
         ArrayList<Integer> structureIds = new ArrayList<>();
         List<Structure> structures = structureService.list(wrapper);
-        for (Structure structure : structures) {
-            structureIds.add(structure.getId());
+        if (structures != null && structures.size() > 0) {
+            for (Structure structure : structures) {
+                structureIds.add(structure.getId());
+            }
+            LambdaQueryWrapper<AssoStructurePicture> assoStructurePictureWrapper = new LambdaQueryWrapper<>();
+            assoStructurePictureWrapper.in(AssoStructurePicture::getStructureId, structureIds);
+            List<AssoStructurePicture> assoStructurePictures = assoStructurePictureService.list(assoStructurePictureWrapper);
+            if (assoStructurePictures != null && assoStructurePictures.size() > 0) {
+                log.info("架构图片关联表删除数据");
+                //删除架构图片关联表数据
+                assoStructurePictureService.remove(assoStructurePictureWrapper);
+            }
+            log.info("产品的架构表删除数据");
+            structureService.remove(wrapper);
         }
-        LambdaQueryWrapper<AssoStructurePicture> assoStructurePictureWrapper = new LambdaQueryWrapper<>();
-        assoStructurePictureWrapper.in(AssoStructurePicture::getStructureId, structureIds);
-        log.info("架构图片关联表删除数据");
-        //删除架构图片关联表数据
-        assoStructurePictureService.remove(assoStructurePictureWrapper);
-        log.info("产品的架构表删除数据");
-        structureService.remove(wrapper);
 
         //删除产品营销数据
         LambdaQueryWrapper<ProductMarketData> wrapper2 = new LambdaQueryWrapper<>();

+ 0 - 1
PAS/src/main/resources/mapper/EventMapper.xml

@@ -147,7 +147,6 @@
 
     <resultMap id="queryApplicationScenarioEventNumberMap"
                type="cn.cslg.pas.common.model.vo.ApplicationScenarioEventNumberVO">
-        <id column="id" property="applicationScenarioId"/>
         <result column="label" property="applicationScenarioName"/>
         <result column="value" property="applicationScenarioName"/>
         <collection property="eventNumberFromEvent" ofType="integer"

+ 5 - 3
PAS/src/main/resources/mapper/PermissionRecordMapper.xml

@@ -6,10 +6,10 @@
     <!--int add(PermissionRecord permissionRecord);-->
     <insert id="add" useGeneratedKeys="true" keyProperty="id">
         insert into permission_record(id, patent_no, licensor, licensee, licensee_country, license_time,
-                                      license_fee, license_dead_line, license_type, create_person_id,
+                                      license_fee, license_dead_line, license_type, tenant_id, create_person_id,
                                       create_person_name, create_time, modified_time)
         values (#{id}, #{patentNo}, #{licensor}, #{licensee}, #{licenseeCountry},
-                #{licenseTime}, #{licenseFee}, #{licenseDeadLine}, #{licenseType}, #{createPersonId},
+                #{licenseTime}, #{licenseFee}, #{licenseDeadLine}, #{licenseType}, #{tenantId}, #{createPersonId},
                 #{createPersonName}, #{createTime}, #{modifiedTime})
     </insert>
 
@@ -86,9 +86,11 @@
                license_time,
                license_fee,
                license_dead_line,
-               license_type
+               license_type,
+               tenant_id
         from permission_record
         where patent_no = #{patentNo}
+          and tenant_id = #{tenantId}
     </select>
 
     <!--根据专利号统计许可记录数量-->

+ 17 - 14
PAS/src/main/resources/mapper/ProductMapper.xml

@@ -5,10 +5,10 @@
     <!--插入数据-->
     <!--int insert(Product product);-->
     <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into product (product_name, market_time, company_name, tenant_id, product_explain,
-                             product_category_id, license_rate, create_person_id, create_person_name)
-        values (#{productName}, #{marketTime}, #{companyName}, #{tenantId}, #{productExplain}, #{productCategoryId},
-                #{licenseRate}, #{createPersonId}, #{createPersonName});
+        insert into product (product_name, market_time, company_name, tenant_id, create_person_tenant_id,
+                             product_explain, product_category_id, license_rate, create_person_id, create_person_name)
+        values (#{productName}, #{marketTime}, #{companyName}, #{tenantId}, #{createPersonTenantId}, #{productExplain},
+                #{productCategoryId}, #{licenseRate}, #{createPersonId}, #{createPersonName});
     </insert>
 
     <!--根据id删除产品-->
@@ -24,13 +24,15 @@
     <update id="updateById">
         update product
         <set>
-
             product_name = #{productName},
             market_time = #{marketTime},
             company_name = #{companyName},
             <if test="tenantId != null">
                 tenant_id = #{tenantId},
             </if>
+            <if test="createPersonTenantId != null">
+                create_person_tenant_id = #{createPersonTenantId},
+            </if>
             product_explain = #{productExplain},
             product_category_id = #{productCategoryId},
             license_rate = #{licenseRate},
@@ -97,6 +99,7 @@
         market_time,
         company_name,
         p.tenant_id,
+        create_person_tenant_id,
         product_explain,
         product_category_id,
         p.license_rate,
@@ -120,7 +123,7 @@
                 '%${productCategoryName}%')
             </if>
             <if test="true">
-                and p.tenant_id = #{tenantId}
+                and create_person_tenant_id = #{createPersonTenantId}
             </if>
         </where>
         order by
@@ -218,7 +221,7 @@
     <select id="queryByGroupProductCategoryId" resultMap="queryByGroupProductCategoryIdMap">
         select product_category_id pci,
         product_category_name,
-        p.tenant_id pTenantId,
+        p.create_person_tenant_id pCreatePersonTenantId,
         ifnull(#{orderBy}, '') orderBy,
         ifnull(#{orderType}, '') orderType,
         ifnull(#{productName}, '') productName,
@@ -247,7 +250,7 @@
                 '%${productCategoryName}%')
             </if>
             <if test="true">
-                and p.tenant_id = #{tenantId}
+                and p.create_person_tenant_id = #{createPersonTenantId}
             </if>
         </where>
         group by product_category_id
@@ -260,7 +263,7 @@
         <collection property="products" ofType="cn.cslg.pas.common.model.vo.ProductVO"
                     select="queryByGroupProductCategoryId2"
                     column="{pci=pci, orderBy=orderBy, orderType=orderType, productName=productName, companyName=companyName,
-                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, pTenantId=pTenantId}">
+                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, pCreatePersonTenantId=pCreatePersonTenantId}">
         </collection>
     </resultMap>
 
@@ -300,7 +303,7 @@
                 and product_category_id = #{pci}
             </if>
             <if test="true">
-                and p.tenant_id = #{pTenantId}
+                and p.create_person_tenant_id = #{pCreatePersonTenantId}
             </if>
         </where>
         order by
@@ -318,7 +321,7 @@
     <!--List<ProductGroupVO> queryByGroupCompanyName(ProductQueryPageDTO productQueryPageDTO);-->
     <select id="queryByGroupCompanyName" resultMap="queryByGroupCompanyNameMap">
         select company_name cn,
-        tenant_id pTenantId,
+        create_person_tenant_id CreatePersonTenantId,
         ifnull(#{orderBy}, '') orderBy,
         ifnull(#{orderType}, '') orderType,
         ifnull(#{productName}, '') productName,
@@ -349,7 +352,7 @@
                 and company_name is not null
             </if>
             <if test="true">
-                and tenant_id = #{tenantId}
+                and create_person_tenant_id = #{createPersonTenantId}
             </if>
         </where>
         group by company_name
@@ -361,7 +364,7 @@
         <collection property="products" ofType="cn.cslg.pas.common.model.vo.ProductVO"
                     select="queryByGroupCompanyNameMap2"
                     column="{cn=cn, orderBy=orderBy, orderType=orderType, productName=productName, companyName=companyName,
-                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, pTenantId=pTenantId}">
+                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, CreatePersonTenantId=CreatePersonTenantId}">
         </collection>
     </resultMap>
 
@@ -401,7 +404,7 @@
                 and company_name = #{cn}
             </if>
             <if test="true">
-                and p.tenant_id = #{pTenantId}
+                and p.create_person_tenant_id = #{CreatePersonTenantId}
             </if>
         </where>
         order by

+ 4 - 1
PAS/src/main/resources/mapper/ProjectMapper.xml

@@ -48,7 +48,10 @@
                 <if test="params.tenantId!=null">
                     or a.tenantId = #{params.tenantId}
                 </if>
-                    )
+                )
+            </if>
+            <if test="params.eventId != null and params.eventId != ''">
+                and a.id in (select project_id from asso_event_project where event_id = #{params.eventId})
             </if>
         </where>
         order by a.`${params.sort.prop}` ${params.sort.order}