From a8a951c96f6b4cba82753ed2416febaf8a811e79 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Thu, 31 Oct 2024 10:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=B1=E6=B5=B7=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/biz/datacenter/DataCenterRest.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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));