项目画像修改

dongdingding
杜函宇 1 week ago
parent f80956f5f0
commit 86bf903b29

@ -40,6 +40,6 @@ public interface XmpjqdService extends IService<Xmpjqd> {
* @param id * @param id
* @return * @return
*/ */
List<XmhxResponse> oneXmhx(Serializable id); List<XmhxResponse> oneXmhx(Long id);
} }

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

Loading…
Cancel
Save