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

Commit c361a9e7 authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/阶梯退票_羊毛券_合并分支' into 阶梯退票_羊毛券_合并分支

parents 5503a5ff aadfad73
...@@ -16,6 +16,8 @@ public interface IGoblinOrderAppService { ...@@ -16,6 +16,8 @@ public interface IGoblinOrderAppService {
ResponseDto<GoblinAppOrderDetailsVo> orderDetails(String orderId,String uid); ResponseDto<GoblinAppOrderDetailsVo> orderDetails(String orderId,String uid);
Integer couponState(String orderId, String uid);
ResponseDto<Boolean> getProduce(String orderId,String uid); ResponseDto<Boolean> getProduce(String orderId,String uid);
ResponseDto<Boolean> applyRefund(GoblinAppOrderRefundParam param); ResponseDto<Boolean> applyRefund(GoblinAppOrderRefundParam param);
......
...@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -59,6 +60,12 @@ public class GoblinOrderAppController { ...@@ -59,6 +60,12 @@ public class GoblinOrderAppController {
return goblinOrderAppService.orderDetails(orderId, uid); return goblinOrderAppService.orderDetails(orderId, uid);
} }
@GetMapping("couponState")
@ApiOperation(value = "券类商品订单查询已发放券状态", notes = "响应参数[1-可用,5-已用]")
public ResponseDto<Integer> couponState(@NotBlank(message = "子订单Id不能为空") @RequestParam String orderSkuId) {
return ResponseDto.success(goblinOrderAppService.couponState(orderSkuId, CurrentUtil.getCurrentUid()));
}
@PostMapping("getProduce") @PostMapping("getProduce")
@ApiOperation("已收货") @ApiOperation("已收货")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -160,6 +160,21 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -160,6 +160,21 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
return ResponseDto.success(vo); return ResponseDto.success(vo);
} }
@Override
public Integer couponState(String orderSkuId, String uid) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
if (Objects.equals(orderSkuVo.getSkuType(), 2)) {// 券类商品-校验发放的券是否已使用
// 券类商品默认一个商品对应一个券,下单只可购买一张
List<CandyUserCouponBasicDto> vos = (List<CandyUserCouponBasicDto>) redisUtils.get(CandyRedisConst.BASIC_USER_COUPON.concat(uid));
if (!CollectionUtil.isEmpty(vos)) {
CandyUserCouponBasicDto basicDto = vos.stream().filter(r -> r.getUcouponId().equals(orderSkuId)).findAny().orElse(null);
return (!Objects.isNull(basicDto) && basicDto.getState() == 5) ? 5 : 1;
}
}
return 1;
}
@Override @Override
public ResponseDto<Boolean> getProduce(String orderId, String uid) { public ResponseDto<Boolean> getProduce(String orderId, String uid) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
......
...@@ -136,7 +136,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -136,7 +136,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String couponSkuIdNoBuyLimitKey = String.format(GoblinRedisConst.REDIS_GOBLIN_BUY_COUNT_IDNO, skuParam.getIdType(), skuParam.getIdNo(), skuId, skuParam.getNumber()); String couponSkuIdNoBuyLimitKey = String.format(GoblinRedisConst.REDIS_GOBLIN_BUY_COUNT_IDNO, skuParam.getIdType(), skuParam.getIdNo(), skuId, skuParam.getNumber());
couponSkuIdNoBuyLimitMap.put(couponSkuIdNoBuyLimitKey, skuParam.getNumber()); couponSkuIdNoBuyLimitMap.put(couponSkuIdNoBuyLimitKey, skuParam.getNumber());
if (redisUtils.redisUtil.incr(couponSkuIdNoBuyLimitKey, skuParam.getNumber()) > idNoLimitCount) { if (redisUtils.redisUtil.incr(couponSkuIdNoBuyLimitKey, skuParam.getNumber()) > idNoLimitCount) {
throw new LiquidnetServiceException("-1", String.format("超出限购数量,一份证件限购%d张", idNoLimitCount)); throw new LiquidnetServiceException("-1", String.format("超过限购数量,一个证件信息限购%d张", idNoLimitCount));
} }
} }
} }
......
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