真对寄件进行修改

grs
yjxx 2 weeks ago
parent 8a149c54b6
commit 9ef8ec7a6b

@ -14,15 +14,17 @@ public class ExpressListDTO {
private User recipient; // 收件人 private User recipient; // 收件人
private User addressee; // 签收者 private User addressee; // 签收者
private User courier; // 派送的快递员 private User courier; // 派送的快递员
private Address address; // 送到哪里 private Address addressFrom; // 从哪里送的
private Address addressTo; // 送到哪里
public ExpressListDTO(Records records, Goods goods, User sender, User recipient, User addressee, User courier, Address address) { public ExpressListDTO(Records records, Goods goods, User sender, User recipient, User addressee, User courier, Address addressFrom, Address addressTo) {
this.records = records; this.records = records;
this.goods = goods; this.goods = goods;
this.sender = sender; this.sender = sender;
this.recipient = recipient; this.recipient = recipient;
this.addressee = addressee; this.addressee = addressee;
this.courier = courier; this.courier = courier;
this.address = address; this.addressFrom = addressFrom;
this.addressTo = addressTo;
} }
} }

@ -20,8 +20,11 @@ public class GoodsDTO {
@NotBlank(message = "快递重量不能为空") @NotBlank(message = "快递重量不能为空")
private String quality; private String quality;
@NotBlank(message = "发货地不能为空")
private String addressFrom;
@NotBlank(message = "运送地址不能为空") @NotBlank(message = "运送地址不能为空")
private String address; private String addressTo;
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@NotNull @NotNull

@ -118,9 +118,10 @@ public class AdminController {
User recipient = userService.getById(records.getGetUserId()); User recipient = userService.getById(records.getGetUserId());
User addressee = userService.getById(records.getAddresseeId()); User addressee = userService.getById(records.getAddresseeId());
User courier = userService.getById(records.getExpressId()); User courier = userService.getById(records.getExpressId());
// 查询地址信息 // 查询地址信息: 从哪里送的 送到哪里
Address address = addressService.getById(records.getAddressId()); Address addressTo = addressService.getById(records.getAddressId());
ExpressListDTO expressListDTO = new ExpressListDTO(records, goods, sender, recipient, addressee, courier, address); Address addressFrom = addressService.getById(records.getAddressFrom());
ExpressListDTO expressListDTO = new ExpressListDTO(records, goods, sender, recipient, addressee, courier, addressFrom, addressTo);
expressListDTOList.add(expressListDTO); expressListDTOList.add(expressListDTO);
} }
Page<ExpressListDTO> expressDTOPage = new Page<>(recordsPage.getCurrent(), recordsPage.getSize(), recordsPage.getTotal()); Page<ExpressListDTO> expressDTOPage = new Page<>(recordsPage.getCurrent(), recordsPage.getSize(), recordsPage.getTotal());

@ -156,7 +156,7 @@ public class UserController {
} }
// 判断地址是否存在 // 判断地址是否存在
LambdaQueryWrapper<Address> addressLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Address> addressLambdaQueryWrapper = new LambdaQueryWrapper<>();
addressLambdaQueryWrapper.eq(Address::getAddress, goodsDTO.getAddress()); addressLambdaQueryWrapper.eq(Address::getAddress, goodsDTO.getAddressTo());
Address address = addressService.getOne(addressLambdaQueryWrapper); Address address = addressService.getOne(addressLambdaQueryWrapper);
if (address == null) { if (address == null) {
return new Result<>(404, "地址不存在", null); return new Result<>(404, "地址不存在", null);

@ -33,6 +33,7 @@ public class Records implements Serializable {
@NotNull @NotNull
private Long getUserId; private Long getUserId;
@TableField("express_id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@NotNull @NotNull
private Long expressId; private Long expressId;
@ -45,7 +46,13 @@ public class Records implements Serializable {
@TableField("mark") @TableField("mark")
private Integer mark; private Integer mark;
@TableField // 从哪里送的
@TableField("address_from")
@JsonSerialize(using = ToStringSerializer.class)
private Long addressFrom;
// 送到哪里
@TableField("address_id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long addressId; private Long addressId;

Loading…
Cancel
Save