Authored by caoyan

订单列表

... ... @@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yoho.activity.common.ApiResponse;
... ... @@ -49,25 +50,21 @@ public class LotteryController {
}
/**
* 查询用户订单信息(时间:15天 至 一个月,是否已经抽奖)
* 查询用户订单列表(时间:15天 至 一个月,是否已经抽奖)
*
* @param lotteryId 活动id
* @param userId 用户id
* @param orderCode 订单编号
* @return 抽奖状态信息
* @param uid 用户id
* @return 用户有效的订单列表
*/
@RequestMapping("/getValidOrderInfo")
@RequestMapping("/getValidOrderList")
@ResponseBody
public ApiResponse getValidOrderInfo(@RequestBody LotteryVO vo) {
logger.info("Start getValidTimeOrderInfo with req {}", vo);
public ApiResponse getValidOrderList(@RequestParam(value="uid")Integer uid) {
logger.info("Start getValidOrderList with uid is {}", uid);
Integer userId = vo.getUserId();
checkUserId(userId);
checkUserId(uid);
LotteryRespData respData = lotteryService.getValidTimeOrderInfo(userId);
LotteryRespData respData = lotteryService.getValidOrderList(uid);
logger.info("End getValidTimeOrderInfo with req {}", vo);
logger.info("End getValidOrderList");
return new ApiResponse(respData);
}
... ...
... ... @@ -8,7 +8,7 @@ public interface WeixinOrderListMapper {
int insert(WeixinOrderList record);
WeixinOrderList selectByPrimaryKey(Long orderCode);
List<Integer> selectOrderCodeByUid(Integer uid);
List<WeixinOrderList> selectAll();
... ...
... ... @@ -26,10 +26,10 @@
prize_id = #{prizeId,jdbcType=INTEGER}
where order_code = #{orderCode,jdbcType=BIGINT}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select order_code, create_time, uid, wx, prize_id
<select id="selectOrderCodeByUid" parameterType="java.lang.Integer">
select order_code
from weixin_order_list
where order_code = #{orderCode,jdbcType=BIGINT}
where uid = #{uid,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select order_code, create_time, uid, wx, prize_id
... ...
... ... @@ -37,13 +37,13 @@ public interface ILotteryService {
LotteryRespData lucky(Integer lotteryId, Integer userId, Integer orderCode);
/**
* 查询用户订单信息(时间:15天 至 一个月)
* 查询用户订单列表(时间:距离当前时间15天 至 一个月)
*
* @param lotteryId 活动id
* @param userId 用户id
* @param orderCode 订单编号
* @return 抽奖状态信息
*/
LotteryRespData getValidTimeOrderInfo(Integer userId);
LotteryRespData getValidOrderList(Integer userId);
}
... ...
... ... @@ -3,14 +3,21 @@
*/
package com.yoho.activity.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yoho.activity.common.vo.LotteryRespData;
import com.yoho.activity.service.ILotteryService;
import com.yoho.lottery.dal.WeixinOrderListMapper;
@Service
public class LotteryServiceImpl implements ILotteryService {
@Autowired
private WeixinOrderListMapper weixinOrderListMapper;
@Override
public LotteryRespData getLotteryInfo(Integer lotteryId) {
... ... @@ -31,8 +38,9 @@ public class LotteryServiceImpl implements ILotteryService {
}
@Override
public LotteryRespData getValidTimeOrderInfo(Integer userId) {
// TODO Auto-generated method stub
public LotteryRespData getValidOrderList(Integer uid) {
List<Integer> weixinOrderCodeList = weixinOrderListMapper.selectOrderCodeByUid(uid);
return null;
}
... ...
... ... @@ -5,5 +5,14 @@ datasources:
- 192.168.102.219:3306
username: yh_test
password: 9nm0icOwt6bMHjMusIfMLw==
yh_lottery:
servers:
- 192.168.102.219:3306
- 192.168.102.219:3306
username: yh_test
password: 9nm0icOwt6bMHjMusIfMLw==
daos:
- com.yoho.lottery.dal.WeixinORderListMapper
readOnlyInSlave: true
\ No newline at end of file
... ...