Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-kafkaconsumer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a7c8aad0
authored
May 07, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发大数据研判报警消费逻辑
1 parent
27f96467
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1797 additions
and
0 deletions
src/main/java/cn/com/glsx/kafka/protocol/BlackAbnormal.java
src/main/java/cn/com/glsx/kafka/queue/consumer/StujudgeConsumer.java
src/main/java/cn/com/glsx/kafka/service/StujudgeService.java
src/main/java/cn/com/glsx/kafka/protocol/BlackAbnormal.java
0 → 100644
View file @
a7c8aad
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: black_abnormal.proto
package
cn
.
com
.
glsx
.
kafka
.
protocol
;
public
final
class
BlackAbnormal
{
private
BlackAbnormal
()
{}
public
static
void
registerAllExtensions
(
com
.
google
.
protobuf
.
ExtensionRegistry
registry
)
{
}
public
interface
abnormalAndBlackRegionOrBuilder
extends
com
.
google
.
protobuf
.
MessageOrBuilder
{
// required string sn = 1;
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
boolean
hasSn
();
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
String
getSn
();
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
com
.
google
.
protobuf
.
ByteString
getSnBytes
();
// required string aggkey = 2;
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
boolean
hasAggkey
();
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
String
getAggkey
();
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
com
.
google
.
protobuf
.
ByteString
getAggkeyBytes
();
// required string alarmaddress = 3;
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
boolean
hasAlarmaddress
();
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
String
getAlarmaddress
();
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
com
.
google
.
protobuf
.
ByteString
getAlarmaddressBytes
();
// required string alarmtime = 4;
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
boolean
hasAlarmtime
();
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
String
getAlarmtime
();
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
com
.
google
.
protobuf
.
ByteString
getAlarmtimeBytes
();
// required int32 alarmtype = 5;
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
boolean
hasAlarmtype
();
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
int
getAlarmtype
();
// required int32 status = 6;
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
boolean
hasStatus
();
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
int
getStatus
();
// required float lng = 7;
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
boolean
hasLng
();
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
float
getLng
();
// required float lat = 8;
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
boolean
hasLat
();
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
float
getLat
();
}
/**
* Protobuf type {@code black_abnormal.abnormalAndBlackRegion}
*/
public
static
final
class
abnormalAndBlackRegion
extends
com
.
google
.
protobuf
.
GeneratedMessage
implements
abnormalAndBlackRegionOrBuilder
{
// Use abnormalAndBlackRegion.newBuilder() to construct.
private
abnormalAndBlackRegion
(
com
.
google
.
protobuf
.
GeneratedMessage
.
Builder
<?>
builder
)
{
super
(
builder
);
this
.
unknownFields
=
builder
.
getUnknownFields
();
}
private
abnormalAndBlackRegion
(
boolean
noInit
)
{
this
.
unknownFields
=
com
.
google
.
protobuf
.
UnknownFieldSet
.
getDefaultInstance
();
}
private
static
final
abnormalAndBlackRegion
defaultInstance
;
public
static
abnormalAndBlackRegion
getDefaultInstance
()
{
return
defaultInstance
;
}
public
abnormalAndBlackRegion
getDefaultInstanceForType
()
{
return
defaultInstance
;
}
private
final
com
.
google
.
protobuf
.
UnknownFieldSet
unknownFields
;
@Override
public
final
com
.
google
.
protobuf
.
UnknownFieldSet
getUnknownFields
()
{
return
this
.
unknownFields
;
}
private
abnormalAndBlackRegion
(
com
.
google
.
protobuf
.
CodedInputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
initFields
();
int
mutable_bitField0_
=
0
;
com
.
google
.
protobuf
.
UnknownFieldSet
.
Builder
unknownFields
=
com
.
google
.
protobuf
.
UnknownFieldSet
.
newBuilder
();
try
{
boolean
done
=
false
;
while
(!
done
)
{
int
tag
=
input
.
readTag
();
switch
(
tag
)
{
case
0
:
done
=
true
;
break
;
default
:
{
if
(!
parseUnknownField
(
input
,
unknownFields
,
extensionRegistry
,
tag
))
{
done
=
true
;
}
break
;
}
case
10
:
{
bitField0_
|=
0x00000001
;
sn_
=
input
.
readBytes
();
break
;
}
case
18
:
{
bitField0_
|=
0x00000002
;
aggkey_
=
input
.
readBytes
();
break
;
}
case
26
:
{
bitField0_
|=
0x00000004
;
alarmaddress_
=
input
.
readBytes
();
break
;
}
case
34
:
{
bitField0_
|=
0x00000008
;
alarmtime_
=
input
.
readBytes
();
break
;
}
case
40
:
{
bitField0_
|=
0x00000010
;
alarmtype_
=
input
.
readInt32
();
break
;
}
case
48
:
{
bitField0_
|=
0x00000020
;
status_
=
input
.
readInt32
();
break
;
}
case
61
:
{
bitField0_
|=
0x00000040
;
lng_
=
input
.
readFloat
();
break
;
}
case
69
:
{
bitField0_
|=
0x00000080
;
lat_
=
input
.
readFloat
();
break
;
}
}
}
}
catch
(
com
.
google
.
protobuf
.
InvalidProtocolBufferException
e
)
{
throw
e
.
setUnfinishedMessage
(
this
);
}
catch
(
java
.
io
.
IOException
e
)
{
throw
new
com
.
google
.
protobuf
.
InvalidProtocolBufferException
(
e
.
getMessage
()).
setUnfinishedMessage
(
this
);
}
finally
{
this
.
unknownFields
=
unknownFields
.
build
();
makeExtensionsImmutable
();
}
}
public
static
final
com
.
google
.
protobuf
.
Descriptors
.
Descriptor
getDescriptor
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
;
}
protected
FieldAccessorTable
internalGetFieldAccessorTable
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
internal_static_black_abnormal_abnormalAndBlackRegion_fieldAccessorTable
.
ensureFieldAccessorsInitialized
(
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
class
,
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
Builder
.
class
);
}
public
static
com
.
google
.
protobuf
.
Parser
<
abnormalAndBlackRegion
>
PARSER
=
new
com
.
google
.
protobuf
.
AbstractParser
<
abnormalAndBlackRegion
>()
{
public
abnormalAndBlackRegion
parsePartialFrom
(
com
.
google
.
protobuf
.
CodedInputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
return
new
abnormalAndBlackRegion
(
input
,
extensionRegistry
);
}
};
@Override
public
com
.
google
.
protobuf
.
Parser
<
abnormalAndBlackRegion
>
getParserForType
()
{
return
PARSER
;
}
private
int
bitField0_
;
// required string sn = 1;
public
static
final
int
SN_FIELD_NUMBER
=
1
;
private
Object
sn_
;
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
boolean
hasSn
()
{
return
((
bitField0_
&
0x00000001
)
==
0x00000001
);
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
String
getSn
()
{
Object
ref
=
sn_
;
if
(
ref
instanceof
String
)
{
return
(
String
)
ref
;
}
else
{
com
.
google
.
protobuf
.
ByteString
bs
=
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
String
s
=
bs
.
toStringUtf8
();
if
(
bs
.
isValidUtf8
())
{
sn_
=
s
;
}
return
s
;
}
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getSnBytes
()
{
Object
ref
=
sn_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
sn_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
// required string aggkey = 2;
public
static
final
int
AGGKEY_FIELD_NUMBER
=
2
;
private
Object
aggkey_
;
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
boolean
hasAggkey
()
{
return
((
bitField0_
&
0x00000002
)
==
0x00000002
);
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
String
getAggkey
()
{
Object
ref
=
aggkey_
;
if
(
ref
instanceof
String
)
{
return
(
String
)
ref
;
}
else
{
com
.
google
.
protobuf
.
ByteString
bs
=
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
String
s
=
bs
.
toStringUtf8
();
if
(
bs
.
isValidUtf8
())
{
aggkey_
=
s
;
}
return
s
;
}
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAggkeyBytes
()
{
Object
ref
=
aggkey_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
aggkey_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
// required string alarmaddress = 3;
public
static
final
int
ALARMADDRESS_FIELD_NUMBER
=
3
;
private
Object
alarmaddress_
;
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
boolean
hasAlarmaddress
()
{
return
((
bitField0_
&
0x00000004
)
==
0x00000004
);
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
String
getAlarmaddress
()
{
Object
ref
=
alarmaddress_
;
if
(
ref
instanceof
String
)
{
return
(
String
)
ref
;
}
else
{
com
.
google
.
protobuf
.
ByteString
bs
=
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
String
s
=
bs
.
toStringUtf8
();
if
(
bs
.
isValidUtf8
())
{
alarmaddress_
=
s
;
}
return
s
;
}
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAlarmaddressBytes
()
{
Object
ref
=
alarmaddress_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
alarmaddress_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
// required string alarmtime = 4;
public
static
final
int
ALARMTIME_FIELD_NUMBER
=
4
;
private
Object
alarmtime_
;
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
boolean
hasAlarmtime
()
{
return
((
bitField0_
&
0x00000008
)
==
0x00000008
);
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
String
getAlarmtime
()
{
Object
ref
=
alarmtime_
;
if
(
ref
instanceof
String
)
{
return
(
String
)
ref
;
}
else
{
com
.
google
.
protobuf
.
ByteString
bs
=
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
String
s
=
bs
.
toStringUtf8
();
if
(
bs
.
isValidUtf8
())
{
alarmtime_
=
s
;
}
return
s
;
}
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAlarmtimeBytes
()
{
Object
ref
=
alarmtime_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
alarmtime_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
// required int32 alarmtype = 5;
public
static
final
int
ALARMTYPE_FIELD_NUMBER
=
5
;
private
int
alarmtype_
;
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
boolean
hasAlarmtype
()
{
return
((
bitField0_
&
0x00000010
)
==
0x00000010
);
}
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
int
getAlarmtype
()
{
return
alarmtype_
;
}
// required int32 status = 6;
public
static
final
int
STATUS_FIELD_NUMBER
=
6
;
private
int
status_
;
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
boolean
hasStatus
()
{
return
((
bitField0_
&
0x00000020
)
==
0x00000020
);
}
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
int
getStatus
()
{
return
status_
;
}
// required float lng = 7;
public
static
final
int
LNG_FIELD_NUMBER
=
7
;
private
float
lng_
;
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
boolean
hasLng
()
{
return
((
bitField0_
&
0x00000040
)
==
0x00000040
);
}
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
float
getLng
()
{
return
lng_
;
}
// required float lat = 8;
public
static
final
int
LAT_FIELD_NUMBER
=
8
;
private
float
lat_
;
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
boolean
hasLat
()
{
return
((
bitField0_
&
0x00000080
)
==
0x00000080
);
}
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
float
getLat
()
{
return
lat_
;
}
private
void
initFields
()
{
sn_
=
""
;
aggkey_
=
""
;
alarmaddress_
=
""
;
alarmtime_
=
""
;
alarmtype_
=
0
;
status_
=
0
;
lng_
=
0
F
;
lat_
=
0
F
;
}
private
byte
memoizedIsInitialized
=
-
1
;
public
final
boolean
isInitialized
()
{
byte
isInitialized
=
memoizedIsInitialized
;
if
(
isInitialized
!=
-
1
)
return
isInitialized
==
1
;
if
(!
hasSn
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasAggkey
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasAlarmaddress
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasAlarmtime
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasAlarmtype
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasStatus
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasLng
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
if
(!
hasLat
())
{
memoizedIsInitialized
=
0
;
return
false
;
}
memoizedIsInitialized
=
1
;
return
true
;
}
public
void
writeTo
(
com
.
google
.
protobuf
.
CodedOutputStream
output
)
throws
java
.
io
.
IOException
{
getSerializedSize
();
if
(((
bitField0_
&
0x00000001
)
==
0x00000001
))
{
output
.
writeBytes
(
1
,
getSnBytes
());
}
if
(((
bitField0_
&
0x00000002
)
==
0x00000002
))
{
output
.
writeBytes
(
2
,
getAggkeyBytes
());
}
if
(((
bitField0_
&
0x00000004
)
==
0x00000004
))
{
output
.
writeBytes
(
3
,
getAlarmaddressBytes
());
}
if
(((
bitField0_
&
0x00000008
)
==
0x00000008
))
{
output
.
writeBytes
(
4
,
getAlarmtimeBytes
());
}
if
(((
bitField0_
&
0x00000010
)
==
0x00000010
))
{
output
.
writeInt32
(
5
,
alarmtype_
);
}
if
(((
bitField0_
&
0x00000020
)
==
0x00000020
))
{
output
.
writeInt32
(
6
,
status_
);
}
if
(((
bitField0_
&
0x00000040
)
==
0x00000040
))
{
output
.
writeFloat
(
7
,
lng_
);
}
if
(((
bitField0_
&
0x00000080
)
==
0x00000080
))
{
output
.
writeFloat
(
8
,
lat_
);
}
getUnknownFields
().
writeTo
(
output
);
}
private
int
memoizedSerializedSize
=
-
1
;
public
int
getSerializedSize
()
{
int
size
=
memoizedSerializedSize
;
if
(
size
!=
-
1
)
return
size
;
size
=
0
;
if
(((
bitField0_
&
0x00000001
)
==
0x00000001
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeBytesSize
(
1
,
getSnBytes
());
}
if
(((
bitField0_
&
0x00000002
)
==
0x00000002
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeBytesSize
(
2
,
getAggkeyBytes
());
}
if
(((
bitField0_
&
0x00000004
)
==
0x00000004
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeBytesSize
(
3
,
getAlarmaddressBytes
());
}
if
(((
bitField0_
&
0x00000008
)
==
0x00000008
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeBytesSize
(
4
,
getAlarmtimeBytes
());
}
if
(((
bitField0_
&
0x00000010
)
==
0x00000010
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeInt32Size
(
5
,
alarmtype_
);
}
if
(((
bitField0_
&
0x00000020
)
==
0x00000020
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeInt32Size
(
6
,
status_
);
}
if
(((
bitField0_
&
0x00000040
)
==
0x00000040
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeFloatSize
(
7
,
lng_
);
}
if
(((
bitField0_
&
0x00000080
)
==
0x00000080
))
{
size
+=
com
.
google
.
protobuf
.
CodedOutputStream
.
computeFloatSize
(
8
,
lat_
);
}
size
+=
getUnknownFields
().
getSerializedSize
();
memoizedSerializedSize
=
size
;
return
size
;
}
private
static
final
long
serialVersionUID
=
0L
;
@Override
protected
Object
writeReplace
()
throws
java
.
io
.
ObjectStreamException
{
return
super
.
writeReplace
();
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
com
.
google
.
protobuf
.
ByteString
data
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
return
PARSER
.
parseFrom
(
data
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
com
.
google
.
protobuf
.
ByteString
data
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
return
PARSER
.
parseFrom
(
data
,
extensionRegistry
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
byte
[]
data
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
return
PARSER
.
parseFrom
(
data
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
byte
[]
data
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
com
.
google
.
protobuf
.
InvalidProtocolBufferException
{
return
PARSER
.
parseFrom
(
data
,
extensionRegistry
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
java
.
io
.
InputStream
input
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseFrom
(
input
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
java
.
io
.
InputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseFrom
(
input
,
extensionRegistry
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseDelimitedFrom
(
java
.
io
.
InputStream
input
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseDelimitedFrom
(
input
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseDelimitedFrom
(
java
.
io
.
InputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseDelimitedFrom
(
input
,
extensionRegistry
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
com
.
google
.
protobuf
.
CodedInputStream
input
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseFrom
(
input
);
}
public
static
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parseFrom
(
com
.
google
.
protobuf
.
CodedInputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
java
.
io
.
IOException
{
return
PARSER
.
parseFrom
(
input
,
extensionRegistry
);
}
public
static
Builder
newBuilder
()
{
return
Builder
.
create
();
}
public
Builder
newBuilderForType
()
{
return
newBuilder
();
}
public
static
Builder
newBuilder
(
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
prototype
)
{
return
newBuilder
().
mergeFrom
(
prototype
);
}
public
Builder
toBuilder
()
{
return
newBuilder
(
this
);
}
@Override
protected
Builder
newBuilderForType
(
BuilderParent
parent
)
{
Builder
builder
=
new
Builder
(
parent
);
return
builder
;
}
/**
* Protobuf type {@code black_abnormal.abnormalAndBlackRegion}
*/
public
static
final
class
Builder
extends
com
.
google
.
protobuf
.
GeneratedMessage
.
Builder
<
Builder
>
implements
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegionOrBuilder
{
public
static
final
com
.
google
.
protobuf
.
Descriptors
.
Descriptor
getDescriptor
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
;
}
protected
FieldAccessorTable
internalGetFieldAccessorTable
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
internal_static_black_abnormal_abnormalAndBlackRegion_fieldAccessorTable
.
ensureFieldAccessorsInitialized
(
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
class
,
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
Builder
.
class
);
}
// Construct using cn.com.glsx.kafka.protocol.BlackAbnormal.abnormalAndBlackRegion.newBuilder()
private
Builder
()
{
maybeForceBuilderInitialization
();
}
private
Builder
(
BuilderParent
parent
)
{
super
(
parent
);
maybeForceBuilderInitialization
();
}
private
void
maybeForceBuilderInitialization
()
{
if
(
com
.
google
.
protobuf
.
GeneratedMessage
.
alwaysUseFieldBuilders
)
{
}
}
private
static
Builder
create
()
{
return
new
Builder
();
}
public
Builder
clear
()
{
super
.
clear
();
sn_
=
""
;
bitField0_
=
(
bitField0_
&
~
0x00000001
);
aggkey_
=
""
;
bitField0_
=
(
bitField0_
&
~
0x00000002
);
alarmaddress_
=
""
;
bitField0_
=
(
bitField0_
&
~
0x00000004
);
alarmtime_
=
""
;
bitField0_
=
(
bitField0_
&
~
0x00000008
);
alarmtype_
=
0
;
bitField0_
=
(
bitField0_
&
~
0x00000010
);
status_
=
0
;
bitField0_
=
(
bitField0_
&
~
0x00000020
);
lng_
=
0
F
;
bitField0_
=
(
bitField0_
&
~
0x00000040
);
lat_
=
0
F
;
bitField0_
=
(
bitField0_
&
~
0x00000080
);
return
this
;
}
public
Builder
clone
()
{
return
create
().
mergeFrom
(
buildPartial
());
}
public
com
.
google
.
protobuf
.
Descriptors
.
Descriptor
getDescriptorForType
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
;
}
public
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
getDefaultInstanceForType
()
{
return
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
getDefaultInstance
();
}
public
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
build
()
{
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
result
=
buildPartial
();
if
(!
result
.
isInitialized
())
{
throw
newUninitializedMessageException
(
result
);
}
return
result
;
}
public
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
buildPartial
()
{
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
result
=
new
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
(
this
);
int
from_bitField0_
=
bitField0_
;
int
to_bitField0_
=
0
;
if
(((
from_bitField0_
&
0x00000001
)
==
0x00000001
))
{
to_bitField0_
|=
0x00000001
;
}
result
.
sn_
=
sn_
;
if
(((
from_bitField0_
&
0x00000002
)
==
0x00000002
))
{
to_bitField0_
|=
0x00000002
;
}
result
.
aggkey_
=
aggkey_
;
if
(((
from_bitField0_
&
0x00000004
)
==
0x00000004
))
{
to_bitField0_
|=
0x00000004
;
}
result
.
alarmaddress_
=
alarmaddress_
;
if
(((
from_bitField0_
&
0x00000008
)
==
0x00000008
))
{
to_bitField0_
|=
0x00000008
;
}
result
.
alarmtime_
=
alarmtime_
;
if
(((
from_bitField0_
&
0x00000010
)
==
0x00000010
))
{
to_bitField0_
|=
0x00000010
;
}
result
.
alarmtype_
=
alarmtype_
;
if
(((
from_bitField0_
&
0x00000020
)
==
0x00000020
))
{
to_bitField0_
|=
0x00000020
;
}
result
.
status_
=
status_
;
if
(((
from_bitField0_
&
0x00000040
)
==
0x00000040
))
{
to_bitField0_
|=
0x00000040
;
}
result
.
lng_
=
lng_
;
if
(((
from_bitField0_
&
0x00000080
)
==
0x00000080
))
{
to_bitField0_
|=
0x00000080
;
}
result
.
lat_
=
lat_
;
result
.
bitField0_
=
to_bitField0_
;
onBuilt
();
return
result
;
}
public
Builder
mergeFrom
(
com
.
google
.
protobuf
.
Message
other
)
{
if
(
other
instanceof
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
)
{
return
mergeFrom
((
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
)
other
);
}
else
{
super
.
mergeFrom
(
other
);
return
this
;
}
}
public
Builder
mergeFrom
(
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
other
)
{
if
(
other
==
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
.
getDefaultInstance
())
return
this
;
if
(
other
.
hasSn
())
{
bitField0_
|=
0x00000001
;
sn_
=
other
.
sn_
;
onChanged
();
}
if
(
other
.
hasAggkey
())
{
bitField0_
|=
0x00000002
;
aggkey_
=
other
.
aggkey_
;
onChanged
();
}
if
(
other
.
hasAlarmaddress
())
{
bitField0_
|=
0x00000004
;
alarmaddress_
=
other
.
alarmaddress_
;
onChanged
();
}
if
(
other
.
hasAlarmtime
())
{
bitField0_
|=
0x00000008
;
alarmtime_
=
other
.
alarmtime_
;
onChanged
();
}
if
(
other
.
hasAlarmtype
())
{
setAlarmtype
(
other
.
getAlarmtype
());
}
if
(
other
.
hasStatus
())
{
setStatus
(
other
.
getStatus
());
}
if
(
other
.
hasLng
())
{
setLng
(
other
.
getLng
());
}
if
(
other
.
hasLat
())
{
setLat
(
other
.
getLat
());
}
this
.
mergeUnknownFields
(
other
.
getUnknownFields
());
return
this
;
}
public
final
boolean
isInitialized
()
{
if
(!
hasSn
())
{
return
false
;
}
if
(!
hasAggkey
())
{
return
false
;
}
if
(!
hasAlarmaddress
())
{
return
false
;
}
if
(!
hasAlarmtime
())
{
return
false
;
}
if
(!
hasAlarmtype
())
{
return
false
;
}
if
(!
hasStatus
())
{
return
false
;
}
if
(!
hasLng
())
{
return
false
;
}
if
(!
hasLat
())
{
return
false
;
}
return
true
;
}
public
Builder
mergeFrom
(
com
.
google
.
protobuf
.
CodedInputStream
input
,
com
.
google
.
protobuf
.
ExtensionRegistryLite
extensionRegistry
)
throws
java
.
io
.
IOException
{
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
parsedMessage
=
null
;
try
{
parsedMessage
=
PARSER
.
parsePartialFrom
(
input
,
extensionRegistry
);
}
catch
(
com
.
google
.
protobuf
.
InvalidProtocolBufferException
e
)
{
parsedMessage
=
(
cn
.
com
.
glsx
.
kafka
.
protocol
.
BlackAbnormal
.
abnormalAndBlackRegion
)
e
.
getUnfinishedMessage
();
throw
e
;
}
finally
{
if
(
parsedMessage
!=
null
)
{
mergeFrom
(
parsedMessage
);
}
}
return
this
;
}
private
int
bitField0_
;
// required string sn = 1;
private
Object
sn_
=
""
;
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
boolean
hasSn
()
{
return
((
bitField0_
&
0x00000001
)
==
0x00000001
);
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
String
getSn
()
{
Object
ref
=
sn_
;
if
(!(
ref
instanceof
String
))
{
String
s
=
((
com
.
google
.
protobuf
.
ByteString
)
ref
)
.
toStringUtf8
();
sn_
=
s
;
return
s
;
}
else
{
return
(
String
)
ref
;
}
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getSnBytes
()
{
Object
ref
=
sn_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
sn_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
Builder
setSn
(
String
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000001
;
sn_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
Builder
clearSn
()
{
bitField0_
=
(
bitField0_
&
~
0x00000001
);
sn_
=
getDefaultInstance
().
getSn
();
onChanged
();
return
this
;
}
/**
* <code>required string sn = 1;</code>
*
* <pre>
*设备号
* </pre>
*/
public
Builder
setSnBytes
(
com
.
google
.
protobuf
.
ByteString
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000001
;
sn_
=
value
;
onChanged
();
return
this
;
}
// required string aggkey = 2;
private
Object
aggkey_
=
""
;
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
boolean
hasAggkey
()
{
return
((
bitField0_
&
0x00000002
)
==
0x00000002
);
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
String
getAggkey
()
{
Object
ref
=
aggkey_
;
if
(!(
ref
instanceof
String
))
{
String
s
=
((
com
.
google
.
protobuf
.
ByteString
)
ref
)
.
toStringUtf8
();
aggkey_
=
s
;
return
s
;
}
else
{
return
(
String
)
ref
;
}
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAggkeyBytes
()
{
Object
ref
=
aggkey_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
aggkey_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
Builder
setAggkey
(
String
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000002
;
aggkey_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
Builder
clearAggkey
()
{
bitField0_
=
(
bitField0_
&
~
0x00000002
);
aggkey_
=
getDefaultInstance
().
getAggkey
();
onChanged
();
return
this
;
}
/**
* <code>required string aggkey = 2;</code>
*
* <pre>
*黑区or异常聚集编号
* </pre>
*/
public
Builder
setAggkeyBytes
(
com
.
google
.
protobuf
.
ByteString
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000002
;
aggkey_
=
value
;
onChanged
();
return
this
;
}
// required string alarmaddress = 3;
private
Object
alarmaddress_
=
""
;
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
boolean
hasAlarmaddress
()
{
return
((
bitField0_
&
0x00000004
)
==
0x00000004
);
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
String
getAlarmaddress
()
{
Object
ref
=
alarmaddress_
;
if
(!(
ref
instanceof
String
))
{
String
s
=
((
com
.
google
.
protobuf
.
ByteString
)
ref
)
.
toStringUtf8
();
alarmaddress_
=
s
;
return
s
;
}
else
{
return
(
String
)
ref
;
}
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAlarmaddressBytes
()
{
Object
ref
=
alarmaddress_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
alarmaddress_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
Builder
setAlarmaddress
(
String
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000004
;
alarmaddress_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
Builder
clearAlarmaddress
()
{
bitField0_
=
(
bitField0_
&
~
0x00000004
);
alarmaddress_
=
getDefaultInstance
().
getAlarmaddress
();
onChanged
();
return
this
;
}
/**
* <code>required string alarmaddress = 3;</code>
*
* <pre>
*报警地址
* </pre>
*/
public
Builder
setAlarmaddressBytes
(
com
.
google
.
protobuf
.
ByteString
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000004
;
alarmaddress_
=
value
;
onChanged
();
return
this
;
}
// required string alarmtime = 4;
private
Object
alarmtime_
=
""
;
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
boolean
hasAlarmtime
()
{
return
((
bitField0_
&
0x00000008
)
==
0x00000008
);
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
String
getAlarmtime
()
{
Object
ref
=
alarmtime_
;
if
(!(
ref
instanceof
String
))
{
String
s
=
((
com
.
google
.
protobuf
.
ByteString
)
ref
)
.
toStringUtf8
();
alarmtime_
=
s
;
return
s
;
}
else
{
return
(
String
)
ref
;
}
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
com
.
google
.
protobuf
.
ByteString
getAlarmtimeBytes
()
{
Object
ref
=
alarmtime_
;
if
(
ref
instanceof
String
)
{
com
.
google
.
protobuf
.
ByteString
b
=
com
.
google
.
protobuf
.
ByteString
.
copyFromUtf8
(
(
String
)
ref
);
alarmtime_
=
b
;
return
b
;
}
else
{
return
(
com
.
google
.
protobuf
.
ByteString
)
ref
;
}
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
Builder
setAlarmtime
(
String
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000008
;
alarmtime_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
Builder
clearAlarmtime
()
{
bitField0_
=
(
bitField0_
&
~
0x00000008
);
alarmtime_
=
getDefaultInstance
().
getAlarmtime
();
onChanged
();
return
this
;
}
/**
* <code>required string alarmtime = 4;</code>
*
* <pre>
*报警时间
* </pre>
*/
public
Builder
setAlarmtimeBytes
(
com
.
google
.
protobuf
.
ByteString
value
)
{
if
(
value
==
null
)
{
throw
new
NullPointerException
();
}
bitField0_
|=
0x00000008
;
alarmtime_
=
value
;
onChanged
();
return
this
;
}
// required int32 alarmtype = 5;
private
int
alarmtype_
;
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
boolean
hasAlarmtype
()
{
return
((
bitField0_
&
0x00000010
)
==
0x00000010
);
}
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
int
getAlarmtype
()
{
return
alarmtype_
;
}
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
Builder
setAlarmtype
(
int
value
)
{
bitField0_
|=
0x00000010
;
alarmtype_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required int32 alarmtype = 5;</code>
*
* <pre>
*黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警
* </pre>
*/
public
Builder
clearAlarmtype
()
{
bitField0_
=
(
bitField0_
&
~
0x00000010
);
alarmtype_
=
0
;
onChanged
();
return
this
;
}
// required int32 status = 6;
private
int
status_
;
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
boolean
hasStatus
()
{
return
((
bitField0_
&
0x00000020
)
==
0x00000020
);
}
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
int
getStatus
()
{
return
status_
;
}
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
Builder
setStatus
(
int
value
)
{
bitField0_
|=
0x00000020
;
status_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required int32 status = 6;</code>
*
* <pre>
*当前设备状态 1:已恢复 2:未恢复
* </pre>
*/
public
Builder
clearStatus
()
{
bitField0_
=
(
bitField0_
&
~
0x00000020
);
status_
=
0
;
onChanged
();
return
this
;
}
// required float lng = 7;
private
float
lng_
;
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
boolean
hasLng
()
{
return
((
bitField0_
&
0x00000040
)
==
0x00000040
);
}
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
float
getLng
()
{
return
lng_
;
}
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
Builder
setLng
(
float
value
)
{
bitField0_
|=
0x00000040
;
lng_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required float lng = 7;</code>
*
* <pre>
*报警地经度信息
* </pre>
*/
public
Builder
clearLng
()
{
bitField0_
=
(
bitField0_
&
~
0x00000040
);
lng_
=
0
F
;
onChanged
();
return
this
;
}
// required float lat = 8;
private
float
lat_
;
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
boolean
hasLat
()
{
return
((
bitField0_
&
0x00000080
)
==
0x00000080
);
}
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
float
getLat
()
{
return
lat_
;
}
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
Builder
setLat
(
float
value
)
{
bitField0_
|=
0x00000080
;
lat_
=
value
;
onChanged
();
return
this
;
}
/**
* <code>required float lat = 8;</code>
*
* <pre>
*报警地纬度信息
* </pre>
*/
public
Builder
clearLat
()
{
bitField0_
=
(
bitField0_
&
~
0x00000080
);
lat_
=
0
F
;
onChanged
();
return
this
;
}
// @@protoc_insertion_point(builder_scope:black_abnormal.abnormalAndBlackRegion)
}
static
{
defaultInstance
=
new
abnormalAndBlackRegion
(
true
);
defaultInstance
.
initFields
();
}
// @@protoc_insertion_point(class_scope:black_abnormal.abnormalAndBlackRegion)
}
private
static
com
.
google
.
protobuf
.
Descriptors
.
Descriptor
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
;
private
static
com
.
google
.
protobuf
.
GeneratedMessage
.
FieldAccessorTable
internal_static_black_abnormal_abnormalAndBlackRegion_fieldAccessorTable
;
public
static
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
getDescriptor
()
{
return
descriptor
;
}
private
static
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
descriptor
;
static
{
String
[]
descriptorData
=
{
"\n\024black_abnormal.proto\022\016black_abnormal\"\232"
+
"\001\n\026abnormalAndBlackRegion\022\n\n\002sn\030\001 \002(\t\022\016\n"
+
"\006aggkey\030\002 \002(\t\022\024\n\014alarmaddress\030\003 \002(\t\022\021\n\ta"
+
"larmtime\030\004 \002(\t\022\021\n\talarmtype\030\005 \002(\005\022\016\n\006sta"
+
"tus\030\006 \002(\005\022\013\n\003lng\030\007 \002(\002\022\013\n\003lat\030\010 \002(\002B\030\n\026c"
+
"om.glsx.protoTemplate"
};
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
.
InternalDescriptorAssigner
assigner
=
new
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
.
InternalDescriptorAssigner
()
{
public
com
.
google
.
protobuf
.
ExtensionRegistry
assignDescriptors
(
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
root
)
{
descriptor
=
root
;
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
=
getDescriptor
().
getMessageTypes
().
get
(
0
);
internal_static_black_abnormal_abnormalAndBlackRegion_fieldAccessorTable
=
new
com
.
google
.
protobuf
.
GeneratedMessage
.
FieldAccessorTable
(
internal_static_black_abnormal_abnormalAndBlackRegion_descriptor
,
new
String
[]
{
"Sn"
,
"Aggkey"
,
"Alarmaddress"
,
"Alarmtime"
,
"Alarmtype"
,
"Status"
,
"Lng"
,
"Lat"
,
});
return
null
;
}
};
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
.
internalBuildGeneratedFileFrom
(
descriptorData
,
new
com
.
google
.
protobuf
.
Descriptors
.
FileDescriptor
[]
{
},
assigner
);
}
// @@protoc_insertion_point(outer_class_scope)
}
src/main/java/cn/com/glsx/kafka/queue/consumer/StujudgeConsumer.java
0 → 100644
View file @
a7c8aad
package
cn
.
com
.
glsx
.
kafka
.
queue
.
consumer
;
import
cn.com.glsx.kafka.protocol.BlackAbnormal
;
import
cn.com.glsx.kafka.queue.base.MessageReceiver
;
import
cn.com.glsx.kafka.service.StujudgeService
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.hutool.core.date.DateUtil
;
import
com.google.protobuf.InvalidProtocolBufferException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
* 大数据研判警情
*
* @author yangll
*/
@Slf4j
public
class
StujudgeConsumer
extends
MessageReceiver
{
@Autowired
private
StujudgeService
stujudgeService
;
@Override
public
void
processMessage
(
String
topic
,
byte
[]
message
)
{
try
{
AlarmTrackStujudgeDto
alarmTrackRecDto
=
parseStujudge
(
message
);
stujudgeService
.
saveOrUpdate
(
alarmTrackRecDto
);
}
catch
(
Exception
e
)
{
log
.
error
(
topic
+
"Exception:"
+
e
.
getMessage
(),
e
);
}
}
public
static
AlarmTrackStujudgeDto
parseStujudge
(
byte
[]
message
)
throws
InvalidProtocolBufferException
{
BlackAbnormal
.
abnormalAndBlackRegion
abnormalAndBlackRegion
=
BlackAbnormal
.
abnormalAndBlackRegion
.
parseFrom
(
message
);
AlarmTrackStujudgeDto
alarmTrackRecDto
=
new
AlarmTrackStujudgeDto
();
alarmTrackRecDto
.
setAlarmAddress
(
abnormalAndBlackRegion
.
getAlarmaddress
());
alarmTrackRecDto
.
setGeoCode
(
abnormalAndBlackRegion
.
getAggkey
());
alarmTrackRecDto
.
setAlarmType
(
abnormalAndBlackRegion
.
getAlarmtype
());
alarmTrackRecDto
.
setLastTime
(
DateUtil
.
parseDate
(
abnormalAndBlackRegion
.
getAlarmtime
()));
alarmTrackRecDto
.
setDelFlag
(
abnormalAndBlackRegion
.
getStatus
());
alarmTrackRecDto
.
setSn
(
abnormalAndBlackRegion
.
getSn
());
alarmTrackRecDto
.
setLastLng
(
String
.
valueOf
(
abnormalAndBlackRegion
.
getLng
()));
alarmTrackRecDto
.
setLastLat
(
String
.
valueOf
(
abnormalAndBlackRegion
.
getLat
()));
return
alarmTrackRecDto
;
}
}
src/main/java/cn/com/glsx/kafka/service/StujudgeService.java
0 → 100644
View file @
a7c8aad
package
cn
.
com
.
glsx
.
kafka
.
service
;
import
cn.com.glsx.stdinterface.api.StujudgeClient
;
import
cn.com.glsx.stdinterface.dto.AlarmTrackStujudgeDto
;
import
cn.hutool.json.JSONUtil
;
import
com.glsx.plat.core.web.R
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
* @author zhouhaibao
* @date 2021/5/25 11:25
*/
@Service
@Slf4j
public
class
StujudgeService
{
@Autowired
private
StujudgeClient
stujudgeClient
;
/**
* 保存大数据研判警情
*
* @param alarmTrackStujudgeDto 入参
*/
public
void
saveOrUpdate
(
AlarmTrackStujudgeDto
alarmTrackStujudgeDto
)
{
log
.
info
(
"开始消费--------{}"
,
JSONUtil
.
toJsonStr
(
alarmTrackStujudgeDto
));
R
<
AlarmTrackStujudgeDto
>
alarmBySnAndTypeR
=
stujudgeClient
.
findAlarmBySnAndType
(
alarmTrackStujudgeDto
);
AlarmTrackStujudgeDto
alarmBySnAndType
=
alarmBySnAndTypeR
.
getData
(
AlarmTrackStujudgeDto
.
class
);
if
(
alarmBySnAndType
==
null
)
{
alarmTrackStujudgeDto
.
setAlarmNo
(
1
);
alarmTrackStujudgeDto
.
setBeginTime
(
alarmTrackStujudgeDto
.
getLastTime
());
alarmTrackStujudgeDto
.
setLastTime
(
new
Date
());
alarmTrackStujudgeDto
.
setUpdatedDate
(
new
Date
());
stujudgeClient
.
insert
(
alarmTrackStujudgeDto
);
}
else
{
// 不更新报警开始时间 回复报警不累计报警次数 只有报警生效中才累计报警次数
if
(
alarmTrackStujudgeDto
.
getDelFlag
()
==
2
)
{
alarmBySnAndType
.
setAlarmNo
(
alarmBySnAndType
.
getAlarmNo
()
+
1
);
}
alarmBySnAndType
.
setDelFlag
(
alarmTrackStujudgeDto
.
getDelFlag
());
alarmBySnAndType
.
setLastTime
(
new
Date
());
alarmBySnAndType
.
setUpdatedDate
(
new
Date
());
stujudgeClient
.
updateById
(
alarmBySnAndType
);
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment