Преглед изворни кода

Merge branch 'master' into dev

王苗苗 пре 7 месеци
родитељ
комит
a07ff36028

+ 1 - 0
slibra-common/src/main/java/com/slibra/common/constant/MyConstants.java

@@ -37,6 +37,7 @@ public class MyConstants {
     public static final int INT_0 = 0;
     public static final int INT_1 = 1;
     public static final Double DOUBLE_75 = 75D;
+    public static final int NUMBER_SCALE_6 = 6;
     public static final int NUMBER_SCALE_4 = 4;
     public static final int NUMBER_SCALE_2 = 2;
 //    public static final BigDecimal ROBOT_HY_DIVIDE = new BigDecimal("0.8");

+ 44 - 44
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiCarbonMajorServiceImpl.java

@@ -148,7 +148,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal wsHsytkhCsCod = tXinyiCarbonMajor.getWsHsytkhCsCod();
         BigDecimal wsHsytkhCo2 = null;
         if(!Objects.isNull(wsHsytkhClsl) && !Objects.isNull(wsHsytkhJsCod) && !Objects.isNull(wsHsytkhCsCod)){
-            wsHsytkhCo2 = (wsHsytkhJsCod.subtract(wsHsytkhCsCod)).abs().multiply(wsHsytkhClsl).multiply(BigDecimal_0_56).multiply(BigDecimal_0_1).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wsHsytkhCo2 = (wsHsytkhJsCod.subtract(wsHsytkhCsCod)).abs().multiply(wsHsytkhClsl).multiply(BigDecimal_0_56).multiply(BigDecimal_0_1).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWsHsytkhCo2(wsHsytkhCo2);
         }
         BigDecimal wsSjclCh4Clsl = tXinyiCarbonMajor.getWsSjclCh4Clsl();
@@ -164,10 +164,10 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
             }
             //判断是否有实测
             if(!Objects.isNull(wsSjclCh4Tsb) && !Objects.isNull(wsSjclCh4Csc)){//有实测
-                wsSjclCh4Co2 = ((wsSjclCh4JsCod.subtract(wsSjclCh4CsCod)).abs().multiply(wsSjclCh4Clsl).multiply(wsSjclCh4Pfyz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP).add(wsSjclCh4Tsb).add(wsSjclCh4Csc)).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+                wsSjclCh4Co2 = ((wsSjclCh4JsCod.subtract(wsSjclCh4CsCod)).abs().multiply(wsSjclCh4Clsl).multiply(wsSjclCh4Pfyz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP).add(wsSjclCh4Tsb).add(wsSjclCh4Csc)).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
                 tXinyiCarbonMajorUpdate.setWsSjclCh4Co2(wsSjclCh4Co2);
             }else{//没有实测
-                wsSjclCh4Co2 = (wsSjclCh4JsCod.subtract(wsSjclCh4CsCod)).abs().multiply(wsSjclCh4Clsl).multiply(wsSjclCh4Pfyz).multiply((BigDecimal_1.add(BigDecimal_0_2))).multiply(BigDecimal_28).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+                wsSjclCh4Co2 = (wsSjclCh4JsCod.subtract(wsSjclCh4CsCod)).abs().multiply(wsSjclCh4Clsl).multiply(wsSjclCh4Pfyz).multiply((BigDecimal_1.add(BigDecimal_0_2))).multiply(BigDecimal_28).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
                 tXinyiCarbonMajorUpdate.setWsSjclCh4Co2(wsSjclCh4Co2);
             }
         }
@@ -181,7 +181,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
             if(Objects.isNull(wsTdN2oPfyz)){
                 wsTdN2oPfyz = BigDecimal_0_01;
             }
-            wsTdN2oCo2 = (wsTdN2oJsTn.subtract(wsTdN2oCsTn)).abs().multiply(wsTdN2oClsl).multiply(wsTdN2oPfyz).multiply(BigDecimal_265).multiply(BigDecimal_44).divide(BigDecimal_28, NUMBER_SCALE_2, RoundingMode.HALF_UP).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wsTdN2oCo2 = (wsTdN2oJsTn.subtract(wsTdN2oCsTn)).abs().multiply(wsTdN2oClsl).multiply(wsTdN2oPfyz).multiply(BigDecimal_265).multiply(BigDecimal_44).divide(BigDecimal_28, NUMBER_SCALE_6, RoundingMode.HALF_UP).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWsTdN2oCo2(wsTdN2oCo2);
         }
 
@@ -211,56 +211,56 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
             //总耗电
             BigDecimal nyyjDlxhZhdl = tXinyiCarbonMajor.getNyyjDlxhZhdl();
             if(!Objects.isNull(nyyjDlxhZhdl)){
-                nyyjDlxhZhdlCo2 = nyyjDlxhZhdl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+                nyyjDlxhZhdlCo2 = nyyjDlxhZhdl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
                 tXinyiCarbonMajorUpdate.setNyyjDlxhZhdlCo2(nyyjDlxhZhdlCo2);
             }
 
             //进水泵房
             BigDecimal nyyjDlxhJsbf = tXinyiCarbonMajor.getNyyjDlxhJsbf();
             if(!Objects.isNull(nyyjDlxhJsbf)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhJsbfCo2(nyyjDlxhJsbf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhJsbfCo2(nyyjDlxhJsbf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //鼓风机房
             BigDecimal nyyjDlxhGfjf = tXinyiCarbonMajor.getNyyjDlxhGfjf();
             if(!Objects.isNull(nyyjDlxhGfjf)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhGfjfCo2(nyyjDlxhGfjf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhGfjfCo2(nyyjDlxhGfjf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //脱水机房
             BigDecimal nyyjDlxhTsjf = tXinyiCarbonMajor.getNyyjDlxhTsjf();
             if(!Objects.isNull(nyyjDlxhTsjf)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhTsjfCo2(nyyjDlxhTsjf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhTsjfCo2(nyyjDlxhTsjf.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //消毒间
             BigDecimal nyyjDlxhXdj = tXinyiCarbonMajor.getNyyjDlxhXdj();
             if(!Objects.isNull(nyyjDlxhXdj)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhXdjCo2(nyyjDlxhXdj.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhXdjCo2(nyyjDlxhXdj.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //深度处理用电
             BigDecimal nyyjDlxhSdcl = tXinyiCarbonMajor.getNyyjDlxhSdcl();
             if(!Objects.isNull(nyyjDlxhSdcl)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhSdclCo2(nyyjDlxhSdcl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhSdclCo2(nyyjDlxhSdcl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //污泥处置
             BigDecimal nyyjDlxhWncz = tXinyiCarbonMajor.getNyyjDlxhWncz();
             if(!Objects.isNull(nyyjDlxhWncz)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhWnczCo2(nyyjDlxhWncz.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhWnczCo2(nyyjDlxhWncz.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //生活区
             BigDecimal nyyjDlxhShq = tXinyiCarbonMajor.getNyyjDlxhShq();
             if(!Objects.isNull(nyyjDlxhShq)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhShqCo2(nyyjDlxhShq.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhShqCo2(nyyjDlxhShq.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
 
             //其他耗电区
             BigDecimal nyyjDlxhQt = tXinyiCarbonMajor.getNyyjDlxhQt();
             if(!Objects.isNull(nyyjDlxhQt)){
-                tXinyiCarbonMajorUpdate.setNyyjDlxhQtCo2(nyyjDlxhQt.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setNyyjDlxhQtCo2(nyyjDlxhQt.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
         }
 
@@ -271,7 +271,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal nyyjGrrlCo2 = null;
         //2024年08月27日17:21:58  计算的时候,不用nyyjGrrlRl了,用前面的2个值,计算出来热力nyyjGrrlRl
         if(!Objects.isNull(nyyjGrrlZq) && !Objects.isNull(nyyjGrrlDyhz)){
-            nyyjGrrlCo2 = (nyyjGrrlDyhz.subtract(BigDecimal_83_74)).abs().multiply(nyyjGrrlZq).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP).multiply(BigDecimal_110000).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            nyyjGrrlCo2 = (nyyjGrrlDyhz.subtract(BigDecimal_83_74)).abs().multiply(nyyjGrrlZq).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP).multiply(BigDecimal_110000).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setNyyjGrrlCo2(nyyjGrrlCo2);
         }
 
@@ -302,7 +302,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal wnclYyzqChZlfs = tXinyiCarbonMajor.getWnclYyzqChZlfs();
         BigDecimal wnclYyzqCo2 = null;
         if(!Objects.isNull(wnclYyzqZqcl) && !Objects.isNull(wnclYyzqChZlfs)){
-            wnclYyzqCo2 = wnclYyzqZqcl.multiply(wnclYyzqChZlfs).multiply(BigDecimal_0_05).multiply(BigDecimal_28).multiply(BigDecimal_16).divide(BigDecimal_22_4, NUMBER_SCALE_2, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclYyzqCo2 = wnclYyzqZqcl.multiply(wnclYyzqChZlfs).multiply(BigDecimal_0_05).multiply(BigDecimal_28).multiply(BigDecimal_16).divide(BigDecimal_22_4, NUMBER_SCALE_6, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclYyzqCo2(wnclYyzqCo2);
         }
 
@@ -316,7 +316,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
             if(Objects.isNull(wnclDdclPfyz)){
                 wnclDdclPfyz = BigDecimal_0_01;
             }
-            wnclDdclCo2 = (wnclDdclClqnd.subtract(wnclDdclClhnd)).abs().multiply(wnclDdclZycll).multiply(wnclDdclPfyz).multiply(BigDecimal_44).divide(BigDecimal_28, NUMBER_SCALE_2, RoundingMode.HALF_UP).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclDdclCo2 = (wnclDdclClqnd.subtract(wnclDdclClhnd)).abs().multiply(wnclDdclZycll).multiply(wnclDdclPfyz).multiply(BigDecimal_44).divide(BigDecimal_28, NUMBER_SCALE_6, RoundingMode.HALF_UP).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclDdclCo2(wnclDdclCo2);
         }
 
@@ -326,9 +326,9 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal wnclHyfjCh4Co2 = null;
         BigDecimal wnclHyfjN2oCo2 = null;
         if(!Objects.isNull(wnclHyfjFjl)){
-            wnclHyfjCh4Co2 = wnclHyfjFjl.multiply(BigDecimal_10).multiply(BigDecimal_28).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclHyfjCh4Co2 = wnclHyfjFjl.multiply(BigDecimal_10).multiply(BigDecimal_28).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclHyfjCh4Co2(wnclHyfjCh4Co2);
-            wnclHyfjN2oCo2 = wnclHyfjFjl.multiply(BigDecimal_0_6).multiply(BigDecimal_265).divide(BigDecimal_1000000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclHyfjN2oCo2 = wnclHyfjFjl.multiply(BigDecimal_0_6).multiply(BigDecimal_265).divide(BigDecimal_1000000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclHyfjN2oCo2(wnclHyfjN2oCo2);
         }
 
@@ -338,7 +338,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal wnclWnfsCo2 = null;
 
         if(!Objects.isNull(wnclWnfsXhl) && !Objects.isNull(wnclWnfsHtbl)){
-            wnclWnfsCo2 = wnclWnfsXhl.multiply(wnclWnfsHtbl).multiply(BigDecimal_0_12).multiply(BigDecimal_44).divide(BigDecimal_12, NUMBER_SCALE_2, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclWnfsCo2 = wnclWnfsXhl.multiply(wnclWnfsHtbl).multiply(BigDecimal_0_12).multiply(BigDecimal_44).divide(BigDecimal_12, NUMBER_SCALE_6, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclWnfsCo2(wnclWnfsCo2);
         }
 
@@ -368,9 +368,9 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
                     }
                 }
             }
-            wnclBwqrsCh4Co2 = wnclBwqrsFsl.multiply(wnclBwqrsPfyz).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclBwqrsCh4Co2 = wnclBwqrsFsl.multiply(wnclBwqrsPfyz).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclBwqrsCh4Co2(wnclBwqrsCh4Co2);
-            wnclBwqrsN2oCo2 = wnclBwqrsFsl.multiply(BigDecimal_0_99).multiply(BigDecimal_265).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclBwqrsN2oCo2 = wnclBwqrsFsl.multiply(BigDecimal_0_99).multiply(BigDecimal_265).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclBwqrsN2oCo2(wnclBwqrsN2oCo2);
         }
 
@@ -379,7 +379,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal wnclWnrjByhHtbl = tXinyiCarbonMajor.getWnclWnrjByhHtbl();
         BigDecimal wnclWnrjByhCo2 = null;
         if(!Objects.isNull(wnclWnrjByhHtbl) && !Objects.isNull(wnclWnrjByhXhl)){
-            wnclWnrjByhCo2 = wnclWnrjByhXhl.multiply(wnclWnrjByhHtbl).multiply(BigDecimal_0_12).multiply(BigDecimal_44).divide(BigDecimal_12, NUMBER_SCALE_2, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclWnrjByhCo2 = wnclWnrjByhXhl.multiply(wnclWnrjByhHtbl).multiply(BigDecimal_0_12).multiply(BigDecimal_44).divide(BigDecimal_12, NUMBER_SCALE_6, RoundingMode.HALF_UP).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclWnrjByhCo2(wnclWnrjByhCo2);
         }
 
@@ -413,9 +413,9 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
                     }
                 }
             }
-            wnclWnrjQtCh4Co2 = wnclWnrjQtXhl.multiply(wnclWnrjQtPfyzCh4).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclWnrjQtCh4Co2 = wnclWnrjQtXhl.multiply(wnclWnrjQtPfyzCh4).multiply(BigDecimal_28).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclWnrjQtCh4Co2(wnclWnrjQtCh4Co2);
-            wnclWnrjQtN2oCo2 = wnclWnrjQtXhl.multiply(wnclWnrjQtPfyzN2o).multiply(BigDecimal_265).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            wnclWnrjQtN2oCo2 = wnclWnrjQtXhl.multiply(wnclWnrjQtPfyzN2o).multiply(BigDecimal_265).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setWnclWnrjQtN2oCo2(wnclWnrjQtN2oCo2);
         }
 
@@ -459,7 +459,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal thGfZhdl = tXinyiCarbonMajor.getThGfZhdl();
         BigDecimal thGfCo2 = null;
         if(!Objects.isNull(thGfZhdl) && !Objects.isNull(yz)){
-            thGfCo2 = thGfZhdl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            thGfCo2 = thGfZhdl.multiply(yz).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setThGfCo2(thGfCo2);
         }
 
@@ -486,7 +486,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal thWnClhFlwnl = tXinyiCarbonMajor.getThWnClhFlwnl();
         BigDecimal thWnClhCo2 = null;
         if(!Objects.isNull(thWnClhFlwnl)){
-            thWnClhCo2 = ((BigDecimal_0_03.multiply(BigDecimal_0_61).multiply(BigDecimal_2_116)).add((BigDecimal_0_006.multiply(BigDecimal_0_7).multiply(BigDecimal_1_45)))).multiply(thWnClhFlwnl).divide(BigDecimal_1000, NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            thWnClhCo2 = ((BigDecimal_0_03.multiply(BigDecimal_0_61).multiply(BigDecimal_2_116)).add((BigDecimal_0_006.multiply(BigDecimal_0_7).multiply(BigDecimal_1_45)))).multiply(thWnClhFlwnl).divide(BigDecimal_1000, NUMBER_SCALE_6, RoundingMode.HALF_UP);
             tXinyiCarbonMajorUpdate.setThWnClhCo2(thWnClhCo2);
         }
         //替碳、碳汇替总碳量
@@ -520,16 +520,16 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         //处理百分比信息
         if(nyyjTotalCo2.compareTo(BigDecimal.ZERO) > 0){//必须是正数
             if(!Objects.isNull(nyyjDlxhZhdlCo2)){
-                tXinyiCarbonMajorUpdate.setDlxhPercent(nyyjDlxhZhdlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setDlxhPercent(nyyjDlxhZhdlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
             if(!Objects.isNull(wscljdyjxhCo2)){
-                tXinyiCarbonMajorUpdate.setYjxhPercent(wscljdyjxhCo2.divide(nyyjTotalCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setYjxhPercent(wscljdyjxhCo2.divide(nyyjTotalCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
             if(!Objects.isNull(nyyjGrrlCo2)){
-                tXinyiCarbonMajorUpdate.setJgrrlPercent(nyyjGrrlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setJgrrlPercent(nyyjGrrlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
             if(!Objects.isNull(gdsnyrlCo2)){
-                tXinyiCarbonMajorUpdate.setRlxhPercent(gdsnyrlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                tXinyiCarbonMajorUpdate.setRlxhPercent(gdsnyrlCo2.divide(nyyjTotalCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP));
             }
         }
 
@@ -538,7 +538,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         BigDecimal ztTotalCo2 = tXinyiCarbonMajorUpdate.getZtTotalCo2();
         if(!Objects.isNull(avgJsl) && !Objects.isNull(ztTotalCo2)){
             //2024年08月27日09:36:14 计算公式有调整:再乘以10的三次方。
-            BigDecimal wschytpfqd = ztTotalCo2.divide(avgJsl, NUMBER_SCALE_2, RoundingMode.HALF_UP).multiply(BigDecimal_1000);
+            BigDecimal wschytpfqd = ztTotalCo2.divide(avgJsl, NUMBER_SCALE_6, RoundingMode.HALF_UP).multiply(BigDecimal_1000);
             tXinyiCarbonMajorUpdate.setWschytpfqd(wschytpfqd);
             BigDecimal avgCod = this.tXinyiCarbonMajorMapper.selectAvgCodByMonth(addYearMonth.replaceAll("-", "/"));
             //从字典获取不同cod对应的标准
@@ -586,23 +586,23 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
         }
         //2024年08月30日14:08:19 计算公式 不统一,并且字段不太一致,所以需要TXinyiCarbonExtra表新增2个字段,代表四个含义。
         if(type == BusinessEnum.CarbonExtraTeypEnum.ZERO.getCode()){
-            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP));
+            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP));
         }else if(type == BusinessEnum.CarbonExtraTeypEnum.ONE.getCode()){
-            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP));
+            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP));
         }else if(type == BusinessEnum.CarbonExtraTeypEnum.TWO.getCode()){
-            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP));
+            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP));
         }else if(type == BusinessEnum.CarbonExtraTeypEnum.THREE.getCode()){
-            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000000000000,NUMBER_SCALE_2, RoundingMode.HALF_UP));
+            return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000000000000,NUMBER_SCALE_6, RoundingMode.HALF_UP));
         }else if(type == BusinessEnum.CarbonExtraTeypEnum.FOUR.getCode()){
-            return Objects.isNull(yz) ? null : (amount.multiply(yz).add((lyl.multiply(new BigDecimal(sysDictData.getDictValue()))).add((hz.multiply(BigDecimal_0_0022))))).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            return Objects.isNull(yz) ? null : (amount.multiply(yz).add((lyl.multiply(new BigDecimal(sysDictData.getDictValue()))).add((hz.multiply(BigDecimal_0_0022))))).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP);
         }else if(type == BusinessEnum.CarbonExtraTeypEnum.FIVE.getCode()){
-            return Objects.isNull(yz) ? null : (amount.multiply(yz).add((lyl.multiply(hz.subtract(BigDecimal_83_74)).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP))).multiply(new BigDecimal(sysDictData.getDictValue())).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP)).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP);
+            return Objects.isNull(yz) ? null : (amount.multiply(yz).add((lyl.multiply(hz.subtract(BigDecimal_83_74)).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP))).multiply(new BigDecimal(sysDictData.getDictValue())).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP)).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP);
         }else {
             log.error("暂不支持的类型");
             throw new ServiceException("暂不支持的类型");
         }
         //2024年08月28日17:43:58 所有的公式都统一了,都采用下面的方式【感谢郭京京】
-//        return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_2, RoundingMode.HALF_UP));
+//        return amount.multiply(new BigDecimal(sysDictData.getDictValue()).divide(BigDecimal_1000,NUMBER_SCALE_6, RoundingMode.HALF_UP));
     }
 
     /**
@@ -685,35 +685,35 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
             BigDecimal nowCo2 = tXinyiCarbonMajorLastMonth.getWsclTotalCo2();
             BigDecimal lastMonthCo2 = tXinyiCarbonMajor.getWsclTotalCo2();
             if(!Objects.isNull(nowCo2) && !Objects.isNull(lastMonthCo2)){
-                tXinyiCarbonMajor.setWsclTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP) ,NUMBER_SCALE_2));
+                tXinyiCarbonMajor.setWsclTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP) ,NUMBER_SCALE_6));
             }
 
             //能源、药剂碳排量-环比上个月
             nowCo2 = tXinyiCarbonMajorLastMonth.getNyyjTotalCo2();
             lastMonthCo2 = tXinyiCarbonMajor.getNyyjTotalCo2();
             if(!Objects.isNull(nowCo2) && !Objects.isNull(lastMonthCo2)){
-                tXinyiCarbonMajor.setNyyjTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP) ,NUMBER_SCALE_2));
+                tXinyiCarbonMajor.setNyyjTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP) ,NUMBER_SCALE_6));
             }
 
             //污泥处理碳排量-环比上个月
             nowCo2 = tXinyiCarbonMajorLastMonth.getWnclTotalCo2();
             lastMonthCo2 = tXinyiCarbonMajor.getWnclTotalCo2();
             if(!Objects.isNull(nowCo2) && !Objects.isNull(lastMonthCo2)){
-                tXinyiCarbonMajor.setWnclTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP) ,NUMBER_SCALE_2));
+                tXinyiCarbonMajor.setWnclTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP) ,NUMBER_SCALE_6));
             }
 
             //替碳、碳汇替碳量-环比上个月
             nowCo2 = tXinyiCarbonMajorLastMonth.getTtthTotalCo2();
             lastMonthCo2 = tXinyiCarbonMajor.getTtthTotalCo2();
             if(!Objects.isNull(nowCo2) && !Objects.isNull(lastMonthCo2)){
-                tXinyiCarbonMajor.setTtthTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP) ,NUMBER_SCALE_2));
+                tXinyiCarbonMajor.setTtthTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP) ,NUMBER_SCALE_6));
             }
 
             //总碳排放量-环比上个月
             nowCo2 = tXinyiCarbonMajorLastMonth.getZtTotalCo2();
             lastMonthCo2 = tXinyiCarbonMajor.getZtTotalCo2();
             if(!Objects.isNull(nowCo2) && !Objects.isNull(lastMonthCo2)){
-                tXinyiCarbonMajor.setZtTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_2, RoundingMode.HALF_UP) ,NUMBER_SCALE_2));
+                tXinyiCarbonMajor.setZtTotalCo2Hb(DecimalUtils.getAbsAndScale((nowCo2.subtract(lastMonthCo2)).divide(lastMonthCo2, NUMBER_SCALE_6, RoundingMode.HALF_UP) ,NUMBER_SCALE_6));
             }
         }
         //最近7个月的数据集合
@@ -733,7 +733,7 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
                 //获取某个月份的平均进水cod
                 BigDecimal avgJsl = this.tXinyiCarbonMajorMapper.selectSumJslByMonth(addYearMonthTmp.replaceAll("-", "/"));
                 if(!Objects.isNull(avgJsl) && !Objects.isNull(ztTotalCo2)){
-                    chartBasic.setWschytpfqd(ztTotalCo2.divide(avgJsl, NUMBER_SCALE_2, RoundingMode.HALF_UP));
+                    chartBasic.setWschytpfqd(ztTotalCo2.divide(avgJsl, NUMBER_SCALE_6, RoundingMode.HALF_UP).multiply(BigDecimal_1000));
                 }
                 recent7PflDatas.add(chartBasic);
             }

+ 1 - 0
slibra-system/src/main/resources/mapper/business/TXinyiCarbonMajorMapper.xml

@@ -456,6 +456,7 @@
             add_year_month
         FROM
             t_xinyi_carbon_major
+        order by add_year_month desc
     </select>