Commit 3933280e by 吕明尚

验劵方法修改

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