✨ 新增运次读服务,小程序列表与详情按运次聚合
运次=有配载单时那张配载单(含全部子运单),没有配载时就是一张运单。 一次库层查询按运次分组完成状态聚合、接单需求合并、排序与分页, 供司机端与管理端共用;聚合读只读,不触发接单态归一化的写库。
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.pojo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 运次查询条件
|
||||
* <p>
|
||||
* 司机端用 {@link #forDriver(String)} 按司机手机号收口;管理端用 {@link #forAdmin()} 不按司机收口。
|
||||
* 两者都不给时收口为空集——收口一旦缺省就等于把别人的运次发出去,故缺省不放行。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "运次查询条件")
|
||||
public class TripQueryVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "运次主键(详情按它取单个运次)")
|
||||
private String tripId;
|
||||
|
||||
@Schema(description = "司机手机号")
|
||||
private String driverPhone;
|
||||
|
||||
@Schema(description = "是否不按司机收口(管理端)")
|
||||
private boolean allDrivers;
|
||||
|
||||
@Schema(description = "状态:0待接单/1进行中/2已完成/3已取消,不传为全部(不含已取消)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "关键字:运单号 / 配载单号 / 起终点 / 车牌")
|
||||
private String keyword;
|
||||
|
||||
@Schema(description = "当前页,从 1 开始")
|
||||
private Integer current;
|
||||
|
||||
@Schema(description = "每页条数(按运次,不是运单)")
|
||||
private Integer size;
|
||||
|
||||
public static TripQueryVO forDriver(String driverPhone) {
|
||||
TripQueryVO query = new TripQueryVO();
|
||||
query.setDriverPhone(driverPhone);
|
||||
return query;
|
||||
}
|
||||
|
||||
public static TripQueryVO forAdmin() {
|
||||
TripQueryVO query = new TripQueryVO();
|
||||
query.setAllDrivers(true);
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.pojo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 运次 Tab 统计
|
||||
* <p>
|
||||
* 与司机端运单统计字段同名同义,但计数单位是运次(一卡一趟车),不是运单。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "运次 Tab 统计")
|
||||
public class TripTabCountsVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "全部(待接单+进行中+已完成,不含已取消)")
|
||||
private long all;
|
||||
|
||||
@Schema(description = "待接单")
|
||||
private long pending;
|
||||
|
||||
@Schema(description = "进行中")
|
||||
private long doing;
|
||||
|
||||
@Schema(description = "已完成")
|
||||
private long done;
|
||||
|
||||
}
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.pojo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运次:一趟车的展示与操作单位
|
||||
* <p>
|
||||
* 有配载单时就是那张配载单连同它的全部子运单,没配载时就是一张运单;它没有自己的表。
|
||||
* 状态与接单需求都由子运单读时聚合,配载单上不落这两个字段。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "运次")
|
||||
public class TripVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "运次主键:配载单主键或运单主键,按字符串下发(19 位雪花号按数字下发会被前端取整)")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "展示单号:有配载取配载单号,否则取运单号")
|
||||
private String tripNo;
|
||||
|
||||
@Schema(description = "配载单号,未配载为空")
|
||||
private String loadingNo;
|
||||
|
||||
@Schema(description = "运输组织类型:load 公路配载 / common 普通运输")
|
||||
private String transportOrgType;
|
||||
|
||||
@Schema(description = "状态:0待接单/1运输中/2已完成/3已取消,子单集合为空时为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序键:运次内子运单 create_time 的最大值")
|
||||
private Date sortTime;
|
||||
|
||||
@Schema(description = "是否需要接单:任一子运单的项目有接单节点即为是")
|
||||
private Boolean requireAccept;
|
||||
|
||||
@Schema(description = "接单态:accepted 已接单 / pending 待接单,无从判定时为空")
|
||||
private String acceptStatus;
|
||||
|
||||
@Schema(description = "子运单数(可见口径:已排除本司机拒单的子单)")
|
||||
private int waybillCount;
|
||||
|
||||
@Schema(description = "司机姓名")
|
||||
private String driverName;
|
||||
|
||||
@Schema(description = "司机手机号")
|
||||
private String driverPhone;
|
||||
|
||||
@Schema(description = "车牌号")
|
||||
private String vehicleNo;
|
||||
|
||||
@Schema(description = "挂车车牌号")
|
||||
private String trailerVehicleNo;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "运输类型")
|
||||
private String transportType;
|
||||
|
||||
@Schema(description = "货物名称")
|
||||
private String cargoName;
|
||||
|
||||
@Schema(description = "货物类型")
|
||||
private String cargoType;
|
||||
|
||||
@Schema(description = "发货地址")
|
||||
private String departureAddress;
|
||||
|
||||
@Schema(description = "途经地")
|
||||
private String transitAddress;
|
||||
|
||||
@Schema(description = "到货地")
|
||||
private String arrivalAddress;
|
||||
|
||||
@Schema(description = "路线信息,仅单个运次详情返回(列表不带,省流量)")
|
||||
private String routeJson;
|
||||
|
||||
@Schema(description = "货物信息,仅单个运次详情返回(列表不带,省流量)")
|
||||
private String goodsJson;
|
||||
|
||||
@Schema(description = "子运单(可见子单,按创建时间升序)")
|
||||
private List<TripWaybillVO> waybills;
|
||||
|
||||
/**
|
||||
* 运次下的子运单
|
||||
* <p>
|
||||
* 接单事实仍落在每张子运单上,运次只是把它们的需要接单与接单态聚合起来。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "运次下的子运单")
|
||||
public static class TripWaybillVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "运单主键,按字符串下发")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "运单号")
|
||||
private String waybillNo;
|
||||
|
||||
@Schema(description = "业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "接单状态:pending待接单/accepted已接单/rejected已拒绝")
|
||||
private String acceptStatus;
|
||||
|
||||
@Schema(description = "该运单是否需要接单确认")
|
||||
private Boolean requireAccept;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "货物名称")
|
||||
private String cargoName;
|
||||
|
||||
@Schema(description = "货物类型")
|
||||
private String cargoType;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "数量单位")
|
||||
private String quantityUnit;
|
||||
|
||||
@Schema(description = "发货地")
|
||||
private String departureName;
|
||||
|
||||
@Schema(description = "发货地址")
|
||||
private String departureAddress;
|
||||
|
||||
@Schema(description = "收货地")
|
||||
private String arrivalName;
|
||||
|
||||
@Schema(description = "收货地址")
|
||||
private String arrivalAddress;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user