|
@@ -0,0 +1,37 @@
|
|
|
+package com.jiayue.ipfcst.console.service;
|
|
|
+
|
|
|
+import com.jiayue.ipfcst.common.data.entity.*;
|
|
|
+import com.jiayue.ipfcst.common.data.repository.ForecastPowerShortTermOneRepository;
|
|
|
+import com.jiayue.ipfcst.common.data.service.BaseService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+public class ForecastPowerShortTermOneService extends BaseService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ForecastPowerShortTermOneRepository forecastPowerShortTermOneRepository;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按时间段删除数据
|
|
|
+ *
|
|
|
+ * @param startTime
|
|
|
+ * @param endTime
|
|
|
+ * @param listDq
|
|
|
+ */
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED)
|
|
|
+ public void deleteBetweenAndGenTime(Long startTime, Long endTime, List<ForecastPowerShortTermOne> listDq) {
|
|
|
+ forecastPowerShortTermOneRepository.deleteByForecastTimeBetween(startTime, endTime);
|
|
|
+ //保存短期数据
|
|
|
+ forecastPowerShortTermOneRepository.saveAll(listDq);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|