|
@@ -978,19 +978,124 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
|
|
return areaList;
|
|
return areaList;
|
|
}
|
|
}
|
|
@Override
|
|
@Override
|
|
- public List getObtainUnitCompletionInformationList(ZEngineeringCivilBo bo) { // 庭院courtyard 架空overhead 底腿bottom_leg
|
|
|
|
- switch (bo.getEnginClassification()){
|
|
|
|
- case "overhead": // 架空
|
|
|
|
- case "bottom_leg": { // 底腿
|
|
|
|
- return getObtainUnitCompletionInformationList_overleg(bo); // 查询条件 小区和楼栋 返回单元
|
|
|
|
|
|
+ public List getObtainUnitCompletionInformationList(ZEngineeringCivilBo bo) { // 庭院 courtyard 架空 overhead 底腿 bottom_leg
|
|
|
|
+// return getObtainUnitCompletionInformationList_all(bo);
|
|
|
|
+ return getObtainUnitCompletionInformationList_new(bo);
|
|
|
|
+// switch (bo.getEnginClassification()){
|
|
|
|
+// case "overhead": // 架空
|
|
|
|
+// case "bottom_leg": { // 底腿
|
|
|
|
+// return getObtainUnitCompletionInformationList_overleg(bo); // 查询条件 小区和楼栋 返回单元
|
|
|
|
+// }
|
|
|
|
+// case "courtyard":{ // 庭院 查询条件小区
|
|
|
|
+// return getObtainUnitCompletionInformationList_courtyard(bo); // 返回楼栋 不返回单元数据
|
|
|
|
+// }
|
|
|
|
+// default:{
|
|
|
|
+// return null;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ }
|
|
|
|
+ public List getObtainUnitCompletionInformationList_new(ZEngineeringCivilBo bo) { // 架空、底腿
|
|
|
|
+ String statusVoListName = bo.getEnginClassification().equals("")?"buildingStatusVoList":"unitStatusVoList";
|
|
|
|
+ List<Map<String, Object>> result = new ArrayList();
|
|
|
|
+ List<Map<String, Object>> statusList = baseMapper.getObtainUnitCompletionInformationList(bo);
|
|
|
|
+ Set set = new HashSet();
|
|
|
|
+ for (Map item: statusList) {
|
|
|
|
+ set.add(item.get("areaId"));
|
|
|
|
+ }
|
|
|
|
+ Iterator iterator = set.iterator();
|
|
|
|
+ while (iterator.hasNext()){
|
|
|
|
+ String areaId = iterator.next().toString();
|
|
|
|
+ String areaName = zAreaMapper.selectById(areaId).getName();
|
|
|
|
+ Map object = new HashMap();
|
|
|
|
+ List statusVoList = new ArrayList();
|
|
|
|
+ object.put("areaId", areaId);
|
|
|
|
+ object.put("areaName", areaName);
|
|
|
|
+ object.put(statusVoListName, statusVoList);
|
|
|
|
+ result.add(object);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (Map item: statusList) {
|
|
|
|
+ String areaId = item.get("areaId").toString();
|
|
|
|
+ for (Map res: result) {
|
|
|
|
+ if(res.get("areaId").equals(areaId)){
|
|
|
|
+ ((List)res.get(statusVoListName)).add(item);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- case "courtyard":{ // 庭院 查询条件小区
|
|
|
|
- return getObtainUnitCompletionInformationList_courtyard(bo); // 返回楼栋 不返回单元数据
|
|
|
|
|
|
+ }
|
|
|
|
+ for (Map res: result) {
|
|
|
|
+ List<Map> statusVoList = (List)res.get(statusVoListName);
|
|
|
|
+ List willDone = statusVoList.stream().filter(item -> item.get("unitStatus").equals("未施工")).collect(Collectors.toList());
|
|
|
|
+ List notstart = statusVoList.stream().filter(item -> item.get("unitStatus").equals("施工中")).collect(Collectors.toList());
|
|
|
|
+ List done = statusVoList.stream().filter(item -> item.get("unitStatus").equals("竣工")).collect(Collectors.toList());
|
|
|
|
+ List notInstall = statusVoList.stream().filter(item -> item.get("unitStatus").equals("未安装")).collect(Collectors.toList());
|
|
|
|
+ for (Object object: statusVoList) {
|
|
|
|
+ Map objMap = (Map) object;
|
|
|
|
+ objMap.put("done", String.valueOf(done.size()));
|
|
|
|
+ objMap.put("willDone", String.valueOf(willDone.size()));
|
|
|
|
+ objMap.put("notstart", String.valueOf(notstart.size()));
|
|
|
|
+// String status = ((Map)object).get("unitStatus").toString();
|
|
}
|
|
}
|
|
- default:{
|
|
|
|
- return null;
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// List areaList = new ArrayList();
|
|
|
|
+// map.forEach((key, value) -> {
|
|
|
|
+// Map buildingStatusVo = new HashMap();
|
|
|
|
+// buildingStatusVo.put("name", key);
|
|
|
|
+// buildingStatusVo.put("id", value.get(0).get("buildingId"));
|
|
|
|
+// Map<String, List<Map>> unitMap = value.stream().collect(Collectors.groupingBy(item -> (item.get("ordername").toString().replaceAll("[^0-9]", "").length() > 3 ? item.get("ordername").toString().substring(0, 2) : item.get("ordername").toString().substring(0, 1))));
|
|
|
|
+// List willDone = value.stream().filter(item -> item.get("unitStatus").equals("未施工")).collect(Collectors.toList());
|
|
|
|
+// List notstart = value.stream().filter(item -> item.get("unitStatus").equals("施工中")).collect(Collectors.toList());
|
|
|
|
+// List done = value.stream().filter(item -> item.get("unitStatus").equals("竣工")).collect(Collectors.toList());
|
|
|
|
+// List notInstall = value.stream().filter(item -> item.get("unitStatus").equals("未安装")).collect(Collectors.toList());
|
|
|
|
+// List<List<Map>> statusVoList = new ArrayList<>();
|
|
|
|
+// Map<String, List<Map>> sortMap = unitMap.entrySet().stream().sorted(Comparator.comparingInt(entry -> Integer.parseInt(entry.getKey()))).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> oldVal, LinkedHashMap::new));
|
|
|
|
+// sortMap.forEach((key1, value1) -> {
|
|
|
|
+// statusVoList.add(value1);
|
|
|
|
+// });
|
|
|
|
+// buildingStatusVo.put("statusVoList", statusVoList);
|
|
|
|
+// buildingStatusVo.put("done", String.valueOf(done.size()));
|
|
|
|
+// buildingStatusVo.put("willDone", String.valueOf(willDone.size()));
|
|
|
|
+// buildingStatusVo.put("notstart", String.valueOf(notstart.size()));
|
|
|
|
+// areaList.add(buildingStatusVo);
|
|
|
|
+// });
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+ public List getObtainUnitCompletionInformationList_all(ZEngineeringCivilBo bo) { // 架空、底腿
|
|
|
|
+ List<Map<String, Object>> statusList = baseMapper.getObtainUnitCompletionInformationList(bo);
|
|
|
|
+ LinkedHashMap<String, List<Map>> map = new LinkedHashMap<>();
|
|
|
|
+ List<Map> mapvalue = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < statusList.size(); i++) {
|
|
|
|
+
|
|
|
|
+ if (i > 0 && statusList.get(i).get("areaId").equals(statusList.get(i - 1).get("areaId"))) {
|
|
|
|
+ mapvalue.add(statusList.get(i));
|
|
|
|
+ } else {
|
|
|
|
+ mapvalue = new ArrayList<>();
|
|
|
|
+ mapvalue.add(statusList.get(i));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ map.put("key", mapvalue);
|
|
|
|
+ List areaList = new ArrayList();
|
|
|
|
+ map.forEach((key, value) -> {
|
|
|
|
+ Map buildingStatusVo = new HashMap();
|
|
|
|
+ buildingStatusVo.put("name", key);
|
|
|
|
+ buildingStatusVo.put("id", value.get(0).get("buildingId"));
|
|
|
|
+ Map<String, List<Map>> unitMap = value.stream().collect(Collectors.groupingBy(item -> (item.get("ordername").toString().replaceAll("[^0-9]", "").length() > 3 ? item.get("ordername").toString().substring(0, 2) : item.get("ordername").toString().substring(0, 1))));
|
|
|
|
+ List willDone = value.stream().filter(item -> item.get("unitStatus").equals("未施工")).collect(Collectors.toList());
|
|
|
|
+ List notstart = value.stream().filter(item -> item.get("unitStatus").equals("施工中")).collect(Collectors.toList());
|
|
|
|
+ List done = value.stream().filter(item -> item.get("unitStatus").equals("竣工")).collect(Collectors.toList());
|
|
|
|
+ List notInstall = value.stream().filter(item -> item.get("unitStatus").equals("未安装")).collect(Collectors.toList());
|
|
|
|
+ List<List<Map>> statusVoList = new ArrayList<>();
|
|
|
|
+ Map<String, List<Map>> sortMap = unitMap.entrySet().stream().sorted(Comparator.comparingInt(entry -> Integer.parseInt(entry.getKey()))).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> oldVal, LinkedHashMap::new));
|
|
|
|
+ sortMap.forEach((key1, value1) -> {
|
|
|
|
+ statusVoList.add(value1);
|
|
|
|
+ });
|
|
|
|
+ buildingStatusVo.put("statusVoList", statusVoList);
|
|
|
|
+ buildingStatusVo.put("done", String.valueOf(done.size()));
|
|
|
|
+ buildingStatusVo.put("willDone", String.valueOf(willDone.size()));
|
|
|
|
+ buildingStatusVo.put("notstart", String.valueOf(notstart.size()));
|
|
|
|
+ areaList.add(buildingStatusVo);
|
|
|
|
+ });
|
|
|
|
+ return areaList;
|
|
}
|
|
}
|
|
public List getObtainUnitCompletionInformationList_overleg(ZEngineeringCivilBo bo) { // 架空、底腿
|
|
public List getObtainUnitCompletionInformationList_overleg(ZEngineeringCivilBo bo) { // 架空、底腿
|
|
List<UnitStatusVo> unitStatusList = baseMapper.getObtainUnitCompletionInformationList_overleg(bo);
|
|
List<UnitStatusVo> unitStatusList = baseMapper.getObtainUnitCompletionInformationList_overleg(bo);
|