saveNetSaleAllInfo.md
10.7 KB
保存网销的完整信息
接口名:
/product/saveNetSaleAllInfo
方法
POST JSONRAW
入参
属性名称 | 类型 | 例子 | 说明 | 是否必填 | 长度限制 |
---|---|---|---|---|---|
productSkn | number | 50000055 | skn | 必填 | 10 |
productName | string | 名称 | 必填 | 100 | |
isNew | string | 是否新品 | "Y" "N" | 1 | |
sellChannels | string | 销售渠道1网站 2手机 3 场地 多选则用逗号分隔 | N | 10 | |
phrase | string | 商品简评 | N | 100 | |
outSaleTime | number | 售罄几天后下架 | N | 5 | |
shopIds | string | 展示店铺店铺Id列表 多选则用逗号分隔 | N | 100 | |
productDesc | string | 描述信息 | Y | 无 | |
vedioUrl | string | 视频的链接地址 | N | 1024 | |
recommend | string | 小编推荐信息 | N | 无 | |
brandModel | 字符串 | 品牌款型 | N | 5 | |
brandSeries | 字符串 | 品牌系列 | N | 5 | |
makeCrafts | 字符串 | 制作工艺 | N | 5 | |
pattern | 字符串 | 图案纹理 | N | 255 | |
style | 字符串 | 风格 | N | 200 | |
salesPhrase | 字符串 | 促销短语 | N | 100 | |
isHostsell | 字符串 | 是否热卖 "Y" or "N" | N | 1 | |
wearSense | json字符串 | 风格弹性 id 为1 厚度 2 柔软度 3 透气性 4 他们的值1-5 | N | 100 | |
searchSortList | json字符串 | productSkn必填 id 当此为修改的封面则必填否则认为为新增 modelId 品牌排序填“1”,奥莱排序填“2,”,搜索排序填“3”) projectId 填写1 | N | 100 | |
searchKeys | 字符串 | 搜索关键词,用逗号分隔 | N | 100 | |
brandRelationList | 字符串 | 关联品牌ID,格式为"[111,222]" | N | 100 | |
attributeProValuesOne | 字符串 | 商品参数列表格式"[{'productSkn': 999, 'attributeId': 属性id, 'attributeValueId' : 属性值的Id}]" | N | 200 | |
attributeProValuesTwo | 字符串 | 上架后信息列表格式"[{'productSkn': 999, 'attributeId': 属性id, 'attributeValueId' : 属性值的Id}]" | N | 200 | |
goodsImagesReq | 字符串 | 封面信息列表格式'{"goodsImagesBoList":"[{\"angle\":0,\"genderCover\":0,\"id\":936378,\"imageUrl\":\"http://img11.static.yhbimg.com/goodsimg/2016/03/18/16/01565bc83e6c27649681133cd896381fbd.png\",\"isDefault\":\"Y\",\"orderBy\":0,\"productSkc\":12,\"productSkn\":50000684,\"status\":1},{\"angle\":0,\"genderCover\":1,\"imageUrl\":\"http://img11.static.yhbimg.com/goodsimg/2016/03/18/16/01f9f349016b372947677415b0adcad67c.jpg\",\"orderBy\":1,\"productSkc\":12,\"productSkn\":50000684,\"__index\":1,\"index\":0,\"isDefault\":\"N\"}]","productSkc":12,"productSkn":50000684}' | N | 1024 |
对应SQL的操作库表
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.BaseProduct" >
update product
<set >
<if test="productName != null" >
product_name = #{productName,jdbcType=VARCHAR},
</if>
<if test="cnAlphabet != null" >
cn_alphabet = #{cnAlphabet,jdbcType=VARCHAR},
</if>
<if test="brandId != null" >
brand_id = #{brandId,jdbcType=SMALLINT},
</if>
<if test="shopId != null" >
shop_id = #{shopId,jdbcType=SMALLINT},
</if>
<if test="supplierId != null" >
supplier_id = #{supplierId,jdbcType=INTEGER},
</if>
<if test="isJit != null" >
is_jit = #{isJit,jdbcType=CHAR},
</if>
<if test="isScreen != null" >
is_screen = #{isScreen,jdbcType=CHAR},
</if>
<if test="isMeasure != null" >
is_measure = #{isMeasure,jdbcType=CHAR},
</if>
<if test="maxSortId != null" >
max_sort_id = #{maxSortId,jdbcType=SMALLINT},
</if>
<if test="middleSortId != null" >
middle_sort_id = #{middleSortId,jdbcType=SMALLINT},
</if>
<if test="smallSortId != null" >
small_sort_id = #{smallSortId,jdbcType=SMALLINT},
</if>
<if test="sortId != null" >
sort_id = #{sortId,jdbcType=SMALLINT},
</if>
<if test="seriesId != null" >
series_id = #{seriesId,jdbcType=INTEGER},
</if>
<if test="gender != null" >
gender = #{gender,jdbcType=CHAR},
</if>
<if test="style != null" >
style = #{style,jdbcType=VARCHAR},
</if>
<if test="pattern != null" >
pattern = #{pattern,jdbcType=VARCHAR},
</if>
<if test="series != null" >
series = #{series,jdbcType=VARCHAR},
</if>
<if test="models != null" >
models = #{models,jdbcType=VARCHAR},
</if>
<if test="material != null" >
material = #{material,jdbcType=VARCHAR},
</if>
<if test="isLimited != null" >
is_limited = #{isLimited,jdbcType=CHAR},
</if>
<if test="isSpecial != null" >
is_special = #{isSpecial,jdbcType=CHAR},
</if>
<if test="isSales != null" >
is_sales = #{isSales,jdbcType=CHAR},
</if>
<if test="isAdvance != null" >
is_advance = #{isAdvance,jdbcType=CHAR},
</if>
<if test="isRetrieval != null" >
is_retrieval = #{isRetrieval,jdbcType=CHAR},
</if>
<if test="isPromotion != null" >
is_promotion = #{isPromotion,jdbcType=SMALLINT},
</if>
<if test="isOutLets != null" >
is_outlets = #{isOutLets,jdbcType=CHAR},
</if>
<if test="isDown != null" >
is_down = #{isDown,jdbcType=CHAR},
</if>
<if test="attribute != null" >
attribute = #{attribute,jdbcType=TINYINT},
</if>
<if test="seasons != null" >
seasons = #{seasons,jdbcType=CHAR},
</if>
<if test="salableTime != null" >
salable_time = #{salableTime,jdbcType=VARCHAR},
</if>
edit_time = UNIX_TIMESTAMP(),
<if test="expectArrivalTime != null" >
expect_arrival_time = #{expectArrivalTime,jdbcType=INTEGER},
</if>
<if test="productTag != null" >
product_tag = #{productTag,jdbcType=VARCHAR},
</if>
<if test="productElements != null" >
product_elements = #{productElements,jdbcType=VARCHAR},
</if>
<if test="productStyle != null" >
product_style = #{productStyle,jdbcType=VARCHAR},
</if>
<if test="grade != null" >
grade = #{grade,jdbcType=CHAR},
</if>
<if test="brandFolder != null" >
brand_folder = #{brandFolder,jdbcType=INTEGER},
</if>
<if test="limitStartTime != null" >
limit_start_time = #{limitStartTime,jdbcType=INTEGER},
</if>
<if test="limitEndTime != null" >
limit_end_time = #{limitEndTime,jdbcType=INTEGER},
</if>
<if test="expectShelfTime != null" >
expect_shelf_time = #{expectShelfTime,jdbcType=INTEGER},
</if>
<if test="factoryCode != null" >
factory_code = #{factoryCode,jdbcType=VARCHAR},
</if>
<if test="ageLevel != null" >
age_level = #{ageLevel,jdbcType=VARCHAR},
</if>
<if test="goodsYears != null" >
goods_years = #{goodsYears,jdbcType=SMALLINT},
</if>
<if test="goodsSeason != null" >
goods_season = #{goodsSeason,jdbcType=SMALLINT},
</if>
<if test="isPromotionalGifts != null" >
is_promotional_gifts = #{isPromotionalGifts,jdbcType=CHAR},
</if>
<if test="isLimitbuy != null" >
is_limitbuy = #{isLimitbuy,jdbcType=CHAR},
</if>
<if test="isMeasure != null" >
is_measure = #{isMeasure},
</if>
<if test="isVip != null" >
is_vip = #{isVip,jdbcType=CHAR},
</if>
<if test="editId != null" >
editId = #{editId,jdbcType=INTEGER},
</if>
<if test="operateInfo != null" >
operate_info = #{operateInfo,jdbcType=VARCHAR},
</if>
<if test="founder != null" >
founder = #{founder,jdbcType=INTEGER},
</if>
</set>
where product_skn = #{productSkn,jdbcType=INTEGER}
</update>
<update id="updateByProductSkn" parameterType="com.yohobuy.platform.dal.shops.model.Product">
update product set erp_product_id = erp_product_id,
<if test="salesPhrase != null" >
sales_phrase = #{salesPhrase,jdbcType=VARCHAR}
</if>
<if test="phrase != null" >
phrase = #{phrase,jdbcType=VARCHAR}
</if>
where erp_product_id= #{erpProductId,jdbcType=INTEGER}
</update>
<update id="updateByProductSkn" parameterType="com.yohobuy.platform.dal.shops.model.Product">
update product set erp_product_id = erp_product_id,
<if test="salesPhrase != null" >
sales_phrase = #{salesPhrase,jdbcType=VARCHAR}
</if>
<if test="phrase != null" >
phrase = #{phrase,jdbcType=VARCHAR}
</if>
where erp_product_id= #{erpProductId,jdbcType=INTEGER}
</update>
<delete id="delBatchBySkn" parameterType="java.lang.Integer" >
delete from product_attribute_property_values
where product_skn = #{productSkn,jdbcType=INTEGER} AND display_position in
<foreach collection="displayPositions" item="item" open="(" close=")" separator=",">
#{item, jdbcType=INTEGER}
</foreach>
</delete>
<insert id="insertBatch">
insert into product_attribute_property_values (product_skn, attribute_id,
attribute_value_id, display_position)
values
<foreach collection="doList" item="item" index="index" separator=",">
(#{item.productSkn,jdbcType=INTEGER}, #{item.attributeId,jdbcType=INTEGER},
#{item.attributeValueId,jdbcType=INTEGER}, #{item.displayPosition,jdbcType=INTEGER})
</foreach>
</insert>
<update id="updateBrandSeriesBySkn" parameterType="com.yohobuy.platform.dal.product.model.BaseProduct">
update product set series_id = #{seriesId,jdbcType=INTEGER}, brand_folder = #{brandFolder,jdbcType=INTEGER} where product_skn= #{productSkn, jdbcType=INTEGER}
</update>
<insert id="updateProductOnSaleInfo">
insert into product_ext (product_skn, brand_model, brand_series, make_crafts, sales_phrase, is_hostsell)
values (#{extInfo.productSkn,jdbcType=INTEGER}, #{extInfo.brandModel,jdbcType=VARCHAR}
, #{extInfo.brandSeries,jdbcType=VARCHAR}, #{extInfo.makeCrafts,jdbcType=VARCHAR}
, #{extInfo.salesPhrase,jdbcType=VARCHAR}, #{extInfo.isHostsell,jdbcType=CHAR})
ON DUPLICATE KEY UPDATE brand_model=#{extInfo.brandModel,jdbcType=VARCHAR}, brand_series=#{extInfo.brandSeries,jdbcType=VARCHAR},
make_crafts=#{extInfo.makeCrafts,jdbcType=VARCHAR}, sales_phrase=#{extInfo.salesPhrase,jdbcType=VARCHAR},
is_hostsell=#{extInfo.isHostsell,jdbcType=CHAR}
</insert>
错误编码
错误码code | 消息 | 说明 |
---|---|---|
200 | 添加成功! | |
400 | 操作失败! |
返回
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "保存成功."
}