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

Commit 6a3b8734 authored by 胡佳晨's avatar 胡佳晨

下列接口 新增 字段 perType 演出的 performanceVo 的 type 字段

/candy-coupon/preUse/performance “要使用券列表 - 演出”
/candy-coupon/preCanUse/performance “是否可用券 - 演出”
/candy-coupon/use “券使用”
parent 8a069918
......@@ -28,9 +28,9 @@ public interface ICandyCouponService {
List<CandyCouponVo> memberCoupon(String mCouponId);
CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type);
CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type,int perType);
Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId);
Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId,int perType);
CandyMyCouponListVo preUseGoodCoupon(BigDecimal priceTotal, String goodId, Integer type,String uid);
......@@ -40,7 +40,7 @@ public interface ICandyCouponService {
Integer stateCoupon(String uCouponId);
CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodIds,String uid);
CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodIds,String uid,int perType);
Boolean useBackCoupon(List<BackCouponParam> backCouponParam);
......
......@@ -99,14 +99,19 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "type", value = "类型 1可用 2过期/已使用 ", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
})
public ResponseDto<CandyMyCouponListVo> preUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam("type") @NotNull Integer type,
@RequestParam(required = false, name = "page") Integer page) {
CandyMyCouponListVo vo = candyCouponService.preUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId, type);
@RequestParam(required = false, name = "page") Integer page,
@RequestParam(required = false, name = "perType") Integer perType) {
if (perType == null) {
perType = -1;
}
CandyMyCouponListVo vo = candyCouponService.preUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId, type,perType);
List<CandyCouponVo> list = vo.getMyCoupon();
List<CandyCouponVo> listVo = ObjectUtil.getCandyCouponVoArrayList();
if (page == null || page == 0) {
......@@ -133,13 +138,18 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "performanceId", value = "演出id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
})
public ResponseDto<HashMap<String, Integer>> preCanUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId) {
@RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam(required = false, name = "perType") Integer perType) {
if (perType == null) {
perType = -1;
}
HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
hashMap.put("canUse", candyCouponService.preCanUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId));
hashMap.put("canUse", candyCouponService.preCanUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId,perType));
return ResponseDto.success(hashMap);
}
......@@ -255,6 +265,7 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "uid", value = "uid", required = false),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
})
public ResponseDto<CandyUseResultVo> useCoupon(@RequestParam("uCouponId") @NotNull @NotBlank String uCouponId,
@RequestParam("content") @NotNull @NotBlank String content,
......@@ -263,12 +274,16 @@ public class CandyCouponController {
@RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam(value = "uid", required = false) String uid
@RequestParam(value = "uid", required = false) String uid,
@RequestParam(required = false, name = "perType") Integer perType
) {
if (uid == null) {
uid = CurrentUtil.getCurrentUid();
}
CandyUseResultVo result = candyCouponService.useCoupon(uCouponId, content, totalPrice, performanceId, timeId, ticketId, goodId, uid);
if (perType == null) {
perType = -1;
}
CandyUseResultVo result = candyCouponService.useCoupon(uCouponId, content, totalPrice, performanceId, timeId, ticketId, goodId, uid,perType);
if (result == null) {
return ResponseDto.failure();
}
......
......@@ -139,7 +139,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type) {
public CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type,int perType) {
String uid = CurrentUtil.getCurrentUid();
LocalDateTime userCreateTime;
try {
......@@ -153,7 +153,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyCouponVo> myCoupon = ObjectUtil.getCandyCouponVoArrayList();
for (CandyUserCouponBasicDto dtoItem : dtoList) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId);
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId,perType);
if (type == 1) {
if (baseVo.getState().equals(3) || dtoItem.getState().equals(5) || baseVo.getState().equals(21)) {
continue;
......@@ -182,7 +182,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId) {
public Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId,int perType) {
String uid = CurrentUtil.getCurrentUid();
LocalDateTime userCreateTime;
try {
......@@ -193,7 +193,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyUserCouponBasicDto> dtoList = redisDataUtils.getCouponByUid(uid, userCreateTime);
int canUse = 0;
for (CandyUserCouponBasicDto dtoItem : dtoList) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId);
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId,perType);
if (baseVo.getCouType().equals(101) || baseVo.getCouType().equals(3) || baseVo.getBusiType() == 2) {
continue;
}
......@@ -287,7 +287,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyCouponVo> advanceCoupon = ObjectUtil.getCandyCouponVoArrayList();
for (CandyUserCouponBasicDto dtoItem : dtoList) {
if (dtoItem.getBusiType().equals(3)) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, BigDecimal.ZERO, performanceId, "-1", "-1");
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, BigDecimal.ZERO, performanceId, "-1", "-1",-1);
if (baseVo.getState().equals(1)) {
advanceCoupon.add(baseVo);
} else {
......@@ -317,7 +317,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodId, String uid) {
public CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodId, String uid,int perType) {
LocalDateTime userCreateTime;
try {
userCreateTime = getCreatedAt(uid);
......@@ -380,9 +380,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
case 92://票
isTarget = CouponBaseUtil.isTargetCoupon(ruleItem.getBusiId(), dto.getCouType(), ticketId, new BigDecimal(totalPrice), dto.getValOver());
break;
case 100://
case 100://全场
isTarget = true;
break;
//TODO 胡佳晨 20240123
case 101:
case 102:
case 103:
isTarget = ruleItem.getUseScope()==perType;
break;
default:
isTarget = false;
break;
......
......@@ -74,7 +74,8 @@ public class CouponBaseUtil {
BigDecimal priceTotal,
String performanceId,
String timeId,
String ticketId) {
String ticketId,
int perType) {
boolean isTarget = false;
LocalDateTime now = LocalDateTime.now();
CandyCouponVo vo = CandyCouponVo.getNew();
......@@ -126,6 +127,12 @@ public class CouponBaseUtil {
isTarget = true;
}
break;
//TODO 胡佳晨 20240123
case 101:
case 102:
case 103:
isTarget = ruleItem.getUseScope() == perType;
break;
default:
isTarget = false;
break;
......
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