记得上下班打卡 | git大法好,push需谨慎

Commit b31e5831 authored by GaoHu's avatar GaoHu

修改预约逻辑

parent a2bc79f3
...@@ -30,8 +30,7 @@ public class GoblinGoodsAnticipateController { ...@@ -30,8 +30,7 @@ public class GoblinGoodsAnticipateController {
@ApiOperation("用户预约 (只能预约不能取消)") @ApiOperation("用户预约 (只能预约不能取消)")
@PostMapping("/userAbout") @PostMapping("/userAbout")
public ResponseDto<Object> userAbout(HttpServletRequest request, public ResponseDto<Object> userAbout(@RequestParam(name = "skuId", required = true) String skuId,
@RequestParam(name = "skuId", required = true) String skuId,
@RequestParam(name = "uid", required = true) String uid, @RequestParam(name = "uid", required = true) String uid,
@RequestParam(name = "phone", required = true) String phone) { @RequestParam(name = "phone", required = true) String phone) {
return goblinGoodsAnticipateService.userAbout(skuId, uid, phone); return goblinGoodsAnticipateService.userAbout(skuId, uid, phone);
......
...@@ -56,7 +56,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -56,7 +56,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if (anticipateValueVo != null) { if (anticipateValueVo != null) {
anticipateValueVo.setState(setState(anticipateValueVo.getAboutStartDate(), anticipateValueVo.getAboutEndDate())); anticipateValueVo.setState(setState(anticipateValueVo.getAboutStartDate(), anticipateValueVo.getAboutEndDate()));
if (!anticipateValueVo.getState().equals(1)) { if (!anticipateValueVo.getState().equals(1)) {
return ResponseDto.failure("预约尚未开始或已结束!"); return ResponseDto.failure("该商品预约尚未开始或已经结束,不可预约!");
} }
//查询该用户是否预 //查询该用户是否预
GoblinGoodAnticipateUserVo userVo = goblinRedisUtils.getUserAboutAut(skuId, uid); GoblinGoodAnticipateUserVo userVo = goblinRedisUtils.getUserAboutAut(skuId, uid);
...@@ -78,7 +78,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -78,7 +78,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
0 0
}); });
sendRedis("goblin_goods_anticipate_user", sqlValue); sendRedis("goblin_goods_anticipate_user", sqlValue);
goblinRedisUtils.setSkuIdPeople(skuId, 0); goblinRedisUtils.setSkuIdPeople(skuId);
//储存用户头像 //储存用户头像
userAvatar(skuId); userAvatar(skuId);
} }
......
...@@ -99,12 +99,11 @@ public class GoblinRedisUtils { ...@@ -99,12 +99,11 @@ public class GoblinRedisUtils {
/** /**
* 实际预约人数修改 * 实际预约人数修改
*/ */
public void setSkuIdPeople(String skuId,Integer state) { public void setSkuIdPeople(String skuId) {
BigInteger num = (BigInteger) redisUtil.get(GoblinRedisConst.ANTICIPATE_PEOPLE.concat(skuId)); BigInteger num = (BigInteger) redisUtil.get(GoblinRedisConst.ANTICIPATE_PEOPLE.concat(skuId));
num = num!=null?num: BigInteger.valueOf(0); num = num!=null?num: BigInteger.valueOf(0);
//新预约 +1 //新预约 +1
redisUtil.set(GoblinRedisConst.ANTICIPATE_PEOPLE.concat(skuId),num.add(BigInteger.valueOf(1))); redisUtil.set(GoblinRedisConst.ANTICIPATE_PEOPLE.concat(skuId),num.add(BigInteger.valueOf(1)));
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment