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.
 
 
 
 
 

1.4 KiB

03 直接新建 adapter 业务接线 + 校验

Type: task Status: resolved

目标

把 01 票新增的 DTO 字段在 OpportunityCreateServiceImpl.createOpportunity 里真实翻译进 OpportunityIntakeSpec,并补业务校验。

改动

1. DTO → spec 翻译(OpportunityCreateServiceImpl

new OpportunityIntakeSpec(...) 构造处,把以下字段从 request 传入(替换相应位置的 null):

  • projectAmountrequest.getProjectAmount()
  • addressrequest.getAddress()
  • customerRolerequest.getCustomerRole()
  • isPrimaryIntendedrequest.getIsPrimaryIntended()
  • keyContactId / keyContactName / keyContactCompany ← request 对应字段

2. 校验规则

  • isPrimaryIntended:当 customerId 非空时必填,取值仅 1/0;customerId 为空时忽略(不强制,A4 未建)。
  • customerRole:当 customerId 非空时必填;空则沿用深模块回退 ROLE_INTENDED
  • 六必填校验(D-14)不变。

3. OpportunityCreationPortImpl(线索转入 adapter)

本票不改业务语义:新 spec 组件传 null / 默认(保持 LEAD_CONVERT 现有行为),只保证编译通过。

完成标准

  • createOpportunity 翻译 7 个新字段进 spec
  • isPrimaryIntended / customerRole 校验按规则
  • 线索转入 port 编译通过、行为不变
  • mvn -pl crm-opportunity compile 通过