Authored by qinchao

内部买家标识

package com.yoho.order.dal;
import com.yoho.order.model.OrderConfig;
import org.apache.ibatis.annotations.Param;
/**
* Created by craig.qin
*/
public interface OrderConfigMapper {
OrderConfig selectByCode(@Param("code") String code);
}
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
/**
* Created by craig.qin
*/
@ToString
@Data
public class OrderConfig {
private Integer id;
private String code;
private String name;
private String content;
private Integer createTime;
}
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.order.dal.OrderConfigMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.OrderConfig">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, code, name, content, create_time
</sql>
<select id="selectByCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from order_config where code=#{code}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -14,7 +14,10 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.google.common.base.Splitter;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -38,41 +41,6 @@ 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.AppraiseAddressMapper;
import com.yoho.order.dal.AreaMapper;
import com.yoho.order.dal.BuyerOrderGoodsMapper;
import com.yoho.order.dal.BuyerOrderMapper;
import com.yoho.order.dal.BuyerOrderMetaMapper;
import com.yoho.order.dal.ExpressCompanyMapper;
import com.yoho.order.dal.ExpressInfoMapper;
import com.yoho.order.dal.ExpressRecordMapper;
import com.yoho.order.dal.OrderOperateRecordMapper;
import com.yoho.order.dal.OrdersPayMapper;
import com.yoho.order.dal.QiniuLiveRecordMapper;
import com.yoho.order.dal.QualityCheckMapper;
import com.yoho.order.dal.SellerOrderGoodsMapper;
import com.yoho.order.dal.SellerOrderMapper;
import com.yoho.order.dal.SellerOrderMetaMapper;
import com.yoho.order.dal.SignForPackageMapper;
import com.yoho.order.model.AppraiseAddress;
import com.yoho.order.model.Area;
import com.yoho.order.model.BuyerOrder;
import com.yoho.order.model.BuyerOrderFeedback;
import com.yoho.order.model.BuyerOrderGoods;
import com.yoho.order.model.BuyerOrderMeta;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.ExpressCompany;
import com.yoho.order.model.ExpressInfo;
import com.yoho.order.model.ExpressRecord;
import com.yoho.order.model.OrderOperateRecord;
import com.yoho.order.model.OrdersPay;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.order.model.QualityCheck;
import com.yoho.order.model.QualityCheckResp;
import com.yoho.order.model.SellerOrder;
import com.yoho.order.model.SellerOrderGoods;
import com.yoho.order.model.SellerOrderMeta;
import com.yoho.order.model.SignForPackage;
import com.yoho.service.model.order.request.OrderRequest;
import com.yoho.ufo.constants.PlatformConstant;
import com.yoho.ufo.constants.RedisKeyConstants;
... ... @@ -168,11 +136,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();
... ... @@ -1612,8 +1585,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return resp;
}
@Override
@Override
public QcOrderDetailResp getQcOrderDetail(String orderCode) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if(null == buyerOrder) {
... ... @@ -1624,6 +1597,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(),
... ...
... ... @@ -45,6 +45,7 @@ datasources:
- com.yoho.order.dal.BusinessLicenseMapper
- com.yoho.order.dal.LiveRecordTimeMapper
- com.yoho.order.dal.SignForPackageMapper
- com.yoho.order.dal.OrderConfigMapper
ufo_resource:
servers:
... ...
... ... @@ -45,6 +45,7 @@ datasources:
- com.yoho.order.dal.BusinessLicenseMapper
- com.yoho.order.dal.LiveRecordTimeMapper
- com.yoho.order.dal.SignForPackageMapper
- com.yoho.order.dal.OrderConfigMapper
ufo_resource:
servers:
... ...