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

Commit 723e4b06 authored by zhangguobing's avatar zhangguobing

Merge remote-tracking branch 'origin/20240123_COUPON_SPU' into 20240123_COUPON_SPU

parents 0d4c5972 dc59f646
......@@ -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;
......
......@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.base.*;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.candy.dto.CandyUserCouponAssocDto;
import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
......@@ -322,6 +323,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
return ResponseDto.failure(ErrorMapping.get("20015"));//入场人数量错误
}
//判断新商品券
CandyUserCouponAssocDto couponAssocDto = dataUtils.getGoblinPlatformCoupon(payOrderParam.getVoucherCode());
if(couponAssocDto!=null){
boolean goblinPlatformCouponseCanUse = false;
for (AdamEntersVo adamEnters : entersVoList) {
if(couponAssocDto.getIdNo().equals(adamEnters.getIdCard())){
goblinPlatformCouponseCanUse = true;
}
}
if(!goblinPlatformCouponseCanUse){
return ResponseDto.failure("实名券与入场人信息不一致");
}
}
// 判断库存
int surplusGeneral = orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), -payOrderParam.getNumber());
......
......@@ -5,6 +5,8 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IPUtil;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyUserCouponAssocDto;
import com.liquidnet.service.goblin.constant.SmileRedisConst;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.KylinFreightChargeDao;
......@@ -126,8 +128,8 @@ public class DataUtils {
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKeyUid;
String redisKeyIdCard;
String performanceIdKeyIdCard="";
String ticketIdKeyIdCard="";
String performanceIdKeyIdCard = "";
String ticketIdKeyIdCard = "";
int isTrueName = getPerformanceIsTrueName(performanceId);
......@@ -380,7 +382,7 @@ public class DataUtils {
/**
* 获取演出ids
*/
public List<String> getShowIds(){
public List<String> getShowIds() {
String rdk = SmileRedisConst.SMILE_SHOW;
Object obj = redisUtil.get(rdk);
if (obj == null) {
......@@ -389,4 +391,19 @@ public class DataUtils {
return (List<String>) obj;
}
}
/**
* 根据券id查询适用人证件信息
* @param ucouponId
* @return
*/
public CandyUserCouponAssocDto getGoblinPlatformCoupon(String ucouponId) {
String rdk = CandyRedisConst.BASIC_USER_COUPON_ASSOC.concat(ucouponId);
Object obj = redisUtil.get(rdk);
if (obj == null) {
return null;
} else {
return (CandyUserCouponAssocDto) obj;
}
}
}
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