|
|
@@ -75,9 +75,10 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
|
|
|
|
|
|
//判断用户今天购买该商品次数是否超过限制(-1标识不限制次数)
|
|
|
if(!helpGoods.getTotal().equals(-1L)){
|
|
|
- int count = pointRecordService.count(Wrappers.<PointRecord>lambdaQuery()
|
|
|
- .eq(PointRecord::getUserId,loginUser.getId())
|
|
|
- .eq(PointRecord::getHelpGoodsId,helpGoods.getId())
|
|
|
+ int count = goodsRecordService.count(Wrappers.<GoodsRecord>lambdaQuery()
|
|
|
+ .eq(GoodsRecord::getUserId,loginUser.getId())
|
|
|
+ .eq(GoodsRecord::getHelpGoodsId,helpGoods.getId())
|
|
|
+ .eq(GoodsRecord::getType,GoodsRecordType.HELP_GOODS_EXCHANGE.name())
|
|
|
.last(new StringBuilder("and date_format(")
|
|
|
.append(BeanPropertyUtil.getFieldNameToUnder(PointRecord::getCreateTime))
|
|
|
.append(",\"%Y-%m-%d\")=\"")
|
|
|
@@ -113,6 +114,7 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
|
|
|
|
|
|
//添加道具兑换记录
|
|
|
GoodsRecord goodsRecord = new GoodsRecord();
|
|
|
+ goodsRecord.setUserId(loginUser.getId());
|
|
|
goodsRecord.setHelpGoodsId(helpGoods.getId());
|
|
|
goodsRecord.setType(GoodsRecordType.HELP_GOODS_EXCHANGE);
|
|
|
Assert.isTrue(goodsRecordService.save(goodsRecord),"兑换失败");
|