|
@@ -676,7 +676,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
for (LifeDiscountCouponUser lifeDiscountCouponUser : lifeDiscountCouponUserIPage.getRecords()) {
|
|
for (LifeDiscountCouponUser lifeDiscountCouponUser : lifeDiscountCouponUserIPage.getRecords()) {
|
|
|
LifeDiscountCoupon lifeDiscountCouponOne = lifeDiscountCoupons.stream().filter(lifeDiscountCoupon -> lifeDiscountCoupon.getId().equals(lifeDiscountCouponUser.getCouponId())).collect(Collectors.toList()).get(0);
|
|
LifeDiscountCoupon lifeDiscountCouponOne = lifeDiscountCoupons.stream().filter(lifeDiscountCoupon -> lifeDiscountCoupon.getId().equals(lifeDiscountCouponUser.getCouponId())).collect(Collectors.toList()).get(0);
|
|
|
StoreInfo storeInfoOne = null;
|
|
StoreInfo storeInfoOne = null;
|
|
|
- if (!storeInfoList.isEmpty()) {
|
|
|
|
|
|
|
+ if (!storeInfoList.isEmpty() && !StringUtils.isEmpty(lifeDiscountCouponOne.getStoreId())) {
|
|
|
storeInfoOne = storeInfoList.stream().filter(storeInfo -> storeInfo.getId().toString().equals(lifeDiscountCouponOne.getStoreId())).collect(Collectors.toList()).get(0);
|
|
storeInfoOne = storeInfoList.stream().filter(storeInfo -> storeInfo.getId().toString().equals(lifeDiscountCouponOne.getStoreId())).collect(Collectors.toList()).get(0);
|
|
|
}
|
|
}
|
|
|
LifeDiscountCouponVo lifeDiscountCouponVo = new LifeDiscountCouponVo();
|
|
LifeDiscountCouponVo lifeDiscountCouponVo = new LifeDiscountCouponVo();
|
|
@@ -770,7 +770,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
|
|
|
} else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
|
|
} else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
|
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
|
|
|
- } else if (endResult > 0) {
|
|
|
|
|
|
|
+ } else if (endResult > 0) {
|
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.FINISHED.getValue()));
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.FINISHED.getValue()));
|
|
|
} else if (startResult >= 0 && endResult <= 0) {
|
|
} else if (startResult >= 0 && endResult <= 0) {
|
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.UNDER_WAY.getValue()));
|
|
lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.UNDER_WAY.getValue()));
|
|
@@ -1095,13 +1095,13 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
@Override
|
|
@Override
|
|
|
public boolean addPlatformCoupon(LifeDiscountCoupon lifeDiscountCoupon) {
|
|
public boolean addPlatformCoupon(LifeDiscountCoupon lifeDiscountCoupon) {
|
|
|
lifeDiscountCoupon.setStartDate(LocalDate.now());
|
|
lifeDiscountCoupon.setStartDate(LocalDate.now());
|
|
|
- if (null == lifeDiscountCoupon.getExpirationDate()) {
|
|
|
|
|
|
|
+ if (null == lifeDiscountCoupon.getSpecifiedDay()) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- lifeDiscountCoupon.setEndDate(LocalDate.now().plusDays(lifeDiscountCoupon.getExpirationDate()));
|
|
|
|
|
|
|
+ lifeDiscountCoupon.setEndDate(LocalDate.now().plusDays(Long.parseLong(lifeDiscountCoupon.getSpecifiedDay())));
|
|
|
lifeDiscountCoupon.setType(3);
|
|
lifeDiscountCoupon.setType(3);
|
|
|
lifeDiscountCoupon.setGetStatus(1);
|
|
lifeDiscountCoupon.setGetStatus(1);
|
|
|
- lifeDiscountCoupon.setMinimumSpendingAmount(BigDecimal.ZERO);
|
|
|
|
|
|
|
+// lifeDiscountCoupon.setMinimumSpendingAmount(BigDecimal.ZERO);
|
|
|
return this.save(lifeDiscountCoupon);
|
|
return this.save(lifeDiscountCoupon);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1132,7 +1132,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
lifeDiscountCouponUser.setUserId(userId);
|
|
lifeDiscountCouponUser.setUserId(userId);
|
|
|
lifeDiscountCouponUser.setCouponId(couponId);
|
|
lifeDiscountCouponUser.setCouponId(couponId);
|
|
|
lifeDiscountCouponUser.setReceiveTime(new Date());
|
|
lifeDiscountCouponUser.setReceiveTime(new Date());
|
|
|
- lifeDiscountCouponUser.setExpirationTime(LocalDate.now().plusDays(lifeDiscountCoupon.getExpirationDate()));
|
|
|
|
|
|
|
+ lifeDiscountCouponUser.setExpirationTime(LocalDate.now().plusDays(Long.parseLong(lifeDiscountCoupon.getSpecifiedDay())));
|
|
|
lifeDiscountCouponUser.setStatus(0);
|
|
lifeDiscountCouponUser.setStatus(0);
|
|
|
lifeDiscountCouponUser.setDeleteFlag(0);
|
|
lifeDiscountCouponUser.setDeleteFlag(0);
|
|
|
lifeDiscountCouponUser.setCreatedTime(new Date());
|
|
lifeDiscountCouponUser.setCreatedTime(new Date());
|
|
@@ -1190,14 +1190,14 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
@Override
|
|
@Override
|
|
|
public List<LifeDiscountCoupon> getPlatformCoupon(Integer couponId, Integer couponType) {
|
|
public List<LifeDiscountCoupon> getPlatformCoupon(Integer couponId, Integer couponType) {
|
|
|
LambdaQueryWrapper<LifeDiscountCoupon> lifeDiscountCouponLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<LifeDiscountCoupon> lifeDiscountCouponLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if(couponId != null){
|
|
|
|
|
|
|
+ if (couponId != null) {
|
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getId, couponId);
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getId, couponId);
|
|
|
}
|
|
}
|
|
|
- if(couponType != null){
|
|
|
|
|
|
|
+ if (couponType != null) {
|
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getType, couponType);
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getType, couponType);
|
|
|
}
|
|
}
|
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getDeleteFlag, 0);
|
|
lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getDeleteFlag, 0);
|
|
|
- lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getGetStatus,1);
|
|
|
|
|
|
|
+ lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getGetStatus, 1);
|
|
|
return lifeDiscountCouponMapper.selectList(lifeDiscountCouponLambdaQueryWrapper);
|
|
return lifeDiscountCouponMapper.selectList(lifeDiscountCouponLambdaQueryWrapper);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|