Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
secure
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡懿
secure
Commits
e8fe8c18
Commit
e8fe8c18
authored
Oct 09, 2025
by
胡懿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备信息获取方式,增加在线设备判断,修改设备规则判断逻辑
parent
4f6cc1ca
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
13 deletions
+57
-13
PumpStationKafkaConsumer.java
...main/java/cn/gintone/config/PumpStationKafkaConsumer.java
+21
-0
DeviceTypeController.java
...main/java/cn/gintone/controller/DeviceTypeController.java
+1
-1
DeviceReqConfRespVO.java
...in/java/cn/gintone/controller/vo/DeviceReqConfRespVO.java
+2
-2
DeviceReqConfSaveReqVO.java
...java/cn/gintone/controller/vo/DeviceReqConfSaveReqVO.java
+0
-1
DeviceReqConfServiceImpl.java
...ain/java/cn/gintone/service/DeviceReqConfServiceImpl.java
+0
-1
TokenAuthenticationFilter.java
...ework/security/core/filter/TokenAuthenticationFilter.java
+1
-1
application-local.yaml
yudao-server/src/main/resources/application-local.yaml
+30
-5
application.yaml
yudao-server/src/main/resources/application.yaml
+2
-2
No files found.
gt-club/gt-club-biz/src/main/java/cn/gintone/config/PumpStationKafkaConsumer.java
View file @
e8fe8c18
...
...
@@ -4,8 +4,10 @@ import cn.gintone.controller.vo.DeviceReqConfListReqVO;
import
cn.gintone.controller.vo.DeviceReqConfSaveReqVO
;
import
cn.gintone.dal.DeviceReqConfMapper
;
import
cn.gintone.entity.DeviceReqConfDO
;
import
cn.gintone.iotdbUtils.MyDateUtils
;
import
cn.gintone.service.DeviceReqConfService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
org.slf4j.Logger
;
...
...
@@ -17,6 +19,7 @@ import org.springframework.kafka.support.KafkaHeaders;
import
org.springframework.messaging.handler.annotation.Header
;
import
org.springframework.stereotype.Component
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
...
...
@@ -101,9 +104,27 @@ public class PumpStationKafkaConsumer {
private
void
processMessageAsync
(
String
message
,
String
topic
)
{
CompletableFuture
.
runAsync
(()
->
{
try
{
boolean
b
=
false
;
JSONObject
msgJsonObject
=
JSON
.
parseObject
(
message
);
String
snCode
=
msgJsonObject
.
get
(
"serialNo"
).
toString
();
JSONArray
services
=
msgJsonObject
.
getJSONArray
(
"services"
);
if
(
null
!=
services
)
{
JSONObject
paramsObject
=
services
.
getJSONObject
(
0
).
getJSONObject
(
"params"
);
if
(
null
!=
paramsObject
)
{
String
ts
=
paramsObject
.
getString
(
"ts"
);
if
(
null
!=
ts
)
{
long
l
=
MyDateUtils
.
stringToLong
(
ts
);
if
(
new
Date
().
getTime
()
-
l
<
24
*
60
*
60
*
1000
)
{
b
=
true
;
}
}
}
}
if
(!
b
)
{
logger
.
info
(
"异步处理完成, topic: {}, SN: {}"
,
topic
,
snCode
);
return
;
}
DeviceReqConfListReqVO
temDRCLRV
=
new
DeviceReqConfListReqVO
();
temDRCLRV
.
setSnCode
(
snCode
);
List
<
DeviceReqConfDO
>
deviceReqConfList
=
deviceReqConfMapper
.
selectList
(
temDRCLRV
);
...
...
gt-club/gt-club-biz/src/main/java/cn/gintone/controller/DeviceTypeController.java
View file @
e8fe8c18
...
...
@@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag
(
name
=
"管理后台 - 设备类型"
)
@RestController
@RequestMapping
(
"/gintone/device-type"
)
@RequestMapping
(
"/
admin-api/
gintone/device-type"
)
@Validated
public
class
DeviceTypeController
{
...
...
gt-club/gt-club-biz/src/main/java/cn/gintone/controller/vo/DeviceReqConfRespVO.java
View file @
e8fe8c18
...
...
@@ -20,7 +20,7 @@ public class DeviceReqConfRespVO {
@ExcelProperty
(
"设备名称"
)
private
String
deviceName
;
@Schema
(
description
=
"设备id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"21048"
)
@Schema
(
description
=
"设备id"
,
example
=
"21048"
)
@ExcelProperty
(
"设备id"
)
private
String
deviceId
;
...
...
@@ -32,7 +32,7 @@ public class DeviceReqConfRespVO {
@ExcelProperty
(
"父级id"
)
private
Long
parentId
;
@Schema
(
description
=
"创建时间"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@Schema
(
description
=
"创建时间"
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
...
...
gt-club/gt-club-biz/src/main/java/cn/gintone/controller/vo/DeviceReqConfSaveReqVO.java
View file @
e8fe8c18
...
...
@@ -16,7 +16,6 @@ public class DeviceReqConfSaveReqVO {
private
String
deviceName
;
@Schema
(
description
=
"设备id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"21048"
)
@NotEmpty
(
message
=
"设备id不能为空"
)
private
String
deviceId
;
@Schema
(
description
=
"设备类型id"
,
example
=
"24373"
)
...
...
gt-club/gt-club-biz/src/main/java/cn/gintone/service/DeviceReqConfServiceImpl.java
View file @
e8fe8c18
...
...
@@ -429,7 +429,6 @@ public class DeviceReqConfServiceImpl implements DeviceReqConfService {
deviceReqConf
.
setDeviceName
(
ptExportDevice
.
getDeviceName
());
deviceReqConf
.
setAddress
(
ptExportDevice
.
getDescription
());
deviceReqConf
.
setDeviceEn
(
modelCode
);
deviceReqConf
.
setRegionName
(
ptExportDevice
.
getDescription
());
deviceReqConfMapper
.
insert
(
deviceReqConf
);
}
...
...
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java
View file @
e8fe8c18
...
...
@@ -54,7 +54,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
protected
void
doFilterInternal
(
HttpServletRequest
request
,
HttpServletResponse
response
,
FilterChain
chain
)
throws
ServletException
,
IOException
{
MyReadApplicationUtils
.
readApplication
();
boolean
b
=
fals
e
;
boolean
b
=
tru
e
;
if
(
b
)
{
String
pdToken
=
request
.
getHeader
(
"pdToken"
);
StringBuffer
requestURL
=
request
.
getRequestURL
();
...
...
yudao-server/src/main/resources/application-local.yaml
View file @
e8fe8c18
...
...
@@ -121,8 +121,7 @@ spring:
rocketmq
:
name-server
:
127.0.0.1:9876
# RocketMQ Namesrv
spring
:
# RabbitMQ 配置项,对应 RabbitProperties 配置类
# RabbitMQ 配置项,对应 RabbitProperties 配置类
# rabbitmq:
# host: 192.168.19.205
# host: 127.0.0.1
...
...
@@ -131,16 +130,42 @@ spring:
# password: kalo
# virtual-host: /
# Kafka 配置项,对应 KafkaProperties 配置类
kafka
:
bootstrap-servers
:
localhost:9092
kafka
:
cluster1
:
bootstrap-servers
:
59.195.13.209:9092
# bootstrap-servers: 192.168.19.128:9092
producer
:
retries
:
3
timeout
:
60000
request-timeout-ms
:
60000
max-block-ms
:
60000
key.serializer
:
org.apache.kafka.common.serialization.StringSerializer
value.serializer
:
org.apache.kafka.common.serialization.StringSerializer
consumer
:
group-id
:
weblog_consumer_group
auto-offset-reset
:
earliest
enable-auto-commit
:
false
max-poll-interval-ms
:
300000
admin
:
auto-create
:
true
cluster2
:
bootstrap-servers
:
59.195.13.250:29400,59.195.13.250:29401,59.195.13.250:29402
properties
:
security.protocol
:
PLAINTEXT
producer
:
retries
:
3
request-timeout-ms
:
60000
max-block-ms
:
60000
key.serializer
:
org.apache.kafka.common.serialization.StringSerializer
value.serializer
:
org.apache.kafka.common.serialization.StringSerializer
consumer
:
group-id
:
pump_station_consumer_group
auto-offset-reset
:
earliest
enable-auto-commit
:
false
max-poll-interval-ms
:
300000
# 添加消费者稳定性配置
session-timeout-ms
:
30000
heartbeat-interval-ms
:
10000
max-poll-records
:
500
---
#################### 服务保障相关配置 ####################
# Lock4j 配置项
...
...
yudao-server/src/main/resources/application.yaml
View file @
e8fe8c18
...
...
@@ -3,8 +3,8 @@ spring:
name
:
yudao-server
profiles
:
#
active: local
active
:
dev
active
:
local
#
active: dev
main
:
allow-circular-references
:
true
# 允许循环依赖,因为项目是三层架构,无法避免这个情况。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment