|
@@ -173,8 +173,13 @@ public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, Ehs
|
|
|
// .isNotNull("t1.old_purchase_id")
|
|
|
// );
|
|
|
|
|
|
- //权限过滤:采购自己看自己
|
|
|
- wrapper.eq("t1", EhsdPurchase::getCompanyId, SecurityUtils.getCompanyId());
|
|
|
+ //权限过滤:采购-子公司看自己的,总公司看全部
|
|
|
+ Long companyId = SecurityUtils.getCompanyId();
|
|
|
+ if (!Objects.equals(companyId, 100L)) {
|
|
|
+ wrapper.eq("t1", EhsdPurchase::getCompanyId, companyId);
|
|
|
+ } else {
|
|
|
+ wrapper.eq("t1", EhsdPurchase::getCompanyId, dto.getCompanyId());
|
|
|
+ }
|
|
|
|
|
|
wrapper.orderByDesc("t1", EhsdPurchase::getCreateTime);
|
|
|
|