|
|
package com.yohoufo.order.service;
|
|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.sun.corba.se.spi.ior.IOR;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.service.model.response.UserAddressRspBO;
|
|
|
import com.yohobuy.ufo.model.order.bo.PlatformFee;
|
|
|
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
|
...
|
...
|
@@ -10,17 +13,28 @@ import com.yohoufo.common.caller.UfoServiceCaller; |
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
|
|
import com.yohoufo.common.utils.PriceFormater;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.common.OrderCodeType;
|
|
|
import com.yohoufo.order.common.OrderListType;
|
|
|
import com.yohoufo.order.common.SellerOrderListType;
|
|
|
import com.yohoufo.order.model.AddressInfo;
|
|
|
import com.yohoufo.order.model.GoodsInfo;
|
|
|
import com.yohoufo.order.model.SellerOrderContext;
|
|
|
import com.yohoufo.order.model.dto.PlatformFeeDto;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
|
import com.yohoufo.order.request.OrderListRequest;
|
|
|
import com.yohoufo.order.response.OrderListInfo;
|
|
|
import com.yohoufo.order.response.OrderListInfoRsp;
|
|
|
import com.yohoufo.order.service.IOrderListService;
|
|
|
import com.yohoufo.order.service.handler.SellerOrderComputeHandler;
|
|
|
import com.yohoufo.order.service.handler.SellerOrderSubmitHandler;
|
|
|
import com.yohoufo.order.service.impl.AbsOrderListService;
|
|
|
import com.yohoufo.order.service.proxy.UserProxyService;
|
|
|
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
|
|
|
import com.yohoufo.product.model.GoodsSize;
|
...
|
...
|
@@ -32,6 +46,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -39,7 +54,7 @@ import java.util.Objects; |
|
|
*/
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
public class SellerOrderService {
|
|
|
public class SellerOrderService extends AbsOrderListService implements IOrderListService {
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderMapper sellerOrderMapper;
|
...
|
...
|
@@ -151,10 +166,6 @@ public class SellerOrderService { |
|
|
}
|
|
|
|
|
|
|
|
|
public OrderListInfoRsp getOrderList(SellerOrderListReq req){
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
private GoodsInfo getProductDetail(SellerOrderContext context){
|
|
|
int uid = context.getUid();
|
...
|
...
|
@@ -300,7 +311,66 @@ public class SellerOrderService { |
|
|
return PriceFormater.addCnCurrencySymbol(BigDecimalHelper.formatNumber(fee, BigDecimalHelper.FORMAT_TWOBITAFTERPOINT));
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
BuyerOrderMapper buyerOrderMapper;
|
|
|
|
|
|
@Autowired
|
|
|
BuyerOrderGoodsMapper buyerOrderGoodsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
|
|
|
|
|
@Override
|
|
|
public OrderListInfoRsp getOrderList(OrderListRequest request){
|
|
|
int type;
|
|
|
if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()){
|
|
|
|
|
|
//todo
|
|
|
log.info("in seller getOrderList");
|
|
|
return null;
|
|
|
}else{
|
|
|
return super.getOrderList(request);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected List<Integer> initOrderListRequest(OrderListRequest request) {
|
|
|
if (request.getUid() < 0){
|
|
|
log.warn("initOrderListRequest uid is {}", request.getUid());
|
|
|
throw new ServiceException(ServiceError.ORDER_UID_IS_EMPTY);
|
|
|
}
|
|
|
|
|
|
SellerOrderListType orderListType = SellerOrderListType.getOrderListType(request.getType());
|
|
|
if (orderListType == null){
|
|
|
log.warn("initOrderListRequest type invalidate, uid is {}, type is {}",request.getUid(), request.getType());
|
|
|
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
|
|
|
}
|
|
|
|
|
|
request.setPage(request.getPage() > 0 ? request.getPage() : 1);
|
|
|
request.setLimit( request.getLimit() > 0 ? request.getLimit() : 10 );
|
|
|
return orderListType.getStatus();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
int getTotal(int uid, List<Integer> statusQuery) {
|
|
|
return buyerOrderMapper.selectCntBySellerUidStatus(uid, statusQuery);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
List<BuyerOrder> getOrderList(int uid, List<Integer> statusQuery, int offset, int limit){
|
|
|
List<BuyerOrder> buyerOrderList = buyerOrderMapper.selectListBySellerUidStatus(uid, statusQuery, offset, limit);
|
|
|
return buyerOrderList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
List<BuyerOrderGoods> getOrderGoodsList(int uid, List<Long> orderCodeList){
|
|
|
List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectByOrderCodeList(null, orderCodeList);
|
|
|
return buyerOrderGoodsList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
List<SellerOrderGoods> getBaseOrderGoodsList(List<Integer> skups){
|
|
|
List<SellerOrderGoods> sellerOrderGoodsList = sellerOrderGoodsMapper.selectBySkups(skups);
|
|
|
return sellerOrderGoodsList;
|
|
|
}
|
|
|
} |
...
|
...
|
|