|
@@ -95,10 +95,10 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(list), "已存在领取的优惠券");
|
|
|
|
|
|
|
|
|
- String contractIdEnc = (String) redisTemplate.opsForValue().get(form.getContractIdEnc());
|
|
|
- Assert.isTrue(StrUtil.isNotBlank(contractIdEnc), "二维码已过期");
|
|
|
- Long contractId = Long.parseLong(contractIdEnc);
|
|
|
- form.setContractId(contractId);
|
|
|
+ Object contractIdEnc = redisTemplate.opsForValue().get(form.getContractIdEnc());
|
|
|
+ Assert.isTrue(contractIdEnc != null, "二维码已过期");
|
|
|
+ String contractId = contractIdEnc.toString();
|
|
|
+ form.setContractId(Long.parseLong(contractId));
|
|
|
// 根据协议id生成优惠券
|
|
|
if(form.getContractId() != null){
|
|
|
Contract contract = contractService.getById(form.getContractId());
|