Authored by qinchao

Merge branch 'hotfix_0410_内部买家' into test6.9.0

# Conflicts:
#	order/src/main/java/com/yoho/ufo/order/service/impl/BuyerOrderServiceImpl.java
  1 +package com.yoho.order.dal;
  2 +
  3 +import com.yoho.order.model.OrderConfig;
  4 +import org.apache.ibatis.annotations.Param;
  5 +
  6 +/**
  7 + * Created by craig.qin
  8 + */
  9 +public interface OrderConfigMapper {
  10 +
  11 + OrderConfig selectByCode(@Param("code") String code);
  12 +
  13 +}
  1 +package com.yoho.order.model;
  2 +
  3 +import lombok.Data;
  4 +import lombok.ToString;
  5 +
  6 +/**
  7 + * Created by craig.qin
  8 + */
  9 +@ToString
  10 +@Data
  11 +public class OrderConfig {
  12 +
  13 + private Integer id;
  14 + private String code;
  15 + private String name;
  16 + private String content;
  17 + private Integer createTime;
  18 +
  19 +
  20 +}
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.yoho.order.dal.OrderConfigMapper">
  4 + <resultMap id="BaseResultMap" type="com.yoho.order.model.OrderConfig">
  5 + <result column="id" property="id" jdbcType="INTEGER" />
  6 + <result column="code" property="code" jdbcType="VARCHAR" />
  7 + <result column="name" property="name" jdbcType="VARCHAR" />
  8 + <result column="content" property="content" jdbcType="VARCHAR" />
  9 + <result column="create_time" property="createTime" jdbcType="INTEGER" />
  10 + </resultMap>
  11 +
  12 + <sql id="Base_Column_List">
  13 + id, code, name, content, create_time
  14 + </sql>
  15 +
  16 + <select id="selectByCode" resultMap="BaseResultMap">
  17 + select <include refid="Base_Column_List" />
  18 + from order_config where code=#{code}
  19 + </select>
  20 +
  21 +
  22 +</mapper>
1 package com.yoho.ufo.order.service.impl; 1 package com.yoho.ufo.order.service.impl;
2 2
3 -import java.math.BigDecimal;  
4 -import java.util.ArrayList;  
5 -import java.util.Arrays;  
6 -import java.util.Collections;  
7 -import java.util.HashSet;  
8 -import java.util.List;  
9 -import java.util.Map;  
10 -import java.util.Objects;  
11 -import java.util.Set;  
12 -import java.util.concurrent.TimeUnit;  
13 -import java.util.stream.Collectors;  
14 -  
15 -import javax.annotation.Resource;  
16 -  
17 -import com.yoho.order.dal.*;  
18 -import com.yoho.order.model.*;  
19 -import com.yoho.core.dal.datasource.annotation.Database;  
20 -import org.apache.commons.collections.CollectionUtils;  
21 -import org.apache.commons.lang3.StringUtils;  
22 -import org.elasticsearch.common.collect.Lists;  
23 -import org.elasticsearch.common.collect.Maps;  
24 -import org.elasticsearch.common.netty.util.internal.StringUtil;  
25 -import org.slf4j.Logger;  
26 -import org.slf4j.LoggerFactory;  
27 -import org.springframework.beans.factory.annotation.Autowired;  
28 -import org.springframework.beans.factory.annotation.Value;  
29 -import org.springframework.http.HttpEntity;  
30 -import org.springframework.http.HttpHeaders;  
31 -import org.springframework.http.MediaType;  
32 -import org.springframework.http.ResponseEntity;  
33 -import org.springframework.stereotype.Service;  
34 -import org.springframework.web.client.RestTemplate;  
35 -  
36 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
37 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
  5 +import com.google.common.base.Splitter;
  6 +import com.yoho.core.dal.datasource.annotation.Database;
38 import com.yoho.core.redis.cluster.annotation.Redis; 7 import com.yoho.core.redis.cluster.annotation.Redis;
39 import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations; 8 import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations;
40 import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; 9 import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
41 import com.yoho.core.rest.client.ServiceCaller; 10 import com.yoho.core.rest.client.ServiceCaller;
42 import com.yoho.error.exception.ServiceException; 11 import com.yoho.error.exception.ServiceException;
  12 +import com.yoho.order.dal.*;
  13 +import com.yoho.order.model.*;
43 import com.yoho.service.model.order.request.OrderRequest; 14 import com.yoho.service.model.order.request.OrderRequest;
44 import com.yoho.ufo.constants.PlatformConstant; 15 import com.yoho.ufo.constants.PlatformConstant;
45 import com.yoho.ufo.constants.RedisKeyConstants; 16 import com.yoho.ufo.constants.RedisKeyConstants;
@@ -63,11 +34,28 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType; @@ -63,11 +34,28 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
63 import com.yohobuy.ufo.model.order.common.OperateTypeEnum; 34 import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
64 import com.yohobuy.ufo.model.order.constants.QNliveConstants; 35 import com.yohobuy.ufo.model.order.constants.QNliveConstants;
65 import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq; 36 import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
66 -import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;  
67 -import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;  
68 -import com.yohobuy.ufo.model.order.resp.OrderDetailResp;  
69 -import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;  
70 -import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp; 37 +import com.yohobuy.ufo.model.order.resp.*;
  38 +import org.apache.commons.collections.CollectionUtils;
  39 +import org.apache.commons.lang3.StringUtils;
  40 +import org.elasticsearch.common.collect.Lists;
  41 +import org.elasticsearch.common.collect.Maps;
  42 +import org.elasticsearch.common.netty.util.internal.StringUtil;
  43 +import org.slf4j.Logger;
  44 +import org.slf4j.LoggerFactory;
  45 +import org.springframework.beans.factory.annotation.Autowired;
  46 +import org.springframework.beans.factory.annotation.Value;
  47 +import org.springframework.http.HttpEntity;
  48 +import org.springframework.http.HttpHeaders;
  49 +import org.springframework.http.MediaType;
  50 +import org.springframework.http.ResponseEntity;
  51 +import org.springframework.stereotype.Service;
  52 +import org.springframework.web.client.RestTemplate;
  53 +
  54 +import javax.annotation.Resource;
  55 +import java.math.BigDecimal;
  56 +import java.util.*;
  57 +import java.util.concurrent.TimeUnit;
  58 +import java.util.stream.Collectors;
71 59
72 /** 60 /**
73 * @author caoyan 61 * @author caoyan
@@ -138,12 +126,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -138,12 +126,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
138 @Autowired 126 @Autowired
139 private BuyerOrderFeedbackService buyerOrderFeedbackService; 127 private BuyerOrderFeedbackService buyerOrderFeedbackService;
140 128
  129 + @Autowired
  130 + private OrderConfigMapper orderConfigMapper;
  131 +
141 private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address"; 132 private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
142 133
143 private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address"; 134 private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address";
144 135
145 private static final String SELLER_ORDER_META_KEY_FEE = "fee"; 136 private static final String SELLER_ORDER_META_KEY_FEE = "fee";
146 137
  138 + private static final String ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE = "inner_buyer_for_offline";
  139 +
147 private static final Integer EXPRESS_TYPE_SELLER_TO_JUDGE = EnumExpressType.EXPRESS_TYPE_1.getCode(); 140 private static final Integer EXPRESS_TYPE_SELLER_TO_JUDGE = EnumExpressType.EXPRESS_TYPE_1.getCode();
148 141
149 private static final Integer EXPRESS_TYPE_JUDGE_TO_BUYER = EnumExpressType.EXPRESS_TYPE_2.getCode(); 142 private static final Integer EXPRESS_TYPE_JUDGE_TO_BUYER = EnumExpressType.EXPRESS_TYPE_2.getCode();
@@ -1606,6 +1599,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -1606,6 +1599,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
1606 resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus())); 1599 resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
1607 resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); 1600 resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
1608 1601
  1602 + //检查买家是否是线下店的用户
  1603 + resp.setInnerBuyerType("0");
  1604 + OrderConfig config = orderConfigMapper.selectByCode(ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE);
  1605 + if(config!=null&&StringUtils.isNotBlank(config.getContent())&&buyerOrder.getUid()>0){
  1606 + //
  1607 + List<String> uidList = Splitter.on(",").trimResults().splitToList(config.getContent());
  1608 + if(uidList.contains(String.valueOf(buyerOrder.getUid()))){
  1609 + resp.setInnerBuyerType("1");
  1610 + }
  1611 + }
  1612 +
1609 //卖家物流单号 1613 //卖家物流单号
1610 ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(), 1614 ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
1611 buyerOrder.getSellerUid(), EXPRESS_TYPE_SELLER_TO_JUDGE); 1615 buyerOrder.getSellerUid(), EXPRESS_TYPE_SELLER_TO_JUDGE);
@@ -45,6 +45,7 @@ datasources: @@ -45,6 +45,7 @@ datasources:
45 - com.yoho.order.dal.BusinessLicenseMapper 45 - com.yoho.order.dal.BusinessLicenseMapper
46 - com.yoho.order.dal.LiveRecordTimeMapper 46 - com.yoho.order.dal.LiveRecordTimeMapper
47 - com.yoho.order.dal.SignForPackageMapper 47 - com.yoho.order.dal.SignForPackageMapper
  48 + - com.yoho.order.dal.OrderConfigMapper
48 49
49 ufo_resource: 50 ufo_resource:
50 servers: 51 servers:
@@ -45,6 +45,7 @@ datasources: @@ -45,6 +45,7 @@ datasources:
45 - com.yoho.order.dal.BusinessLicenseMapper 45 - com.yoho.order.dal.BusinessLicenseMapper
46 - com.yoho.order.dal.LiveRecordTimeMapper 46 - com.yoho.order.dal.LiveRecordTimeMapper
47 - com.yoho.order.dal.SignForPackageMapper 47 - com.yoho.order.dal.SignForPackageMapper
  48 + - com.yoho.order.dal.OrderConfigMapper
48 49
49 ufo_resource: 50 ufo_resource:
50 servers: 51 servers: