Commit b34b4493 authored by luben's avatar luben

Merge branch 'dev' into 'main'

Dev

See merge request !162
parents 68081979 6ee13b7b
Pipeline #143460 passed with stages
in 6 minutes and 9 seconds
......@@ -914,4 +914,21 @@ public class RegionController extends BaseController {
return AjaxResult.success(gridRegionMapper.changeTreeNodeNameByCode(id,name));
}
@RequestMapping(value = "/getRegion", method = RequestMethod.GET)
@ResponseBody
public AjaxResult getRegion(@RequestParam("wgCode") String wgCode) {
Map<String,List<GridRegion>> res = new HashMap<>();
List<GridRegion> type1 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"1");
List<GridRegion> type4 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"4");
List<GridRegion> type5 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"5");
List<GridRegion> type6 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"6");
List<GridRegion> type7 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"7");
res.put("1",type1);
res.put("4",type4);
res.put("5",type5);
res.put("6",type6);
res.put("7",type7);
return AjaxResult.success(res);
}
}
......@@ -39,4 +39,6 @@ public interface GridRegionService extends BaseService<GridRegion, GridRegionExa
List<GridRegion> getByParams(GridRegionSearchParam searchParam);
List<GridRegion> getGridRegionMapByWgType(String wgType);
List<GridRegion> getGridRegionMapByWgCodeAndWgType(String wgCode,String wgType);
}
......@@ -15,10 +15,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -176,4 +173,15 @@ public class GridRegionServiceImpl extends BaseServiceImpl<GridRegionMapper, Gri
return gridRegionService.selectByExample(ex);
}
@Override
public List<GridRegion> getGridRegionMapByWgCodeAndWgType(String wgCode, String wgType) {
GridRegionExample example = new GridRegionExample();
GridRegionExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo("1");
criteria.andWgTypeEqualTo(wgType);
criteria.andWgCodeNotEqualTo(wgCode);
criteria.andWgCodeLike("%"+wgCode+"%");
return gridRegionMapper.selectByExampleWithBLOBs(example);
}
}
......@@ -195,6 +195,9 @@ public class HouseResourceServiceImpl implements HouseResourceService {
if (StringUtils.hasText(two)) {
list = list.stream().filter(x -> x.getTwo().equals(two)).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(list)) {
return businessEntityStatisticsDetail;
}
businessEntityStatisticsDetail.setLyCount(list.stream().filter(x -> x.getType() == 1).count());
businessEntityStatisticsDetail.setJdCount(list.stream().filter(x -> x.getType() == 4).count());
businessEntityStatisticsDetail.setJqCount(list.stream().filter(x -> x.getType() == 5).count());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment