查询模组档位统计分布图 修改

This commit is contained in:
caixiang 2023-03-17 13:50:53 +08:00
parent c37f25a874
commit 6f50adc782
2 changed files with 13 additions and 4 deletions

View File

@ -184,11 +184,15 @@ public class WoPackagingBoxSubstrateController {
totalSubNum+= subNum; totalSubNum+= subNum;
} }
for(PowerReportDTO power : powerReportList){ for(PowerReportDTO power : powerReportList){
if(power.getSubNum()==0 ||totalSubNum ==0 ){
power.setProportion("0%");
}else {
Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100; Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100;
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.00");
String propS = df.format(prop)+"%"; String propS = df.format(prop)+"%";
power.setProportion(propS); power.setProportion(propS);
} }
}
diversePower = totalCompensatePower - totalLevelPower; diversePower = totalCompensatePower - totalLevelPower;

View File

@ -40,4 +40,9 @@ public class PowerReportDTO implements Serializable {
this.sumPMPP = sumPMPP; this.sumPMPP = sumPMPP;
this.proportion = proportion; this.proportion = proportion;
} }
public PowerReportDTO(Integer subNum, String subLevel, Float sumPMPP) {
this.subNum = subNum;
this.subLevel = subLevel;
this.sumPMPP = sumPMPP;
}
} }