Browse Source

拼接的时候 中间再额外拼接一个空格

wangmiaomiao 8 months ago
parent
commit
19135b6646

+ 16 - 17
slibra-admin/src/main/java/com/slibra/web/controller/business/FrontController.java

@@ -29,8 +29,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
-import static com.slibra.common.constant.MyConstants.SUCCESS;
-import static com.slibra.common.constant.MyConstants.MAX_COUNT;
+import static com.slibra.common.constant.MyConstants.*;
 
 /**
  * 前端用户相关接口
@@ -228,34 +227,34 @@ public class FrontController extends BaseController {
     private String getWarningValStr(BigDecimal warningVal, String category) {
         BigDecimal absAndScale = DecimalUtils.getAbsAndScale(warningVal, MyConstants.INT_2);
         if(BusinessEnum.WarningCategoryEnum.NHLB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.PERCENT.getCode();
+            return absAndScale + SPACE_STR + BusinessEnum.BigModelUnitEnum.PERCENT.getCode();
         if(BusinessEnum.WarningCategoryEnum.WNND_MLSS_1.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
         if(BusinessEnum.WarningCategoryEnum.WNND_MLSS_2.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
         if(BusinessEnum.WarningCategoryEnum.WNFH.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.KGBOD_KGMLSS_D.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.KGBOD_KGMLSS_D.getCode();
         if(BusinessEnum.WarningCategoryEnum.HFXWNNDZB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.NULL.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.NULL.getCode();
         if(BusinessEnum.WarningCategoryEnum.TDB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.NULL.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.NULL.getCode();
         if(BusinessEnum.WarningCategoryEnum.TLB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.NULL.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.NULL.getCode();
         if(BusinessEnum.WarningCategoryEnum.BODCODB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.NULL.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.NULL.getCode();
         if(BusinessEnum.WarningCategoryEnum.HYQDO_ONE.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
         if(BusinessEnum.WarningCategoryEnum.HYQDO_TWO.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.MG_L.getCode();
         if(BusinessEnum.WarningCategoryEnum.QSB.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.M3_M3.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.M3_M3.getCode();
         if(BusinessEnum.WarningCategoryEnum.ECC_BMFH.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.M3_M2_H.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.M3_M2_H.getCode();
         if(BusinessEnum.WarningCategoryEnum.ECC_GTFH.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.KG_M2_D.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.KG_M2_D.getCode();
         if(BusinessEnum.WarningCategoryEnum.FCXSL.getCode().equals(category))
-            return absAndScale + BusinessEnum.BigModelUnitEnum.PERCENT.getCode();
-        return absAndScale + BusinessEnum.BigModelUnitEnum.NULL.getCode();
+            return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.PERCENT.getCode();
+        return absAndScale + SPACE_STR  + BusinessEnum.BigModelUnitEnum.NULL.getCode();
     }
 
     /**

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

@@ -8,6 +8,7 @@ public class MyConstants {
     public static final String SUCCESS = "操作成功";
 
     public static final String PERCENT_SYMBOL = "%";
+    public static final String SPACE_STR = " ";//空格
     public static final String SESSION_ID = "session_id";
     public static final String STOP_GEN_STREAM = "stop_gen_stream";