|
|
package com.yoho.ufo.order.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.yoho.order.dal.*;
|
|
|
import com.yoho.order.model.*;
|
|
|
import com.yoho.core.dal.datasource.annotation.Database;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.elasticsearch.common.collect.Maps;
|
|
|
import org.elasticsearch.common.netty.util.internal.StringUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.base.Splitter;
|
|
|
import com.yoho.core.dal.datasource.annotation.Database;
|
|
|
import com.yoho.core.redis.cluster.annotation.Redis;
|
|
|
import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations;
|
|
|
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.order.dal.*;
|
|
|
import com.yoho.order.model.*;
|
|
|
import com.yoho.service.model.order.request.OrderRequest;
|
|
|
import com.yoho.ufo.constants.PlatformConstant;
|
|
|
import com.yoho.ufo.constants.RedisKeyConstants;
|
...
|
...
|
@@ -63,11 +34,28 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType; |
|
|
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
|
|
|
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
|
|
|
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderDetailResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.*;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.elasticsearch.common.collect.Maps;
|
|
|
import org.elasticsearch.common.netty.util.internal.StringUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author caoyan
|
...
|
...
|
@@ -138,11 +126,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
@Autowired
|
|
|
private BuyerOrderFeedbackService buyerOrderFeedbackService;
|
|
|
|
|
|
@Autowired
|
|
|
private OrderConfigMapper orderConfigMapper;
|
|
|
|
|
|
private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
|
|
|
|
|
|
private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address";
|
|
|
|
|
|
private static final String SELLER_ORDER_META_KEY_FEE = "fee";
|
|
|
|
|
|
private static final String ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE = "inner_buyer_for_offline";
|
|
|
|
|
|
private static final Integer EXPRESS_TYPE_SELLER_TO_JUDGE = EnumExpressType.EXPRESS_TYPE_1.getCode();
|
|
|
|
...
|
...
|
@@ -1593,8 +1586,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
@Override
|
|
|
public QcOrderDetailResp getQcOrderDetail(String orderCode) {
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if(null == buyerOrder) {
|
...
|
...
|
@@ -1605,6 +1598,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
resp.setStatus(buyerOrder.getStatus());
|
|
|
resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
|
|
|
resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
//检查买家是否是线下店的用户
|
|
|
resp.setInnerBuyerType("0");
|
|
|
OrderConfig config = orderConfigMapper.selectByCode(ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE);
|
|
|
if(config!=null&&StringUtils.isNotBlank(config.getContent())&&buyerOrder.getUid()>0){
|
|
|
//
|
|
|
List<String> uidList = Splitter.on(",").trimResults().splitToList(config.getContent());
|
|
|
if(uidList.contains(String.valueOf(buyerOrder.getUid()))){
|
|
|
resp.setInnerBuyerType("1");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//卖家物流单号
|
|
|
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
|
...
|
...
|
|