Commit a4d6eec7 authored by chenzhao's avatar chenzhao

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

parent cd67f54d
......@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -47,6 +48,8 @@ public class TestController extends BaseController {
IndicatorDataMapper indicatorDataMapper;
@Autowired
CommonServiceImpl commonService;
@Autowired
HealthStatusIndicatorServiceImpl healthStatusIndicatorService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test1", notes = "test1")
......@@ -162,29 +165,13 @@ public class TestController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "test2", notes = "test1")
@GetMapping("/set-date")
@GetMapping("/test123")
public void clearRecord() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String d = sdf.format(new Date());
LambdaQueryWrapper<FanWarningRecord> wf = new LambdaQueryWrapper<>();
wf.isNull(FanWarningRecord::getDisposotionDate);
List<FanWarningRecord> list = fanWaringRecordMapper.selectList(wf);
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);
}
Date time = new Date();
time = DateUtil.offsetMinute(time, -DateUtil.minute(time) % 10);
String format = DateUtil.format(time, "yyyy-MM-dd HH:mm:00");
time = DateUtil.parse(format, "yyyy-MM-dd HH:mm:00");
healthStatusIndicatorService.healthWarningMinuteGF(time);
}
@TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
......
......@@ -2694,7 +2694,7 @@ public class CommonServiceImpl {
BeanUtil.copyProperties(idxBizPvHealthIndex, pvHealthIndex);
pvHealthIndex.setWeight(idxBizPvHealthIndex.getWeigth());
pvHealthIndex.setAnomaly(idxBizPvHealthIndex.getANOMALY());
pvHealthIndex.setRecDate(DateUtil.now());
pvHealthIndex.setRecDate(format);
pvHealthIndex.setArea(idxBizPvHealthIndex.getArae());
pvHealthIndex.setAnalysisTime(format);
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