|
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
import org.springframework.util.MultiValueMap;
|
|
import org.springframework.util.MultiValueMap;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import shop.alien.entity.store.LifeCoupon;
|
|
|
import shop.alien.entity.store.LifeDiscountCoupon;
|
|
import shop.alien.entity.store.LifeDiscountCoupon;
|
|
|
import shop.alien.entity.store.LifeNotice;
|
|
import shop.alien.entity.store.LifeNotice;
|
|
|
import shop.alien.entity.store.StoreImg;
|
|
import shop.alien.entity.store.StoreImg;
|
|
@@ -26,6 +27,7 @@ import shop.alien.entity.storePlatform.StoreOperationalActivity;
|
|
|
import shop.alien.entity.storePlatform.StoreOperationalActivitySignup;
|
|
import shop.alien.entity.storePlatform.StoreOperationalActivitySignup;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivityDTO;
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivityDTO;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivityVO;
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivityVO;
|
|
|
|
|
+import shop.alien.mapper.LifeCouponMapper;
|
|
|
import shop.alien.mapper.LifeDiscountCouponMapper;
|
|
import shop.alien.mapper.LifeDiscountCouponMapper;
|
|
|
import shop.alien.mapper.LifeNoticeMapper;
|
|
import shop.alien.mapper.LifeNoticeMapper;
|
|
|
import shop.alien.mapper.StoreImgMapper;
|
|
import shop.alien.mapper.StoreImgMapper;
|
|
@@ -71,6 +73,8 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
|
|
|
|
|
private final LifeDiscountCouponMapper lifeDiscountCouponMapper;
|
|
private final LifeDiscountCouponMapper lifeDiscountCouponMapper;
|
|
|
|
|
|
|
|
|
|
+ private final LifeCouponMapper lifeCouponMapper;
|
|
|
|
|
+
|
|
|
private final StoreOperationalActivitySignupMapper signupMapper;
|
|
private final StoreOperationalActivitySignupMapper signupMapper;
|
|
|
|
|
|
|
|
private final StoreUserMapper storeUserMapper;
|
|
private final StoreUserMapper storeUserMapper;
|
|
@@ -106,6 +110,7 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
+ "用户可参与次数:%s\n"
|
|
+ "用户可参与次数:%s\n"
|
|
|
+ "活动规则:%s\n"
|
|
+ "活动规则:%s\n"
|
|
|
+ "优惠券发放数量:%s\n"
|
|
+ "优惠券发放数量:%s\n"
|
|
|
|
|
+ + "代金券发放数量:%s\n"
|
|
|
+ "图片描述:%s";
|
|
+ "图片描述:%s";
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -208,7 +213,8 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
dto.getEndTime(),
|
|
dto.getEndTime(),
|
|
|
dto.getParticipationLimit(),
|
|
dto.getParticipationLimit(),
|
|
|
dto.getActivityRule(),
|
|
dto.getActivityRule(),
|
|
|
- dto.getCouponQuantity(),
|
|
|
|
|
|
|
+ dto.getCouponQuantity() != null ? dto.getCouponQuantity() : 0,
|
|
|
|
|
+ dto.getVoucherQuantity() != null ? dto.getVoucherQuantity() : 0,
|
|
|
dto.getImgDescribe()
|
|
dto.getImgDescribe()
|
|
|
);
|
|
);
|
|
|
requestBody.put("text", filled);
|
|
requestBody.put("text", filled);
|
|
@@ -369,7 +375,8 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
dto.getEndTime(),
|
|
dto.getEndTime(),
|
|
|
dto.getParticipationLimit(),
|
|
dto.getParticipationLimit(),
|
|
|
dto.getActivityRule(),
|
|
dto.getActivityRule(),
|
|
|
- dto.getCouponQuantity(),
|
|
|
|
|
|
|
+ dto.getCouponQuantity() != null ? dto.getCouponQuantity() : 0,
|
|
|
|
|
+ dto.getVoucherQuantity() != null ? dto.getVoucherQuantity() : 0,
|
|
|
dto.getImgDescribe()
|
|
dto.getImgDescribe()
|
|
|
);
|
|
);
|
|
|
requestBody.put("text", filled);
|
|
requestBody.put("text", filled);
|
|
@@ -486,15 +493,22 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
} else if (activity.getStatus() == 7) {
|
|
} else if (activity.getStatus() == 7) {
|
|
|
vo.setStatusName("已结束");
|
|
vo.setStatusName("已结束");
|
|
|
}
|
|
}
|
|
|
-//
|
|
|
|
|
-// // 设置优惠券名称与优惠券类型(判空处理)
|
|
|
|
|
-// if (activity.getCouponId() != null) {
|
|
|
|
|
-// LifeDiscountCoupon coupon = lifeDiscountCouponMapper.selectById(activity.getCouponId());
|
|
|
|
|
-// if (coupon != null) {
|
|
|
|
|
-// vo.setCouponName(coupon.getName());
|
|
|
|
|
-// vo.setCouponType(coupon.getType());
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 设置优惠券名称(判空处理)
|
|
|
|
|
+ if (activity.getCouponId() != null) {
|
|
|
|
|
+ LifeDiscountCoupon coupon = lifeDiscountCouponMapper.selectById(activity.getCouponId());
|
|
|
|
|
+ if (coupon != null) {
|
|
|
|
|
+ vo.setCouponName(coupon.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 设置代金券名称(判空处理)
|
|
|
|
|
+ if (activity.getVoucherId() != null) {
|
|
|
|
|
+ LifeCoupon voucher = lifeCouponMapper.selectById(String.valueOf(activity.getVoucherId()));
|
|
|
|
|
+ if (voucher != null) {
|
|
|
|
|
+ vo.setVoucherName(voucher.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
StoreImg activityTitleImg = imgMapper.selectOne(new LambdaQueryWrapper<StoreImg>()
|
|
StoreImg activityTitleImg = imgMapper.selectOne(new LambdaQueryWrapper<StoreImg>()
|
|
|
.eq(StoreImg::getStoreId, vo.getStoreId())
|
|
.eq(StoreImg::getStoreId, vo.getStoreId())
|
|
@@ -564,6 +578,34 @@ public class OperationalActivityServiceImpl implements OperationalActivityServic
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 设置代金券名称(判空处理)
|
|
|
|
|
+ if (activity.getVoucherId() != null) {
|
|
|
|
|
+ LifeCoupon voucher = lifeCouponMapper.selectById(String.valueOf(activity.getVoucherId()));
|
|
|
|
|
+ if (voucher != null) {
|
|
|
|
|
+ vo.setVoucherName(voucher.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询活动标题图片
|
|
|
|
|
+ StoreImg activityTitleImg = imgMapper.selectOne(new LambdaQueryWrapper<StoreImg>()
|
|
|
|
|
+ .eq(StoreImg::getStoreId, vo.getStoreId())
|
|
|
|
|
+ .eq(StoreImg::getImgType, 26)
|
|
|
|
|
+ .eq(StoreImg::getDeleteFlag, 0)
|
|
|
|
|
+ .eq(StoreImg::getBusinessId, activity.getId()));
|
|
|
|
|
+ if (activityTitleImg != null) {
|
|
|
|
|
+ vo.setActivityTitleImgUrl(activityTitleImg.getImgUrl());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询活动详情图片
|
|
|
|
|
+ StoreImg activityDetailImg = imgMapper.selectOne(new LambdaQueryWrapper<StoreImg>()
|
|
|
|
|
+ .eq(StoreImg::getStoreId, vo.getStoreId())
|
|
|
|
|
+ .eq(StoreImg::getImgType, 27)
|
|
|
|
|
+ .eq(StoreImg::getDeleteFlag, 0)
|
|
|
|
|
+ .eq(StoreImg::getBusinessId, activity.getId()));
|
|
|
|
|
+ if (activityDetailImg != null) {
|
|
|
|
|
+ vo.setActivityDetailImgUrl(activityDetailImg.getImgUrl());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
voRecords.add(vo);
|
|
voRecords.add(vo);
|
|
|
}
|
|
}
|
|
|
|
|
|