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

Commit d4e546f3 authored by zhangguobing's avatar zhangguobing

~api:券商品业务-券类商品订单详情优化;

parent ca8842b7
...@@ -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();
......
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