|
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -148,8 +149,11 @@ public class ChannelMapServiceImpl implements ChannelMapService {
|
|
|
|
|
|
|
|
//5.计算radio
|
|
//5.计算radio
|
|
|
for (WdCountBody wdCountBody : result) {
|
|
for (WdCountBody wdCountBody : result) {
|
|
|
- if (total != 0)
|
|
|
|
|
- wdCountBody.setRadio((float) wdCountBody.getCount() / total);
|
|
|
|
|
|
|
+ if (total != 0){
|
|
|
|
|
+ BigDecimal bigDecimal = new BigDecimal((float) wdCountBody.getCount() / total);
|
|
|
|
|
+ float v = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
|
|
|
|
|
+ wdCountBody.setRadio(v);
|
|
|
|
|
+ }
|
|
|
else
|
|
else
|
|
|
wdCountBody.setRadio(0.0f);
|
|
wdCountBody.setRadio(0.0f);
|
|
|
}
|
|
}
|