Merge branch 'feature' of https://gitee.com/liuyingfang/cashier-admin into feature
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
@@ -77,16 +78,9 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
|
||||
@Override
|
||||
public List<TbProduct> findByIdProduct(Integer productGroup) {
|
||||
TbProductGroup tbProductGroup = tbProductGroupRepository.findById(productGroup).orElseGet(TbProductGroup::new);
|
||||
if (tbProductGroup.getProductIds() != null){
|
||||
List<String> list = ListUtil.stringChangeStringList(tbProductGroup.getProductIds());
|
||||
|
||||
List<Integer> intList = new ArrayList<>();
|
||||
for (String str : list) {
|
||||
intList.add(Integer.parseInt(str));
|
||||
}
|
||||
System.out.println(intList);
|
||||
|
||||
return tbProductRepository.findByIds(ListUtil.stringChangeIntegerList(list));
|
||||
TbProductGroupDto dto = tbProductGroupMapper.toDto(tbProductGroup);
|
||||
if (!CollectionUtils.isEmpty(dto.getProductIds())){
|
||||
return tbProductRepository.findByIds(ListUtil.stringChangeIntegerList(dto.getProductIds()));
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user