This commit is contained in:
Lx 2025-06-13 18:06:46 +08:00
parent 3f0d8297d1
commit e5ff111e8f

View File

@ -250,7 +250,8 @@ public class DataViewServiceImpl implements DataViewService {
studentInfoMap.put("schoolRate", 0 != schoolRate ? (Double.parseDouble(df.format(schoolRate)) * 100) : 0);
studentInfoMap.put("businessNum", businessNum);
studentInfoMap.put("businessAmount", businessAmount);
studentInfoMap.put("businessRate", 0 != businessRate ? (Double.parseDouble(df.format(businessRate)) * 100) : 0);
// studentInfoMap.put("businessRate", 0 != businessRate ? (Double.parseDouble(df.format(businessRate)) * 100) : 0);
studentInfoMap.put("businessRate", businessRate != 0 ? formatRate(businessRate) : 0);
rtnObj.setStudentInfo(studentInfoMap);
/*4.财务情况--*/
//应收
@ -392,7 +393,12 @@ public class DataViewServiceImpl implements DataViewService {
return rtnObj;
}
private Double formatRate(double rate) {
return BigDecimal.valueOf(rate)
.multiply(BigDecimal.valueOf(100)) // 转为百分比
.setScale(2, RoundingMode.HALF_UP) // 四舍五入保留两位小数
.doubleValue(); // 转为 Double 存入 Map
}
@Override
public IndexDataVO selectIndexInfoByBusiness(String type, String timeType, Long coachId, String startTime, String endTime, Integer isSign) {
IndexDataVO rtnObj = new IndexDataVO();