|
|
|
@ -162,6 +162,7 @@ public class UserController {
|
|
|
|
|
if (address == null) {
|
|
|
|
|
return new Result<>(404, "地址不存在", null);
|
|
|
|
|
}
|
|
|
|
|
addressLambdaQueryWrapper.clear();
|
|
|
|
|
// 如果寄件和收件是一个地方,禁止
|
|
|
|
|
if (goodsDTO.getAddressFrom().equals(goodsDTO.getAddressTo())) {
|
|
|
|
|
return new Result<>(400, "寄件和收件不能是同一个地方", null);
|
|
|
|
@ -178,7 +179,11 @@ public class UserController {
|
|
|
|
|
goods.setQuality(goodsDTO.getQuality());
|
|
|
|
|
goodsService.save(goods);
|
|
|
|
|
// 存进历史记录
|
|
|
|
|
// 寄件方位置
|
|
|
|
|
addressLambdaQueryWrapper.eq(Address::getAddress, goodsDTO.getAddressFrom());
|
|
|
|
|
Address addressFrom = addressService.getOne(addressLambdaQueryWrapper);
|
|
|
|
|
Records records = new Records();
|
|
|
|
|
records.setAddressFrom(addressFrom.getId());
|
|
|
|
|
records.setSendUserId(GetIdUtil.getId());
|
|
|
|
|
records.setGetUserId(getUser.getId());
|
|
|
|
|
records.setAddressId(address.getId());
|
|
|
|
|