|
@@ -6,7 +6,9 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
|
+import com.ruoyi.zdsz.domain.ZEngineeringGY;
|
|
|
import com.ruoyi.zdsz.domain.ZEngineeringMaterial;
|
|
|
+import com.ruoyi.zdsz.domain.bo.ZEnginMaterialQualityBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringInfoBo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
|
|
|
import com.ruoyi.zdsz.domain.vo.*;
|
|
@@ -522,4 +524,93 @@ public class ZEngineeringWasteMaterialServiceImpl implements IZEngineeringWasteM
|
|
|
// zEngineeringWasteMaterialVo.setMaterialPercentagePE();
|
|
|
return zEngineeringWasteMaterialVo;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * PC用料统计列表 Echarts图表
|
|
|
+ */
|
|
|
+ public List<WasteMaterialVo> engineeringIndustryList(ZEnginMaterialQualityBo bo){
|
|
|
+ LambdaQueryWrapper<ZEngineeringGY> lqw = Wrappers.lambdaQuery();
|
|
|
+// LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery();
|
|
|
+// lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey());
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getEnginType()), ZEngineeringGY::getEnginType, bo.getEnginType());
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getEnginSort()), ZEngineeringGY::getEnginClassification, bo.getEnginSort());
|
|
|
+ List<ZEngineeringGYVo> list = gyMapper.selectVoList(lqw);
|
|
|
+// List<Map> mapList = new ArrayList<>();
|
|
|
+ List<WasteMaterialVo> resultList = new ArrayList<>();
|
|
|
+ for (ZEngineeringGYVo zEngineeringGYVo:list) {
|
|
|
+// Map map = new HashMap();
|
|
|
+ WasteMaterialVo wasteMaterialVo = new WasteMaterialVo();
|
|
|
+ ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
|
|
|
+// zEngineeringNodeBo.setCivliId(id);
|
|
|
+ zEngineeringNodeBo.setCivliId(zEngineeringGYVo.getId());
|
|
|
+ zEngineeringNodeBo.setCreateTime(zEngineeringGYVo.getCreateTime());
|
|
|
+ List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
|
|
|
+ ZEngineeringWasteMaterialVo zEngineeringWasteMaterialVo = new ZEngineeringWasteMaterialVo();
|
|
|
+ AtomicReference<BigDecimal> pesj = new AtomicReference<>(new BigDecimal(0));
|
|
|
+ AtomicReference<BigDecimal> gsj = new AtomicReference<>(new BigDecimal(0));
|
|
|
+ for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
|
|
|
+ ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
|
|
|
+ for (ZEngineeringInfoBo info: nodeBo.getzEngineeringInfoBoList()) {
|
|
|
+ System.out.println(info.getzEngineeringMaterialBo());
|
|
|
+ LambdaQueryWrapper<ZEngineeringMaterial> lqw4 = Wrappers.lambdaQuery();
|
|
|
+ lqw4.eq(StringUtils.isNotBlank(info.getId()), ZEngineeringMaterial::getDetailsId, info.getId());
|
|
|
+ List<ZEngineeringMaterial> material= zEngineeringMaterialMapper.selectList(lqw4);
|
|
|
+ material.stream().forEach(item4->{
|
|
|
+ String materialQuality = item4.getMaterialQuality();
|
|
|
+ if(materialQuality == null){
|
|
|
+ // continue;
|
|
|
+ }else {
|
|
|
+ String type = zEnginMaterialQualityMapper.selectVoById(materialQuality).getMaterialType();
|
|
|
+ if("0".equals(type)){
|
|
|
+ pesj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))) );
|
|
|
+ }else if("1".equals(type)){
|
|
|
+ gsj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))) );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wasteMaterialVo.setEnginName(zEngineeringGYVo.getEnginName()); // 工程名称
|
|
|
+ wasteMaterialVo.setEnginClassification(zEngineeringGYVo.getEnginClassification()); // 工程分类
|
|
|
+// map.put("enginName", zEngineeringGYVo.getEnginName()); // 工程名称
|
|
|
+// map.put("enginClassification", zEngineeringGYVo.getEnginClassification()); // 工程分类
|
|
|
+ Map pe = new HashMap(); // PE材料
|
|
|
+ pe.put("actuality", getRoundDouble(pesj.get(), 2)); // 实际
|
|
|
+ pe.put("anticipation", zEngineeringGYVo.getPePreset()); // 预计 divide zEngineeringGYVo.getGcPreset()
|
|
|
+ pe.put("percentage", zEngineeringGYVo.getPePreset() == 0 ? "100.0%" : getRoundDouble((pesj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringGYVo.getPePreset()), BigDecimal.ROUND_CEILING),2) + "%"); // 占比
|
|
|
+// map.put("actualityPE",pe.get("actuality"));
|
|
|
+// map.put("anticipationPE",pe.get("anticipation"));
|
|
|
+// map.put("percentagePE",pe.get("percentage"));
|
|
|
+ wasteMaterialVo.setActualityPE(pe.get("actuality").toString());
|
|
|
+ wasteMaterialVo.setAnticipationPE(pe.get("anticipation").toString());
|
|
|
+ wasteMaterialVo.setPercentagePE(pe.get("percentage").toString());
|
|
|
+ Map iron = new HashMap(); // 钢材
|
|
|
+ iron.put("actuality", getRoundDouble(gsj.get(), 2)); // 实际
|
|
|
+ iron.put("anticipation", zEngineeringGYVo.getGcPreset()); // 预计
|
|
|
+ iron.put("percentage", zEngineeringGYVo.getGcPreset() == 0 ? "100.0%" : getRoundDouble((gsj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringGYVo.getGcPreset()), BigDecimal.ROUND_CEILING),2) + "%"); // 占比
|
|
|
+// map.put("actualityIron",iron.get("actuality"));
|
|
|
+// map.put("anticipationIron",iron.get("anticipation"));
|
|
|
+// map.put("percentageIron",iron.get("percentage"));
|
|
|
+ wasteMaterialVo.setActualityIron(iron.get("actuality").toString());
|
|
|
+ wasteMaterialVo.setAnticipationIron(iron.get("anticipation").toString());
|
|
|
+ wasteMaterialVo.setPercentageIron(iron.get("percentage").toString());
|
|
|
+ zEngineeringWasteMaterialVo.setMaterialPercentagePE(pe);
|
|
|
+ zEngineeringWasteMaterialVo.setMaterialPercentageIron(iron);
|
|
|
+// mapList.add(map);
|
|
|
+ resultList.add(wasteMaterialVo);
|
|
|
+ }
|
|
|
+// ZEngineeringGYVo zEngineeringGYVo = gyMapper.selectVoById(id);
|
|
|
+// return mapList;
|
|
|
+ return resultList;
|
|
|
+ }
|
|
|
+ public List<Map> engineeringMunicipalList(ZEnginMaterialQualityBo bo){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ public List<Map> engineeringPipeJackingList(ZEnginMaterialQualityBo bo){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ public List<Map> engineeringInfrastructureList(ZEnginMaterialQualityBo bo){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|