|
@@ -8,6 +8,7 @@ import com.bizmatics.mhfire.service.vo.SiAeAllVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.nio.file.OpenOption;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -43,11 +44,20 @@ public class SiAeAllServiceImpl implements SiAeAllService {
|
|
|
SiAeAllVO siAeAllVO = new SiAeAllVO();
|
|
|
siAeAllVO.setCheckType(type);
|
|
|
Double radio = aeAll.get(type);
|
|
|
- siAeAllVO.setNumber(radio.intValue());
|
|
|
- siAeAllVO.setSameRatio(
|
|
|
- Optional.ofNullable(upAllCollect).map(up -> up.get(type)).orElse(0.0)/radio);
|
|
|
- siAeAllVO.setSameRatio(
|
|
|
- Optional.ofNullable(linkAllCollect).map(link -> link.get(type)).orElse(0.0)/radio);
|
|
|
+ siAeAllVO.setNumber(radio);
|
|
|
+ if (0 != radio){
|
|
|
+ Double upRadio = Optional.ofNullable(upAllCollect).map(up -> up.get(type)).orElse(0.0)/radio;
|
|
|
+ BigDecimal b = new BigDecimal(upRadio);
|
|
|
+ upRadio = b.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
+ siAeAllVO.setSameRatio(upRadio);
|
|
|
+ Double linkRadio = Optional.ofNullable(linkAllCollect).map(link -> link.get(type)).orElse(0.0)/radio;
|
|
|
+ b = new BigDecimal(linkRadio);
|
|
|
+ linkRadio = b.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
+ siAeAllVO.setLinkRelativeRatio(linkRadio);
|
|
|
+ }else {
|
|
|
+ siAeAllVO.setSameRatio(0.00);
|
|
|
+ siAeAllVO.setLinkRelativeRatio(0.00);
|
|
|
+ }
|
|
|
allVoS.add(siAeAllVO);
|
|
|
}
|
|
|
});
|