|
|
|
|
|
# 按活动抽奖接口
|
|
|
|
|
|
> 接口名: `/DrawlineActivityRest/luckyUserDraw`
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|----|--------|--------|
|
|
|
|activityId|int||活动ID|是|11
|
|
|
---------------------
|
|
|
|
|
|
```xml
|
|
|
<select id="selectByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from drawline_lucky_user_bak
|
|
|
where activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<insert id="insertBatch" parameterType="java.util.List">
|
|
|
insert into drawline_lucky_user (sid, activity_id, queue_time, status, create_time, update_time, uid, user_type)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(#{item.sid}, #{item.activityId}, #{item.queueTime}, #{item.status}, #{item.createTime}, #{item.updateTime}, #{item.uid},
|
|
|
#{item.userType})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="selectLimitProductByActivityId" resultMap="BaseResultMap">
|
|
|
select <include refid="Base_Column_List" />
|
|
|
from limit_product where activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="getSpecialCountLimitCodeNotUse" resultType="java.lang.String" >
|
|
|
select code
|
|
|
from limit_code_batchno
|
|
|
where batchNo = #{batchNo, jdbcType=VARCHAR} and status=0
|
|
|
limit #{limit,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<insert id="batchAddLimitCodeReceiveRecord" parameterType="java.util.List" >
|
|
|
insert into limit_code_receive_record (id, uid, limit_code,
|
|
|
batchno, limit_product_code, productSkn,
|
|
|
productSku, is_use, create_time,
|
|
|
update_time)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(#{item.id,jdbcType=INTEGER},#{item.uid,jdbcType=INTEGER}, #{item.limitCode,jdbcType=VARCHAR},
|
|
|
#{item.batchno,jdbcType=VARCHAR}, #{item.limitProductCode,jdbcType=VARCHAR}, #{item.productskn,jdbcType=VARCHAR},
|
|
|
#{item.productsku,jdbcType=VARCHAR}, #{item.isUse,jdbcType=TINYINT}, #{item.createTime,jdbcType=INTEGER},
|
|
|
#{item.updateTime,jdbcType=INTEGER})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<update id="batchUpdateLimitCodeUseFlag" parameterType="java.util.List">
|
|
|
update limit_code_batchno
|
|
|
set status = 1
|
|
|
where batchNo = #{batchNo,jdbcType=VARCHAR} and code in
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<update id="updatePrizeStatusByActIdAndUids">
|
|
|
update drawline_lucky_user
|
|
|
set is_send_prize = 1
|
|
|
where status = 1 and user_type = 1
|
|
|
and activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
<if test="list != null and list.size() > 0">
|
|
|
and uid in
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</update>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="selectByActivityIds" resultMap="BaseResultMap">
|
|
|
select <include refid="Base_Column_List" /> from drawline_prize_setting where activity_id in (${activityIds})
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
### 响应码
|
|
|
|
|
|
-------------------------
|
|
|
|响应码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|200| 抽奖成功| |
|
|
|
|400| 入口参数的活动id不能为空.| |
|
|
|
|500| 没有导入的中奖用户数据./抽奖数据异常/该活动对应的限定商品情报没有./该活动的限购码数量不够!/该活动的奖项设置不存在| |
|
|
|
|
|
|
### 返回
|
|
|
|
|
|
``` json
|
|
|
{
|
|
|
"code": 200,
|
|
|
"data": [],
|
|
|
"md5": "d751713988987e9331980363e24189ce",
|
|
|
"message": "抽奖成功."
|
|
|
}
|
|
|
|
|
|
``` |
|
|
|
|
|
# 按活动抽奖接口
|
|
|
|
|
|
> 接口名: `/DrawlineActivityRest/luckyUserDraw`
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|----|--------|--------|
|
|
|
|activityId|int|111|活动ID|是|1~11
|
|
|
---------------------
|
|
|
|
|
|
```xml
|
|
|
<select id="selectByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from drawline_lucky_user_bak
|
|
|
where activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<insert id="insertBatch" parameterType="java.util.List">
|
|
|
insert into drawline_lucky_user (sid, activity_id, queue_time, status, create_time, update_time, uid, user_type)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(#{item.sid}, #{item.activityId}, #{item.queueTime}, #{item.status}, #{item.createTime}, #{item.updateTime}, #{item.uid},
|
|
|
#{item.userType})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="selectLimitProductByActivityId" resultMap="BaseResultMap">
|
|
|
select <include refid="Base_Column_List" />
|
|
|
from limit_product where activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="getSpecialCountLimitCodeNotUse" resultType="java.lang.String" >
|
|
|
select code
|
|
|
from limit_code_batchno
|
|
|
where batchNo = #{batchNo, jdbcType=VARCHAR} and status=0
|
|
|
limit #{limit,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<insert id="batchAddLimitCodeReceiveRecord" parameterType="java.util.List" >
|
|
|
insert into limit_code_receive_record (id, uid, limit_code,
|
|
|
batchno, limit_product_code, productSkn,
|
|
|
productSku, is_use, create_time,
|
|
|
update_time)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(#{item.id,jdbcType=INTEGER},#{item.uid,jdbcType=INTEGER}, #{item.limitCode,jdbcType=VARCHAR},
|
|
|
#{item.batchno,jdbcType=VARCHAR}, #{item.limitProductCode,jdbcType=VARCHAR}, #{item.productskn,jdbcType=VARCHAR},
|
|
|
#{item.productsku,jdbcType=VARCHAR}, #{item.isUse,jdbcType=TINYINT}, #{item.createTime,jdbcType=INTEGER},
|
|
|
#{item.updateTime,jdbcType=INTEGER})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<update id="batchUpdateLimitCodeUseFlag" parameterType="java.util.List">
|
|
|
update limit_code_batchno
|
|
|
set status = 1
|
|
|
where batchNo = #{batchNo,jdbcType=VARCHAR} and code in
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<update id="updatePrizeStatusByActIdAndUids">
|
|
|
update drawline_lucky_user
|
|
|
set is_send_prize = 1
|
|
|
where status = 1 and user_type = 1
|
|
|
and activity_id = #{activityId,jdbcType=INTEGER}
|
|
|
<if test="list != null and list.size() > 0">
|
|
|
and uid in
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</update>
|
|
|
```
|
|
|
|
|
|
```xml
|
|
|
<select id="selectByActivityIds" resultMap="BaseResultMap">
|
|
|
select <include refid="Base_Column_List" /> from drawline_prize_setting where activity_id in (${activityIds})
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
### 响应码
|
|
|
|
|
|
-------------------------
|
|
|
|响应码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|200| 抽奖成功| |
|
|
|
|400| 入口参数的活动id不能为空.| |
|
|
|
|500| 没有导入的中奖用户数据./抽奖数据异常/该活动对应的限定商品情报没有./该活动的限购码数量不够!/该活动的奖项设置不存在| |
|
|
|
|
|
|
### 返回
|
|
|
|
|
|
``` json
|
|
|
{
|
|
|
"code": 200,
|
|
|
"data": [],
|
|
|
"md5": "d751713988987e9331980363e24189ce",
|
|
|
"message": "抽奖成功."
|
|
|
}
|
|
|
|
|
|
``` |
...
|
...
|
|