Commit 13dac54f by 吕明尚

修改提前抖音团购验卷操作

parent 38a1a2f4
......@@ -209,10 +209,10 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
SStore byId = getById(sStore.getId());
int i = baseMapper.updateSStore(sStore);
if (!sStore.getOpenShopUuid().equals(byId.getOpenShopUuid())) {
if (!sStore.getOpenShopUuid().equals(byId.getOpenShopUuid()) && StringUtils.isNotBlank(sStore.getOpenShopUuid())) {
extracted();
}
if (!sStore.getTiktokPoiId().equals(byId.getTiktokPoiId())) {
if (!sStore.getTiktokPoiId().equals(byId.getTiktokPoiId()) && StringUtils.isNotBlank(sStore.getTiktokPoiId())) {
updateTiktok();
}
return i;
......
......@@ -320,6 +320,17 @@ public class TiktokServiceImpl implements TiktokService {
if (ObjectUtils.isNotEmpty(unUsedCoupon)) {
throw new RuntimeException("该券已被领取");
}
TiktokCouponDto couponDto = new TiktokCouponDto();
couponDto.setVerifyToken(prepare.getStr("verify_token"));
couponDto.setPoiId(sStore.getTiktokPoiId());
List<String> codes = new ArrayList<>();
List<JSONObject> list = certificates.toList(JSONObject.class);
//获取List中的encrypted_code
list.stream().forEach(e -> {
codes.add(e.getStr("encrypted_code"));
});
couponDto.setEncryptedCodes(codes);
verify(couponDto);
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon.setStoreId(sStore.getId());
......@@ -372,17 +383,6 @@ public class TiktokServiceImpl implements TiktokService {
sConsumerCoupon.setRemark(sCoupon.getRemark());
}
isConsumerCouponService.insertSConsumerCoupon(sConsumerCoupon);
TiktokCouponDto couponDto = new TiktokCouponDto();
couponDto.setVerifyToken(prepare.getStr("verify_token"));
couponDto.setPoiId(sStore.getTiktokPoiId());
List<String> codes = new ArrayList<>();
List<JSONObject> list = certificates.toList(JSONObject.class);
//获取List中的encrypted_code
list.stream().forEach(e -> {
codes.add(e.getStr("encrypted_code"));
});
couponDto.setEncryptedCodes(codes);
verify(couponDto);
} catch (RuntimeException e) {
throw new RuntimeException(e);
}
......
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