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

Commit 7fb9c14a authored by 胡佳晨's avatar 胡佳晨

goblin 帮助前端用店铺券/平台券

parent 1e332918
...@@ -256,6 +256,10 @@ public class GoblinCouponController { ...@@ -256,6 +256,10 @@ public class GoblinCouponController {
if (param.getUid() == null || param.getUid().equals("")) { if (param.getUid() == null || param.getUid().equals("")) {
param.setUid(CurrentUtil.getCurrentUid()); param.setUid(CurrentUtil.getCurrentUid());
} }
return ResponseDto.success(goblinCouponService.helpUseCoupon(param)); CouponHelpUseVo vo = goblinCouponService.helpUseCoupon(param);
if(vo==null){
return ResponseDto.failure("券不存在");
}
return ResponseDto.success(vo);
} }
} }
...@@ -126,14 +126,17 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -126,14 +126,17 @@ public class GoblinCouponImpl implements GoblinCouponService {
// } // }
if ("1".equals(type)) { if ("1".equals(type)) {
if (vo.getDuedAt().isAfter(now) && vo.getState().equals(1)) { if (vo.getDuedAt().isAfter(now) && vo.getState().equals(1)) {
vo.setSpuIds(goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId()));
returnList.add(vo); returnList.add(vo);
} }
} else { } else {
if (vo.getDuedAt().isBefore(now) || vo.getState().equals(3)) { if (vo.getDuedAt().isBefore(now) || vo.getState().equals(3)) {
vo.setState(3); vo.setState(3);
vo.setSpuIds(goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId()));
returnList.add(vo); returnList.add(vo);
} }
if (vo.getState().equals(5)) { if (vo.getState().equals(5)) {
vo.setSpuIds(goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId()));
returnList.add(vo); returnList.add(vo);
} }
} }
...@@ -488,6 +491,9 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -488,6 +491,9 @@ public class GoblinCouponImpl implements GoblinCouponService {
} }
} else if (platformUcouponId != null && !platformUcouponId.equals("")) { } else if (platformUcouponId != null && !platformUcouponId.equals("")) {
CandyCouponVo candyCouponVo = orderUtils.getCouponDetails(platformUcouponId); CandyCouponVo candyCouponVo = orderUtils.getCouponDetails(platformUcouponId);
if(candyCouponVo==null){
return null;
}
if (candyCouponVo.getState().equals(1) && (candyCouponVo.getBusiType().equals(0) || candyCouponVo.getBusiType().equals(2))) { if (candyCouponVo.getState().equals(1) && (candyCouponVo.getBusiType().equals(0) || candyCouponVo.getBusiType().equals(2))) {
BigDecimal voucherPrice; BigDecimal voucherPrice;
switch (candyCouponVo.getCouType()) { switch (candyCouponVo.getCouType()) {
......
...@@ -65,7 +65,11 @@ public class GoblinOrderUtils { ...@@ -65,7 +65,11 @@ public class GoblinOrderUtils {
String returnData = HttpUtil.post(candyUrl + " /candy-coupon/receive/ListById", params, header); String returnData = HttpUtil.post(candyUrl + " /candy-coupon/receive/ListById", params, header);
ResponseDto<List<CandyCouponVo>> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<List<CandyCouponVo>>>() { ResponseDto<List<CandyCouponVo>> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<List<CandyCouponVo>>>() {
}); });
return innerReturnVo.getData().get(0); if(innerReturnVo.getData().size()>0){
return innerReturnVo.getData().get(0);
}else{
return null;
}
} catch (Exception e) { } catch (Exception e) {
log.error("回退券ERROR:{}", e); log.error("回退券ERROR:{}", e);
CandyCouponVo vo = CandyCouponVo.getNew(); CandyCouponVo vo = CandyCouponVo.getNew();
......
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