更新 2026-04-18 21:11
This commit is contained in:
parent
e3b95b45b7
commit
7ac2b27a83
@ -54,6 +54,7 @@ public class ReportLeadController {
|
||||
data.put("remindDate", lead.getRemindDate() == null ? null : lead.getRemindDate().toString());
|
||||
data.put("unsubscribeToken", lead.getUnsubscribeToken());
|
||||
data.put("wechatBound", outcome.wechatBound());
|
||||
data.put("repeatSubmit", outcome.repeatSubmit());
|
||||
return Map.of("code", 200, "data", data);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Map.of("code", 400, "message", e.getMessage());
|
||||
|
||||
@ -31,8 +31,8 @@ public class ReportLeadService {
|
||||
private final UserService userService;
|
||||
private final WechatMiniProgramService wechatMiniProgramService;
|
||||
|
||||
/** 留资提交结果:记录 + 是否已将微信 openid 绑定到宠主账号(S3→S4) */
|
||||
public record LeadSubmitOutcome(ReportLead lead, boolean wechatBound) {}
|
||||
/** 留资提交结果:记录 + 是否已将微信 openid 绑定到宠主账号(S3→S4)+ 是否同报告同手机号再次提交(幂等更新) */
|
||||
public record LeadSubmitOutcome(ReportLead lead, boolean wechatBound, boolean repeatSubmit) {}
|
||||
|
||||
/** 当服务类型不在已配置表中时使用的兜底间隔(天) */
|
||||
private static final int FALLBACK_MIN = 28;
|
||||
@ -127,6 +127,7 @@ public class ReportLeadService {
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
ReportLead lead = reportLeadMapper.findFirstByReportIdAndPhone(report.getId(), phone).orElse(null);
|
||||
boolean repeatSubmit = lead != null;
|
||||
if (lead == null) {
|
||||
lead = new ReportLead();
|
||||
lead.setReportId(report.getId());
|
||||
@ -180,7 +181,7 @@ public class ReportLeadService {
|
||||
}
|
||||
}
|
||||
|
||||
return new LeadSubmitOutcome(lead, wechatBound);
|
||||
return new LeadSubmitOutcome(lead, wechatBound, repeatSubmit);
|
||||
}
|
||||
|
||||
/** 退订:按 unsubscribeToken 找记录并置状态 */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user