You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

3.2 KiB

01 — workspace 列表补「是否关注」字段(前端反馈)

Type: task Status: resolved Blocked by: (无,frontier)

Question

前端反馈:/api/customer/workspace/page(客户公海)查询结果缺「是否关注」字段。已实锤:CustomerListRowDTO 无该字段;CustomerMapper.pageWorkspace 两条 SELECT 分支(overview 分支与 mine/pool otherwise 分支)均无 customer_focus 子查询。本票把行级「是否关注」补齐:

  • SQL 两分支各加一列:(SELECT COUNT(*) FROM customer_focus f WHERE f.customer_id = c.id AND f.user_id = #{q.userId}) AS focus_flag(COUNT 天然 0/1;customer_focus 无软删,行存在=关注,见 API-SUMMARY §2.9 一行两态语义——本列只表达「关注」,不含「重点标记」starred;若票 03 原型对照发现列表还要重点列再补)。
  • CustomerListRowDTOInteger focusFlag(@Schema 描述「是否关注 1/0」);别名 focus_flag 走 map-underscore 驼峰映射(同 opportunity_count 先例);无孤立大写字母陷阱。
  • 三个 workspace 共用同一 SQL/DTO,字段对 mine/overview/pool 一并生效(成本一致,前端三列表通用)。
  • 单测:CustomerWorkspaceOwnershipIntegrationTest(已有关注夹具 focus() 助手 + H2 customer_focus 表)补 focusFlag 断言:关注=1 / 未关注=0。
  • 登记:.scratch/customer-module/API-SUMMARY.md workspace 列表出参补字段(零漂移纪律)。

不做:.bru 重生成(归票 05 一次性同步);e2e 断言新增(归票 04);demo 展示(归票 02)。

Answer

已落地,全绿。

  1. SQLCustomerMapper.pageWorkspace 两分支(overview / mine+pool otherwise)各加 focus_flag 标量子查询(customer_focus f 按 customer_id + #{q.userId} COUNT);方法 javadoc 补段说明。
  2. DTOCustomerListRowDTOInteger focusFlag(@Schema「是否关注(customer_focus 行存在=1;0=未关注)」);别名驼峰映射同 opportunity_count 先例。
  3. 单测CustomerWorkspaceOwnershipIntegrationTest 新增 listRows_carryFocusFlag(mine 关注=1 / 未关注=0 / pool 关注=1);类内 22 例全绿。
  4. 全量mvn -pl crm-customer -am test 全链 BUILD SUCCESS——crm-base 44 / crm-file 84 / crm-auth 241 / crm-dict 64 / crm-rule 218 / crm-preference 23 / crm-customer 219(=218+1 新例),共 693 全绿。
  5. 文档:API-SUMMARY §2.1 出参句补 focusFlag(零漂移)。

环境坑(后续票必读)

  • JBR(IDEA bundled)跑单测不可靠:Mockito inline mock-maker 自附着失败(Could not self-attach to current VM using external process),凡 @Mock/mockStatic 测试类全灭(PendingNoticeWriterTest 6 Error 即此)。
  • 可靠单测通道 = JAVA_HOME=C:\Users\Administrator\.jdks\corretto-17.0.13 + '-DargLine=-Djdk.attach.allowAttachSelf=true -Xmx1024m'(父 POM 无 surefire 配置,-DargLine 直通 fork)。
  • -am 全量跑曾 native OOM(ChunkPool::allocate,hs_err/replay 转储已清)——限堆后过;跑全量前留意内存压力。

证据

  • log:test-ticket01-r4.log(CustomerWorkspace* 30 例)/ test-ticket01-r5.log(全链 BUILD SUCCESS),均在本 effort 目录。