添加获取优惠券条件
This commit is contained in:
@@ -62,8 +62,10 @@ public class OrderController {
|
||||
@GetMapping("/mineCoupons")
|
||||
private Result mineCoupons(@RequestHeader String token,@RequestParam("userId") String userId,@RequestParam("status") String status,
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException {
|
||||
return orderService.mineCoupons(userId,status,page,size);
|
||||
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
|
||||
@RequestParam("orderId") String orderId
|
||||
) throws IOException {
|
||||
return orderService.mineCoupons(userId,orderId,status,page,size);
|
||||
}
|
||||
@GetMapping("/findCoupons")
|
||||
private Result findCoupons(@RequestHeader String token,String type,
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface TbUserCouponsMapper {
|
||||
|
||||
int updateByPrimaryKey(TbUserCoupons record);
|
||||
|
||||
List<TbUserCoupons> selectByUserId(@Param("userId") String userId,@Param("status") String status);
|
||||
List<TbUserCoupons> selectByUserId(@Param("userId") String userId,@Param("status") String status,@Param("amount") BigDecimal amount);
|
||||
|
||||
TbUserCoupons selectByOrderId(@Param("orderId") Integer orderId);
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ public class OrderService {
|
||||
private TbYhqParamsMapper yhqParamsMapper;
|
||||
@Autowired
|
||||
private TbShopUserMapper shopUserMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TbOrderInfoMapper tbOrderInfoMapper;
|
||||
/**
|
||||
* 创建订单
|
||||
*
|
||||
@@ -307,9 +311,16 @@ public class OrderService {
|
||||
}
|
||||
|
||||
|
||||
public Result mineCoupons(String userId, String status, Integer page, Integer size) {
|
||||
public Result mineCoupons(String userId, String orderId,String status, Integer page, Integer size) {
|
||||
BigDecimal amount=null;
|
||||
if(ObjectUtil.isNotNull(orderId)&&ObjectUtil.isNotEmpty(orderId)){
|
||||
TbOrderInfo orderInfo= tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId));
|
||||
amount=orderInfo.getOriginAmount();
|
||||
}
|
||||
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
List<TbUserCoupons> list = userCouponsMapper.selectByUserId(userId,status);
|
||||
List<TbUserCoupons> list = userCouponsMapper.selectByUserId(userId,status,amount);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user