Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-mindworkplate
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 30b905cb
authored
Jan 23, 2026
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]新增预警管理,录音查询的逻辑调整
1 parent
e22814b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
16 deletions
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/model/warning/MonitoringMsgDTO.java
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/model/warning/Rule.java
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/service/monitoring/MonitoringService.java
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/ConversationBatchMapper.xml
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/MonitorTypeDictMapper.xml
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/RuleMapper.xml
rpc-dj-mindworkplate/src/test/java/cn/com/glsx/dj/mindworkplate/service/EarlyWarningTest.java
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/model/warning/MonitoringMsgDTO.java
View file @
30b905c
...
@@ -3,6 +3,8 @@ package cn.com.glsx.dj.mindworkplate.model.warning;
...
@@ -3,6 +3,8 @@ package cn.com.glsx.dj.mindworkplate.model.warning;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
javax.persistence.Column
;
import
javax.persistence.Transient
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
...
@@ -93,4 +95,17 @@ public class MonitoringMsgDTO implements Serializable {
...
@@ -93,4 +95,17 @@ public class MonitoringMsgDTO implements Serializable {
private
String
fieldName
;
private
String
fieldName
;
/**
* sortId
*/
@ApiModelProperty
(
notes
=
"sortId"
)
private
Integer
sortId
;
/**
* sortOrder
*/
@ApiModelProperty
(
notes
=
"sortOrder"
)
private
Integer
sortOrder
;
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/model/warning/Rule.java
View file @
30b905c
...
@@ -197,4 +197,16 @@ public class Rule implements Serializable {
...
@@ -197,4 +197,16 @@ public class Rule implements Serializable {
@Transient
@Transient
private
String
fieldName
;
private
String
fieldName
;
/**
* sortId
*/
@Column
(
name
=
"sort_id"
)
private
Integer
sortId
;
/**
* sortId
*/
@Transient
private
Integer
sortOrder
;
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/service/monitoring/MonitoringService.java
View file @
30b905c
...
@@ -39,6 +39,7 @@ import java.util.ArrayList;
...
@@ -39,6 +39,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -107,9 +108,6 @@ public class MonitoringService {
...
@@ -107,9 +108,6 @@ public class MonitoringService {
Map
<
Integer
,
List
<
MonitoringMsgDTO
>>
warningsByMerchant
=
monitorListByCondition
.
stream
()
Map
<
Integer
,
List
<
MonitoringMsgDTO
>>
warningsByMerchant
=
monitorListByCondition
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
MonitoringMsgDTO:
:
getMerchantId4s
));
.
collect
(
Collectors
.
groupingBy
(
MonitoringMsgDTO:
:
getMerchantId4s
));
// 转化成StoreItemResponse对象
Set
<
Integer
>
merchantList
=
warningsByMerchant
.
keySet
();
// 3. 转换为 StoreItemResponse 列表
// 3. 转换为 StoreItemResponse 列表
List
<
StoreItemResponse
>
storeResponses
=
warningsByMerchant
.
entrySet
().
stream
()
List
<
StoreItemResponse
>
storeResponses
=
warningsByMerchant
.
entrySet
().
stream
()
.
map
(
entry
->
{
.
map
(
entry
->
{
...
@@ -121,6 +119,7 @@ public class MonitoringService {
...
@@ -121,6 +119,7 @@ public class MonitoringService {
StoreItemResponse
info
=
new
StoreItemResponse
();
StoreItemResponse
info
=
new
StoreItemResponse
();
info
.
setMerchantNo
(
merchantId
+
""
);
info
.
setMerchantNo
(
merchantId
+
""
);
info
.
setStoreName
(
value
.
get
(
0
).
getMerchantName4s
());
info
.
setStoreName
(
value
.
get
(
0
).
getMerchantName4s
());
info
.
setWarningTotalCount
(
warnings
.
size
());
// 预警摘要:取前2条
// 预警摘要:取前2条
List
<
String
>
summary
=
warnings
.
stream
()
List
<
String
>
summary
=
warnings
.
stream
()
.
limit
(
2
)
.
limit
(
2
)
...
@@ -129,7 +128,7 @@ public class MonitoringService {
...
@@ -129,7 +128,7 @@ public class MonitoringService {
info
.
setWarningSummary
(
summary
);
info
.
setWarningSummary
(
summary
);
// 预警总数
// 预警总数
info
.
setWarningTotalCount
(
warnings
.
size
());
return
info
;
return
info
;
})
})
...
@@ -162,6 +161,11 @@ public class MonitoringService {
...
@@ -162,6 +161,11 @@ public class MonitoringService {
List
<
MonitoringMsgDTO
>
allWarnings
=
futures
.
stream
()
List
<
MonitoringMsgDTO
>
allWarnings
=
futures
.
stream
()
.
map
(
CompletableFuture:
:
join
)
// 阻塞等待每个 future 完成
.
map
(
CompletableFuture:
:
join
)
// 阻塞等待每个 future 完成
.
flatMap
(
List:
:
stream
)
// 合并所有 List<WarningMsg> 为一个流
.
flatMap
(
List:
:
stream
)
// 合并所有 List<WarningMsg> 为一个流
.
sorted
(
Comparator
.
comparing
(
MonitoringMsgDTO:
:
getMerchantId4s
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
.
thenComparing
(
MonitoringMsgDTO:
:
getSortOrder
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
.
thenComparing
(
MonitoringMsgDTO:
:
getSortId
,
Comparator
.
nullsLast
(
Comparator
.
naturalOrder
()))
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
allWarnings
)){
if
(
CollectionUtils
.
isEmpty
(
allWarnings
)){
...
@@ -463,6 +467,8 @@ public class MonitoringService {
...
@@ -463,6 +467,8 @@ public class MonitoringService {
warningMsg
.
setRule
(
rule
.
getRule
());
warningMsg
.
setRule
(
rule
.
getRule
());
warningMsg
.
setRuleType
(
rule
.
getRuleType
());
warningMsg
.
setRuleType
(
rule
.
getRuleType
());
warningMsg
.
setFieldName
(
rule
.
getFieldName
());
warningMsg
.
setFieldName
(
rule
.
getFieldName
());
warningMsg
.
setSortOrder
(
rule
.
getSortOrder
());
warningMsg
.
setSortId
(
rule
.
getSortId
());
if
(
s
.
getConfigValue
()!=
null
){
if
(
s
.
getConfigValue
()!=
null
){
log
.
info
(
"返回值:{}"
,
JSONObject
.
toJSONString
(
s
));
log
.
info
(
"返回值:{}"
,
JSONObject
.
toJSONString
(
s
));
if
((
"兜底指标"
).
equals
(
rule
.
getRuleType
())){
if
((
"兜底指标"
).
equals
(
rule
.
getRuleType
())){
...
...
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/ConversationBatchMapper.xml
View file @
30b905c
...
@@ -496,7 +496,8 @@
...
@@ -496,7 +496,8 @@
t2.end_time,
t2.end_time,
t2.score as score,
t2.score as score,
t2.duration as duration,
t2.duration as duration,
t3.avg_defence as def_score
t3.avg_defence as def_score,
t4.reception_status as receptionStatus
from
from
inspection_badge_recordings t1
inspection_badge_recordings t1
left join inspection_conversation_batch t2 on t2.record_id=t1.id
left join inspection_conversation_batch t2 on t2.record_id=t1.id
...
...
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/MonitorTypeDictMapper.xml
View file @
30b905c
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
property=
"rules"
ofType=
"cn.com.glsx.dj.mindworkplate.model.warning.Rule"
property=
"rules"
ofType=
"cn.com.glsx.dj.mindworkplate.model.warning.Rule"
javaType=
"java.util.ArrayList"
>
javaType=
"java.util.ArrayList"
>
<!-- 子表字段映射 -->
<!-- 子表字段映射 -->
<id
property=
"id"
column=
"
ruleI
d"
/>
<id
property=
"id"
column=
"
i
d"
/>
<result
property=
"rule"
column=
"rule
Name
"
/>
<result
property=
"rule"
column=
"rule"
/>
</collection>
</collection>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
@@ -27,19 +27,19 @@
...
@@ -27,19 +27,19 @@
type_code, type_name, description, sort_order, enabled, create_time
type_code, type_name, description, sort_order, enabled, create_time
</sql>
</sql>
<select
id=
"findMonitorTypeDictList"
<select
id=
"findMonitorTypeDictList"
result
Type=
"cn.com.glsx.dj.mindworkplate.model.MonitorTypeDict
"
>
result
Map=
"BaseResultMap
"
>
select
select
t1.type_code as type
C
ode,
t1.type_code as type
_c
ode,
t1.type_name as type
N
ame,
t1.type_name as type
_n
ame,
t2.id as
ruleI
d,
t2.id as
i
d,
t2.rule as rule
Name
t2.rule as rule
from monitor_type_dict t1
from monitor_type_dict t1
left join early_warning_rule t2 on t1.type_code = t2.monitor_type_dict_id
left join early_warning_rule t2 on t1.type_code = t2.monitor_type_dict_id
where t1.enabled = 1 and t2.deleted_flag ='N'
where t1.enabled = 1 and t2.deleted_flag ='N'
<if
test=
"bussinessType!=null"
>
<if
test=
"bussinessType!=null"
>
and t2.business_type = #{bussinessType}
and t2.business_type = #{bussinessType}
</if>
</if>
order by t1.sort_order
order by t1.sort_order
,t2.sort_id
</select>
</select>
<select
id=
"findMerchantIdsByUUidAndType"
resultType=
"java.lang.Integer"
>
<select
id=
"findMerchantIdsByUUidAndType"
resultType=
"java.lang.Integer"
>
select merchant_id from merchant_monitor_type_dict where uuid = #{uuid} and type_code = #{typeCode}
select merchant_id from merchant_monitor_type_dict where uuid = #{uuid} and type_code = #{typeCode}
...
...
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/RuleMapper.xml
View file @
30b905c
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
<result
column=
"updated_by"
property=
"updatedBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"updated_by"
property=
"updatedBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
<result
column=
"field_name"
property=
"fieldName"
jdbcType=
"VARCHAR"
/>
<result
column=
"field_name"
property=
"fieldName"
jdbcType=
"VARCHAR"
/>
<result
column=
"sortOrder"
property=
"sortOrder"
jdbcType=
"INTEGER"
/>
<result
column=
"sort_id"
property=
"sortId"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<resultMap
id=
"MsgResultMap"
type=
"cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg"
>
<resultMap
id=
"MsgResultMap"
type=
"cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg"
>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
...
@@ -67,8 +69,9 @@
...
@@ -67,8 +69,9 @@
</select>
</select>
<select
id=
"selectByTypeAndMetricType"
<select
id=
"selectByTypeAndMetricType"
resultMap=
"BaseResultMap"
>
resultMap=
"BaseResultMap"
>
SELECT t1.*,t2.field_name FROM early_warning_rule t1
SELECT t1.*,t2.field_name
,t3.sort_order as sortOrder
FROM early_warning_rule t1
LEFT JOIN early_warning_rule_condition t2 ON t1.id=t2.rule_id
LEFT JOIN early_warning_rule_condition t2 ON t1.id=t2.rule_id
left join monitor_type_dict t3 on t1.monitor_type_dict_id=t3.type_code
where strategy_flag=1 and t1.deleted_flag='N'
where strategy_flag=1 and t1.deleted_flag='N'
<if
test=
"monitorType!=null"
>
<if
test=
"monitorType!=null"
>
and monitor_type_dict_id=#{monitorType}
and monitor_type_dict_id=#{monitorType}
...
...
rpc-dj-mindworkplate/src/test/java/cn/com/glsx/dj/mindworkplate/service/EarlyWarningTest.java
View file @
30b905c
...
@@ -136,8 +136,9 @@ public class EarlyWarningTest extends BaseServiceTest{
...
@@ -136,8 +136,9 @@ public class EarlyWarningTest extends BaseServiceTest{
@Test
@Test
public
void
findMonitorListPage
()
throws
ParseException
{
public
void
findMonitorListPage
()
throws
ParseException
{
MonitorFilterRequest
request
=
new
MonitorFilterRequest
();
MonitorFilterRequest
request
=
new
MonitorFilterRequest
();
request
.
setStartDate
(
"2024-11-01"
);
request
.
setStartDate
(
"2025-11-01"
);
request
.
setEndDate
(
"2024-11-18"
);
request
.
setEndDate
(
"2025-12-31"
);
request
.
setBusinessType
(
1
);
List
<
StoreItemResponse
>
monitorListPage
=
monitoringService
.
findMonitorListPage
(
request
);
List
<
StoreItemResponse
>
monitorListPage
=
monitoringService
.
findMonitorListPage
(
request
);
System
.
out
.
println
(
"aa"
+
JSONObject
.
toJSONString
(
monitorListPage
));
System
.
out
.
println
(
"aa"
+
JSONObject
.
toJSONString
(
monitorListPage
));
}
}
...
...
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