chendayu 2 лет назад
Родитель
Сommit
32594d32b5

+ 2 - 1
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())
+                .setTenantId(personnelVO.getTenantId());
         //数据入产品表
         log.info("数据入产品表");
         int rows = productMapper.insert(product);

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

@@ -223,6 +223,7 @@
     <select id="queryByGroupProductCategoryId" resultMap="queryByGroupProductCategoryIdMap">
         select product_category_id pci,
         product_category_name,
+        p.tenant_id pTenantId,
         ifnull(#{orderBy}, '') orderBy,
         ifnull(#{orderType}, '') orderType,
         ifnull(#{productName}, '') productName,
@@ -265,7 +266,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}">
+                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, pTenantId=pTenantId}">
         </collection>
     </resultMap>
 
@@ -305,7 +306,7 @@
                 and product_category_id = #{pci}
             </if>
             <if test="true">
-                and p.tenant_id = #{tenantId}
+                and p.tenant_id = #{pTenantId}
             </if>
         </where>
         order by
@@ -323,6 +324,7 @@
     <!--List<ProductGroupVO> queryByGroupCompanyName(ProductQueryPageDTO productQueryPageDTO);-->
     <select id="queryByGroupCompanyName" resultMap="queryByGroupCompanyNameMap">
         select company_name cn,
+        tenant_id pTenantId,
         ifnull(#{orderBy}, '') orderBy,
         ifnull(#{orderType}, '') orderType,
         ifnull(#{productName}, '') productName,
@@ -366,7 +368,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}">
+                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, pTenantId=pTenantId}">
         </collection>
     </resultMap>
 
@@ -406,7 +408,7 @@
                 and company_name = #{cn}
             </if>
             <if test="true">
-                and p.tenant_id = #{tenantId}
+                and p.tenant_id = #{pTenantId}
             </if>
         </where>
         order by