瀏覽代碼

权限过滤问题处理

yzc 1 年之前
父節點
當前提交
21d983ffdd

+ 4 - 4
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -144,8 +144,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             dto.setCompanyId(companyId);
         }
         wrapper.and(q1 -> q1.
-                and(q -> q.eq(ProductInfo::getDefinition, 1).eq(ProductInfo::getCompanyId, dto.getCompanyId()))
-                .or().eq(ProductInfo::getDefinition, 2)
+                and(q -> q.eq("pi", ProductInfo::getDefinition, 1).eq("pi", ProductInfo::getCompanyId, dto.getCompanyId()))
+                .or().eq("pi", ProductInfo::getDefinition, 2)
         );
 
         wrapper.orderByDesc("pi", ProductInfo::getId);
@@ -772,8 +772,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             dto.setCompanyId(companyId);
         }
         wrapper.and(q1 -> q1.
-                and(q -> q.eq(ProductInfo::getDefinition, 1).eq(ProductInfo::getCompanyId, dto.getCompanyId()))
-                .or().eq(ProductInfo::getDefinition, 2)
+                and(q -> q.eq("pi", ProductInfo::getDefinition, 1).eq("pi", ProductInfo::getCompanyId, dto.getCompanyId()))
+                .or().eq("pi", ProductInfo::getDefinition, 2)
         );
 
         List<ProductInfo> productInfoList = this.list(wrapper);

+ 2 - 2
hx-mes/src/main/java/com/fjhx/mes/service/material/impl/MaterialPreparationServiceImpl.java

@@ -47,9 +47,9 @@ public class MaterialPreparationServiceImpl extends ServiceImpl<MaterialPreparat
         //权限过滤:生产备料-子公司看自己的,总公司看全部
         Long companyId = SecurityUtils.getCompanyId();
         if (!Objects.equals(companyId, 100L)) {
-            wrapper.eq(MaterialPreparation::getCompanyId, companyId);
+            wrapper.eq("mp", MaterialPreparation::getCompanyId, companyId);
         } else {
-            wrapper.eq(MaterialPreparation::getCompanyId, dto.getCompanyId());
+            wrapper.eq("mp", MaterialPreparation::getCompanyId, dto.getCompanyId());
         }
 
         wrapper.orderByDesc("mp", MaterialPreparation::getCreateTime);

+ 2 - 2
hx-purchase/src/main/java/com/fjhx/purchase/service/invoice/impl/InvoiceServiceImpl.java

@@ -68,9 +68,9 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
         //权限过滤:发票-子公司看自己的,总公司看全部
         Long companyId = SecurityUtils.getCompanyId();
         if (!Objects.equals(companyId, 100L)) {
-            wrapper.eq(Invoice::getCompanyId, companyId);
+            wrapper.eq("t1", Invoice::getCompanyId, companyId);
         } else {
-            wrapper.eq(Invoice::getCompanyId, dto.getCompanyId());
+            wrapper.eq("t1", Invoice::getCompanyId, dto.getCompanyId());
         }
         wrapper.orderByDesc("t1", Invoice::getCreateTime);
         Page<InvoiceVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);

+ 2 - 2
hx-purchase/src/main/java/com/fjhx/purchase/service/pay/impl/PayServiceImpl.java

@@ -109,9 +109,9 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PaySe
         //权限过滤:采购付款-子公司看自己的,总公司看全部
         Long companyId = SecurityUtils.getCompanyId();
         if (!Objects.equals(companyId, 100L)) {
-            wrapper.eq(Pay::getCompanyId, companyId);
+            wrapper.eq("p", Pay::getCompanyId, companyId);
         } else {
-            wrapper.eq(Pay::getCompanyId, dto.getCompanyId());
+            wrapper.eq("p", Pay::getCompanyId, dto.getCompanyId());
         }
 
         wrapper.orderByDesc("p", Pay::getCreateTime);

+ 2 - 2
hx-wms/src/main/java/com/fjhx/wms/service/warehouse/impl/WarehouseServiceImpl.java

@@ -46,9 +46,9 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse
         //权限过滤:仓库-子公司看自己的,总公司看全部
         Long companyId = SecurityUtils.getCompanyId();
         if (!Objects.equals(companyId, 100L)) {
-            wrapper.eq(Warehouse::getCompanyId, companyId);
+            wrapper.eq("w", Warehouse::getCompanyId, companyId);
         } else {
-            wrapper.eq(Warehouse::getCompanyId, dto.getCompanyId());
+            wrapper.eq("w", Warehouse::getCompanyId, dto.getCompanyId());
         }
 
         wrapper.orderByDesc("w", Warehouse::getId);