1.调整源下发参数单位信息
This commit is contained in:
@@ -27,13 +27,13 @@ public class PqErrSysDtlsParam {
|
||||
private String scriptType;
|
||||
|
||||
@ApiModelProperty(value = "误差判断起始值", required = true)
|
||||
private Float startValue;
|
||||
private Double startValue;
|
||||
|
||||
@ApiModelProperty(value = "是否包含起始值", required = true)
|
||||
private Integer startFlag;
|
||||
|
||||
@ApiModelProperty(value = "误差判断结束值", required = true)
|
||||
private Float endValue;
|
||||
private Double endValue;
|
||||
|
||||
@ApiModelProperty(value = "是否包含结束值", required = true)
|
||||
private Integer endFlag;
|
||||
@@ -48,7 +48,7 @@ public class PqErrSysDtlsParam {
|
||||
|
||||
@ApiModelProperty(value = "最大值误差", required = true)
|
||||
@NotNull(message = DevValidMessage.MAX_ERROR_VALUE_NOT_NULL)
|
||||
private Float maxErrorValue;
|
||||
private Double maxErrorValue;
|
||||
|
||||
@ApiModelProperty(value = "误差值类型", required = true)
|
||||
@NotNull(message = DevValidMessage.ERROR_VALUE_TYPE_NOT_BLANK)
|
||||
|
||||
@@ -73,6 +73,7 @@ public class PqErrSysDtls implements Serializable {
|
||||
/**
|
||||
* 误差最大值
|
||||
*/
|
||||
@TableField("Max_Error_Value")
|
||||
private Double maxErrorValue;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -223,10 +224,16 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
if (isValueType) {
|
||||
for (PqScriptDtls pqScriptDtl : pqScriptDtls) {
|
||||
if (VOL.equals(pqScriptDtl.getValueType())) {
|
||||
pqScriptDtl.setValue(pqScriptDtl.getValue() * volt);
|
||||
BigDecimal volValue = new BigDecimal(pqScriptDtl.getValue());
|
||||
BigDecimal result = volValue.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)
|
||||
.multiply(new BigDecimal(volt.toString()));
|
||||
pqScriptDtl.setValue(result.doubleValue());
|
||||
}
|
||||
if (CUR.equals(pqScriptDtl.getValueType())) {
|
||||
pqScriptDtl.setValue(pqScriptDtl.getValue() * curr);
|
||||
BigDecimal volValue = new BigDecimal(pqScriptDtl.getValue());
|
||||
BigDecimal result = volValue.divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)
|
||||
.multiply(new BigDecimal(curr.toString()));
|
||||
pqScriptDtl.setValue(result.doubleValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user