优化属性类型
parent
a2624d4510
commit
6e0b120ec6
|
|
@ -57,8 +57,8 @@ public class ForecastUseparam extends GenericPageParams implements Serializable
|
||||||
@TableField(value="param_code")
|
@TableField(value="param_code")
|
||||||
@Schema(description="参数名")
|
@Schema(description="参数名")
|
||||||
@Size(max = 255,message = "参数名最大长度要小于 255")
|
@Size(max = 255,message = "参数名最大长度要小于 255")
|
||||||
// @NotBlank(message = "参数名不能为空")
|
@NotBlank(message = "参数名不能为空")
|
||||||
// @NotNull(message = "参数名不能为空")
|
@NotNull(message = "参数名不能为空")
|
||||||
private String paramCode;
|
private String paramCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,18 +67,8 @@ public class ForecastUseparam extends GenericPageParams implements Serializable
|
||||||
@TableField(value="param_value")
|
@TableField(value="param_value")
|
||||||
@Schema(description="参数值")
|
@Schema(description="参数值")
|
||||||
@Size(max = 255,message = "参数值最大长度要小于 255")
|
@Size(max = 255,message = "参数值最大长度要小于 255")
|
||||||
@NotBlank(message = "参数值不能为空")
|
|
||||||
@NotNull(message = "参数值不能为空")
|
|
||||||
private String paramValue;
|
private String paramValue;
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数单位
|
|
||||||
*/
|
|
||||||
@TableField(value="param_unit")
|
|
||||||
@Schema(description="参数单位")
|
|
||||||
@Size(max = 255,message = "参数单位最大长度要小于 255")
|
|
||||||
private String paramUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数排序
|
* 参数排序
|
||||||
*/
|
*/
|
||||||
|
|
@ -92,7 +82,7 @@ public class ForecastUseparam extends GenericPageParams implements Serializable
|
||||||
@TableField(value="param_remarks")
|
@TableField(value="param_remarks")
|
||||||
@Schema(description="参数描述")
|
@Schema(description="参数描述")
|
||||||
@Size(max = 255,message = "参数描述最大长度要小于 255")
|
@Size(max = 255,message = "参数描述最大长度要小于 255")
|
||||||
private String paramRemarks;
|
private String paramDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
|
|
@ -110,4 +100,26 @@ public class ForecastUseparam extends GenericPageParams implements Serializable
|
||||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数类型(1:普通类型,一对一;2:一对多,k;3:多对多,PPaR)
|
||||||
|
*/
|
||||||
|
@TableField(value="param_type")
|
||||||
|
@Schema(description="参数类型(1:普通类型,一对一;2:一对多;3多对多)")
|
||||||
|
private String paramType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能码(前端调用引导)
|
||||||
|
*/
|
||||||
|
@TableField(value="ability_code")
|
||||||
|
@Schema(description="功能码(前端调用引导)")
|
||||||
|
@Size(max = 255,message = "功能码最大长度要小于 255")
|
||||||
|
private String abilityCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField(value="remarks")
|
||||||
|
@Schema(description="备注")
|
||||||
|
@Size(max = 255,message = "备注最大长度要小于 255")
|
||||||
|
private String remarks;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,18 +192,15 @@ public class ForecastResultsService extends ServiceImpl<ForecastResultsMapper, F
|
||||||
ForecastPa forecastPa = paMap.get(sdfDay.format(cal.getTime()));
|
ForecastPa forecastPa = paMap.get(sdfDay.format(cal.getTime()));
|
||||||
// 根据降雨数据,按照△t的颗粒度,均分
|
// 根据降雨数据,按照△t的颗粒度,均分
|
||||||
List<String> pResultList = new ArrayList<>();
|
List<String> pResultList = new ArrayList<>();
|
||||||
// 筛选时间段内的降雨数据。第一个条件:时间大于等于开始时间;第二个条件:时间小于等于结束时间(包前不包后,但是需要使用最后的tm计算间隔值)
|
// 筛选时间段内的降雨数据。第一个条件:时间大于等开始时间;第二个条件:时间小于等于结束时间(不包前但包后,比如从8点开始,就要拆下一个时间:9点的数据)
|
||||||
List<StPptnR> filterList = pptnRAllList.stream().filter(e -> e.getTm().compareTo(period[0]) >= 0).filter(e -> e.getTm().compareTo(period[1]) <= 0).collect(Collectors.toList());
|
List<StPptnR> filterList = pptnRAllList.stream().filter(e -> e.getTm().compareTo(period[0]) >= 0).filter(e -> e.getTm().compareTo(period[1]) <= 0).collect(Collectors.toList());
|
||||||
for (int i = 0; i < filterList.size(); i++) {
|
// 从第二条数据开始
|
||||||
// 到第二天早八,包前不包后,最后一条的第二天早八剔除
|
for (int i = 1; i <= filterList.size(); i++) {
|
||||||
if (i + 1 == filterList.size()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
StPptnR stPptnR = filterList.get(i);
|
StPptnR stPptnR = filterList.get(i);
|
||||||
String drp = stPptnR.getDrp();
|
String drp = stPptnR.getDrp();
|
||||||
StPptnR stPptnRNext = filterList.get(i + 1);
|
StPptnR stPptnRLast = filterList.get(i - 1);
|
||||||
// 两条数据的小时差
|
// 两条数据的小时差
|
||||||
double diffHours = dateHourDifference(stPptnR.getTm(), stPptnRNext.getTm());
|
double diffHours = dateHourDifference(stPptnRLast.getTm(), stPptnR.getTm());
|
||||||
// 两条数据间需要增补几条
|
// 两条数据间需要增补几条
|
||||||
int floorNum = (int) Math.floor(diffHours / dt);
|
int floorNum = (int) Math.floor(diffHours / dt);
|
||||||
for (int j = 0; j < floorNum; j++) {
|
for (int j = 0; j < floorNum; j++) {
|
||||||
|
|
@ -337,9 +334,7 @@ public class ForecastResultsService extends ServiceImpl<ForecastResultsMapper, F
|
||||||
// 两条数据的小时差
|
// 两条数据的小时差
|
||||||
double diffHours = dateHourDifference(stRsvrR.getTm(), stRsvrRNext.getTm());
|
double diffHours = dateHourDifference(stRsvrR.getTm(), stRsvrRNext.getTm());
|
||||||
int floorNum = (int) Math.floor(diffHours / dt);
|
int floorNum = (int) Math.floor(diffHours / dt);
|
||||||
BigDecimal meanDifference =
|
BigDecimal meanDifference = new BigDecimal(stRsvrRNext.getRz()).subtract(new BigDecimal(drp)).divide(new BigDecimal(floorNum), BigDecimal.ROUND_HALF_UP, 2);
|
||||||
new BigDecimal(stRsvrRNext.getRz()).subtract(new BigDecimal(drp)).divide(new BigDecimal(floorNum),
|
|
||||||
BigDecimal.ROUND_HALF_UP, 2);
|
|
||||||
for (int j = 1; j < floorNum; j++) {
|
for (int j = 1; j < floorNum; j++) {
|
||||||
// 增补出的数据
|
// 增补出的数据
|
||||||
StRsvrR suppleStRsvrR = new StRsvrR();
|
StRsvrR suppleStRsvrR = new StRsvrR();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue