Authored by qinchao

去掉不用接口

... ... @@ -152,19 +152,6 @@ public class BuyerOrderController {
return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("取消成功").build();
}
/**
* 更新收货地址:待付款状态的订单
*/
@RequestMapping(params = "method=ufo.buyer.updateAddress")
@ResponseBody
public ApiResponse updateAddress(@RequestParam("orderCode") long orderCode,
@RequestParam("uid") int uid,@RequestParam("address") String address) {
LOG.info("method ufo.buyer.updateAddress in, orderCode is {}, uid is {} ,address is {}", orderCode, uid,address);
boolean data = buyerOrderService.updateAddress(uid, orderCode,address);
LOG.info("method ufo.buyer.updateAddress out, orderCode is {}, uid is {}", orderCode, uid);
return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("修改收货地址成功").build();
}
/**
* 确认收货
... ...
... ... @@ -33,8 +33,6 @@ public interface IBuyerOrderService extends IOrderListService, IOrderDetailServi
boolean delete(int uid, long orderCode);
boolean updateAddress(int uid, long orderCode,String address);
void confirmReceive(long orderCode);
}
... ...
... ... @@ -10,13 +10,11 @@ import com.yohoufo.dal.order.BuyerOrderMetaMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.common.DelStatus;
import com.yohoufo.order.common.OrderStatus;
import com.yohoufo.order.common.SkupStatus;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.model.AddressInfo;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.model.request.OrderRequest;
... ... @@ -26,7 +24,6 @@ import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.utils.SmsHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -232,42 +229,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Override
public boolean updateAddress(int uid, long orderCode,String address){
if (uid < 0
|| orderCode < 0|| StringUtils.isBlank(address)){
logger.warn("buyer updateAddress, uid or orderCode empty, uid {}, orderCode {},address {}", uid, orderCode,address);
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, uid);
if (Objects.isNull(buyerOrder)){
logger.warn("buyer updateAddress, order not exist, uid {}, orderCode {},address {}", uid, orderCode,address);
throw new ServiceException(400,"订单不存在");
}
Integer status= buyerOrder.getStatus();
if(OrderStatus.WAITING_PAY.getCode()!=status.intValue()){
logger.warn("buyer updateAddress, uid or orderCode status is not waiting pay, uid {}, orderCode {} address{} ,now status {}", uid, orderCode,address,status);
throw new ServiceException(400,"订单状态已更新,不允许更改地址");
}
//开始更新
BuyerOrderMeta meta=new BuyerOrderMeta();
meta.setUid(uid);
meta.setOrderCode(orderCode);
meta.setMetaKey(MetaKey.BUYER_DELIVERY_ADDRESS);
meta.setMetaValue(address);
logger.info("buyer updateAddress, uid {}, orderCode {} address{} ,meta param {} begin ",uid, orderCode,address,meta);
int result = buyerOrderMetaMapper.updateMetaValueByUidAndOrderCodeAndMetaKey(meta);
logger.info("buyer updateAddress, uid {}, orderCode {} address{} ,meta param {} end ,result {} ",uid, orderCode,address,meta,result);
if(result<=0){
return false;
}else{
return true;
}
}
@Override
public void confirmReceive(long orderCode) {
logger.info("in confirmReceive, orderCode {}", orderCode);
OrderStatus expectStatus = OrderStatus.SELLER_SEND_OUT;
... ...