|
|
@@ -44,8 +44,11 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
private final StoreInfoMapper storeInfoMapper;
|
|
|
|
|
|
private final StoreImgMapper storeImgMapper;
|
|
|
+
|
|
|
private final EssentialHolidayComparisonMapper essentialHolidayComparisonMapper;
|
|
|
|
|
|
+ private final LifeGroupBuyThaliMapper lifeGroupBuyThaliMapper;
|
|
|
+
|
|
|
private final AliOSSUtil aliOSSUtil;
|
|
|
|
|
|
List<LifeCouponVo> toExcel = new ArrayList<>();
|
|
|
@@ -250,8 +253,8 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
if (null == lifeGroupBuyMain) return 0;
|
|
|
lifeGroupBuyMain.setStatus(status);
|
|
|
lifeGroupBuyMain.setApprovalComments(comment);
|
|
|
- // 审核后开始
|
|
|
- if (lifeGroupBuyMain.getStartTimeType()==0) {
|
|
|
+ // 审核通过后开始
|
|
|
+ if (lifeGroupBuyMain.getStartTimeType() == 0 && lifeGroupBuyMain.getStatus() == 5) {
|
|
|
lifeGroupBuyMain.setStartTimeValue(new Date());
|
|
|
}
|
|
|
return platformStoreLifeGroupBuyMainMapper.updateById(lifeGroupBuyMain);
|
|
|
@@ -484,7 +487,12 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
|
|
|
@Override
|
|
|
public LifeGroupBuyMainVo getLifeGroupBuyMainByDetail(Integer id) {
|
|
|
+ LifeGroupBuyMainVo lifeGroupBuyMainVo = new LifeGroupBuyMainVo();
|
|
|
LifeGroupBuyMain lifeGroupBuyMain = platformStoreLifeGroupBuyMainMapper.selectById(id);
|
|
|
+ List<LifeGroupBuyThali> lifeGroupBuyThali = lifeGroupBuyThaliMapper.getLifeGroupBuyThaliList(new LambdaQueryWrapper<LifeGroupBuyThali>()
|
|
|
+ .eq(LifeGroupBuyThali::getParentId, lifeGroupBuyMain.getId()).groupBy(LifeGroupBuyThali::getDetailId));
|
|
|
+ lifeGroupBuyMainVo.setLifeGroupBuyThaliList(lifeGroupBuyThali);
|
|
|
+
|
|
|
// 添加商户信息
|
|
|
StoreInfo storeUser = storeInfoMapper.selectById(lifeGroupBuyMain.getStoreId());
|
|
|
// 图片
|
|
|
@@ -492,8 +500,6 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
.map(String::trim)
|
|
|
.collect(Collectors.toList());
|
|
|
List<StoreImg> storeImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, collect));
|
|
|
-
|
|
|
- LifeGroupBuyMainVo lifeGroupBuyMainVo = new LifeGroupBuyMainVo();
|
|
|
BeanUtils.copyProperties(lifeGroupBuyMain, lifeGroupBuyMainVo);
|
|
|
lifeGroupBuyMainVo.setStoreName(storeUser.getStoreName());
|
|
|
lifeGroupBuyMainVo.setStoreImgList(storeImgs);
|
|
|
@@ -519,22 +525,22 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
|
|
|
lifeGroupBuyMainVo.setExpiredState("1"); // 当前时间超过 endDate → 已到期
|
|
|
}
|
|
|
|
|
|
- // 核心逻辑:未过期时赋 0,已过期赋 1(与前端枚举定义一致)
|
|
|
- if (nowDate.isBefore(endDateTime)) {
|
|
|
- // 计算剩余天数
|
|
|
- long remainingDays = ChronoUnit.DAYS.between(nowDate, endDateTime);
|
|
|
- lifeGroupBuyMainVo.setDaysToExpire(remainingDays + "天");
|
|
|
- lifeGroupBuyMainVo.setExpiredState("0"); // 当前时间未超过 endDate → 未到期
|
|
|
- } else {
|
|
|
- lifeGroupBuyMainVo.setDaysToExpire("0天");
|
|
|
- lifeGroupBuyMainVo.setExpiredState("1"); // 当前时间超过 endDate → 已到期
|
|
|
- }
|
|
|
+ // 核心逻辑:未过期时赋 0,已过期赋 1(与前端枚举定义一致)
|
|
|
+ if (nowDate.isBefore(endDateTime)) {
|
|
|
+ // 计算剩余天数
|
|
|
+ long remainingDays = ChronoUnit.DAYS.between(nowDate, endDateTime);
|
|
|
+ lifeGroupBuyMainVo.setDaysToExpire(remainingDays + "天");
|
|
|
+ lifeGroupBuyMainVo.setExpiredState("0"); // 当前时间未超过 endDate → 未到期
|
|
|
+ } else {
|
|
|
+ lifeGroupBuyMainVo.setDaysToExpire("0天");
|
|
|
+ lifeGroupBuyMainVo.setExpiredState("1"); // 当前时间超过 endDate → 已到期
|
|
|
+ }
|
|
|
// 不可用日期
|
|
|
String afterSemicolon = lifeGroupBuyMain.getDisableDateValue().split(";")[1];
|
|
|
- if(StringUtils.isNotEmpty(afterSemicolon)){
|
|
|
+ if (StringUtils.isNotEmpty(afterSemicolon)) {
|
|
|
List<String> collectUnavailableDate = Arrays.stream(afterSemicolon.split(",")).map(String::trim).collect(Collectors.toList());
|
|
|
- if(CollectionUtils.isNotEmpty(collectUnavailableDate)){
|
|
|
- List<EssentialHolidayComparison> essentialHolidayComparisons = essentialHolidayComparisonMapper.selectList(new LambdaQueryWrapper<EssentialHolidayComparison>().in(EssentialHolidayComparison::getId,collectUnavailableDate));
|
|
|
+ if (CollectionUtils.isNotEmpty(collectUnavailableDate)) {
|
|
|
+ List<EssentialHolidayComparison> essentialHolidayComparisons = essentialHolidayComparisonMapper.selectList(new LambdaQueryWrapper<EssentialHolidayComparison>().in(EssentialHolidayComparison::getId, collectUnavailableDate));
|
|
|
lifeGroupBuyMainVo.setEssentialHolidayComparisonList(essentialHolidayComparisons);
|
|
|
}
|
|
|
}
|