yzc 1 år sedan
förälder
incheckning
615652f349

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/sale/dto/SaleQuotationSelectDto.java

@@ -57,4 +57,9 @@ public class SaleQuotationSelectDto extends BaseSelectDto {
      * 审批状态。10:发起。20 驳回。30通过
      */
     private Integer status;
+
+    /**
+     * 是否是报价评估
+     */
+    private Integer isEstimate;
 }

+ 0 - 4
hx-sale/src/main/java/com/fjhx/sale/flow/ContractFlow.java

@@ -323,16 +323,12 @@ public class ContractFlow extends FlowDelegate {
 
         //根据归属公司将数据赋值给指定公司
         Long companyId = contract.getCompanyId();
-        TenantHolder.setIgnore(true);
         SysDept company = deptService.getById(companyId);
-        TenantHolder.clear();
         if (ObjectUtil.isEmpty(companyId)) {
             throw new ServiceException("归属公司不存在");
         }
-        SecurityUtils.setTenantId(company.getTenantId());
         //保存待采购明细
         subscribeDetailService.saveBatch(subscribeDetailList);
-        SecurityUtils.clearTenantId();
 
     }
 

+ 5 - 9
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -108,17 +108,12 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
     @Override
     public Page<SaleQuotationVo> getPage(SaleQuotationSelectDto dto) {
 
-//        List<Long> authIdList = customerService.getAuthIdList();
-//
-//        if (authIdList.size() == 0) {
-//            return new Page<>();
-//        }
-
         IWrapper<SaleQuotation> wrapper = IWrapper.getWrapper();
-//        wrapper.eq(ObjectUtil.isNotEmpty(dto.getStatus()), SaleQuotation::getStatus, dto.getStatus());
-//        wrapper.orderByDesc(SaleQuotation::getCreateTime);
-//        wrapper.in(SaleQuotation::getBuyCorporationId, authIdList);
 
+        //权限过滤:报价评估自己看自己
+        if (Objects.equals(dto.getIsEstimate(), 1)) {
+            wrapper.eq("sq", SaleQuotation::getCompanyId, SecurityUtils.getCompanyId());
+        }
 
         //报价状态
         wrapper.eq(SaleQuotation::getQuotationStatus, dto.getQuotationStatus());
@@ -127,6 +122,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         //报价单类型
         wrapper.eq(SaleQuotation::getType, dto.getType());
 
+
         //报价时间-时间范围过滤
         wrapper.ge("sq", SaleQuotation::getQuotationTime, dto.getQuotationTimeSta());
         wrapper.le("sq", SaleQuotation::getQuotationTime, dto.getQuotationTimeEnd());