xusl il y a 3 ans
Parent
commit
012cf65f66

+ 2 - 2
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/DateTimeUtil.java

@@ -210,8 +210,8 @@ public class DateTimeUtil {
     public static boolean checkInSunriseAndSunset(Long time, double dfLonIn, double dfLatIn) {
         Date date = new Date(time);
 
-        String str1 = SunRiseSet.getSunrise(new BigDecimal(dfLonIn), new BigDecimal(dfLatIn), date);
-        String str2 = SunRiseSet.getSunset(new BigDecimal(dfLonIn), new BigDecimal(dfLatIn), date);
+        String str1 = SunRiseSet.getSunrise(BigDecimal.valueOf(dfLonIn), BigDecimal.valueOf(dfLatIn), date);
+        String str2 = SunRiseSet.getSunset(BigDecimal.valueOf(dfLonIn), BigDecimal.valueOf(dfLatIn), date);
 
         Date dt1 = null;
         Date dt2 = null;

+ 2 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/QuartzController.java

@@ -67,11 +67,11 @@ public class QuartzController {
   @SneakyThrows
   @PutMapping(value = "quartzs")
   public ResponseVO stateQuartz(@RequestBody final Quartz qt) {
-    final boolean flag = quartzService.save(qt);
+    boolean flag = quartzService.save(qt);
     if (flag) {
       return ResponseVO.success("修改成功!");
     } else {
-      return ResponseVO.success("修改成功!");
+      return ResponseVO.fail("修改失败!");
     }
   }
 

+ 1 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermService.java

@@ -130,7 +130,7 @@ public class ForecastPowerShortTermService extends BaseService {
         _forecastPowerShortTerm.getFpValue().multiply(openCapacityMap != null ? openCapacityMap.get(_forecastPowerShortTerm.getForecastTime()) : electricFieldInfo.getCapacity())
           .divide(electricFieldInfo.getCapacity(), 2, RoundingMode.HALF_UP);
 
-      forecastPowerShortTermHis.setAbleValue(ableValue.compareTo(lpl) == -1 ? lpl : ableValue);
+      forecastPowerShortTermHis.setAbleValue(ableValue.compareTo(lpl) < 0 ? lpl : ableValue);
       forecastPowerShortTermHis.setPredictionModelEnum(_forecastPowerShortTerm.getPredictionModelEnum());
       forecastPowerShortTermHis.setGenDate(new Date());
       forecastPowerShortTermHis.setSuCapacity(openCapacityMap != null ? openCapacityMap.get(_forecastPowerShortTerm.getForecastTime()) : electricFieldInfo.getCapacity());

+ 3 - 3
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerUltraShortTermService.java

@@ -177,7 +177,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
         PowerStationStatusData realPower = realPowerList.get(0);
         // 将实际功率替换到对应的超短期点位上
         ForecastPowerUltraShortTermHis d = forecastPowerUltraShortTermHiss.get(replacePoint - 1);
-        if (realPower.getRealValue().compareTo(new BigDecimal(0)) != -1) {
+        if (realPower.getRealValue().compareTo(new BigDecimal(0)) >=0) {
           d.setAbleValue(realPower.getRealValue());
         }
       }
@@ -187,7 +187,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
     BigDecimal lpl = new BigDecimal(lowerPredictionLimit);
 
     forecastPowerUltraShortTermHiss.forEach(s -> {
-      if (s.getAbleValue().compareTo(lpl) == -1) {
+      if (s.getAbleValue().compareTo(lpl) < 0) {
         s.setAbleValue(lpl);
       }
     });
@@ -367,7 +367,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
         forecastPowerUltraShortTerm.setForecastTime(forecastPowerShortTermList.get(i).getForecastTime());
         forecastPowerUltraShortTerm.setPredictionModelEnum(PredictionModelEnum.E9);
         forecastPowerUltraShortTerm.setCoefficientValue(ustPower);
-        forecastPowerUltraShortTerm.setDifferenceValue(new BigDecimal(-0.99).setScale(2, RoundingMode.HALF_UP));
+        forecastPowerUltraShortTerm.setDifferenceValue(BigDecimal.valueOf(-0.99).setScale(2, RoundingMode.HALF_UP));
         forecastPowerUltraShortTerm.setFpValue(ustPower);
         forecastPowerUltraShortTerm.setGenDate(new Date(monentTime));
         forecastPowerUltraShortTerm.setStationCode(stationCode);

+ 2 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/OverHaulPlanService.java

@@ -75,7 +75,7 @@ public class OverHaulPlanService {
    * 查询检修计划信息(分页)
    */
   public Page<OverhaulPlan> get(final OverhaulPlan overhaulPlan, final Integer page, final Integer size) {
-    getAll();
+//    getAll();
     ExampleMatcher matcher =
       ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains());
     Example<OverhaulPlan> example = Example.of(overhaulPlan, matcher);
@@ -88,7 +88,7 @@ public class OverHaulPlanService {
    * 查询检修计划信息(分页)
    */
   public Page<OverhaulPlan> getByStationCode(final OverhaulPlan overhaulPlan, final Integer page, final Integer size, final String stationCode) {
-    getAll();
+//    getAll();
     overhaulPlan.setStationCode(stationCode);
     ExampleMatcher matcher =
       ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains())

+ 8 - 6
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/util/ByteUtil.java

@@ -187,7 +187,7 @@ public abstract class ByteUtil {
     for (int i = 0; i < byteArray.length; i++) {//因为是16进制,最多只会占用4位,转换成字节需要两个16进制的字符,高位在先
       byte high = (byte) (Character.digit(hexString.charAt(k), 16) & 0xff);
       byte low = (byte) (Character.digit(hexString.charAt(k + 1), 16) & 0xff);
-      byteArray[i] = (byte) (high << 4 | low);
+      byteArray[i] = (byte) (high << 4 | low & 0xff);
       k += 2;
     }
     return byteArray;
@@ -200,18 +200,20 @@ public abstract class ByteUtil {
    * @return string
    */
   public static String Byte2String(byte[] ba) {
-    if (ba == null || ba.length == 0) {
-      return null;
-    }
+    if(ba == null || ba.length == 0)
+    { return null;}
     Formatter f = new Formatter();
+    String resultStr;
     try {
       for (int i = 0; i < ba.length; ++i) {
         f.format("%02x ", ba[i]);
       }
-    } finally {
+      resultStr = f.toString();
+    }
+    finally {
       f.close();
     }
-    return f.toString();
+    return resultStr;
   }
 
   /**