|
@@ -16,6 +16,7 @@ import com.fjhx.sale.entity.contract.po.ContractProduct;
|
|
|
import com.fjhx.sale.mapper.after.AfterSalesMapper;
|
|
|
import com.fjhx.sale.service.after.AfterSalesService;
|
|
|
import com.fjhx.sale.service.contract.ContractProductService;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import com.ruoyi.system.utils.UserUtil;
|
|
@@ -23,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -51,6 +53,14 @@ public class AfterSalesServiceImpl extends ServiceImpl<AfterSalesMapper, AfterSa
|
|
|
public Page<AfterSalesVo> getPage(AfterSalesSelectDto dto) {
|
|
|
IWrapper<AfterSales> wrapper = getWrapper();
|
|
|
|
|
|
+ //权限过滤:售后管理-子公司看自己的,总公司看全部
|
|
|
+ Long companyId = SecurityUtils.getCompanyId();
|
|
|
+ if (!Objects.equals(companyId, 100L)) {
|
|
|
+ wrapper.eq("as1", AfterSales::getCompanyId, companyId);
|
|
|
+ } else {
|
|
|
+ wrapper.eq("as1", AfterSales::getCompanyId, dto.getCompanyId());
|
|
|
+ }
|
|
|
+
|
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("as1.code"), new SqlField("c.code"));
|
|
|
|
|
|
wrapper.orderByDesc("as1", AfterSales::getId);
|
|
@@ -94,6 +104,8 @@ public class AfterSalesServiceImpl extends ServiceImpl<AfterSalesMapper, AfterSa
|
|
|
afterSalesDto.setContractId(contractProduct.getContractId());
|
|
|
afterSalesDto.setProductId(contractProduct.getProductId());
|
|
|
|
|
|
+ afterSalesDto.setCompanyId(SecurityUtils.getCompanyId());
|
|
|
+
|
|
|
this.save(afterSalesDto);
|
|
|
}
|
|
|
|