...
|
...
|
@@ -5,12 +5,12 @@ import com.yoho.error.ServiceError; |
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.PriceFormater;
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
|
|
import com.yohoufo.order.common.*;
|
|
|
import com.yohoufo.order.common.OrderCodeType;
|
|
|
import com.yohoufo.order.common.Payment;
|
|
|
import com.yohoufo.order.common.SkupStatus;
|
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.constants.OrderConstant;
|
|
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
|
|
import com.yohoufo.order.model.AddressInfo;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
...
|
...
|
@@ -58,6 +58,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
@Autowired
|
|
|
private SellerOrderMetaMapper somMapper;
|
|
|
|
|
|
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
|
|
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -88,19 +91,18 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
Integer skupStatusCode = sellerOrderGoods.getStatus();
|
|
|
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
|
|
|
|
|
|
SoldPrdComputeBo computeBo = getSoldPrdCompute(uid, skup);
|
|
|
|
|
|
SellerOrderMeta addressMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.BACK_2_SELLER_DELIVERY_ADDRESS);
|
|
|
AddressInfo addressInfo = JSONObject.parseObject(addressMeta.getMetaValue(), AddressInfo.class);
|
|
|
|
|
|
return buildOrderDetail(sellerOrder, skupStatus, sellerOrderGoods, computeBo, addressInfo);
|
|
|
return buildOrderDetail(sellerOrder, skupStatus, sellerOrderGoods, addressInfo);
|
|
|
}
|
|
|
|
|
|
return super.getOrderDetail(orderRequest);
|
|
|
}
|
|
|
|
|
|
|
|
|
SoldPrdComputeBo getSoldPrdCompute(int uid, int skup){
|
|
|
@Override
|
|
|
void assembleSoldPrdCompute(OrderDetailInfo orderDetailInfo, int uid, int skup){
|
|
|
SellerOrderMeta feeMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE);
|
|
|
boolean metaIsPresent = Objects.nonNull(feeMeta);
|
|
|
SoldPrdComputeBo computeBo = null;
|
...
|
...
|
@@ -108,7 +110,13 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class);
|
|
|
computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult);
|
|
|
}
|
|
|
return computeBo;
|
|
|
if(Objects.nonNull(computeBo)){
|
|
|
orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
orderDetailInfo.setIncome(computeBo.getIncome());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -165,6 +173,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
*/
|
|
|
private GoodsInfo getGoodsInfo(SellerOrderGoods sellerOrderGoods) {
|
|
|
GoodsInfo goodsInfo = new GoodsInfo();
|
|
|
goodsInfo.setSkup(sellerOrderGoods.getId());
|
|
|
goodsInfo.setProductName(sellerOrderGoods.getProductName());
|
|
|
goodsInfo.setColorName(sellerOrderGoods.getColorName());
|
|
|
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
|
...
|
...
|
@@ -199,9 +208,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
return statusDetail;
|
|
|
}
|
|
|
|
|
|
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
|
|
|
|
|
|
|
|
private Long getOrderCode(SkupStatus skupStatus, SellerOrder order){
|
|
|
Long orderCode;
|
...
|
...
|
@@ -214,8 +221,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
}
|
|
|
|
|
|
private OrderDetailInfo buildOrderDetail(SellerOrder order, SkupStatus skupStatus,
|
|
|
SellerOrderGoods sellerOrderGoods, SoldPrdComputeBo computeBo
|
|
|
, AddressInfo addressInfo
|
|
|
SellerOrderGoods sellerOrderGoods, AddressInfo addressInfo
|
|
|
) {
|
|
|
OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
|
|
|
orderDetailInfo.setUid(order.getUid());
|
...
|
...
|
@@ -224,13 +230,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
|
|
orderDetailInfo.setUserAddress(addressInfo);
|
|
|
//卖家
|
|
|
orderDetailInfo.setIncome(order.getIncome().toPlainString());
|
|
|
if(Objects.nonNull(computeBo)){
|
|
|
orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
}
|
|
|
assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
|
|
|
|
|
|
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
|
|
|
orderDetailInfo.setStatusDetail(statusDetail);
|
...
|
...
|
|