|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.dromara.demo.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
@ -139,22 +140,26 @@ public class AreaInfoServiceImpl implements IAreaInfoService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<AreaInfoFinalVo> getList(AreaInfoBo bo) { |
|
|
|
String des = "从“九五~十三五”期间,XX区实际实施项目208项,其中完工168项。累计完成总投资为199.38亿元。\n" + |
|
|
|
String des = "从“九五~十三五”期间,XX区实际实施项目208项,其中完工168项。累计完成总投资为199.38亿元。" + |
|
|
|
"累积完成4座污水处理厂新建与扩建,新建8座调蓄池;管道建设641.45km;河道清淤14.86万m3;生态修复2193.96亩。"; |
|
|
|
|
|
|
|
// 从数据库中获取的所有区域信息
|
|
|
|
List<AreaInfoVo> areaInfoVos = this.queryList(bo); |
|
|
|
|
|
|
|
// 按 district(区域)分组
|
|
|
|
Map<String, List<AreaInfoVo>> groupedByDistrict = areaInfoVos.stream() |
|
|
|
.collect(Collectors.groupingBy(AreaInfoVo::getDistrict)); |
|
|
|
if (CollectionUtil.isNotEmpty(areaInfoVos)){ |
|
|
|
// 按 district(区域)分组
|
|
|
|
Map<String, List<AreaInfoVo>> groupedByDistrict = areaInfoVos.stream() |
|
|
|
.collect(Collectors.groupingBy(AreaInfoVo::getDistrict)); |
|
|
|
|
|
|
|
// 转换为 List<AreaInfoFinalVo>
|
|
|
|
List<AreaInfoFinalVo> result = new ArrayList<>(); |
|
|
|
for (Map.Entry<String, List<AreaInfoVo>> entry : groupedByDistrict.entrySet()) { |
|
|
|
result.add(new AreaInfoFinalVo(entry.getValue(), des)); // description 先为 null
|
|
|
|
} |
|
|
|
// 转换为 List<AreaInfoFinalVo>
|
|
|
|
// TODO 各区AI描述待提供
|
|
|
|
List<AreaInfoFinalVo> result = new ArrayList<>(); |
|
|
|
for (Map.Entry<String, List<AreaInfoVo>> entry : groupedByDistrict.entrySet()) { |
|
|
|
result.add(new AreaInfoFinalVo(entry.getValue(), des)); // description 先为默认
|
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
} |
|
|
|