diff --git a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/datacenter/DataCenterRest.java b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/datacenter/DataCenterRest.java index 280e6468..67c38d9a 100644 --- a/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/datacenter/DataCenterRest.java +++ b/yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/datacenter/DataCenterRest.java @@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.*; @@ -474,8 +475,10 @@ public class DataCenterRest { ResultBean rb=new ResultBean(); Map map=new HashMap<>(); IndexVo vo=ShRequester.getscreen$enterprise$index(query); - map.put("enterprise_month",vo.getEnterprise_month()); - map.put("enterprise_year",vo.getEnterprise_year()); +// map.put("enterprise_month",vo.getEnterprise_month()); +// map.put("enterprise_year",vo.getEnterprise_year()); + map.put("enterprise_month",new BigDecimal(vo.getEnterprise_month()).setScale(0,RoundingMode.HALF_UP)); + map.put("enterprise_year",new BigDecimal(vo.getEnterprise_year()).setScale(0, RoundingMode.HALF_UP)); List name =new ArrayList<>(); List enterprise_power =new ArrayList<>(); for (NearVo nearVo : vo.getNear_day()) { @@ -773,13 +776,15 @@ public class DataCenterRest { List c =vos.getData().getList(); for (OrderIndexVo orderIndexVo : c) { String d=""; - if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("MW")){ +// if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("MW")){ + if(orderIndexVo.getAll_power().contains("MW")){ d =orderIndexVo.getAll_power().replace("MW",""); BigDecimal bigDecimal=new BigDecimal(d); bigDecimal=bigDecimal.multiply(new BigDecimal(1000000)); bigDecimal=bigDecimal.multiply(new BigDecimal(3)); ztz=ztz.add(bigDecimal); - }else if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("KW")){ +// }else if(orderIndexVo.getAll_power().substring(orderIndexVo.getAll_power().length()-2).equals("KW")){ + }else if(orderIndexVo.getAll_power().contains("KW")){ d =orderIndexVo.getAll_power().replace("KW",""); BigDecimal bigDecimal=new BigDecimal(d); bigDecimal=bigDecimal.multiply(new BigDecimal(1000)); @@ -801,13 +806,16 @@ public class DataCenterRest { Integer dkzcCount =0; for (ProjectDetailsVo orderIndexVo : vos) { String g=""; - if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("MW")){ + +// if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("MW")){ + if(orderIndexVo.getSquareMeter().contains("MW")){ g =orderIndexVo.getSquareMeter().replace("MW",""); BigDecimal bigDecimal=new BigDecimal(g); bigDecimal=bigDecimal.multiply(new BigDecimal(1000000)); bigDecimal=bigDecimal.multiply(new BigDecimal(1)); dkzc=dkzc.add(bigDecimal); - }else if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("KW")){ +// }else if(orderIndexVo.getSquareMeter().substring(orderIndexVo.getSquareMeter().length()-2).equals("KW")){ + }else if(orderIndexVo.getSquareMeter().contains("MW")){ g =orderIndexVo.getSquareMeter().replace("KW",""); BigDecimal bigDecimal=new BigDecimal(g); bigDecimal=bigDecimal.multiply(new BigDecimal(1000));