|
@@ -2816,6 +2816,42 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
return resultPage;
|
|
return resultPage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<LifeCouponVo> getStoreCouponList(String storeId) {
|
|
|
|
|
+ // 获取店铺代金券列表
|
|
|
|
|
+ LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
+ quanWrapper.eq(LifeCoupon::getStoreId, storeId).eq(LifeCoupon::getStatus, CouponStatusEnum.ONGOING.getCode()).eq(LifeCoupon::getType, 1);
|
|
|
|
|
+ List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
|
|
|
|
|
+ List<LifeCouponVo> quanVoList = new ArrayList<>();
|
|
|
|
|
+ List<String> collect = quanList.stream().map(LifeCoupon::getId).collect(Collectors.toList());
|
|
|
|
|
+ // 设置已售数量
|
|
|
|
|
+ // 定义需要的订单状态集合
|
|
|
|
|
+ Set<Integer> excludeStatuses = new HashSet<>(Arrays.asList(
|
|
|
|
|
+ OrderStatusEnum.WAIT_PAY.getStatus(),
|
|
|
|
|
+ OrderStatusEnum.WAIT_USE.getStatus(),
|
|
|
|
|
+ OrderStatusEnum.USED.getStatus()
|
|
|
|
|
+ ));
|
|
|
|
|
+ if (!collect.isEmpty()) {
|
|
|
|
|
+ List<LifeUserOrderVo> quanCount = lifeUserOrderMapper.getQuanCount(new QueryWrapper<LifeUserOrderVo>()
|
|
|
|
|
+ .eq("luo.store_id", storeId)
|
|
|
|
|
+ .eq("luo.coupon_type", CouponTypeEnum.COUPON.getCode())
|
|
|
|
|
+ .eq("luo.delete_flag", 0)
|
|
|
|
|
+ .in("ocm.status", excludeStatuses)
|
|
|
|
|
+ .groupBy("ocm.coupon_id"));
|
|
|
|
|
+ quanList.forEach(a -> {
|
|
|
|
|
+ LifeCouponVo lifeCouponVo = new LifeCouponVo();
|
|
|
|
|
+ BeanUtils.copyProperties(a, lifeCouponVo);
|
|
|
|
|
+ quanCount.forEach(item -> {
|
|
|
|
|
+ if (a.getId().equals(item.getCouponId().toString())) {
|
|
|
|
|
+ lifeCouponVo.setCount(item.getCount());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ quanVoList.add(lifeCouponVo);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return quanVoList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
void verificationStoreInfoStatus(StoreInfoDto storeInfo) {
|
|
void verificationStoreInfoStatus(StoreInfoDto storeInfo) {
|
|
|
//营业状态 0:正常营业, 1:暂停营业, 2:筹建中, 99:永久关门
|
|
//营业状态 0:正常营业, 1:暂停营业, 2:筹建中, 99:永久关门
|
|
|
if (!Objects.isNull(storeInfo.getBusinessStatus()) && storeInfo.getBusinessStatus() == 99) {
|
|
if (!Objects.isNull(storeInfo.getBusinessStatus()) && storeInfo.getBusinessStatus() == 99) {
|