dingxin 5 år sedan
förälder
incheckning
3f388bef4d

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/TaGoodsController.java Visa fil

@@ -337,7 +337,8 @@ public class TaGoodsController extends BaseController {
337 337
             //兑换商品
338 338
             String state = iTaGoodsService.exchangeGoods(id,openid);
339 339
             if (state.equals(CommConstant.SUCCESS)){
340
-                responseBean.addSuccess("兑换成功");
340
+                TaGoods taGoods = iTaGoodsService.getById(id);
341
+                responseBean.addSuccess(taGoods);
341 342
             }else{
342 343
                 responseBean.addError(state);
343 344
             }

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaGoodsServiceImpl.java Visa fil

@@ -64,11 +64,11 @@ public class TaGoodsServiceImpl extends ServiceImpl<TaGoodsMapper, TaGoods> impl
64 64
 		}
65 65
 
66 66
 		//判断积分是否足够
67
-		if (taPerson.getPoints() < taGoods.getPointPrice()){
67
+		if (null == taPerson.getPoints() || taPerson.getPoints().intValue() < taGoods.getPointPrice()){
68 68
 			return "积分不足,请先获取积分";
69 69
 		}
70 70
 		//判断商品是否够兑换
71
-		if (taGoods.getInventory() < 1){
71
+		if (null == taGoods.getInventory()|| taGoods.getInventory().intValue() < 1){
72 72
 			return "此商品无库存";
73 73
 		}
74 74