Commit c1b0031e authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改风电站运行状态接口,增加模拟实际发电功率处理逻辑,完成接口冒烟测试;
2.修改天气数据处理定时任务,解决晚上十一点半天气预报数据处理异常问题,修改风资源预测数据和光伏资源预测数据时间处理逻辑,完成接口冒烟测试;
3.修改风机预测数据模块相关功能接口,增加判断当前部署环境逻辑,解决查询全量数据问题;
4.修改风机预测数据生成模块第三方风力发电数据生成功能,增加数据拆分逻辑,区分15分数据层级,完成功能冒烟测试;
5.修改风机预测监控页面历史风速统计接口,统计数据不显示问题及小数位过多问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent ec185e56
package com.fasterxml.uuid;
import java.util.UUID;
/**
* Intermediate base class for UUID generators that do not take arguments for individual
* calls. This includes random and time-based variants, but not name-based ones.
*
* @since 3.0
*/
public abstract class NoArgGenerator extends UUIDGenerator {
public abstract UUID generate();
}
\ No newline at end of file
package com.fasterxml.uuid;
import java.util.UUID;
/**
* Intermediate base class for UUID generators that take one String argument for individual
* calls. This includes name-based generators, but not random and time-based generators.
*
* @since 3.0
*/
public abstract class StringArgGenerator extends UUIDGenerator {
/**
* Method for generating name-based UUIDs using specified name (serialized to
* bytes using UTF-8 encoding)
*/
public abstract UUID generate(String name);
/**
* Method for generating name-based UUIDs using specified byte-serialization
* of name.
*
* @since 3.1
*/
public abstract UUID generate(byte[] nameBytes);
}
\ No newline at end of file
/* JUG Java UUID Generator
*
* Copyright (c) 2002- Tatu Saloranta, tatu.saloranta@iki.fi
*
* Licensed under the License specified in the file LICENSE which is
* included with the source code.
* You may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fasterxml.uuid;
/**
* Minimal "tag" base class from which all generator implementations
* derive. Actual generation methods are not included since different
* generators take different number of arguments.
*
* @since 3.0
*/
public abstract class UUIDGenerator {
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
/**
* Constructor is private to enforce singleton access.
*/
protected UUIDGenerator() {
}
/*
/**********************************************************
/* Shared (minimal) API
/**********************************************************
*/
/**
* Accessor for determining type of UUIDs (variant) that this
* generator instance will produce.
*/
public abstract UUIDType getType();
}
\ No newline at end of file
package com.fasterxml.uuid.impl;
import java.security.SecureRandom;
/**
* Trivial helper class that uses class loading as synchronization
* mechanism for lazy instantiation of the shared secure random
* instance.
*/
public final class LazyRandom {
private final static SecureRandom shared = new SecureRandom();
public static SecureRandom sharedSecureRandom() {
return shared;
}
}
\ No newline at end of file
package com.fasterxml.uuid.impl;
import com.fasterxml.uuid.StringArgGenerator;
import com.fasterxml.uuid.UUIDType;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.UUID;
/**
* Implementation of UUID generator that uses one of name-based generation methods
* (variants 3 (MD5) and 5 (SHA1)).
* <p>
* As all JUG provided implementations, this generator is fully thread-safe; access
* to digester is synchronized as necessary.
*
* @since 3.0
*/
public class NameBasedGenerator extends StringArgGenerator {
public final static Charset _utf8;
/**
* Namespace used when name is a DNS name.
*/
public final static UUID NAMESPACE_DNS = UUID.fromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
/**
* Namespace used when name is a URL.
*/
public final static UUID NAMESPACE_URL = UUID.fromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8");
/**
* Namespace used when name is an OID.
*/
public final static UUID NAMESPACE_OID = UUID.fromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8");
/**
* Namespace used when name is an X500 identifier
*/
public final static UUID NAMESPACE_X500 = UUID.fromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8");
static {
_utf8 = StandardCharsets.UTF_8;
}
/**
* Namespace to use as prefix.
*/
protected final UUID _namespace;
/*
/**********************************************************************
/* Configuration
/**********************************************************************
*/
/**
* Message digesster to use for hash calculation
*/
protected final MessageDigest _digester;
protected final UUIDType _type;
/*
/**********************************************************************
/* Construction
/**********************************************************************
*/
/**
* @param namespace of the namespace, as defined by the
* spec. UUID has 4 pre-defined "standard" name space strings
* that can be passed to UUID constructor (see example below).
* Note that this argument is optional; if no namespace is needed
* (for example when name includes namespace prefix), null may be passed.
* @param digester Hashing algorithm to use.
*/
public NameBasedGenerator(UUID namespace, MessageDigest digester, UUIDType type) {
_namespace = namespace;
// And default digester SHA-1
if (digester == null) {
throw new IllegalArgumentException("Digester not optional: cannot pass `null`");
}
if (type == null) {
String typeStr = digester.getAlgorithm();
if (typeStr.startsWith("MD5")) {
type = UUIDType.NAME_BASED_MD5;
} else if (typeStr.startsWith("SHA")) {
type = UUIDType.NAME_BASED_SHA1;
} else {
// Hmmh... error out? Let's default to SHA-1, but log a warning
type = UUIDType.NAME_BASED_SHA1;
LoggerFacade _logger = LoggerFacade.getLogger(getClass());
_logger.warn("Could not determine type of Digester from '%s'; assuming 'SHA-1' type", typeStr);
}
}
_digester = digester;
_type = type;
}
/*
/**********************************************************************
/* Access to config
/**********************************************************************
*/
@Override
public UUIDType getType() {
return _type;
}
public UUID getNamespace() {
return _namespace;
}
/*
/**********************************************************************
/* UUID generation
/**********************************************************************
*/
@Override
public UUID generate(String name) {
// !!! TODO: 14-Oct-2010, tatu: can repurpose faster UTF-8 encoding from Jackson
return generate(name.getBytes(_utf8));
}
@Override
public UUID generate(byte[] nameBytes) {
byte[] digest;
synchronized (_digester) {
_digester.reset();
if (_namespace != null) {
_digester.update(UUIDUtil.asByteArray(_namespace));
}
_digester.update(nameBytes);
digest = _digester.digest();
}
return UUIDUtil.constructUUID(_type, digest);
}
}
\ No newline at end of file
package com.fasterxml.uuid.impl;
import com.fasterxml.uuid.NoArgGenerator;
import com.fasterxml.uuid.UUIDType;
import java.security.SecureRandom;
import java.util.Random;
import java.util.UUID;
/**
* Implementation of UUID generator that uses generation method 4.
* <p>
* Note on random number generation when using {@link SecureRandom} for random number
* generation: the first time {@link SecureRandom} object is used, there is noticeable delay between
* calling the method and getting the reply. This is because SecureRandom
* has to initialize itself to reasonably random state. Thus, if you
* want to lessen delay, it may be be a good idea to either get the
* first random UUID asynchronously from a separate thread, or to
* use the other generateRandomBasedUUID passing a previously initialized
* SecureRandom instance.
*
* @since 3.0
*/
public class RandomBasedGenerator extends NoArgGenerator {
/**
* Random number generator that this generator uses.
*/
protected final Random _random;
/**
* Looks like {@link SecureRandom} implementation is more efficient
* using single call access (compared to basic {@link java.util.Random}),
* so let's use that knowledge to our benefit.
*/
protected final boolean _secureRandom;
/**
* @param rnd Random number generator to use for generating UUIDs; if null,
* shared default generator is used. Note that it is strongly recommend to
* use a <b>good</b> (pseudo) random number generator; for example, JDK's
* {@link SecureRandom}.
*/
public RandomBasedGenerator(Random rnd) {
if (rnd == null) {
rnd = LazyRandom.sharedSecureRandom();
_secureRandom = true;
} else {
_secureRandom = (rnd instanceof SecureRandom);
}
_random = rnd;
}
/*
/**********************************************************************
/* Access to config
/**********************************************************************
*/
protected static long _toLong(byte[] buffer, int offset) {
long l1 = _toInt(buffer, offset);
long l2 = _toInt(buffer, offset + 4);
return (l1 << 32) + ((l2 << 32) >>> 32);
}
/*
/**********************************************************************
/* UUID generation
/**********************************************************************
*/
private static long _toInt(byte[] buffer, int offset) {
return (buffer[offset] << 24)
+ ((buffer[++offset] & 0xFF) << 16)
+ ((buffer[++offset] & 0xFF) << 8)
+ (buffer[++offset] & 0xFF);
}
/*
/**********************************************************************
/* Internal methods
/**********************************************************************
*/
@Override
public UUIDType getType() {
return UUIDType.RANDOM_BASED;
}
@Override
public UUID generate() {
// 14-Oct-2010, tatu: Surprisingly, variant for reading byte array is
// tad faster for SecureRandom... so let's use that then
long r1, r2;
if (_secureRandom) {
final byte[] buffer = new byte[16];
_random.nextBytes(buffer);
r1 = _toLong(buffer, 0);
r2 = _toLong(buffer, 1);
} else {
r1 = _random.nextLong();
r2 = _random.nextLong();
}
return UUIDUtil.constructUUID(UUIDType.RANDOM_BASED, r1, r2);
}
}
\ No newline at end of file
package com.fasterxml.uuid.impl;
import com.fasterxml.uuid.NoArgGenerator;
import com.fasterxml.uuid.UUIDType;
import java.security.SecureRandom;
import java.util.Random;
import java.util.UUID;
/**
* Implementation of UUID generator that uses time/location based generation
* method field from the Unix Epoch timestamp source - the number of
* milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded
* <p>
* As all JUG provided implementations, this generator is fully thread-safe.
* Additionally it can also be made externally synchronized with other instances
* (even ones running on other JVMs); to do this, use
* {@link com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer} (or
* equivalent).
*
* @since 4.1
*/
public class TimeBasedEpochGenerator extends NoArgGenerator {
/*
/**********************************************************************
/* Configuration
/**********************************************************************
*/
/**
* Random number generator that this generator uses.
*/
protected final Random _random;
/*
/**********************************************************************
/* Construction
/**********************************************************************
*/
/**
* @param rnd Random number generator to use for generating UUIDs; if null,
* shared default generator is used. Note that it is strongly recommend to
* use a <b>good</b> (pseudo) random number generator; for example, JDK's
* {@link SecureRandom}.
*/
public TimeBasedEpochGenerator(Random rnd) {
if (rnd == null) {
rnd = LazyRandom.sharedSecureRandom();
}
_random = rnd;
}
/*
/**********************************************************************
/* Access to config
/**********************************************************************
*/
protected static long _toLong(byte[] buffer) {
long l1 = _toInt(buffer, 0);
long l2 = _toInt(buffer, 4);
return (l1 << 32) + ((l2 << 32) >>> 32);
}
/*
/**********************************************************************
/* UUID generation
/**********************************************************************
*/
private static long _toInt(byte[] buffer, int offset) {
return (buffer[offset] << 24)
+ ((buffer[++offset] & 0xFF) << 16)
+ ((buffer[++offset] & 0xFF) << 8)
+ (buffer[++offset] & 0xFF);
}
/*
/**********************************************************************
/* Internal methods
/**********************************************************************
*/
private static long _toShort(byte[] buffer, int offset) {
return ((buffer[offset] & 0xFF) << 8)
+ (buffer[++offset] & 0xFF);
}
@Override
public UUIDType getType() {
return UUIDType.TIME_BASED_EPOCH;
}
@Override
public UUID generate() {
final long rawTimestamp = System.currentTimeMillis();
final byte[] rnd = new byte[10];
_random.nextBytes(rnd);
// Use only 48 lowest bits as per spec, next 16 bit from random
// (note: UUIDUtil.constuctUUID will add "version" so it's only 12
// actual random bits)
long l1 = (rawTimestamp << 16) | _toShort(rnd, 8);
// And then the other 64 bits of random; likewise UUIDUtil.constructUUID
// will overwrite first 2 random bits so it's "only" 62 bits
long l2 = _toLong(rnd);
// and as per above, this call fills in "variant" and "version" bits
return UUIDUtil.constructUUID(UUIDType.TIME_BASED_EPOCH, l1, l2);
}
}
package com.fasterxml.uuid.impl;
import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.NoArgGenerator;
import com.fasterxml.uuid.UUIDTimer;
import com.fasterxml.uuid.UUIDType;
import java.util.UUID;
/**
* Implementation of UUID generator that uses time/location based generation
* method (variant 1).
* <p>
* As all JUG provided implementations, this generator is fully thread-safe.
* Additionally it can also be made externally synchronized with other
* instances (even ones running on other JVMs); to do this,
* use {@link com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer}
* (or equivalent).
*
* @since 3.0
*/
public class TimeBasedGenerator extends NoArgGenerator {
/*
/**********************************************************************
/* Configuration
/**********************************************************************
*/
protected final EthernetAddress _ethernetAddress;
/**
* Object used for synchronizing access to timestamps, to guarantee
* that timestamps produced by this generator are unique and monotonically increasings.
* Some implementations offer even stronger guarantees, for example that
* same guarantee holds between instances running on different JVMs (or
* with native code).
*/
protected final UUIDTimer _timer;
/**
* Base values for the second long (last 8 bytes) of UUID to construct
*/
protected final long _uuidL2;
/*
/**********************************************************************
/* Construction
/**********************************************************************
*/
/**
* @param ethAddr Hardware address (802.1) to use for generating
* spatially unique part of UUID. If system has more than one NIC,
*/
public TimeBasedGenerator(EthernetAddress ethAddr, UUIDTimer timer) {
byte[] uuidBytes = new byte[16];
if (ethAddr == null) {
ethAddr = EthernetAddress.constructMulticastAddress();
}
// initialize baseline with MAC address info
_ethernetAddress = ethAddr;
_ethernetAddress.toByteArray(uuidBytes, 10);
// and add clock sequence
int clockSeq = timer.getClockSequence();
uuidBytes[UUIDUtil.BYTE_OFFSET_CLOCK_SEQUENCE] = (byte) (clockSeq >> 8);
uuidBytes[UUIDUtil.BYTE_OFFSET_CLOCK_SEQUENCE + 1] = (byte) clockSeq;
long l2 = UUIDUtil.gatherLong(uuidBytes, 8);
_uuidL2 = UUIDUtil.initUUIDSecondLong(l2);
_timer = timer;
}
/*
/**********************************************************************
/* Access to config
/**********************************************************************
*/
@Override
public UUIDType getType() {
return UUIDType.TIME_BASED;
}
public EthernetAddress getEthernetAddress() {
return _ethernetAddress;
}
/*
/**********************************************************************
/* UUID generation
/**********************************************************************
*/
/* As timer is not synchronized (nor _uuidBytes), need to sync; but most
* importantly, synchronize on timer which may also be shared between
* multiple instances
*/
@Override
public UUID generate() {
final long rawTimestamp = _timer.getTimestamp();
// Time field components are kind of shuffled, need to slice:
int clockHi = (int) (rawTimestamp >>> 32);
int clockLo = (int) rawTimestamp;
// and dice
int midhi = (clockHi << 16) | (clockHi >>> 16);
// need to squeeze in type (4 MSBs in byte 6, clock hi)
midhi &= ~0xF000; // remove high nibble of 6th byte
midhi |= 0x1000; // type 1
long midhiL = midhi;
midhiL = ((midhiL << 32) >>> 32); // to get rid of sign extension
// and reconstruct
long l1 = (((long) clockLo) << 32) | midhiL;
// last detail: must force 2 MSB to be '10'
return new UUID(l1, _uuidL2);
}
}
\ No newline at end of file
package com.fasterxml.uuid.impl;
import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.NoArgGenerator;
import com.fasterxml.uuid.UUIDTimer;
import com.fasterxml.uuid.UUIDType;
import java.util.UUID;
/**
* Implementation of UUID generator that uses time/location based generation
* method field compatible with UUIDv1, reorderd for improved DB locality
* (variant 6).
* <p>
* As all JUG provided implementations, this generator is fully thread-safe.
* Additionally it can also be made externally synchronized with other instances
* (even ones running on other JVMs); to do this, use
* {@link com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer} (or
* equivalent).
*
* @since 4.1
*/
public class TimeBasedReorderedGenerator extends NoArgGenerator {
public static int BYTE_OFFSET_TIME_HIGH = 0;
public static int BYTE_OFFSET_TIME_MID = 4;
public static int BYTE_OFFSET_TIME_LOW = 7;
/*
/**********************************************************************
/* Configuration
/**********************************************************************
*/
protected final EthernetAddress _ethernetAddress;
/**
* Object used for synchronizing access to timestamps, to guarantee
* that timestamps produced by this generator are unique and monotonically increasings.
* Some implementations offer even stronger guarantees, for example that
* same guarantee holds between instances running on different JVMs (or
* with native code).
*/
protected final UUIDTimer _timer;
/**
* Base values for the second long (last 8 bytes) of UUID to construct
*/
protected final long _uuidL2;
/*
/**********************************************************************
/* Construction
/**********************************************************************
*/
/**
* @param ethAddr Hardware address (802.1) to use for generating
* spatially unique part of UUID. If system has more than one NIC,
*/
public TimeBasedReorderedGenerator(EthernetAddress ethAddr, UUIDTimer timer) {
byte[] uuidBytes = new byte[16];
if (ethAddr == null) {
ethAddr = EthernetAddress.constructMulticastAddress();
}
// initialize baseline with MAC address info
_ethernetAddress = ethAddr;
_ethernetAddress.toByteArray(uuidBytes, 10);
// and add clock sequence
int clockSeq = timer.getClockSequence();
uuidBytes[UUIDUtil.BYTE_OFFSET_CLOCK_SEQUENCE] = (byte) (clockSeq >> 8);
uuidBytes[UUIDUtil.BYTE_OFFSET_CLOCK_SEQUENCE + 1] = (byte) clockSeq;
long l2 = UUIDUtil.gatherLong(uuidBytes, 8);
_uuidL2 = UUIDUtil.initUUIDSecondLong(l2);
_timer = timer;
}
/*
/**********************************************************************
/* Access to config
/**********************************************************************
*/
@Override
public UUIDType getType() {
return UUIDType.TIME_BASED_REORDERED;
}
public EthernetAddress getEthernetAddress() {
return _ethernetAddress;
}
/*
/**********************************************************************
/* UUID generation
/**********************************************************************
*/
/* As timer is not synchronized (nor _uuidBytes), need to sync; but most
* importantly, synchronize on timer which may also be shared between
* multiple instances
*/
@Override
public UUID generate() {
// Ok, get 60-bit timestamp (4 MSB are ignored)
final long rawTimestamp = _timer.getTimestamp();
// First: discard 4 MSB, next 32 bits (top of 60-bit timestamp) form the
// highest 32-bit segments
final long timestampHigh = (rawTimestamp >>> 28) << 32;
// and then bottom 28 bits split into mid (16 bits), low (12 bits)
final int timestampLow = (int) rawTimestamp;
// and then low part gets mixed with variant identifier
long timeBottomL = ((long) ((timestampLow >> 12) & 0xFFFF) << 16)
// and final 12 bits mixed with variant identifier
| 0x6000 | (timestampLow & 0xFFF);
timeBottomL = ((timeBottomL << 32) >>> 32); // to get rid of sign extension
// and reconstruct
long l1 = timestampHigh | timeBottomL;
return new UUID(l1, _uuidL2);
}
}
\ No newline at end of file
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