saveNetSaleBaseInfo.md 8.12 KB

新增上架前文本信息

接口名: /product/saveNetSaleBaseInfo

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
productSkn number 50000055 skn 必填 10
productName string 名称 必填 100
isNew string 是否新品 "Y" "N" 1
sellChannels string 销售渠道 1网站 2手机 3 场地 多选则用逗号分隔 10
phrase string 商品简评 N 100
outSaleTime number 售罄几天后下架 N 5
shopIds string 展示店铺 店铺Id列表 多选则用逗号分隔 N

对应SQL的操作库表

 <update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.BaseProduct" >
    update base_product
    <set >
      <if test="productName != null" >
        product_name = #{productName,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="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="sizeMaxSortId != null" >
        size_max_sort_id = #{sizeMaxSortId,jdbcType=SMALLINT},
      </if>
      <if test="sizeMiddleSortId != null" >
        size_middle_sort_id = #{sizeMiddleSortId,jdbcType=SMALLINT},
      </if>
      <if test="sizeSmallSortId != null" >
        size_small_sort_id = #{sizeSmallSortId,jdbcType=SMALLINT},
      </if>
      <if test="seriesId != null" >
        series_id = #{seriesId,jdbcType=INTEGER},
      </if>
      <if test="gender != null" >
        gender = #{gender,jdbcType=CHAR},
      </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="isAdvance != null" >
        is_advance = #{isAdvance,jdbcType=CHAR},
      </if>
      <if test="isMainPush != null" >
        is_main_push = #{isMainPush,jdbcType=CHAR},
      </if>
      <if test="isPromotionalGifts != null" >
        is_promotional_gifts = #{isPromotionalGifts,jdbcType=CHAR},
      </if>
      <if test="attribute != null" >
        attribute = #{attribute,jdbcType=TINYINT},
      </if>
      <if test="remarks != null" >
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      edit_time = UNIX_TIMESTAMP(),
      <if test="replenishmentFactor != null" >
        replenishment_factor = #{replenishmentFactor,jdbcType=REAL},
      </if>
      <if test="soldoutRate != null" >
        soldout_rate = #{soldoutRate,jdbcType=REAL},
      </if>
      <if test="retailPrice != null" >
        retail_price = #{retailPrice,jdbcType=DECIMAL},
      </if>
      <if test="salesPrice != null" >
        sales_price = #{salesPrice,jdbcType=DECIMAL},
      </if>
      <if test="stock != null" >
        stock = #{stock,jdbcType=SMALLINT},
      </if>
      <if test="stockoutRate != null" >
        stockout_rate = #{stockoutRate,jdbcType=REAL},
      </if>
      <if test="expectArrivalTime != null" >
        expect_arrival_time = #{expectArrivalTime,jdbcType=INTEGER},
      </if>
      <if test="goodsYears != null" >
        goods_years = #{goodsYears,jdbcType=SMALLINT},
      </if>
      <if test="goodsSeason != null" >
        goods_season = #{goodsSeason,jdbcType=SMALLINT},
      </if>
      <if test="productStyle != null" >
        product_style = #{productStyle,jdbcType=VARCHAR},
      </if>
      <if test="productElements != null" >
        product_elements = #{productElements,jdbcType=VARCHAR},
      </if>
      <if test="productTag != null" >
        product_tag = #{productTag,jdbcType=VARCHAR},
      </if>
      <if test="grade != null" >
        grade = #{grade,jdbcType=CHAR},
      </if>
      <if test="brandFolder != null" >
        brand_folder = #{brandFolder,jdbcType=INTEGER},
      </if>
      <if test="isOutLets != null" >
        is_outlets = #{isOutLets,jdbcType=CHAR},
      </if>
      <if test="factoryCode != null" >
        factory_code = #{factoryCode,jdbcType=VARCHAR},
      </if>
      <if test="ageLevel != null" >
        age_level = #{ageLevel,jdbcType=VARCHAR},
      </if>
      <if test="isLimitbuy != null" >
        is_limitbuy = #{isLimitbuy,jdbcType=CHAR},
      </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="isVip != null" >
        is_vip = #{isVip,jdbcType=VARCHAR},
      </if>
      <if test="seasons != null" >
        seasons = #{seasons,jdbcType=VARCHAR},
      </if>
      <if test="rejectReason != null" >
        reason = #{rejectReason,jdbcType=VARCHAR},
      </if>

      <if test="editId != null" >
        editId = #{editId,jdbcType=INTEGER},
      </if>
      <if test="operateInfo != null" >
        operate_info = #{operateInfo,jdbcType=VARCHAR},
      </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>

  <insert id="insertProductBaseInfo" parameterType="com.yohobuy.platform.dal.product.model.ProductExt">
   insert into product_ext (product_skn, phrase, sell_channels, is_new)
    values (#{productExt.productSkn,jdbcType=INTEGER}, #{productExt.phrase,jdbcType=VARCHAR}
            , #{productExt.sellChannels,jdbcType=CHAR}, #{productExt.isNew,jdbcType=CHAR})
            ON DUPLICATE KEY UPDATE phrase=#{productExt.phrase,jdbcType=VARCHAR},  sell_channels=#{productExt.sellChannels,jdbcType=CHAR},
             is_new=#{productExt.isNew,jdbcType=CHAR}
  </insert>

  <insert id="insert" parameterType="com.yohobuy.platform.dal.product.model.ProductTiming" >
    insert into product_timing (id, product_skn, shelve_time, 
      on_new_time, out_sale_time, advance_begin_time, 
      advance_end_time, flag, create_time
      )
    values (#{id,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, #{shelveTime,jdbcType=INTEGER}, 
      #{onNewTime,jdbcType=INTEGER}, #{outSaleTime,jdbcType=INTEGER}, #{advanceBeginTime,jdbcType=INTEGER}, 
      #{advanceEndTime,jdbcType=INTEGER}, #{flag,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}
      )
  </insert>

  <insert id="batchInsert" parameterType="java.util.List">
    insert into product_shop_relation (product_skn, shop_id)
    values 
     <foreach collection="relationList" item="item" index="index" separator="," >  
        (#{item.productSkn},#{item.shopId})  
    </foreach>
  </insert>

错误编码


错误码code 消息 说明
200 添加成功!
400 操作失败!

返回

{
  "code": 200,
  "data": [],
  "md5": "d751713988987e9331980363e24189ce",
  "message": "保存文本信息成功."
}