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