xiaoqiang 4 tahun lalu
induk
melakukan
05be8b81e8

+ 1 - 3
src/main/java/org/springblade/gateway/point_gateway/controller/PointGoodsByAIdController.java

@@ -16,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
-
 @RestController
 @AllArgsConstructor
 @RequestMapping("sing_goods/pointgoods")
@@ -28,7 +26,7 @@ public class PointGoodsByAIdController {
 	private IPointGoodsService pointGoodsService;
 
 	@GetMapping("/queryList")
-	public R<IPage<PointGoodsVO>> orderList(@ApiParam(value = "活动id",required = true) @RequestParam Long activeId, Query query) throws IllegalAccessException {
+	public R<IPage<PointGoodsVO>> orderList(@ApiParam(value = "活动id",required = true) @RequestParam Long activeId, Query query) {
 		IPage<PointGoods> pages = pointGoodsService.queryList(activeId, query);
 		return R.data(PointGoodsWrapper.build().pageVO(pages));
 	}

+ 3 - 1
src/main/java/org/springblade/gateway/point_gateway/service/impl/PointExchangeServiceImpl.java

@@ -104,7 +104,9 @@ public class PointExchangeServiceImpl implements PointExchangeService {
 
 		//添加积分消费
 		PointRecord pointRecord = new PointRecord();
-		pointRecord.setPoint(goods.getPoint());
+		BigDecimal negate = goods.getPoint().negate();
+		System.out.println(negate);
+		pointRecord.setPoint(goods.getPoint().negate());
 		pointRecord.setUserId(user.getId());
 		pointRecord.setPointGoodsId(goodsId);
 		pointRecord.setPointType(PointTypeEnum.PUFA_POINT_EXCHANGE);

+ 1 - 1
src/main/java/org/springblade/sing/goods/service/IPointGoodsService.java

@@ -47,5 +47,5 @@ public interface IPointGoodsService extends BaseService<PointGoods> {
 	 * @param activeId 活动id
 	 * @return
 	 */
-    IPage<PointGoods> queryList(Long activeId, Query query) throws IllegalAccessException;
+    IPage<PointGoods> queryList(Long activeId, Query query);
 }

+ 4 - 7
src/main/java/org/springblade/sing/goods/service/impl/PointGoodsServiceImpl.java

@@ -48,17 +48,14 @@ public class PointGoodsServiceImpl extends BaseServiceImpl<PointGoodsMapper, Poi
 	}
 
     @Override
-    public IPage<PointGoods> queryList(Long activeId,Query query) throws IllegalAccessException {
+    public IPage<PointGoods> queryList(Long activeId,Query query) {
 		LambdaQueryWrapper<PointGoods> wrapper = new LambdaQueryWrapper<PointGoods>().eq(PointGoods::getActiveId, activeId);
 
 		List<PointGoods> goods = baseMapper.selectList(wrapper);
-		if (goods.size() == 0){
-			throw new IllegalAccessException("此活动没有可兑换商品");
-		}
+		Assert.notEmpty(goods,"出错");
+		IPage<PointGoods> pointGoodsIPage = new Page<>(query.getCurrent(),query.getSize());
 
-		IPage<PointGoods> pointGoodsIpage = new Page<>(query.getCurrent(),query.getSize());
-
-		return super.page(pointGoodsIpage,wrapper);
+		return super.page(pointGoodsIPage,wrapper);
 
     }