Authored by qinchao

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

@@ -16,6 +16,7 @@ import com.yohoufo.order.model.response.OrderDetailInfo; @@ -16,6 +16,7 @@ import com.yohoufo.order.model.response.OrderDetailInfo;
16 import com.yohoufo.order.service.IBuyerOrderService; 16 import com.yohoufo.order.service.IBuyerOrderService;
17 import com.yohoufo.order.service.impl.SellerFeeService; 17 import com.yohoufo.order.service.impl.SellerFeeService;
18 import com.yohoufo.order.service.impl.SellerOrderService; 18 import com.yohoufo.order.service.impl.SellerOrderService;
  19 +import org.apache.commons.lang3.StringUtils;
19 import org.slf4j.Logger; 20 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory; 21 import org.slf4j.LoggerFactory;
21 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
@@ -136,8 +137,13 @@ public class BuyerOrderController { @@ -136,8 +137,13 @@ public class BuyerOrderController {
136 } 137 }
137 138
138 LOG.info("in ufo.order.buyerModifyAddress, uid {},orderCode {} request addressInfo {} ", addressInfo.getUid(),orderCode,addressInfo); 139 LOG.info("in ufo.order.buyerModifyAddress, uid {},orderCode {} request addressInfo {} ", addressInfo.getUid(),orderCode,addressInfo);
139 - buyerOrderService.buyerModifyAddress(addressInfo.getUid(),orderCode,addressInfo);  
140 - return new ApiResponse.ApiResponseBuilder().code(200).message("修改收货地址成功").build(); 140 + //如果地址信息没有变化,返回false,有变化返回true
  141 + boolean changed = buyerOrderService.buyerModifyAddress(addressInfo.getUid(),orderCode,addressInfo);
  142 + String info = StringUtils.EMPTY;
  143 + if(changed){
  144 + info = "修改成功";
  145 + }
  146 + return new ApiResponse.ApiResponseBuilder().code(200).message(info).build();
141 } 147 }
142 148
143 149
@@ -30,8 +30,9 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi @@ -30,8 +30,9 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi
30 30
31 /** 31 /**
32 * 买家修改收货地址 32 * 买家修改收货地址
  33 + * 如果地址信息没有变化,返回false,有变化返回true
33 */ 34 */
34 - void buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress); 35 + boolean buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress);
35 36
36 /** 37 /**
37 * 根据uid查询购买的订单数目 38 * 根据uid查询购买的订单数目
@@ -123,9 +123,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -123,9 +123,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
123 /** 123 /**
124 * 买家修改收货地址: 124 * 买家修改收货地址:
125 * 鉴定中心确定收货之前,都可以修改地址 125 * 鉴定中心确定收货之前,都可以修改地址
  126 + * 如果地址信息没有变化,返回false,有变化返回true
126 */ 127 */
127 @Override 128 @Override
128 - public void buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){ 129 + public boolean buyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){
129 //参数检查和状态检查 130 //参数检查和状态检查
130 paramAndStatusCheck_BuyerModifyAddress(uid,orderCode,changedAddress); 131 paramAndStatusCheck_BuyerModifyAddress(uid,orderCode,changedAddress);
131 132
@@ -147,7 +148,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -147,7 +148,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
147 if(!changed){ 148 if(!changed){
148 logger.warn("buyerModifyAddress no change address return now!"); 149 logger.warn("buyerModifyAddress no change address return now!");
149 //throw new UfoServiceException(400,"地址信息无变化"); 150 //throw new UfoServiceException(400,"地址信息无变化");
150 - return ; 151 + return false;
151 } 152 }
152 153
153 //更新收货地址:明文地址 . 隐藏地址 154 //更新收货地址:明文地址 . 隐藏地址
@@ -161,6 +162,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -161,6 +162,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
161 logger.info("buyerModifyAddress begin update address , uid is {}, orderCode is {},update address info {}", 162 logger.info("buyerModifyAddress begin update address , uid is {}, orderCode is {},update address info {}",
162 uid, orderCode ,jo_address_string); 163 uid, orderCode ,jo_address_string);
163 buyerOrderMetaService.updateDeliveryAddress(updateInfo); 164 buyerOrderMetaService.updateDeliveryAddress(updateInfo);
  165 + return true;
164 } 166 }
165 167
166 private void paramAndStatusCheck_BuyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){ 168 private void paramAndStatusCheck_BuyerModifyAddress(int uid, long orderCode,AddressInfo changedAddress){