|
|
|
@ -16,7 +16,6 @@ import com.ruoyi.gysl.service.XmpjqdService;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -82,38 +81,47 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
|
|
|
|
|
* @return 单条数据
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<XmhxResponse> oneXmhx(Serializable id) {
|
|
|
|
|
public List<XmhxResponse> oneXmhx(Long id) {
|
|
|
|
|
//返回体
|
|
|
|
|
List<XmhxResponse> obj = new ArrayList<>();
|
|
|
|
|
//最大值
|
|
|
|
|
BuildingInformation allMax = buildingInformationService.getAllMax();
|
|
|
|
|
BuildingInformation allMax1 = buildingInformationService.getAllMax();
|
|
|
|
|
BuildingInformation allMax = allMax1 == null ? new BuildingInformation() : allMax1;
|
|
|
|
|
//本项目
|
|
|
|
|
BuildingInformation th = buildingInformationService.getOneXmIdToMax((Long) id);
|
|
|
|
|
BuildingInformation th1 = buildingInformationService.getOneXmIdToMax(id);
|
|
|
|
|
BuildingInformation th = th1 == null ? new BuildingInformation() : th1;
|
|
|
|
|
//查询所有的建筑信息,只保留是重要楼栋的max条
|
|
|
|
|
List<BuildingInformation> ib = buildingInformationService.getImportantBuildings();
|
|
|
|
|
//获取项目评价配置数据
|
|
|
|
|
List<Pjpz> list = pjpzService.list();
|
|
|
|
|
//分类数据
|
|
|
|
|
XmhxResponse xr1 = new XmhxResponse();
|
|
|
|
|
xr1.setType(1);
|
|
|
|
|
List<XmhxDetail> l1 = new ArrayList<>();
|
|
|
|
|
XmhxResponse xr2 = new XmhxResponse();
|
|
|
|
|
xr2.setType(2);
|
|
|
|
|
List<XmhxDetail> l2 = new ArrayList<>();
|
|
|
|
|
XmhxResponse xr3 = new XmhxResponse();
|
|
|
|
|
xr3.setType(3);
|
|
|
|
|
List<XmhxDetail> l3 = new ArrayList<>();
|
|
|
|
|
list.forEach(x -> {
|
|
|
|
|
XmhxResponse xr1 = new XmhxResponse();
|
|
|
|
|
xr1.setType(1);
|
|
|
|
|
List<XmhxDetail> l1 = new ArrayList<>();
|
|
|
|
|
XmhxResponse xr2 = new XmhxResponse();
|
|
|
|
|
xr2.setType(2);
|
|
|
|
|
List<XmhxDetail> l2 = new ArrayList<>();
|
|
|
|
|
XmhxResponse xr3 = new XmhxResponse();
|
|
|
|
|
xr3.setType(3);
|
|
|
|
|
List<XmhxDetail> l3 = new ArrayList<>();
|
|
|
|
|
if (allMax != null && th != null) {
|
|
|
|
|
switch (x.getPjys()) {
|
|
|
|
|
case "总投资额":
|
|
|
|
|
l1.add(xmpjqdMapper.zdzZtze());
|
|
|
|
|
l2.add(xmpjqdMapper.meZtze((Long) id));
|
|
|
|
|
switch (x.getPjys()) {
|
|
|
|
|
case "总投资额":
|
|
|
|
|
l1.add(xmpjqdMapper.zdzZtze() == null ? new XmhxDetail("总投资额", "0") : xmpjqdMapper.zdzZtze());
|
|
|
|
|
l2.add(xmpjqdMapper.meZtze(id) == null ? new XmhxDetail("总投资额", "0") : xmpjqdMapper.meZtze(id));
|
|
|
|
|
if (xmpjqdMapper.zwsZtze() != null) {
|
|
|
|
|
l3.add(getXmhxDetails(xmpjqdMapper.zwsZtze(), "总投资额"));
|
|
|
|
|
break;
|
|
|
|
|
case "层数":
|
|
|
|
|
l1.add(new XmhxDetail("层数", String.valueOf(allMax.getFloor())));
|
|
|
|
|
l2.add(new XmhxDetail("层数", String.valueOf(th.getFloor())));
|
|
|
|
|
//层数拿出来
|
|
|
|
|
} else {
|
|
|
|
|
l3.add(new XmhxDetail("总投资额", "0"));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "层数":
|
|
|
|
|
l1.add(new XmhxDetail("层数", String.valueOf(allMax.getFloor() == null ? 0 : allMax.getFloor())));
|
|
|
|
|
l2.add(new XmhxDetail("层数", String.valueOf(th.getFloor() == null ? 0 : th.getFloor())));
|
|
|
|
|
//层数拿出来
|
|
|
|
|
if (ib.isEmpty()) {
|
|
|
|
|
l3.add(new XmhxDetail("层数", "0"));
|
|
|
|
|
} else {
|
|
|
|
|
List<Integer> floor = ib.stream()
|
|
|
|
|
.map(BuildingInformation::getFloor)
|
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
@ -132,48 +140,63 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
l3.add(new XmhxDetail("层数", s));
|
|
|
|
|
break;
|
|
|
|
|
case "首层层高":
|
|
|
|
|
l1.add(new XmhxDetail("首层层高", String.valueOf(allMax.getScgd())));
|
|
|
|
|
l2.add(new XmhxDetail("首层层高", String.valueOf(th.getScgd())));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "首层层高":
|
|
|
|
|
l1.add(new XmhxDetail("首层层高", String.valueOf(allMax.getScgd() == null ? 0 : allMax.getScgd())));
|
|
|
|
|
l2.add(new XmhxDetail("首层层高", String.valueOf(th.getScgd() == null ? 0 : th.getScgd())));
|
|
|
|
|
if (ib.isEmpty()) {
|
|
|
|
|
l3.add(new XmhxDetail("首层层高", "0"));
|
|
|
|
|
} else {
|
|
|
|
|
List<BigDecimal> sccg = ib.stream()
|
|
|
|
|
.map(BuildingInformation::getScgd)
|
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
|
.sorted()
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
l3.add(getXmhxDetails(sccg, "首层层高"));
|
|
|
|
|
break;
|
|
|
|
|
case "二层及以上层高":
|
|
|
|
|
l1.add(new XmhxDetail("二层及以上层高", String.valueOf(allMax.getTwoAndFourCg())));
|
|
|
|
|
l2.add(new XmhxDetail("二层及以上层高", String.valueOf(th.getTwoAndFourCg())));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "二层及以上层高":
|
|
|
|
|
l1.add(new XmhxDetail("二层及以上层高", String.valueOf(allMax.getTwoAndFourCg() == null ? 0 : allMax.getTwoAndFourCg())));
|
|
|
|
|
l2.add(new XmhxDetail("二层及以上层高", String.valueOf(th.getTwoAndFourCg() == null ? 0 : th.getTwoAndFourCg())));
|
|
|
|
|
if (ib.isEmpty()) {
|
|
|
|
|
l3.add(new XmhxDetail("二层及以上层高", "0"));
|
|
|
|
|
} else {
|
|
|
|
|
List<BigDecimal> ec = ib.stream()
|
|
|
|
|
.map(BuildingInformation::getTwoAndFourCg)
|
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
|
.sorted()
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
l3.add(getXmhxDetails(ec, "二层及以上层高"));
|
|
|
|
|
break;
|
|
|
|
|
case "二层及以上楼面荷载":
|
|
|
|
|
l1.add(new XmhxDetail("二层及以上楼面荷载", String.valueOf(allMax.getTwoAndThreeLmhz())));
|
|
|
|
|
l2.add(new XmhxDetail("二层及以上楼面荷载", String.valueOf(th.getTwoAndThreeLmhz())));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "二层及以上楼面荷载":
|
|
|
|
|
l1.add(new XmhxDetail("二层及以上楼面荷载", String.valueOf(allMax.getTwoAndThreeLmhz() == null ? 0 : allMax.getTwoAndThreeLmhz())));
|
|
|
|
|
l2.add(new XmhxDetail("二层及以上楼面荷载", String.valueOf(th.getTwoAndThreeLmhz() == null ? 0 : th.getTwoAndThreeLmhz())));
|
|
|
|
|
if (ib.isEmpty()) {
|
|
|
|
|
l3.add(new XmhxDetail("二层及以上楼载荷", "0"));
|
|
|
|
|
} else {
|
|
|
|
|
List<BigDecimal> zh = ib.stream()
|
|
|
|
|
.map(BuildingInformation::getTwoAndThreeLmhz)
|
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
|
.sorted()
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
l3.add(getXmhxDetails(zh, "二层及以上楼载荷"));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
l1.add(new XmhxDetail(x.getPjys(), null));
|
|
|
|
|
l2.add(new XmhxDetail(x.getPjys(), null));
|
|
|
|
|
l3.add(new XmhxDetail(x.getPjys(), null));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
l1.add(new XmhxDetail(x.getPjys(), "0"));
|
|
|
|
|
l2.add(new XmhxDetail(x.getPjys(), "0"));
|
|
|
|
|
l3.add(new XmhxDetail(x.getPjys(), "0"));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
xr1.setList(l1);
|
|
|
|
|
xr2.setList(l2);
|
|
|
|
|
xr3.setList(l3);
|
|
|
|
|
});
|
|
|
|
|
xr1.setList(l1);
|
|
|
|
|
xr2.setList(l2);
|
|
|
|
|
xr3.setList(l3);
|
|
|
|
|
obj.add(xr1);
|
|
|
|
|
obj.add(xr2);
|
|
|
|
|
obj.add(xr3);
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|