Browse Source
- RECENT 视图独立路径 pageRecent:按 opportunity_view_log.last_view_time 倒序取上限 50(票 10 P2-2),再 ORDER BY FIELD 回主表保序;空 view_log 直接 返回空页不查主表;公共筛选抽 applyCommonFilters 供 RECENT/其它视图复用 - OpportunityQueryController /api/opportunity/page:六视图分页薄适配层, @DataScope 自动注入,tags 按销售机会/管理/公海页面入口实挂 测试补 RECENT 保序 + 空 view_log 短路。crm-opportunity 128→129 全绿。master
3 changed files with 122 additions and 10 deletions
@ -0,0 +1,35 @@ |
|||
package com.crm.opportunity.controller; |
|||
|
|||
import com.crm.base.domain.result.PageResult; |
|||
import com.crm.base.domain.result.Result; |
|||
import com.crm.opportunity.domain.dto.OpportunityDTO; |
|||
import com.crm.opportunity.domain.param.OpportunityPageParam; |
|||
import com.crm.opportunity.query.OpportunityViewQuery; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 商机读侧查询接口(薄适配层,票 10 四视图 + 票 14 视图族)。 |
|||
* |
|||
* <p>数据隔离由 {@code @DataScope}({@code Opportunity} 实体注解)自动注入部门天花板;个人四视图 |
|||
* (RECENT/MINE/PARTICIPATED/FOLLOWED)另叠团队成员白名单,MANAGE/PUBLIC_POOL 严格按 DataScope。 |
|||
* tags 按真实页面入口实挂(销售机会工作区 + 商机管理 + 商机公海两个独立 workspace)。</p> |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/api/opportunity") |
|||
@RequiredArgsConstructor |
|||
public class OpportunityQueryController { |
|||
|
|||
private final OpportunityViewQuery opportunityViewQuery; |
|||
|
|||
@Operation(summary = "商机分页(六视图:RECENT/MINE/PARTICIPATED/FOLLOWED/MANAGE/PUBLIC_POOL)", |
|||
tags = {"销售机会/最近访问", "销售机会/我负责的", "销售机会/我参与的", "销售机会/我关注的", |
|||
"商机管理", "商机公海"}) |
|||
@PostMapping("/page") |
|||
public Result<PageResult<OpportunityDTO>> page(OpportunityPageParam param) { |
|||
return Result.success(opportunityViewQuery.pageOpportunities(param)); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue