1:回归方程精度修改
parent
a64b448365
commit
1c20338cbb
|
|
@ -57,4 +57,11 @@ public interface JcskSyBMapper extends BaseMapper<JcskSyB> {
|
|||
</script>
|
||||
""")
|
||||
String selectDvcdByStcdAndMpcd(@Param("stcd")String stcd,@Param("mpcd") String mpcd);
|
||||
|
||||
|
||||
@Select("""
|
||||
select DISTINCT(t1.dvcd) from jcsk_sy_b t1
|
||||
""")
|
||||
List<String> selectAllDvcd();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.gunshi.project.hsz.common.model;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.db.annotation.IgnoreAutoMapperAndDao;
|
||||
import com.gunshi.project.hsz.common.model.vo.JcskByRProcessVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
|
@ -59,6 +60,7 @@ public class JcskByR {
|
|||
* 观测时间2
|
||||
*/
|
||||
@TableField("ob_date")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime obDate;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ public class JcskGnssR {
|
|||
* 监测时间
|
||||
*/
|
||||
@TableField("tm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime tm;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class JcskSyR {
|
|||
* 测量时间
|
||||
*/
|
||||
@TableField("mstm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime mstm;
|
||||
|
||||
/**
|
||||
|
|
@ -79,6 +80,7 @@ public class JcskSyR {
|
|||
* 更新时间
|
||||
*/
|
||||
@TableField("update_tm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime updateTm;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ public class DebugController {
|
|||
@Autowired
|
||||
private WarningRuleTask warningRuleTask;
|
||||
|
||||
@GetMapping("/syRegressionCaculate")
|
||||
public String syRegressionCaculate(){
|
||||
try {
|
||||
jcskDataTask.calculate();
|
||||
return "SUCCESS";
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/warnRule")
|
||||
public String warningRuleTast(){
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class ForecastDispatchPlan implements Serializable {
|
|||
@Schema(description = "开始时间")
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime startTm;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
|
|
@ -74,7 +74,7 @@ public class ForecastDispatchPlan implements Serializable {
|
|||
@Schema(description = "结束时间")
|
||||
@NotNull(message = "结束时间不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime endTime;
|
||||
private LocalDateTime endTm;
|
||||
|
||||
/**
|
||||
* 制定时间
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class ForecastDispatchPlanService extends ServiceImpl<ForecastDispatchPla
|
|||
queryWrapper.like(ForecastDispatchPlan::getPlanName, pageSo.getPlanName());
|
||||
}
|
||||
Page<ForecastDispatchPlan> forecastDispatchPlanPage = this.baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
queryWrapper.orderByDesc(ForecastDispatchPlan::getCreateTime);
|
||||
for (ForecastDispatchPlan record : forecastDispatchPlanPage.getRecords()) {
|
||||
List<ForecastDispatchCommand> forecastDispatchCommandList = forecastDispatchCommandService.lambdaQuery().eq(ForecastDispatchCommand::getPlanId, record.getId()).list();
|
||||
record.setForecastDispatchCommands(forecastDispatchCommandList);
|
||||
|
|
@ -233,8 +234,8 @@ public class ForecastDispatchPlanService extends ServiceImpl<ForecastDispatchPla
|
|||
// 基本信息数据
|
||||
Row dataRow = sheet.createRow(startRow++);
|
||||
int colNum = 0;
|
||||
dataRow.createCell(colNum++).setCellValue(formatDateTime(plan.getStartTime()));
|
||||
dataRow.createCell(colNum++).setCellValue(formatDateTime(plan.getEndTime()));
|
||||
dataRow.createCell(colNum++).setCellValue(formatDateTime(plan.getStartTm()));
|
||||
dataRow.createCell(colNum++).setCellValue(formatDateTime(plan.getEndTm()));
|
||||
dataRow.createCell(colNum++).setCellValue(formatDateTime(plan.getCreateTime()));
|
||||
dataRow.createCell(colNum++).setCellValue(getStringValue(plan.getCreator()));
|
||||
dataRow.createCell(colNum).setCellValue(plan.getReservoirControlLevel() != null ?
|
||||
|
|
|
|||
|
|
@ -52,4 +52,8 @@ public class JcskSyBService extends ServiceImpl<JcskSyBMapper, JcskSyB> {
|
|||
public String getDvcdByStcdAndMpcd(String stcd, String mpcd) {
|
||||
return this.baseMapper.selectDvcdByStcdAndMpcd(stcd,mpcd);
|
||||
}
|
||||
|
||||
public List<String> getAllDvcd() {
|
||||
return this.baseMapper.selectAllDvcd();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||
import com.gunshi.project.hsz.common.model.JcskSyR;
|
||||
import com.gunshi.project.hsz.common.model.vo.*;
|
||||
import com.gunshi.project.hsz.common.util.LocalDateTimeConverter;
|
||||
import com.gunshi.project.hsz.entity.dto.ArtificialJcskSyDeleteDto;
|
||||
import com.gunshi.project.hsz.common.model.so.JcskSyRPageSo;
|
||||
import com.gunshi.project.hsz.common.model.so.OsmoticDetailQuerySo;
|
||||
|
|
@ -796,6 +797,17 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
|
|||
* @return
|
||||
*/
|
||||
public ProjectSafeCalculateVo calculate(@NotNull ProjectSafeCalculateDto dto) {
|
||||
/**
|
||||
* 首先startTime和endTime有没有数据
|
||||
*
|
||||
* */
|
||||
LambdaQueryWrapper<SyRegressionData> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SyRegressionData::getDvcd,dto.getDvcd());
|
||||
wrapper.eq(SyRegressionData::getStartTime,dto.getDateTimeRangeSo().getStart());
|
||||
wrapper.eq(SyRegressionData::getEndTime,dto.getDateTimeRangeSo().getEnd());
|
||||
wrapper.orderByAsc(SyRegressionData::getOrder);
|
||||
List<SyRegressionData> queryData = syRegressionDataService.getBaseMapper().selectList(wrapper);
|
||||
if(!queryData.isEmpty()){
|
||||
LambdaQueryWrapper<JcskSyB> queryWrapper = new LambdaQueryWrapper<>();
|
||||
ProjectSafeCalculateVo res = new ProjectSafeCalculateVo();
|
||||
//根据dvcd查询stcd和mpcd
|
||||
|
|
@ -813,7 +825,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
|
|||
List<JcskSyREightAm> jcskSyREightAms = jcskSyREightAmMapper.selectList(eightAmLambdaQueryWrapper);
|
||||
AttResBase attResBase = attResBaseService.list().get(0);
|
||||
OsmoticQuerySo querySo = new OsmoticQuerySo();
|
||||
querySo.setDateTimeRangeSo(dto.getDateTimeRangeSo());
|
||||
DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
||||
dateTimeRangeSo.setStart(dto.getDateTimeRangeSo().getStart());
|
||||
dateTimeRangeSo.setEnd(dto.getDateTimeRangeSo().getEnd());
|
||||
querySo.setDateTimeRangeSo(dateTimeRangeSo);
|
||||
List<StRzVo> stRzVos = baseMapper.qeury8AmRz(querySo,attResBase.getStcd());
|
||||
Map<String, BigDecimal> rzMap = stRzVos.stream()
|
||||
.collect(Collectors.toMap(
|
||||
|
|
@ -860,6 +875,81 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
|
|||
if(data.isEmpty()){
|
||||
return res;
|
||||
}
|
||||
res.setDatas(data);
|
||||
res.setOne(queryData.get(0) != null?queryData.get(0).getRegressionEquation():null);
|
||||
res.setTwo(queryData.get(1) != null?queryData.get(1).getRegressionEquation():null);
|
||||
res.setThree(queryData.get(2) != null?queryData.get(2).getRegressionEquation():null);
|
||||
res.setFour(queryData.get(3) != null?queryData.get(3).getRegressionEquation():null);
|
||||
return res;
|
||||
}else{
|
||||
LambdaQueryWrapper<JcskSyB> queryWrapper = new LambdaQueryWrapper<>();
|
||||
ProjectSafeCalculateVo res = new ProjectSafeCalculateVo();
|
||||
//根据dvcd查询stcd和mpcd
|
||||
queryWrapper.eq(JcskSyB::getDvcd, dto.getDvcd());
|
||||
JcskSyB jcskSyB = jcskSyBService.getBaseMapper().selectOne(queryWrapper);
|
||||
String stcd = jcskSyB.getStcd();
|
||||
String mpcd = jcskSyB.getMpcd();
|
||||
//取得这个时间段得所有八点得数据
|
||||
LambdaQueryWrapper<JcskSyREightAm> eightAmLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
eightAmLambdaQueryWrapper.eq(JcskSyREightAm::getStcd, stcd);
|
||||
eightAmLambdaQueryWrapper.eq(JcskSyREightAm::getMpcd, mpcd);
|
||||
eightAmLambdaQueryWrapper.ge(JcskSyREightAm::getMstm,dto.getDateTimeRangeSo().getStart());
|
||||
eightAmLambdaQueryWrapper.le(JcskSyREightAm::getMstm,dto.getDateTimeRangeSo().getEnd());
|
||||
eightAmLambdaQueryWrapper.orderByAsc(JcskSyREightAm::getMstm);
|
||||
List<JcskSyREightAm> jcskSyREightAms = jcskSyREightAmMapper.selectList(eightAmLambdaQueryWrapper);
|
||||
AttResBase attResBase = attResBaseService.list().get(0);
|
||||
OsmoticQuerySo querySo = new OsmoticQuerySo();
|
||||
DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
||||
dateTimeRangeSo.setStart(dto.getDateTimeRangeSo().getStart());
|
||||
dateTimeRangeSo.setEnd(dto.getDateTimeRangeSo().getEnd());
|
||||
querySo.setDateTimeRangeSo(dateTimeRangeSo);
|
||||
List<StRzVo> stRzVos = baseMapper.qeury8AmRz(querySo,attResBase.getStcd());
|
||||
Map<String, BigDecimal> rzMap = stRzVos.stream()
|
||||
.collect(Collectors.toMap(
|
||||
StRzVo::getTm, // key: 时间
|
||||
StRzVo::getRz, // value: 水位
|
||||
(existing, replacement) -> existing // 如果key冲突,保留已存在的
|
||||
));
|
||||
//组合成为 时间 库水位 管道水位的数据
|
||||
List<OsmoticPressDetailVo> data = new ArrayList<>();
|
||||
Iterator<JcskSyREightAm> iterator = jcskSyREightAms.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
JcskSyREightAm eightAm = iterator.next();
|
||||
if(eightAm.getMstm() == null || eightAm.getSpprwl() == null){
|
||||
iterator.remove();
|
||||
}
|
||||
OsmoticPressDetailVo detailVo = new OsmoticPressDetailVo();
|
||||
|
||||
// 设置监测时间和监测值(管道水位)
|
||||
String mstmStr = eightAm.getMstm().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
detailVo.setTm(mstmStr);
|
||||
detailVo.setValue(eightAm.getSpprwl());
|
||||
|
||||
// 查找对应的库水位
|
||||
BigDecimal rzValue = findClosestRzValue(rzMap, mstmStr);
|
||||
if(rzValue == null){
|
||||
iterator.remove();
|
||||
}
|
||||
detailVo.setRz(rzValue);
|
||||
//获取数据清洗规则
|
||||
SyDataCheckRule rule = syDataCheckRuleService.getByDvcd(dto.getDvcd());
|
||||
if(rule != null && rule.getIsAvailable() == 1){
|
||||
//校验这条数据是否符合规则
|
||||
if(rzValue.compareTo(rule.getRz()) >=0){
|
||||
//如果当前库水位大于等于设置库水位,则跳过这条数据
|
||||
iterator.remove();
|
||||
}
|
||||
if(eightAm.getSpprwl().compareTo(rule.getSyValue()) <=0){
|
||||
//如果当前监测值小于等于设置值,则跳过这套数据
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
data.add(detailVo);
|
||||
}
|
||||
if(data.isEmpty()){
|
||||
return res;
|
||||
}
|
||||
res.setDatas(data);
|
||||
List<SyRegressionData> saves = new ArrayList<>();
|
||||
RegressionEquation first = RegressionAnalysis.calculateLinear(data);
|
||||
LocalDateTime createTime = LocalDateTime.now();
|
||||
|
|
@ -926,10 +1016,10 @@ public class JcskSyRService extends ServiceImpl<JcskSyRMapper, JcskSyR> {
|
|||
syRegressionData.setCreateTime(createTime);
|
||||
saves.add(syRegressionData);
|
||||
}
|
||||
res.setDatas(data);
|
||||
syRegressionDataService.saveBatch(saves);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找最接近的库水位值
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
*/
|
||||
if (isMonthInKaPeriod(sortedMonth, kaStartTime, kaEndTime)) {
|
||||
int kaDaysInMonth = calculateKaDaysInMonth(kaStartTime, kaEndTime, sortedMonth);
|
||||
BigDecimal kaConsumption = kaQuota.divide(BigDecimal.valueOf(totalKaDays), 100, RoundingMode.HALF_UP)
|
||||
BigDecimal kaConsumption = kaQuota.divide(BigDecimal.valueOf(totalKaDays), 2, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(kaDaysInMonth));
|
||||
irrigationVolume = irrigationVolume.add(kaConsumption);
|
||||
}
|
||||
|
|
@ -326,8 +326,8 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
// irrigationVolume = BigDecimal.ZERO;
|
||||
// }
|
||||
|
||||
// 保留1位小数
|
||||
irrigationVolume = irrigationVolume.setScale(2, RoundingMode.HALF_UP);
|
||||
// 保留2位小数
|
||||
irrigationVolume = irrigationVolume.setScale(2,RoundingMode.UP);
|
||||
|
||||
riceIrrigationUse.setIrrigationUse(irrigationVolume);
|
||||
res.add(riceIrrigationUse);
|
||||
|
|
@ -369,7 +369,7 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
* 那么计算公式为 返青期耗水量/返青期天数11天*返青期四月份天数(ps 泡田期在四月份的耗水量已经计算完了)
|
||||
*/
|
||||
BigDecimal dailyConsumption = growPeriod.getWaterRqStage()
|
||||
.divide(BigDecimal.valueOf(growPeriod.getDays()), 10, RoundingMode.HALF_UP);
|
||||
.divide(BigDecimal.valueOf(growPeriod.getDays()), 2, RoundingMode.HALF_UP);
|
||||
//再去乘当前阶段在当前月份的天数
|
||||
BigDecimal monthlyConsumption = dailyConsumption.multiply(BigDecimal.valueOf(daysInMonth));
|
||||
totalConsumption = totalConsumption.add(monthlyConsumption);
|
||||
|
|
@ -480,10 +480,10 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
BigDecimal irrigationUse = riceIrrigationUse.getIrrigationUse();
|
||||
// 计算公式:2/3 * irrigationUse * sArea / 10000
|
||||
BigDecimal value = new BigDecimal("2")
|
||||
.divide(new BigDecimal("3"), 10, RoundingMode.HALF_UP) // 2/3,保留10位小数
|
||||
.divide(new BigDecimal("3"), 9, RoundingMode.HALF_UP) // 2/3,保留10位小数
|
||||
.multiply(irrigationUse)
|
||||
.multiply(sArea)
|
||||
.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); // 除以10000,保留2位小数
|
||||
.divide(new BigDecimal("10000")); // 除以10000,保留2位小数
|
||||
|
||||
entity.setIrrigationUse(value);
|
||||
res.add(entity);
|
||||
|
|
@ -524,7 +524,7 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
LocalDateTime startTime = riceWaterKi.getStartTime();
|
||||
LocalDateTime endTime = riceWaterKi.getEndTime();
|
||||
BigDecimal irrigationUse = calculateIrrigationUse(riceWaterKi, rainfallList, startTime, endTime);
|
||||
data.setIrrigationUse(irrigationUse.setScale(2,RoundingMode.UP));
|
||||
data.setIrrigationUse(irrigationUse.setScale(2,RoundingMode.HALF_UP));
|
||||
res.add(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -533,10 +533,10 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
BigDecimal irrigationUse = re.getIrrigationUse();
|
||||
|
||||
BigDecimal value = new BigDecimal("2")
|
||||
.divide(new BigDecimal("3"), 10, RoundingMode.HALF_UP) // 2/3,保留10位小数
|
||||
.divide(new BigDecimal("3"), 9, RoundingMode.HALF_UP) // 2/3,保留10位小数
|
||||
.multiply(irrigationUse)
|
||||
.multiply(sArea)
|
||||
.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); // 除以10000,保留2位小数
|
||||
.divide(new BigDecimal("10000")); // 除以10000,保留2位小数
|
||||
re.setIrrigationUse(value);
|
||||
}
|
||||
return res;
|
||||
|
|
@ -605,7 +605,7 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
// 按实际使用天数比例计算有效降雨量
|
||||
return originalRainfall
|
||||
.multiply(BigDecimal.valueOf(daysInMonth))
|
||||
.divide(BigDecimal.valueOf(totalDaysInMonth), 10, RoundingMode.HALF_UP);
|
||||
.divide(BigDecimal.valueOf(totalDaysInMonth), 2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
return BigDecimal.ZERO;
|
||||
|
|
@ -622,6 +622,7 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
BigDecimal monthTotal = BigDecimal.ZERO;
|
||||
for (RiceWaterForecastMonth riceWaterForecastMonth : riceWaterForecastMonths) {
|
||||
monthTotal = monthTotal.add(riceWaterForecastMonth.getIrrigationUse());
|
||||
// riceWaterForecastMonth.setIrrigationUse(riceWaterForecastMonth.getIrrigationUse().setScale(2,RoundingMode.HALF_UP));
|
||||
}
|
||||
riceGrowConfig.setIrrigationUse(monthTotal);
|
||||
//计算灌区水稻用水量-按周期
|
||||
|
|
@ -629,9 +630,10 @@ public class RiceRqWaterService extends ServiceImpl<RiceRqWaterMapper, RiceRqWat
|
|||
BigDecimal cycleTotal = BigDecimal.ZERO;
|
||||
for (RiceWaterForecastCycle riceWaterForecastCycle : riceWaterForecastCycles) {
|
||||
cycleTotal = cycleTotal.add(riceWaterForecastCycle.getIrrigationUse());
|
||||
// riceWaterForecastCycle.setIrrigationUse(riceWaterForecastCycle.getIrrigationUse().setScale(2,RoundingMode.HALF_UP));
|
||||
}
|
||||
vo.setIrrigationMonthTotalUse(monthTotal);
|
||||
vo.setIrrigationCycleTotalUse(cycleTotal);
|
||||
vo.setIrrigationMonthTotalUse(monthTotal.setScale(2,RoundingMode.HALF_UP));
|
||||
vo.setIrrigationCycleTotalUse(cycleTotal.setScale(2,RoundingMode.HALF_UP));
|
||||
vo.setRiceWaterKis(riceWaterKis);
|
||||
vo.setRiceWaterForecastMonths(riceWaterForecastMonths);
|
||||
vo.setRiceWaterForecastCycles(riceWaterForecastCycles);
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@ public class RiceSupportBalanceService extends ServiceImpl<RiceSupportBalanceMap
|
|||
if(!StringUtils.isBlank(pageSo.getIcplanName())){
|
||||
queryWrapper.like(IcWaterForecast::getPlanName, pageSo.getIcplanName());
|
||||
}
|
||||
queryWrapper.orderByDesc(IcWaterForecast::getCreateTime);
|
||||
Page<IcWaterForecast> icWaterForecastPage = icWaterForecastService.getBaseMapper().selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
for (IcWaterForecast record : icWaterForecastPage.getRecords()) {
|
||||
List<IcWaterForecastDetail> icWaterForecastDetails = icWaterForecastDetailService.listByForecastId(record.getId());
|
||||
|
|
@ -340,6 +341,7 @@ public class RiceSupportBalanceService extends ServiceImpl<RiceSupportBalanceMap
|
|||
queryWrapper.like(RiceRqWater::getPlanName, pageSo.getRcplanName());
|
||||
}
|
||||
queryWrapper.in(RiceRqWater::getYear, yearByRangeDate);
|
||||
queryWrapper.orderByDesc(RiceRqWater::getCreateTime);
|
||||
Page<RiceRqWater> riceRqWaterPage = riceRqWaterService.getBaseMapper().selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
List<RiceRqWater> records = riceRqWaterPage.getRecords();
|
||||
for (RiceRqWater record : records) {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,14 @@ package com.gunshi.project.hsz.timetask;
|
|||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||
import com.gunshi.project.hsz.common.model.*;
|
||||
import com.gunshi.project.hsz.common.model.so.OsmoticQuerySo;
|
||||
import com.gunshi.project.hsz.common.model.vo.OsmoticShiftValueVo2;
|
||||
import com.gunshi.project.hsz.common.util.LocalDateTimeConverter;
|
||||
import com.gunshi.project.hsz.entity.dto.ProjectSafeCalculateDto;
|
||||
import com.gunshi.project.hsz.entity.vo.ProjectSafeCalculateVo;
|
||||
import com.gunshi.project.hsz.mapper.JcskGnssREightAmMapper;
|
||||
import com.gunshi.project.hsz.common.mapper.JcskSlBMapper;
|
||||
import com.gunshi.project.hsz.mapper.JcskSlREightAmMapper;
|
||||
|
|
@ -14,6 +18,7 @@ import com.gunshi.project.hsz.model.*;
|
|||
import com.gunshi.project.hsz.service.*;
|
||||
import com.gunshi.project.hsz.util.DateTransforUtil;
|
||||
import com.gunshi.project.hsz.util.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -22,6 +27,8 @@ import org.springframework.scheduling.annotation.Async;
|
|||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -78,6 +85,24 @@ public class JcskDataTask {
|
|||
|
||||
public static final Integer GNSS = 3;
|
||||
|
||||
// @Scheduled(cron = "0 30 8 * * ?")
|
||||
@Async
|
||||
public void calculate(){
|
||||
List<String> dvcds = jcskSyBService.getAllDvcd();
|
||||
for (String dvcd : dvcds) {
|
||||
ProjectSafeCalculateDto dto = new ProjectSafeCalculateDto();
|
||||
LocalDateTime now = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).withNano(0);
|
||||
LocalDateTime lastYear = now.minusYears(1);
|
||||
lastYear = lastYear.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
||||
DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
||||
dateTimeRangeSo.setStart(LocalDateTimeConverter.toDate(lastYear));
|
||||
dateTimeRangeSo.setEnd(LocalDateTimeConverter.toDate(now));
|
||||
dto.setDateTimeRangeSo(dateTimeRangeSo);
|
||||
dto.setDvcd(dvcd);
|
||||
ProjectSafeCalculateVo ans = jcskSyRService.calculate(dto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 每5分钟扫描渗流。渗压、位移表 生成预警
|
||||
|
|
|
|||
Loading…
Reference in New Issue