chendayu 2 năm trước cách đây
mục cha
commit
0a780ed529

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/common/model/dto/EventQueryPageDTO.java

@@ -18,5 +18,9 @@ public class EventQueryPageDTO extends PageDTO2 {
      * 事件名称
      */
     private String questionName;
+    /**
+     * 租户id
+     */
+    private Integer tenantId;
 
 }

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

@@ -36,5 +36,9 @@ public class ProductQueryPageDTO extends PageDTO2 {
      * 分组条件
      */
     private String groupBy;
+    /**
+     * 租户id
+     */
+    private Integer tenantId;
 
 }

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

@@ -35,6 +35,10 @@ public class ProductCategory implements Serializable {
      */
     private Double licenseRate;
     /**
+     * 租户id
+     */
+    private Integer tenantId;
+    /**
      * 创建人Id
      */
     private Integer createPersonId;

+ 1 - 1
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;

+ 3 - 0
PAS/src/main/java/cn/cslg/pas/service/impl/EventServiceImpl.java

@@ -148,6 +148,9 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
     public JsonPage query(EventQueryPageDTO eventQueryPageDTO) {
         log.info("开始处理【分页查询事件】的业务,参数为:{}", eventQueryPageDTO);
 
+        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        eventQueryPageDTO.setTenantId(personnelVO.getTenantId());
+
         Integer current = eventQueryPageDTO.getCurrent();
         Integer size = eventQueryPageDTO.getSize();
         String orderBy = eventQueryPageDTO.getOrderBy();

+ 2 - 1
PAS/src/main/java/cn/cslg/pas/service/impl/ProductCategoryServiceImpl.java

@@ -78,7 +78,8 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
         productCategory
                 .setCreatePersonId(personnelVO.getId())
-                .setCreatePersonName(personnelVO.getName());
+                .setCreatePersonName(personnelVO.getName())
+                .setTenantId(personnelVO.getTenantId());
         //数据入产品类别表
         log.info("数据入产品类别表");
         int rows = productCategoryMapper.insert(productCategory);

+ 3 - 0
PAS/src/main/java/cn/cslg/pas/service/impl/ProductServiceImpl.java

@@ -226,6 +226,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     public JsonPage query(ProductQueryPageDTO productQueryPageDTO) {
         log.info("开始处理【查询产品】的业务,参数为:{}", productQueryPageDTO);
 
+        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        productQueryPageDTO.setTenantId(personnelVO.getTenantId());
+
         Integer current = productQueryPageDTO.getCurrent();
         Integer size = productQueryPageDTO.getSize();
         String groupBy = productQueryPageDTO.getGroupBy();

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

@@ -38,6 +38,9 @@
             <if test="questionName != null and questionName != ''">
                 and question_name like '%${questionName}%'
             </if>
+            <if test="true">
+                and tenant_id = #{tenantId}
+            </if>
         </where>
         order by
         <choose>

+ 11 - 6
PAS/src/main/resources/mapper/ProductCategoryMapper.xml

@@ -5,8 +5,10 @@
     <!--插入数据-->
     <!--int insert(ProductCategory productCategory);-->
     <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into product_category (product_category_name, remark, license_rate, create_person_id, create_person_name)
-        values (#{productCategoryName}, #{remark}, #{licenseRate}, #{createPersonId}, #{createPersonName})
+        insert into product_category (product_category_name, remark, license_rate, tenant_id, create_person_id,
+                                      create_person_name)
+        values (#{productCategoryName}, #{remark}, #{licenseRate}, #{tenantId}, #{createPersonId},
+                #{createPersonName})
     </insert>
 
     <!--根据id删除数据-->
@@ -86,6 +88,9 @@
                 asso_product_patent where patent_no = #{patentNo} union select product_id from
                 asso_structure_patent where patent_no = #{patentNo}))
             </if>
+            <if test="true">
+                and tenant_id = #{tenantId}
+            </if>
         </where>
         order by pc_id
     </select>
@@ -125,8 +130,8 @@
     <!--按照月份返回总体-->
     <select id="categoryQueryByMonth" resultMap="queryByDateMap">
         SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
-                sum(sale_money) AS sale_total_money,
-                CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
+        sum(sale_money) AS sale_total_money,
+        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
         FROM product_market_data
         WHERE product_id IN(SELECT id AS product_id
         FROM product
@@ -204,8 +209,8 @@
     <!--按照月份返回每个-->
     <select id="queryByMonth" resultMap="queryByDateMap">
         SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
-                sum(sale_money) AS sale_total_money,
-                CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
+        sum(sale_money) AS sale_total_money,
+        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
         FROM product_market_data
         WHERE product_id = #{productId}
         <if test="categoryArea != null and categoryArea != ''">

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

@@ -25,15 +25,15 @@
         update product
         <set>
 
-                product_name = #{productName},
-                market_time = #{marketTime},
-                company_name = #{companyName},
+            product_name = #{productName},
+            market_time = #{marketTime},
+            company_name = #{companyName},
             <if test="tenantId != null">
                 tenant_id = #{tenantId},
             </if>
-                product_explain = #{productExplain},
-                product_category_id = #{productCategoryId},
-                license_rate = #{licenseRate},
+            product_explain = #{productExplain},
+            product_category_id = #{productCategoryId},
+            license_rate = #{licenseRate},
 
         </set>
         where id = #{id}
@@ -248,6 +248,9 @@
                 and product_category_id in (select id from product_category where product_category_name like
                 '%${productCategoryName}%')
             </if>
+            <if test="true">
+                and tenant_id = #{tenantId}
+            </if>
         </where>
         group by product_category_id
         order by product_category_id
@@ -344,6 +347,9 @@
             <if test="true">
                 and company_name is not null
             </if>
+            <if test="true">
+                and tenant_id = #{tenantId}
+            </if>
         </where>
         group by company_name
         order by company_name