Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
6a5a21ab
Commit
6a5a21ab
authored
Feb 02, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交任务详情、问题记录查询
parent
05432645
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
177 additions
and
13 deletions
+177
-13
McbWarningController.java
...oot/module/jxiop/biz/controller/McbWarningController.java
+41
-6
IMcbWarningService.java
...mos/boot/module/jxiop/biz/service/IMcbWarningService.java
+31
-0
McbWarningServiceImpl.java
.../module/jxiop/biz/service/impl/McbWarningServiceImpl.java
+73
-7
McbWarningFeign.java
...oin/amos/boot/module/jxiop/api/feign/McbWarningFeign.java
+32
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/McbWarningController.java
View file @
6a5a21ab
...
...
@@ -20,24 +20,24 @@ import java.util.Map;
@RestController
@Api
(
tags
=
"McbWarning Controller"
)
@RequestMapping
(
value
=
"/
mcb-
warning"
)
@RequestMapping
(
value
=
"/warning"
)
public
class
McbWarningController
{
@Autowired
private
IMcbWarningService
I
McbWarningService
;
private
IMcbWarningService
i
McbWarningService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]今日预警-预警总数"
,
notes
=
"[监测总览]今日预警-预警总数"
)
@GetMapping
(
value
=
"/count/today"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryTodayCount
(
@RequestParam
(
"processingStatus"
)
Integer
processingStatus
)
{
return
ResponseHelper
.
buildResponse
(
I
McbWarningService
.
queryTodayCount
(
processingStatus
));
return
ResponseHelper
.
buildResponse
(
i
McbWarningService
.
queryTodayCount
(
processingStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]近七日预警统计"
,
notes
=
"[监测总览]近七日预警统计"
)
@GetMapping
(
value
=
"/count/week"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
queryWeekCount
()
{
return
ResponseHelper
.
buildResponse
(
I
McbWarningService
.
queryWeekCount
());
return
ResponseHelper
.
buildResponse
(
i
McbWarningService
.
queryWeekCount
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
...
...
@@ -47,7 +47,7 @@ public class McbWarningController {
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
@RequestParam
(
"processingStatus"
)
Integer
processingStatus
)
{
Page
<
BaseEntity
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
return
ResponseHelper
.
buildResponse
(
I
McbWarningService
.
queryWarningPage
(
page
,
processingStatus
));
return
ResponseHelper
.
buildResponse
(
i
McbWarningService
.
queryWarningPage
(
page
,
processingStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
...
...
@@ -57,7 +57,42 @@ public class McbWarningController {
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
@RequestParam
(
"completionStatus"
)
Integer
completionStatus
)
{
Page
<
BaseEntity
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
return
ResponseHelper
.
buildResponse
(
IMcbWarningService
.
queryQuestionPage
(
page
,
completionStatus
));
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
queryQuestionPage
(
page
,
completionStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情、问题记录左侧树"
,
notes
=
"任务详情、问题记录左侧树"
)
@GetMapping
(
value
=
"/warning-warning-info/tree"
)
public
ResponseModel
getWarnTree
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
getWarnTree
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情分页列表"
,
notes
=
"任务详情分页列表"
)
@GetMapping
(
value
=
"/warning-warning-info/page"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTaskDetailPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
getTaskDetailPage
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情统计"
,
notes
=
"任务详情统计"
)
@GetMapping
(
value
=
"/warning-warning-info/statistics"
)
public
ResponseModel
getTaskDetailStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
getTaskDetailStatistic
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"问题记录分页列表"
,
notes
=
"问题记录分页列表"
)
@GetMapping
(
value
=
"/warning-question-info/questionPage"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getQuestionRecordPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
getQuestionRecordPage
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"问题记录统计"
,
notes
=
"问题记录统计"
)
@GetMapping
(
value
=
"/warning-question-info/questionPageTopStatistics"
)
public
ResponseModel
getQuestionRecordStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iMcbWarningService
.
getQuestionRecordStatistic
(
map
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/IMcbWarningService.java
View file @
6a5a21ab
...
...
@@ -38,4 +38,35 @@ public interface IMcbWarningService {
*/
Page
<
Map
<
String
,
Object
>>
queryQuestionPage
(
Page
<
BaseEntity
>
page
,
Integer
processingStatus
);
/**
* 任务详情分页列表
*
* @return 任务详情分页列表
*/
Page
<
Map
<
String
,
Object
>>
getTaskDetailPage
(
Map
<
String
,
Object
>
map
);
/**
* 问题记录分页列表
*
* @return 任务详情分页列表
*/
Page
<
Map
<
String
,
Object
>>
getQuestionRecordPage
(
Map
<
String
,
Object
>
map
);
/**
* 任务详情、问题记录左侧树
*/
Object
getWarnTree
(
Map
<
String
,
Object
>
map
);
/**
* 任务详情列表统计
*/
Object
getTaskDetailStatistic
(
Map
<
String
,
Object
>
map
);
/**
* 问题记录列表统计
*/
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/McbWarningServiceImpl.java
View file @
6a5a21ab
...
...
@@ -2,16 +2,16 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.McbWarningMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IMcbWarningService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.*
;
@Service
public
class
McbWarningServiceImpl
implements
IMcbWarningService
{
...
...
@@ -22,6 +22,9 @@ public class McbWarningServiceImpl implements IMcbWarningService {
@Autowired
private
IPermissionService
permissionService
;
@Autowired
private
McbWarningFeign
warningFeign
;
/**
* 今日预警-预警总数
*
...
...
@@ -48,7 +51,7 @@ public class McbWarningServiceImpl implements IMcbWarningService {
/**
* 预警信息列表
*
* @param page 分页
* @param page
分页
* @param processingStatus 处理状态
* @return 预警信息列表
*/
...
...
@@ -61,7 +64,7 @@ public class McbWarningServiceImpl implements IMcbWarningService {
/**
* 问题信息列表
*
* @param page 分页
* @param page
分页
* @param completionStatus 处理状态
* @return 问题信息列表
*/
...
...
@@ -72,7 +75,57 @@ public class McbWarningServiceImpl implements IMcbWarningService {
}
/**
* 获取用户权限(此处使用gatewayId)
* 任务详情分页列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
getTaskDetailPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
buildGateWayIdsParam
()));
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
warningFeign
.
getTaskDetailPage
(
map
);
return
page
.
getResult
();
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getQuestionRecordPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
buildGateWayIdsParam
()));
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
warningFeign
.
getQuestionRecordPage
(
map
);
return
page
.
getResult
();
}
/**
* 任务详情、问题记录左侧树
*
*/
@Override
public
Object
getWarnTree
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
buildGateWayIdsParam
()));
FeignClientResult
result
=
warningFeign
.
getWarnTree
(
map
);
return
result
.
getResult
();
}
/**
* 任务详情列表统计
*
*/
@Override
public
Object
getTaskDetailStatistic
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
buildGateWayIdsParam
()));
FeignClientResult
result
=
warningFeign
.
getTaskDetailStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 问题记录统计
*
*/
@Override
public
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"GATEWAY_ID"
,
String
.
format
(
"[%s]"
,
buildGateWayIdsParam
()));
FeignClientResult
result
=
warningFeign
.
getQuestionRecordStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 获取用户权限(此处使用projectOrgCode)
*
* @return gatewayIds
*/
...
...
@@ -83,4 +136,17 @@ public class McbWarningServiceImpl implements IMcbWarningService {
}
return
projectOrgCodes
;
}
private
String
buildGateWayIdsParam
()
{
List
<
String
>
currentUserPermissions
=
permissionService
.
getCurrentUserPermissions
();
if
(
Objects
.
isNull
(
currentUserPermissions
))
{
currentUserPermissions
=
new
ArrayList
<>();
}
String
gatewayIds
=
String
.
join
(
","
,
currentUserPermissions
);
if
(!
gatewayIds
.
isEmpty
())
{
gatewayIds
=
String
.
format
(
"[%s]"
,
gatewayIds
);
}
return
Optional
.
ofNullable
(
gatewayIds
).
orElse
(
"[]"
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/feign/McbWarningFeign.java
View file @
6a5a21ab
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
feign
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -39,4 +40,35 @@ public interface McbWarningFeign {
@PostMapping
(
"/task/updateRawDataByTraceId"
)
FeignClientResult
<
Boolean
>
updateRawDataByTraceId
(
@RequestParam
(
value
=
"traceId"
)
String
traceId
,
@RequestParam
(
value
=
"rawData"
)
String
rawData
);
/**
* 任务详情分页列表
*/
@GetMapping
(
"/warning-warning-info/page"
)
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
getTaskDetailPage
(
@RequestParam
Map
<
String
,
Object
>
map
);
/**
* 问题记录分页列表
*/
@GetMapping
(
"/warning-question-info/questionPage"
)
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
getQuestionRecordPage
(
@RequestParam
Map
<
String
,
Object
>
map
);
/**
* 任务详情、问题记录左侧树
*/
@GetMapping
(
"/warning-warning-info/tree"
)
FeignClientResult
getWarnTree
(
@RequestParam
Map
<
String
,
Object
>
map
);
/**
* 任务详情列表统计
*/
@GetMapping
(
"/warning-warning-info/statistics"
)
FeignClientResult
getTaskDetailStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
);
/**
* 问题记录列表统计
*/
@GetMapping
(
"/warning-question-info/questionPageTopStatistics"
)
FeignClientResult
getQuestionRecordStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
);
}
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