|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.apache.http.client.utils.DateUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import shop.alien.entity.store.*;
|
|
import shop.alien.entity.store.*;
|
|
@@ -51,6 +52,8 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
|
|
LifeGroupBuyMain lifeGroupBuyMain = lifeGroupBuyDto.getLifeGroupBuyMain();
|
|
LifeGroupBuyMain lifeGroupBuyMain = lifeGroupBuyDto.getLifeGroupBuyMain();
|
|
List<LifeGroupBuyThali> lifeGroupBuyThalis = lifeGroupBuyDto.getLifeGroupBuyThalis();
|
|
List<LifeGroupBuyThali> lifeGroupBuyThalis = lifeGroupBuyDto.getLifeGroupBuyThalis();
|
|
if (ObjectUtils.isEmpty(lifeGroupBuyMain.getId())) {
|
|
if (ObjectUtils.isEmpty(lifeGroupBuyMain.getId())) {
|
|
|
|
+ Integer count = lifeGroupBuyMainMapper.selectCount(new LambdaQueryWrapper<LifeGroupBuyMain>().like(LifeGroupBuyMain::getCreatedTime, DateUtils.formatDate(new Date(), "yyyy-MM-dd")).eq(LifeGroupBuyMain::getStoreId, lifeGroupBuyMain.getStoreId()));
|
|
|
|
+ lifeGroupBuyMain.setGroupNo("G" + DateUtils.formatDate(new Date(), "yyyyMMdd") + lifeGroupBuyMain.getStoreId() + org.apache.commons.lang3.StringUtils.leftPad(String.valueOf(count + 1), 5, "0"));
|
|
lifeGroupBuyMain.setCreatedUserId(userId);
|
|
lifeGroupBuyMain.setCreatedUserId(userId);
|
|
lifeGroupBuyMainMapper.insert(lifeGroupBuyMain);
|
|
lifeGroupBuyMainMapper.insert(lifeGroupBuyMain);
|
|
if (ObjectUtils.isNotEmpty(lifeGroupBuyThalis)) {
|
|
if (ObjectUtils.isNotEmpty(lifeGroupBuyThalis)) {
|
|
@@ -90,7 +93,9 @@ public class LifeGroupBuyServiceImpl extends ServiceImpl<LifeGroupBuyMainMapper,
|
|
.eq("delete_flag", 0)
|
|
.eq("delete_flag", 0)
|
|
.orderByDesc("created_time");
|
|
.orderByDesc("created_time");
|
|
IPage<LifeGroupBuyThaliVo> lifeGroupBuyThaliVoIPage = new Page<>(page, size);
|
|
IPage<LifeGroupBuyThaliVo> lifeGroupBuyThaliVoIPage = new Page<>(page, size);
|
|
- return lifeGroupBuyMainMapper.selectPageByThaliVo(lifeGroupBuyThaliVoIPage, queryWrapper);
|
|
|
|
|
|
+ IPage<LifeGroupBuyThaliVo> voIPage = lifeGroupBuyMainMapper.selectPageByThaliVo(lifeGroupBuyThaliVoIPage, queryWrapper);
|
|
|
|
+ voIPage.getRecords().forEach(this::getMainImgAndDisableDate);
|
|
|
|
+ return voIPage;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|