Authored by qinchao

fix: 修改地址时候,如果地址信息没有变化,返回的提示为空串,如果有变化,返回修改成功

... ... @@ -16,6 +16,7 @@ import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.impl.SellerFeeService;
import com.yohoufo.order.service.impl.SellerOrderService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -136,8 +137,13 @@ public class BuyerOrderController {
}
LOG.info("in ufo.order.buyerModifyAddress, uid {},orderCode {} request addressInfo {} ", addressInfo.getUid(),orderCode,addressInfo);
buyerOrderService.buyerModifyAddress(addressInfo.getUid(),orderCode,addressInfo);
return new ApiResponse.ApiResponseBuilder().code(200).message("修改收货地址成功").build();
//如果地址信息没有变化,返回false,有变化返回true
boolean changed = buyerOrderService.buyerModifyAddress(addressInfo.getUid(),orderCode,addressInfo);
String info = StringUtils.EMPTY;
if(changed){
info = "修改成功";
}
return new ApiResponse.ApiResponseBuilder().code(200).message(info).build();
}
... ...
... ... @@ -30,8 +30,9 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi
/**
* 买家修改收货地址
* 如果地址信息没有变化,返回false,有变化返回true
*/
void buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress);
boolean buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress);
/**
* 根据uid查询购买的订单数目
... ...
... ... @@ -123,9 +123,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
/**
* 买家修改收货地址:
* 鉴定中心确定收货之前,都可以修改地址
* 如果地址信息没有变化,返回false,有变化返回true
*/
@Override
public void buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){
public boolean buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){
//参数检查和状态检查
paramAndStatusCheck_BuyerModifyAddress(uid,orderCode,changedAddress);
... ... @@ -147,7 +148,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if(!changed){
logger.warn("buyerModifyAddress no change address return now!");
//throw new UfoServiceException(400,"地址信息无变化");
return ;
return false;
}
//更新收货地址:明文地址 . 隐藏地址
... ... @@ -161,6 +162,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
logger.info("buyerModifyAddress begin update address , uid is {}, orderCode is {},update address info {}",
uid, orderCode ,jo_address_string);
buyerOrderMetaService.updateDeliveryAddress(updateInfo);
return true;
}
private void paramAndStatusCheck_BuyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){
... ...