Commit 3933280e by 吕明尚

验劵方法修改

parent ccf6f6ad
......@@ -59,6 +59,20 @@ public class QPServiceImpl implements QPService {
@Autowired
private RedisUtil redisUtil;
//默认门槛时长
private static final String DEFAULT_MIN_DURATION = "0";
//默认时长
private static final String DEFAULT_DURATION = "0";
//默认折扣最大时长
private static final String DEFAULT_MAX_DURATION = "999";
//默认优惠开始(有效)时段
private static final String DEFAULT_START_TIME = "00:00";
//默认优惠结束(有效)时段
private static final String DEFAULT_END_TIME = "24:00";
//默认门槛金额
private static final BigDecimal DEFAULT_MIN_PRICE = BigDecimal.valueOf(0.00);
/**
* 用户验卷接口
*/
......@@ -88,23 +102,26 @@ public class QPServiceImpl implements QPService {
//根据优惠卷名称查询优惠劵配置
SCoupon sCoupon = isCouponService.selectSCouponByName(prepare.getDeal_title());
TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo();
if (ObjectUtils.isEmpty(sCoupon)) {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon.setDealId(prepare.getDeal_id());
sConsumerCoupon.setCouponCode(code);
sConsumerCoupon.setName(prepare.getDeal_title());
sConsumerCoupon.setSourceType(SourceTypeEnum.CHECK.getCode());
sConsumerCoupon.setPlatformType(PlatformTypeEnum.MEITUAN.getCode());
sConsumerCoupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
sConsumerCoupon.setCreateTime(new Date());
if (ObjectUtils.isEmpty(sCoupon)) {
sConsumerCoupon.setCouponType(CouponTypeEnum.CASH.getCode());
sConsumerCoupon.setStoreType(StoreType.getCodeList());
sConsumerCoupon.setRoomType(RoomType.getCodeList());
sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
sConsumerCoupon.setMinDuration("0");
sConsumerCoupon.setMaxDuration("999");
sConsumerCoupon.setDuration("0");
sConsumerCoupon.setMinPrice(BigDecimal.valueOf(0.00));
sConsumerCoupon.setMinDuration(DEFAULT_MIN_DURATION);
sConsumerCoupon.setMaxDuration(DEFAULT_MAX_DURATION);
sConsumerCoupon.setDuration(DEFAULT_DURATION);
sConsumerCoupon.setMinPrice(DEFAULT_MIN_PRICE);
sConsumerCoupon.setSubPrice(BigDecimal.valueOf(prepare.getDeal_marketprice()));
sConsumerCoupon.setSourceType(SourceTypeEnum.CHECK.getCode());
sConsumerCoupon.setPlatformType(PlatformTypeEnum.MEITUAN.getCode());
//根据门店id查询门店信息
List<TuangouDealQueryShopDealResponseEntity> queryshopdeal = queryshopdeal(openShopUuid);
queryshopdeal.stream().forEach(o -> {
......@@ -122,20 +139,10 @@ public class QPServiceImpl implements QPService {
}
});
sConsumerCoupon.setCouponTimeStart("00:00");
sConsumerCoupon.setCouponTimeEnd("24:00");
sConsumerCoupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
sConsumerCoupon.setCreateTime(new Date());
isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon);
response.setConsumerCouponId(sConsumerCoupon.getId());
sConsumerCoupon.setCouponTimeStart(DEFAULT_START_TIME);
sConsumerCoupon.setCouponTimeEnd(DEFAULT_END_TIME);
} else {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon.setDealId(prepare.getDeal_id());
sConsumerCoupon.setCouponId(sCoupon.getId());
sConsumerCoupon.setCouponCode(code);
sConsumerCoupon.setName(prepare.getDeal_title());
sConsumerCoupon.setCouponType(sCoupon.getCouponType());
sConsumerCoupon.setStoreType(sCoupon.getStoreType());
sConsumerCoupon.setRoomType(sCoupon.getRoomType());
......@@ -144,18 +151,14 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon.setDuration(sCoupon.getDuration());
sConsumerCoupon.setMinPrice(sCoupon.getMinPrice());
sConsumerCoupon.setSubPrice(sCoupon.getSubPrice());
sConsumerCoupon.setSourceType(SourceTypeEnum.CHECK.getCode());
sConsumerCoupon.setPlatformType(PlatformTypeEnum.MEITUAN.getCode());
sConsumerCoupon.setStartDate(sCoupon.getStartDate());
sConsumerCoupon.setEndDate(prepare.getReceiptEndDate());
sConsumerCoupon.setCouponTimeStart(sCoupon.getValidStartTime());
sConsumerCoupon.setCouponTimeEnd(sCoupon.getValidEndTime());
sConsumerCoupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
sConsumerCoupon.setCreateBy(String.valueOf(user.getId()));
sConsumerCoupon.setCreateTime(new Date());
}
isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon);
response.setConsumerCouponId(sConsumerCoupon.getId());
}
//设置过期时间30分钟
Map<String, String> map = new HashMap<>();
map.put("receipt_code", prepare.getReceipt_code());
......
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