Authored by qinchao

修改地址参考有货规则

... ... @@ -123,6 +123,9 @@ public class BuyerOrderController {
/**
* 买家修改收货地址
* 最新逻辑:手机号码、详细地址和收货人如果存在*号,先判断是不是跟原来的一样,如果不一样,
* 详细地址和收货人存在*号,直接报错,手机号码肯定不符合数字规则
*
* @return
*/
@RequestMapping(params = "method=ufo.buyer.modifyAddress")
... ...
... ... @@ -15,6 +15,7 @@ import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohobuy.ufo.model.order.vo.OrderListVo;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.common.utils.UserInfoHiddenHelper;
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
... ... @@ -156,14 +157,29 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//详细地址没有变化
if(StringUtils.equals(dbAddressInfo_hidden.getAddress(),changedAddress.getAddress())){
changedAddress.setAddress(dbAddressInfo.getAddress());
}else{
if(changedAddress.getAddress().contains("*")){
logger.warn("dbAddressInfo_hidden is null ,uid {} ,orderCode {} , invalid address with * {}",uid,orderCode,changedAddress.getAddress());
throw new UfoServiceException(400,"详细地址信息格式填写错误");
}
}
//收货人没有变化
if(StringUtils.equals(dbAddressInfo_hidden.getConsignee(),changedAddress.getConsignee())){
changedAddress.setConsignee(dbAddressInfo.getConsignee());
}else{
if(changedAddress.getConsignee().contains("*")){
logger.warn("dbAddressInfo_hidden is null ,uid {} ,orderCode {} , invalid consignee with * {}",uid,orderCode,changedAddress.getConsignee());
throw new UfoServiceException(400,"收货人格式填写错误");
}
}
//手机号没有变化
if(StringUtils.equals(dbAddressInfo_hidden.getMobile(),changedAddress.getMobile())){
changedAddress.setMobile(dbAddressInfo.getMobile());
}else{
if(!UserInfoHiddenHelper.isPhone(changedAddress.getMobile())){
logger.warn("dbAddressInfo_hidden is null ,uid {} ,orderCode {} , invalid mobile {}",uid,orderCode,changedAddress.getMobile());
throw new UfoServiceException(400,"手机号码格式填写错误");
}
}
boolean changed = convertAddressInfoFrontRequest(dbAddressInfo,changedAddress);
... ... @@ -190,9 +206,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
//买家已付款,卖家已发货,只有这两种状态的情况下,才允许改地址
/*boolean allowChange = buyerOrder.getStatus().intValue() == OrderStatus.HAS_PAYED.getCode()
||buyerOrder.getStatus().intValue() == OrderStatus.SELLER_SEND_OUT.getCode() ;*/
boolean allowChange = ActionStatusHold.buyerCanModifyAddress(buyerOrder.getStatus());
if(!allowChange){
logger.warn("buyerModifyAddress check orderCode status not invalid, uid is {}, orderCode is {} ,status is {}",
... ...