Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
| | |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoById(Integer id) { |
| | | return R.fail("根据id获取秒杀活动失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(Integer goodsId) { |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.factory.SeckillActivityInfoClientFallbackFactory; |
| | | import com.ruoyi.other.api.vo.GetSeckillActivityInfo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | */ |
| | | @PostMapping("/seckill-activity-info/getSeckillActivityInfoById") |
| | | R<SeckillActivityInfo> getSeckillActivityInfoById(@RequestParam("id") Integer id); |
| | | |
| | | @GetMapping("/seckill-activity-info/getSeckillActivityInfoByGoodsId") |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(@RequestParam("goodsId") Integer goodsId); |
| | | } |
| | |
| | | @Override |
| | | public void withdrawalApply(WithdrawalRequestsDTO params) { |
| | | BigDecimal withdrawalAmount = params.getWithdrawalAmount(); |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0) { |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0 && params.getWithdrawalMethod().equals(1)) { |
| | | throw new ServiceException("提现失败,单次提现金额不能超过200元!"); |
| | | } |
| | | |
| | |
| | | if(!order.getAppUserId().equals(userid)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | if(Arrays.asList(2, 3).contains(refundPass.getStatus())){ |
| | | if(refundPass.getStatus().equals(2)){ |
| | | return R.fail("售后取消失败"); |
| | | } |
| | | refundPass.setDelFlag(1); |
| | |
| | | .eq(ShoppingCart::getAppUserId, userid)); |
| | | goodsSaleNum += count; |
| | | Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && (goodsSaleNum + shoppingCart.getNumber()) > goods.getPurchaseLimit()){ |
| | | |
| | | Integer maxNum = 0; |
| | | if(shoppingCart.getType() == 2){ |
| | | R<SeckillActivityInfo> r = seckillActivityInfoClient.getSeckillActivityInfoByGoodsId(shoppingCart.getGoodsId()); |
| | | if (R.isError(r)){ |
| | | throw new ServiceException("获取秒杀商品失败!"); |
| | | } |
| | | SeckillActivityInfo seckillActivityInfo = r.getData(); |
| | | maxNum = seckillActivityInfo.getMaxNum(); |
| | | }else { |
| | | maxNum = goods.getPurchaseLimit(); |
| | | } |
| | | |
| | | if(null != goods.getPurchaseLimit() && -1 != maxNum && (goodsSaleNum + shoppingCart.getNumber()) > maxNum){ |
| | | throw new ServiceException("超出购买数量限制"); |
| | | } |
| | | ShoppingCart one = this.getOne(new LambdaQueryWrapper<ShoppingCart>().eq(ShoppingCart::getAppUserId, userid) |
| | |
| | | }else { |
| | | record.setStatus(1); // 未开始 |
| | | } |
| | | Integer saleNum = orderClient.getGoodsSaleNum(record.getGoodsId(), null).getData(); |
| | | Integer saleNum = orderClient.getGoodsSaleNum(record.getGoodsId(), 2).getData(); |
| | | record.setSaleNum(saleNum); |
| | | } |
| | | return R.ok(IPage); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getSeckillActivityInfoByGoodsId") |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(@RequestParam("goodsId") Integer goodsId){ |
| | | SeckillActivityInfo seckillActivityInfo = seckillActivityInfoService.getOne(new LambdaQueryWrapper<SeckillActivityInfo>() |
| | | .eq(SeckillActivityInfo::getGoodId, goodsId) |
| | | .eq(SeckillActivityInfo::getDelFlag, 0) |
| | | .eq(SeckillActivityInfo::getIsShelves, 1) |
| | | .last(" and now() between start_time and end_time")); |
| | | return R.ok(seckillActivityInfo); |
| | | } |
| | | |
| | | /** |
| | | * 修改秒杀活动 |
| | | */ |
| | |
| | | <select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tg.id goodsId, |
| | | tg.`name` goodsName, |
| | | tg.introduction, |
| | | tgc.`name` goodsCategoryName, |