|
|
|
@ -39,6 +39,7 @@ public class GenerateQRCodeListener {
|
|
|
|
|
private PoiStoreStaffDOMapper poiStoreStaffDOMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private PoiStoreDOMapper poiStoreDOMapper;
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
@EventListener
|
|
|
|
|
//后台创建活动实例并绑定店铺之后,给店铺批量生成二维码
|
|
|
|
@ -56,7 +57,7 @@ public class GenerateQRCodeListener {
|
|
|
|
|
pmnActivityStoreRelation.setInstanceId(instance.getId());
|
|
|
|
|
pmnActivityStoreRelation.setCreateTime(new Date());
|
|
|
|
|
int status = 1;
|
|
|
|
|
if(instance.getStatus() > 2) {
|
|
|
|
|
if (instance.getStatus() > 2) {
|
|
|
|
|
status = 2;
|
|
|
|
|
}
|
|
|
|
|
pmnActivityStoreRelation.setStatus(status);
|
|
|
|
@ -67,7 +68,6 @@ public class GenerateQRCodeListener {
|
|
|
|
|
}
|
|
|
|
|
if (storeIds.size() > 0) {
|
|
|
|
|
pmnActivityStoreRelationService.remove(Wrappers.<PmnActivityStoreRelation>lambdaQuery().eq(PmnActivityStoreRelation::getInstanceId, instance.getId()).notIn(PmnActivityStoreRelation::getStoreId, storeIds));
|
|
|
|
|
}
|
|
|
|
|
List<PmnPromotionSrc> storeSrcs = pmnPromotionSrcService.list(Wrappers.<PmnPromotionSrc>lambdaQuery().eq(PmnPromotionSrc::getInstanceId, instance.getId()).notIn(PmnPromotionSrc::getPromoterId, storeIds).eq(PmnPromotionSrc::getType, 2).select(PmnPromotionSrc::getPromoterId));
|
|
|
|
|
Set<Long> removeStoreSrcs = storeSrcs.stream().map(PmnPromotionSrc::getPromoterId).collect(Collectors.toSet());
|
|
|
|
|
List<PoiStoreStaffDTO> removeSellers = poiStoreStaffDOMapper.selectSellersByShopIds(new ArrayList<>(removeStoreSrcs));
|
|
|
|
@ -75,7 +75,7 @@ public class GenerateQRCodeListener {
|
|
|
|
|
List<Long> removeSrcs = new ArrayList<>();
|
|
|
|
|
removeSrcs.addAll(new ArrayList<>(removeStoreSrcs));
|
|
|
|
|
removeSrcs.addAll(new ArrayList<>(removeSellerIds));
|
|
|
|
|
if(removeSrcs.size() > 0) {
|
|
|
|
|
if (removeSrcs.size() > 0) {
|
|
|
|
|
pmnPromotionSrcService.remove(Wrappers.<PmnPromotionSrc>lambdaQuery().in(PmnPromotionSrc::getPromoterId, removeSrcs).eq(PmnPromotionSrc::getInstanceId, instance.getId()));
|
|
|
|
|
}
|
|
|
|
|
log.info("removeSrcs: {}", removeSrcs);
|
|
|
|
@ -91,7 +91,8 @@ public class GenerateQRCodeListener {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
log.info("生成失败数据: {}", fails);
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("生成失败: {}", e);
|
|
|
|
|
}
|
|
|
|
|