refactor: 优化 `AndroidMeetingController` 中的包丢失率处理逻辑
- 引入 `RoundingMode` 以确保 `packetLossRate` 精度为两位小数 - 更新 `setPacketLossRate` 方法,使用 `setScale` 方法进行四舍五入处理dev_na
parent
384494d9ff
commit
47ebeade20
|
|
@ -56,6 +56,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
|
|
@ -316,7 +317,9 @@ public class AndroidMeetingController {
|
|||
resultVo.setSummaryDegreeOfDetail(dictItemService.getItemsByTypeCode("summary_degree_detail"));
|
||||
resultVo.setMaxMeetingDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_MEETING_DURATION,"30")));
|
||||
resultVo.setMaxPauseDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION,String.valueOf(60*4))));
|
||||
resultVo.setPacketLossRate(new BigDecimal(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION,"99")));
|
||||
BigDecimal bigDecimal = new BigDecimal(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION, "99"));
|
||||
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
|
||||
resultVo.setPacketLossRate(bigDecimal );
|
||||
|
||||
return ApiResponse.ok(resultVo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue