Authored by caoyan

增加香港现货

... ... @@ -3,10 +3,10 @@ package com.yoho.order.model;
import java.util.List;
import com.yoho.ufo.service.model.PageRequestBO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Builder;
/**
... ... @@ -132,4 +132,6 @@ public class BuyerOrderReq extends PageRequestBO{
private String phoneUid;
private String sortRule;
private Integer region;//0:大陆 1:香港
}
... ...
... ... @@ -12,6 +12,8 @@ public class SellerOrderGoods implements Serializable {
private Integer id;
private Integer region;
private Integer uid;
private Integer productId;
... ... @@ -46,6 +48,14 @@ public class SellerOrderGoods implements Serializable {
this.id = id;
}
public Integer getRegion() {
return region;
}
public void setRegion(Integer region) {
this.region = region;
}
public Integer getUid() {
return uid;
}
... ...
... ... @@ -205,12 +205,15 @@
and a.platform_delivery_status in (1,2)
</if>
</if>
<if test="buyerOrderReq.region != null and buyerOrderReq.region != '' ">
and c.region = #{buyerOrderReq.region}
</if>
</sql>
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
select count(a.id)
from buyer_order a
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null) or (buyerOrderReq.storageId != null)">
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null) or (buyerOrderReq.storageId != null) or (buyerOrderReq.region != null)">
LEFT JOIN buyer_order_goods b
ON( b.order_code=a.order_code)
LEFT JOIN seller_order_goods c
... ... @@ -231,7 +234,7 @@
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BuyerOrderReq">
select a.*
from buyer_order a
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null) or (buyerOrderReq.storageId != null)">
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null) or (buyerOrderReq.storageId != null) or (buyerOrderReq.region != null)">
LEFT JOIN buyer_order_goods b
ON( b.order_code=a.order_code)
LEFT JOIN seller_order_goods c
... ...
... ... @@ -3,6 +3,7 @@
<mapper namespace="com.yoho.order.dal.SellerOrderGoodsMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.SellerOrderGoods">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="region" property="region" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="product_id" property="productId" jdbcType="INTEGER" />
<result column="product_name" property="productName" jdbcType="VARCHAR" />
... ... @@ -19,7 +20,7 @@
</resultMap>
<sql id="Base_Column_List">
id, uid, product_id, product_name, storage_id, depot_no, size_id, size_name, color_id,
id, region, uid, product_id, product_name, storage_id, depot_no, size_id, size_name, color_id,
color_name, goods_price, status, image_id, image_url
</sql>
... ...
... ... @@ -111,6 +111,7 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
... ... @@ -255,17 +256,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private SignForPackageMapper signForPackageMapper;
//南京月结账号
// private static final String NANJING_CUSTID = "0255045253";
// private static final String NANJING_CUSTID = "9999999999";
//北京月结账号
// private static final String BEIJING_CUSTID = "0100026158";
// private static final String BEIJING_CUSTID = "9999999999";
private static final Integer PAY_METHOD_MONTHLY = 1;//寄付月结
private static final Integer PAY_METHOD_FREIGHT_COLLECT = 2;//到付
private static final Integer REGION_MAINLAND = 0;//大陆
private static final Integer REGION_HONGKONG = 1;//香港
//已收货
private static final Byte QC_STATUS_RECEIVED = 0;
... ... @@ -1673,6 +1670,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
SellerOrderGoods sellerGoods = sellerGoodsList.get(0);
resp.setDepotNo(sellerGoods.getDepotNo());
resp.setRegion(sellerGoods.getRegion());
//商品信息
resp.setProductImage(ImagesHelper.getImageAbsoluteUrl(sellerGoods.getImageUrl(), ImagesConstant.BUCKET_GOODS_IMG));
... ... @@ -2556,7 +2554,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setChannel(Objects.equals(item.getAttributes(), 2) ? 2 : 1); //1,线上订单; 2,门店订单
resp.setProductNum(1);//目前固定为1
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes()));
resp.setActivityType(item.getActivityType());
if(null==sellerGoodsMap.get(skup)){
LOGGER.warn("convertToResp not correct data,sellerGoodsMap get sku p {} is empty ,buyer order {}",skup,item);
... ... @@ -2566,6 +2563,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setProductName(sellerGoodsMap.get(skup).getProductName());
resp.setColorName(sellerGoodsMap.get(skup).getColorName());
resp.setSizeName(sellerGoodsMap.get(skup).getSizeName());
resp.setAttributesStr(getAttributesStr(sellerGoodsMap.get(skup).getRegion(), item.getAttributes()));
}
resp.setSkup(skup);
... ... @@ -2634,6 +2632,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return respList;
}
private String getAttributesStr(Integer region, Integer attributes) {
String result = OrderConfigConstant.getOrderAttributeStr(attributes);
if(REGION_HONGKONG.equals(region) && attributes.equals(OrderAttributes.COMMON_IN_STOCK.getCode())) {
result = "香港直邮";
}
return result;
}
private List<BuyerOrderResp> convertToRespForQuery(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
Map<Integer, SellerOrderGoods> sellerGoodsMap, Map<String, ExpressRecord> expressInfoMap,
... ... @@ -2775,7 +2782,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
if(null != req.getAttributes() && 0 != req.getAttributes()){
if(null != req.getAttributes() && 0 != req.getAttributes() && 11 != req.getAttributes()){
req.setAttributesList(Arrays.asList(req.getAttributes()));
}
... ... @@ -2813,6 +2820,11 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}else if(StringUtils.isNotEmpty(req.getBuyerEndTime())){
req.setBuyerEndTime(req.getBuyerEndTime().substring(0, 10));
}
if(null != req.getAttributes() && req.getAttributes().intValue() == 11) {//香港直邮
req.setRegion(REGION_HONGKONG);
req.setAttributes(OrderAttributes.COMMON_IN_STOCK.getCode());
}
}
... ...
... ... @@ -461,6 +461,8 @@ function getOrderInfo(orderCode){
attributesStr = '全新瑕疵';
}else if("6" == attributes){
attributesStr = '二手';
}else if("1" == attributes && "1" == result.data.region){
attributesStr = '香港直邮';
}
$("#preSellOrNormal").html(attributesStr);
if (result.data.activityType == 18) {
... ...
... ... @@ -134,6 +134,7 @@
<option value="4">预售</option>
<option value="5">全新瑕疵</option>
<option value="6">二手</option>
<option value="11">香港直邮</option>
</select>
<label>买家下单时间:</label>
<input id="buyerStartTime" type="text">
... ...