Authored by chenchao

save one new goods of seller with skup-type

... ... @@ -51,6 +51,9 @@ public class SellerOrderGoods {
@Getter@Setter
private Integer storageNum;
@Getter@Setter
private Integer attributes;
public String getImageUrl() {
return imageUrl;
}
... ...
... ... @@ -18,7 +18,6 @@
<result column="buyer_order_status" jdbcType="INTEGER" property="buyerOrderStatus" />
<result column="seller_order_status" jdbcType="INTEGER" property="sellerOrderStatus" />
<result column="channel_no" jdbcType="VARCHAR" property="channelNo" />
<result column="attributes" jdbcType="INTEGER" property="attributes" />
</resultMap>
<sql id="Base_Column_List">
... ...
... ... @@ -19,15 +19,16 @@
<result column="batch_no" jdbcType="BIGINT" property="batchNo" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="skup_list" jdbcType="VARCHAR" property="skupList" />
<result column="attributes" jdbcType="INTEGER" property="attributes" />
</resultMap>
<sql id="Base_Column_List">
id, uid, product_id, product_name, storage_id, depot_no, size_id, size_name,
color_id, color_name, goods_price, status, image_url, is_del, batch_no
color_id, color_name, goods_price, status, image_url, is_del, batch_no, attributes
</sql>
<sql id="Associated_Base_Column_List">
sog.id, sog.uid, sog.product_id, sog.product_name, sog.storage_id, sog.depot_no, sog.size_id, sog.size_name,
sog.color_id, sog.color_name, sog.goods_price, sog.status, sog.image_url, sog.is_del, sog.batch_no
sog.color_id, sog.color_name, sog.goods_price, sog.status, sog.image_url, sog.is_del, sog.batch_no, sog.attributes
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
select
... ... @@ -192,6 +193,9 @@
<if test="batchNo != null">
batch_no,
</if>
<if test="attributes != null">
attributes,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">
... ... @@ -233,11 +237,12 @@
<if test="batchNo != null">
#{batchNo,jdbcType=BIGINT},
</if>
<if test="attributes != null">
#{attributes,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateStatusBySkpu" parameterType="com.yohoufo.dal.order.model.SellerOrderGoods">
update seller_order_goods
<set>
... ...
package com.yohoufo.order.convert;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.model.response.GoodsInfo;
import java.util.Optional;
/**
* Created by chao.chen on 2018/11/2.
*/
... ... @@ -47,6 +50,8 @@ public class GoodsInfoConvertor {
sellerOrderGoods.setSizeName(goodsInfo.getSizeName());
sellerOrderGoods.setImageUrl(goodsInfo.getImageUrl());
sellerOrderGoods.setBatchNo(goodsInfo.getBatchNo());
//default is in-stock
sellerOrderGoods.setAttributes(Optional.ofNullable(goodsInfo.getSkupType()).orElse(SkupType.IN_STOCK).prdAttributes().getCode());
return sellerOrderGoods;
}
}
... ...
package com.yohoufo.order.model;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
... ... @@ -47,4 +48,9 @@ public class SellerOrderContext {
private transient SellerOrderGoods sellerOrderGoods;
private String priceOverFlowTips;
/**
* 现货 or 预售
*/
private SkupType skupType;
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.common.SellerWalletType;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohoufo.common.exception.GatewayException;
... ... @@ -105,7 +106,6 @@ public class SellerOrderPrepareProcessor {
}
//the address of send back 2 seller
//
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
... ... @@ -144,6 +144,9 @@ public class SellerOrderPrepareProcessor {
log.info("in buildSellerOrderContext , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
goodsInfo.getPrice(), computeResult);
context.setSellerOrderComputeResult(computeResult);
//
SkupType skupType = SkupType.getSkupType(req.getSkupType());
context.setSkupType(skupType);
return context;
}
... ... @@ -171,6 +174,7 @@ public class SellerOrderPrepareProcessor {
goodsInfo.setImageUrl(prdResp.getImageUrl());
goodsInfo.setPrice(salePrice);
goodsInfo.setStorageId(context.getStorageId());
goodsInfo.setSkupType(context.getSkupType());
return goodsInfo;
}catch (Exception ex){
log.warn("in getProductDetail occur error, uid {}, storageId {}", uid, storageId);
... ...