♻️ 运次收口判据由司机手机号改为司机档案 ID

- TripQueryVO 的收口字段由 driverPhone 换成 driverId,删除按手机号构造收口条件的入口,
  让编译器暴露全部调用点;forAdmin() 与出参 driverPhone 快照不变
- 运次可见范围两段同时切:已配载段按配载单 lm.driver_id 子查询,未配载段按运单 driver_id
- 详情复核改为比较档案 ID(ownedBy)、删除 samePhone;收口缺省(空/0/负数)仍返回空集
- 司机端六个运次入口改用当前司机档案 ID;删除 currentUserPhone/isMobileLike 手机号兜底
- 测试夹具改为同时铺设 driverId 与派单快照号,新增改号仍可见、同号换人、管理端、缺省收口四组用例
This commit is contained in:
2026-10-27 21:07:07 +08:00
parent b10e4f33b4
commit 01b4dd0b5b
7 changed files with 220 additions and 121 deletions
@@ -34,8 +34,11 @@ import java.util.Set;
/**
* 运次查询条件
* <p>
* 司机端用 {@link #forDriver(String)} 按司机手机号收口;管理端用 {@link #forAdmin()} 不按司机收口。
* 司机端用 {@link #forDriver(Long)} 按司机档案 ID 收口;管理端用 {@link #forAdmin()} 不按司机收口。
* 两者都不给时收口为空集——收口一旦缺省就等于把别人的运次发出去,故缺省不放行。
* <p>
* 判据是司机档案 ID 而不是手机号:手机号在配载单/运单上只是派单时的快照,司机换号后并不跟随,
* 按号收口会让改过号的司机看不到自己手上的运次,号码被回收给别人时还会反向串号。
*/
@Data
@Schema(description = "运次查询条件")
@@ -47,8 +50,8 @@ public class TripQueryVO implements Serializable {
@Schema(description = "运次主键(详情按它取单个运次)")
private String tripId;
@Schema(description = "司机手机号")
private String driverPhone;
@Schema(description = "司机档案 ID(司机端收口判据,空或非正数一律不放行)")
private Long driverId;
@Schema(description = "是否不按司机收口(管理端)")
private boolean allDrivers;
@@ -92,9 +95,9 @@ public class TripQueryVO implements Serializable {
@Schema(description = "每页条数(按运次,不是运单)")
private Integer size;
public static TripQueryVO forDriver(String driverPhone) {
public static TripQueryVO forDriver(Long driverId) {
TripQueryVO query = new TripQueryVO();
query.setDriverPhone(driverPhone);
query.setDriverId(driverId);
return query;
}