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

Commit b31e5831 authored by GaoHu's avatar GaoHu

修改预约逻辑

parent a2bc79f3
......@@ -30,8 +30,7 @@ public class GoblinGoodsAnticipateController {
@ApiOperation("用户预约 (只能预约不能取消)")
@PostMapping("/userAbout")
public ResponseDto<Object> userAbout(HttpServletRequest request,
@RequestParam(name = "skuId", required = true) String skuId,
public ResponseDto<Object> userAbout(@RequestParam(name = "skuId", required = true) String skuId,
@RequestParam(name = "uid", required = true) String uid,
@RequestParam(name = "phone", required = true) String phone) {
return goblinGoodsAnticipateService.userAbout(skuId, uid, phone);
......
......@@ -56,7 +56,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if (anticipateValueVo != null) {
anticipateValueVo.setState(setState(anticipateValueVo.getAboutStartDate(), anticipateValueVo.getAboutEndDate()));
if (!anticipateValueVo.getState().equals(1)) {
return ResponseDto.failure("预约尚未开始或已结束!");
return ResponseDto.failure("该商品预约尚未开始或已经结束,不可预约!");
}
//查询该用户是否预
GoblinGoodAnticipateUserVo userVo = goblinRedisUtils.getUserAboutAut(skuId, uid);
......@@ -78,7 +78,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
0
});
sendRedis("goblin_goods_anticipate_user", sqlValue);
goblinRedisUtils.setSkuIdPeople(skuId, 0);
goblinRedisUtils.setSkuIdPeople(skuId);
//储存用户头像
userAvatar(skuId);
}
......
......@@ -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));
num = num!=null?num: BigInteger.valueOf(0);
//新预约 +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