| | |
| | | if (CollectionUtils.isEmpty(ptyValue)){ |
| | | continue; |
| | | } |
| | | PtypeVO ptypeVO = PtypeVO.builder().pTypeName(ptyValue.get(0).getPtypeName()).build(); |
| | | PtypeVO ptypeVO = PtypeVO.builder().pTypeName(ptyValue.get(0).getPtypeName()).sort(ptyValue.get(0).getSort()).build(); |
| | | List<SgTypeVO> sgGxDOS = new ArrayList<>(); |
| | | //类型分组 |
| | | Map<String, List<SgProjectInfoVO>> GxMap = ptyValue.stream().filter(s->s.getDeviceType()!=null).collect(Collectors.groupingBy(SgProjectInfoVO::getDeviceType)); |
| | |
| | | continue; |
| | | } |
| | | gxList = gxList.stream().sorted(Comparator.comparing(SgProjectInfoVO::getPrice)).collect(Collectors.toList()); |
| | | SgTypeVO typeVO = SgTypeVO.builder().typeName(gxList.get(0).getTypeName()).build(); |
| | | SgTypeVO typeVO = SgTypeVO.builder().typeName(gxList.get(0).getTypeName()).sort(gxList.get(0).getDSort()).build(); |
| | | List<SgDeviceDO> deviceDOS = new ArrayList<>(); |
| | | //设备分组 |
| | | Map<Long, List<SgProjectInfoVO>> dMap = gxList.stream().filter(s->s.getDId()!=null).collect(Collectors.groupingBy(SgProjectInfoVO::getDId)); |
| | |
| | | BigDecimal sgGxOver = BigDecimal.valueOf(sum); |
| | | BigDecimal divideSgGx = sgGxOver.divide(sgGxSize, 2, RoundingMode.HALF_UP); |
| | | ptypeVO.setPTypeProgress(getBigDecimalPercent(divideSgGx)); |
| | | sgGxDOS = sgGxDOS.stream().sorted(Comparator.comparing(SgTypeVO::getSort)).collect(Collectors.toList()); |
| | | ptypeVO.setSgTypeVOS(sgGxDOS); |
| | | pTypes.add(ptypeVO); |
| | | } |
| | |
| | | double sum = allDevice.stream().mapToDouble(s -> Double.parseDouble(s.getProgress())).sum(); |
| | | BigDecimal allDeviceOver = BigDecimal.valueOf(sum); |
| | | BigDecimal allDivideDevice = allDeviceOver.divide(allDeviceSize, 2, RoundingMode.HALF_UP); |
| | | sgProjectInfoDO.setPtypeVOS(pTypes); |
| | | List<PtypeVO> sortPtpes = pTypes.stream().sorted(Comparator.comparing(PtypeVO::getSort)).collect(Collectors.toList()); |
| | | sgProjectInfoDO.setPtypeVOS(sortPtpes); |
| | | sgProjectInfoDO.setProjectProgress( getBigDecimalPercent(allDivideDevice)); |
| | | sgProjectInfoDO.setProjectProgressNum(allDivideDevice); |
| | | } |