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

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,10 +184,14 @@ public class WoPackagingBoxSubstrateController {
totalSubNum+= subNum;
}
for(PowerReportDTO power : powerReportList){
Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100;
DecimalFormat df = new DecimalFormat("0.00");
String propS = df.format(prop)+"%";
power.setProportion(propS);
if(power.getSubNum()==0 ||totalSubNum ==0 ){
power.setProportion("0%");
}else {
Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100;
DecimalFormat df = new DecimalFormat("0.00");
String propS = df.format(prop)+"%";
power.setProportion(propS);
}
}

View File

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