feat:装修团队配置

This commit is contained in:
苏竹红
2025-10-30 18:34:54 +08:00
parent 3f23c0ae95
commit ec73dad33e
9 changed files with 174 additions and 0 deletions

View File

@@ -1,7 +1,12 @@
package com.cool.store.service;
import com.cool.store.common.PageBasicInfo;
import com.cool.store.dto.decoration.DecorationTeamDTO;
import com.cool.store.request.decoration.AddTeamRequest;
import com.cool.store.request.decoration.UpdateTeamRequest;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @Author suzhuhong
@@ -32,6 +37,13 @@ public interface DecorationHandleService {
*/
Boolean deleteByTeamId(Long teamId);
/**
* pageBasicInfo
* 根据条件查询团队
* @return
*/
PageInfo<DecorationTeamDTO> listByCondition(PageBasicInfo pageBasicInfo );

View File

@@ -1,7 +1,10 @@
package com.cool.store.service.impl;
import com.cool.store.common.PageBasicInfo;
import com.cool.store.dao.decoration.DecorationTeamConfigDAO;
import com.cool.store.dao.decoration.TeamAreaMappingDAO;
import com.cool.store.dto.decoration.DecorationTeamDTO;
import com.cool.store.dto.decoration.TeamAreaMappingDTO;
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
@@ -10,11 +13,16 @@ import com.cool.store.request.decoration.UpdateTeamRequest;
import com.cool.store.service.DecorationHandleService;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -80,6 +88,22 @@ public class DecorationHandleServiceImpl implements DecorationHandleService {
return Boolean.TRUE;
}
@Override
public PageInfo<DecorationTeamDTO> listByCondition(PageBasicInfo pageBasicInfo) {
PageHelper.startPage(pageBasicInfo.getPageNum(), pageBasicInfo.getPageSize());
List<DecorationTeamDTO> list = decorationTeamConfigDAO.listByCondition();
if (CollectionUtils.isEmpty(list)){
return new PageInfo<>();
}
List<Long> teamIds = list.stream().map(DecorationTeamDTO::getId).collect(Collectors.toList());
Map<Long, List<TeamAreaMappingDTO>> listMap = teamAreaMappingDAO.listByTeamIdList(teamIds);
list.forEach(x->{
x.setCityList(listMap.get(x.getId()));
});
PageInfo<DecorationTeamDTO> result = new PageInfo<>(list);
return result;
}
public String getNextNumber() {
Long current = redisUtilPool.incrby("counter_key", 1);