Przeglądaj źródła

feat: 数值变更截取

sunxiao 8 miesięcy temu
rodzic
commit
3899c4316c

+ 7 - 2
slibra-admin/src/main/java/com/slibra/web/controller/business/HandleDataController.java

@@ -975,10 +975,15 @@ public class HandleDataController extends BaseController
                     }
 
                     // 处理化验室
-                    TXinyiRobot tXinyiRobot = xinyiRobotMapper.selectTXinyiRobotByAvg(TXinyiRobot.builder().testHour(testHour).build());
-                    if ( !Objects.isNull(tXinyiRobot) ) {
+                    List<TXinyiRobot> tXinyiRobots = xinyiRobotMapper.selectTXinyiRobotList(TXinyiRobot.builder().testHour(testHour).build()));
+                    if (!CollectionUtils.isEmpty(tXinyiRobots)) {
+                        TXinyiRobot tXinyiRobot = tXinyiRobots.get(0);
                         handleRobotData(xinyiBigTableHour, tXinyiRobot);
                     }
+                    // TXinyiRobot tXinyiRobot = xinyiRobotMapper.selectTXinyiRobotByAvg(TXinyiRobot.builder().testHour(testHour).build());
+                    // if ( !Objects.isNull(tXinyiRobot) ) {
+                    //     handleRobotData(xinyiBigTableHour, tXinyiRobot);
+                    // }
 
                     tXinyiBigTableHourList.add(xinyiBigTableHour);
                 }

+ 2 - 2
slibra-common/src/main/java/com/slibra/common/DecimalUtils.java

@@ -28,7 +28,7 @@ public class DecimalUtils {
     public static BigDecimal getAbsAndScale(BigDecimal req, int length){
         if(Objects.isNull(req))
             return null;
-        return req.abs().setScale(length, RoundingMode.HALF_UP);
+        return req.abs().setScale(length, RoundingMode.DOWN);
     }
 
     /**
@@ -40,7 +40,7 @@ public class DecimalUtils {
     public static String getAbsAndScaleStr(String req, int length){
         if(StringUtils.isBlank(req))
             return null;
-        return new BigDecimal(req).abs().setScale(length, RoundingMode.HALF_UP).toString();
+        return new BigDecimal(req).abs().setScale(length, RoundingMode.DOWN).toString();
     }
 
     public static String getAbsForArray(String list, int length) {