Commit a4d6eec7 authored by chenzhao's avatar chenzhao

修改分析光伏预警生成数据不对

parent cd67f54d
...@@ -9,6 +9,7 @@ import java.util.Map; ...@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -47,6 +48,8 @@ public class TestController extends BaseController { ...@@ -47,6 +48,8 @@ public class TestController extends BaseController {
IndicatorDataMapper indicatorDataMapper; IndicatorDataMapper indicatorDataMapper;
@Autowired @Autowired
CommonServiceImpl commonService; CommonServiceImpl commonService;
@Autowired
HealthStatusIndicatorServiceImpl healthStatusIndicatorService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test1", notes = "test1") @ApiOperation(httpMethod = "GET", value = "test1", notes = "test1")
...@@ -162,29 +165,13 @@ public class TestController extends BaseController { ...@@ -162,29 +165,13 @@ public class TestController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test2", notes = "test1") @ApiOperation(httpMethod = "GET", value = "test2", notes = "test1")
@GetMapping("/set-date") @GetMapping("/test123")
public void clearRecord() { public void clearRecord() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date time = new Date();
String d = sdf.format(new Date()); time = DateUtil.offsetMinute(time, -DateUtil.minute(time) % 10);
LambdaQueryWrapper<FanWarningRecord> wf = new LambdaQueryWrapper<>(); String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
wf.isNull(FanWarningRecord::getDisposotionDate); time = DateUtil.parse(format, "yyyy-MM-dd HH:mm:00");
List<FanWarningRecord> list = fanWaringRecordMapper.selectList(wf); healthStatusIndicatorService.healthWarningMinuteGF(time);
if (!list.isEmpty()) {
list.forEach(i -> {
i.setDisposotionDate(d);
});
fanWaringRecordMapper.saveBatchWarningRecords(list);
}
LambdaQueryWrapper<PvWarningRecord> pf = new LambdaQueryWrapper<>();
pf.isNull(PvWarningRecord::getDisposotionDate);
List<PvWarningRecord> list1 = pvWaringRecordMapper.selectList(pf);
if (!list1.isEmpty()) {
list1.forEach(i -> {
i.setDisposotionDate(d);
});
pvWaringRecordMapper.saveBatchWarningRecords(list1);
}
} }
@TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false) @TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
......
...@@ -2694,7 +2694,7 @@ public class CommonServiceImpl { ...@@ -2694,7 +2694,7 @@ public class CommonServiceImpl {
BeanUtil.copyProperties(idxBizPvHealthIndex, pvHealthIndex); BeanUtil.copyProperties(idxBizPvHealthIndex, pvHealthIndex);
pvHealthIndex.setWeight(idxBizPvHealthIndex.getWeigth()); pvHealthIndex.setWeight(idxBizPvHealthIndex.getWeigth());
pvHealthIndex.setAnomaly(idxBizPvHealthIndex.getANOMALY()); pvHealthIndex.setAnomaly(idxBizPvHealthIndex.getANOMALY());
pvHealthIndex.setRecDate(DateUtil.now()); pvHealthIndex.setRecDate(format);
pvHealthIndex.setArea(idxBizPvHealthIndex.getArae()); pvHealthIndex.setArea(idxBizPvHealthIndex.getArae());
pvHealthIndex.setAnalysisTime(format); pvHealthIndex.setAnalysisTime(format);
pvHealthIndex.setHealthLevel(idxBizPvHealthIndex.getHealthLevel()); pvHealthIndex.setHealthLevel(idxBizPvHealthIndex.getHealthLevel());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment