Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
f3eee565
Commit
f3eee565
authored
Jul 11, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
e8f320a1
69d4e8d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
348 additions
and
339 deletions
+348
-339
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+5
-8
OverviewQuestionDto.java
...n/amos/boot/module/jxiop/api/dto/OverviewQuestionDto.java
+3
-2
McbWarningServiceImpl.java
.../module/jxiop/biz/service/impl/McbWarningServiceImpl.java
+340
-329
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
View file @
f3eee565
...
...
@@ -87,18 +87,15 @@ public class BasicGridAcceptanceServiceImpl
return
pageNew
;
}
public
HygfOnGrid
saveEntity
(
HygfOnGrid
grid
)
{
if
(
grid
.
getSequenceNbr
()
!=
null
)
{
onGridMapper
.
updateById
(
grid
);
}
else
{
onGridMapper
.
insert
(
grid
);
}
public
synchronized
HygfOnGrid
saveEntity
(
HygfOnGrid
grid
)
{
LambdaQueryWrapper
<
HygfOnGrid
>
hog
=
new
LambdaQueryWrapper
<>();
hog
.
eq
(
HygfOnGrid:
:
getPeasantHouseholdId
,
grid
.
getPeasantHouseholdId
());
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
return
grid
;
}
@GlobalTransactional
public
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>()
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/OverviewQuestionDto.java
View file @
f3eee565
...
...
@@ -13,8 +13,9 @@ public class OverviewQuestionDto {
private
String
createDate
;
@ApiModelProperty
(
value
=
"问题内容"
)
private
String
warningContent
;
private
String
content
;
@ApiModelProperty
(
value
=
"问题内容"
)
private
String
content_
;
@ApiModelProperty
(
value
=
"问题完成情况描述"
)
private
String
completionStatusDesc
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/McbWarningServiceImpl.java
View file @
f3eee565
...
...
@@ -3,8 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.OverviewQuestionDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RectificationUnitClassifyTreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign
;
...
...
@@ -13,7 +11,6 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IPermissionService;
import
com.yeejoin.amos.boot.module.jxiop.biz.mcbwarningmapper.McbWarningMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,332 +23,346 @@ import java.util.stream.Collectors;
@Service
public
class
McbWarningServiceImpl
implements
IMcbWarningService
{
private
final
static
org
.
slf4j
.
Logger
log
=
LoggerFactory
.
getLogger
(
McbWarningServiceImpl
.
class
);
@Autowired
private
McbWarningMapper
mcbWarningMapper
;
@Autowired
private
IPermissionService
permissionService
;
@Autowired
private
McbWarningFeign
mcbWarningFeign
;
/**
* 今日预警-预警总数
*
* @param processingStatus 处理状态
* @return 总数信息
*/
@Override
public
Map
<
String
,
Object
>
queryTodayCount
(
Integer
processingStatus
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryTodayCount
(
projectOrgCodes
,
processingStatus
);
}
/**
* 近七日预警统计
*
* @return 预警统计
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryWeekCount
()
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryWeekCount
(
projectOrgCodes
);
}
/**
* 预警信息列表
*
* @param page 分页
* @param processingStatus 处理状态
* @return 预警信息列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
queryWarningPage
(
Page
<
Map
<
String
,
Object
>>
page
,
Integer
processingStatus
,
String
eventLevel
,
String
createDate
,
String
startTime
,
String
endTime
,
String
warningSourceType
,
String
objectName
,
String
overView
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
long
size
=
page
.
getSize
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
List
<
Map
<
String
,
Object
>>
records
=
mcbWarningMapper
.
queryWarningList
(
start
,
size
,
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
Long
total
=
mcbWarningMapper
.
queryWarningCount
(
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
page
.
setRecords
(
records
);
page
.
setTotal
(
total
);
return
page
;
}
@Override
public
Page
<
OverviewQuestionDto
>
overviewQuestionList
(
Integer
current
,
Integer
size
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
startTime
!=
null
&&
startTime
!=
""
)
{
startTime
+=
" 00:00:00"
;
}
if
(
endTime
!=
null
&&
endTime
!=
""
)
{
endTime
+=
" 23:59:59"
;
}
List
<
OverviewQuestionDto
>
list
=
mcbWarningMapper
.
overviewQuestionList
(
(
current
-
1
)
*
size
,
size
,
projectOrgCodes
,
startTime
,
endTime
);
Integer
total
=
mcbWarningMapper
.
overviewQuestionListTotal
(
projectOrgCodes
,
startTime
,
endTime
);
Page
<
OverviewQuestionDto
>
pagenew
=
new
Page
<>();
pagenew
.
setCurrent
(
current
);
pagenew
.
setTotal
(
total
);
pagenew
.
setSize
(
size
);
pagenew
.
setRecords
(
list
);
return
pagenew
;
}
/**
* 预警信息总数
*
* @param processingStatus 处理状态
* @return 预警信息总数
*/
@Override
public
Long
queryWarningCount
(
Integer
processingStatus
,
String
eventLevel
,
String
createDate
,
String
startTime
,
String
endTime
,
String
warningSourceType
,
String
objectName
,
String
overView
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryWarningCount
(
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
}
/**
* 问题信息列表
*
* @param page 分页
* @param completionStatus 完成状态
* @return 问题信息列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
queryQuestionPage
(
Page
<
Map
<
String
,
Object
>>
page
,
Integer
completionStatus
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
long
start
=
page
.
getCurrent
()
-
1
;
long
offset
=
page
.
getSize
()
*
page
.
getCurrent
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
List
<
Map
<
String
,
Object
>>
records
=
mcbWarningMapper
.
queryQuestionList
(
start
,
offset
,
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
Long
total
=
mcbWarningMapper
.
queryQuestionCount
(
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
page
.
setRecords
(
records
);
page
.
setTotal
(
total
);
return
page
;
}
/**
* 问题信息列表
*
* @param completionStatus 完成状态
* @return 问题信息列表
*/
@Override
public
Long
queryQuestionCount
(
Integer
completionStatus
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryQuestionCount
(
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
}
/**
* 获取地图点位/路线
*
* @param province 省份
* @return 地图点位/路线
*/
@Override
public
Object
queryMapRoutes
(
String
province
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
// TODO: 远程调用warning服务
return
null
;
}
/**
* 任务详情分页列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
getTaskDetailPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
mcbWarningFeign
.
getTaskDetailPage
(
map
);
return
page
.
getResult
();
}
/**
* 问题记录分页列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
getQuestionRecordPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
mcbWarningFeign
.
getQuestionRecordPage
(
map
);
return
page
.
getResult
();
}
public
List
<
RectificationUnitClassifyTreeDto
>
treeToList
(
List
<
RectificationUnitClassifyTreeDto
>
source
,
List
<
RectificationUnitClassifyTreeDto
>
object
)
{
source
.
stream
().
forEach
(
v
->
{
RectificationUnitClassifyTreeDto
t
=
new
RectificationUnitClassifyTreeDto
();
BeanUtils
.
copyProperties
(
v
,
t
);
t
.
setChildren
(
new
ArrayList
());
object
.
add
(
t
);
// 判断该对象的getChildren()是否为空
if
(!
CollectionUtils
.
isEmpty
(
v
.
getChildren
()))
{
treeToList
(
v
.
getChildren
(),
object
);
}
});
return
object
;
}
/**
* 任务详情、问题记录左侧树
*
*/
@Override
public
Object
getWarnTree
()
{
FeignClientResult
<
List
<
RectificationUnitClassifyTreeDto
>>
allUnitList
=
mcbWarningFeign
.
getWarnTree
();
List
<
RectificationUnitClassifyTreeDto
>
res
=
allUnitList
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
res
))
{
return
new
ArrayList
<>();
}
List
<
RectificationUnitClassifyTreeDto
>
targetList
=
new
ArrayList
<>();
List
<
RectificationUnitClassifyTreeDto
>
tempList
=
treeToList
(
res
,
targetList
);
List
<
String
>
codes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
targetList
=
tempList
.
stream
().
filter
(
x
->
{
if
(
CollectionUtil
.
isNotEmpty
(
codes
))
{
for
(
String
str
:
codes
)
{
if
(
x
.
getCode
().
startsWith
(
str
))
{
return
true
;
}
}
}
return
false
;
}).
collect
(
Collectors
.
toList
());
List
<
RectificationUnitClassifyTreeDto
>
listDate
=
new
ArrayList
<>();
if
(!
targetList
.
isEmpty
())
{
for
(
RectificationUnitClassifyTreeDto
t
:
targetList
)
{
if
(
StringUtils
.
isBlank
(
t
.
getParentId
())
||
"0"
.
equals
(
t
.
getParentId
())
||
codes
.
get
(
0
).
equals
(
t
.
getCode
()))
{
t
.
setChildren
(
getChild
(
t
,
targetList
));
listDate
.
add
(
t
);
break
;
}
}
}
return
listDate
;
}
private
List
<
RectificationUnitClassifyTreeDto
>
getChild
(
RectificationUnitClassifyTreeDto
dto
,
List
<
RectificationUnitClassifyTreeDto
>
listDto
)
{
return
(
List
<
RectificationUnitClassifyTreeDto
>)
listDto
.
stream
()
.
filter
(
t
->
t
.
getParentId
().
equals
(
dto
.
getSequenceNbr
().
toString
()))
.
peek
(
m
->
m
.
setChildren
(
getChild
(
m
,
listDto
))).
collect
(
Collectors
.
toList
());
}
/**
* 任务详情列表统计
*
*/
@Override
public
Object
getTaskDetailStatistic
(
Map
<
String
,
Object
>
map
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
map
.
put
(
"projectOrgCodes"
,
projectOrgCodes
);
FeignClientResult
result
=
mcbWarningFeign
.
getTaskDetailStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 问题记录列表统计
*
*/
@Override
public
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
result
=
mcbWarningFeign
.
getQuestionRecordStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 问题记录列表统计
*
*/
@Override
public
Object
getMapRouteInfoByCodes
(
String
province
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getMapRouteInfoByCodes
(
province
,
projectOrgCodes
,
"like"
);
return
result
.
getResult
();
}
@Override
public
Object
getLampListPageByCodes
(
String
questionRectificationStatus
,
String
warningSourceType
,
String
objectName
,
Page
page
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getLampListPage
(
questionRectificationStatus
,
warningSourceType
,
objectName
,
projectOrgCodes
,
"like"
,
page
.
getCurrent
(),
page
.
getSize
());
return
result
.
getResult
();
}
@Override
public
Object
getLampListByCodes
(
String
questionRectificationStatus
,
String
warningSourceType
,
String
objectName
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getLampList
(
questionRectificationStatus
,
warningSourceType
,
objectName
,
projectOrgCodes
,
"like"
);
return
result
.
getResult
();
}
/**
* 获取用户权限(此处使用projectOrgCode)
*
* @return gatewayIds
*/
private
List
<
String
>
getProjectOrgCodes
()
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserProjectOrgCodes
();
if
(
Objects
.
isNull
(
projectOrgCodes
))
{
projectOrgCodes
=
new
ArrayList
<>();
}
log
.
info
(
JSON
.
toJSONString
(
"当前用户转换获取的orgcode列表是 "
+
projectOrgCodes
));
return
projectOrgCodes
;
}
public
List
<
Map
<
String
,
Object
>>
stationOverNum
(
String
sourceAttribution
){
return
mcbWarningMapper
.
stationOverNum
(
sourceAttribution
);
}
public
Map
<
String
,
Object
>
stationOverTotal
(
String
province
,
String
sourceAttribution
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dayNum"
,
mcbWarningMapper
.
getDayTotal
(
province
,
sourceAttribution
));
map
.
put
(
"monNum"
,
mcbWarningMapper
.
getMonthTotal
(
province
,
sourceAttribution
));
map
.
put
(
"yearNum"
,
mcbWarningMapper
.
getYearTotal
(
province
,
sourceAttribution
));
return
map
;
}
private
final
static
org
.
slf4j
.
Logger
log
=
LoggerFactory
.
getLogger
(
McbWarningServiceImpl
.
class
);
@Autowired
private
McbWarningMapper
mcbWarningMapper
;
@Autowired
private
IPermissionService
permissionService
;
@Autowired
private
McbWarningFeign
mcbWarningFeign
;
/**
* 今日预警-预警总数
*
* @param processingStatus 处理状态
* @return 总数信息
*/
@Override
public
Map
<
String
,
Object
>
queryTodayCount
(
Integer
processingStatus
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryTodayCount
(
projectOrgCodes
,
processingStatus
);
}
/**
* 近七日预警统计
*
* @return 预警统计
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryWeekCount
()
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryWeekCount
(
projectOrgCodes
);
}
/**
* 预警信息列表
*
* @param page 分页
* @param processingStatus 处理状态
* @return 预警信息列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
queryWarningPage
(
Page
<
Map
<
String
,
Object
>>
page
,
Integer
processingStatus
,
String
eventLevel
,
String
createDate
,
String
startTime
,
String
endTime
,
String
warningSourceType
,
String
objectName
,
String
overView
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
long
size
=
page
.
getSize
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
List
<
Map
<
String
,
Object
>>
records
=
mcbWarningMapper
.
queryWarningList
(
start
,
size
,
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
if
(
CollectionUtil
.
isNotEmpty
(
records
))
{
for
(
Map
<
String
,
Object
>
record
:
records
)
{
record
.
put
(
"CONTENT"
,
record
.
get
(
"CONTENT_"
));
}
}
Long
total
=
mcbWarningMapper
.
queryWarningCount
(
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
page
.
setRecords
(
records
);
page
.
setTotal
(
total
);
return
page
;
}
@Override
public
Page
<
OverviewQuestionDto
>
overviewQuestionList
(
Integer
current
,
Integer
size
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
startTime
!=
null
&&
startTime
!=
""
)
{
startTime
+=
" 00:00:00"
;
}
if
(
endTime
!=
null
&&
endTime
!=
""
)
{
endTime
+=
" 23:59:59"
;
}
List
<
OverviewQuestionDto
>
list
=
mcbWarningMapper
.
overviewQuestionList
((
current
-
1
)
*
size
,
size
,
projectOrgCodes
,
startTime
,
endTime
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
for
(
OverviewQuestionDto
overviewQuestionDto
:
list
)
{
overviewQuestionDto
.
setContent
(
overviewQuestionDto
.
getContent_
());
}
}
Integer
total
=
mcbWarningMapper
.
overviewQuestionListTotal
(
projectOrgCodes
,
startTime
,
endTime
);
Page
<
OverviewQuestionDto
>
pagenew
=
new
Page
<>();
pagenew
.
setCurrent
(
current
);
pagenew
.
setTotal
(
total
);
pagenew
.
setSize
(
size
);
pagenew
.
setRecords
(
list
);
return
pagenew
;
}
/**
* 预警信息总数
*
* @param processingStatus 处理状态
* @return 预警信息总数
*/
@Override
public
Long
queryWarningCount
(
Integer
processingStatus
,
String
eventLevel
,
String
createDate
,
String
startTime
,
String
endTime
,
String
warningSourceType
,
String
objectName
,
String
overView
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryWarningCount
(
projectOrgCodes
,
processingStatus
,
eventLevel
,
createDate
,
startTime
,
endTime
,
warningSourceType
,
objectName
,
overView
);
}
/**
* 问题信息列表
*
* @param page 分页
* @param completionStatus 完成状态
* @return 问题信息列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
queryQuestionPage
(
Page
<
Map
<
String
,
Object
>>
page
,
Integer
completionStatus
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
long
start
=
page
.
getCurrent
()
-
1
;
long
offset
=
page
.
getSize
()
*
page
.
getCurrent
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
List
<
Map
<
String
,
Object
>>
records
=
mcbWarningMapper
.
queryQuestionList
(
start
,
offset
,
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
if
(
CollectionUtil
.
isNotEmpty
(
records
))
{
for
(
Map
<
String
,
Object
>
record
:
records
)
{
record
.
put
(
"CONTENT"
,
record
.
get
(
"CONTENT_"
));
}
}
Long
total
=
mcbWarningMapper
.
queryQuestionCount
(
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
page
.
setRecords
(
records
);
page
.
setTotal
(
total
);
return
page
;
}
/**
* 问题信息列表
*
* @param completionStatus 完成状态
* @return 问题信息列表
*/
@Override
public
Long
queryQuestionCount
(
Integer
completionStatus
,
String
startTime
,
String
endTime
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
return
mcbWarningMapper
.
queryQuestionCount
(
projectOrgCodes
,
completionStatus
,
startTime
,
endTime
);
}
/**
* 获取地图点位/路线
*
* @param province 省份
* @return 地图点位/路线
*/
@Override
public
Object
queryMapRoutes
(
String
province
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
// TODO: 远程调用warning服务
return
null
;
}
/**
* 任务详情分页列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
getTaskDetailPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
mcbWarningFeign
.
getTaskDetailPage
(
map
);
return
page
.
getResult
();
}
/**
* 问题记录分页列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
getQuestionRecordPage
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
<
Page
<
Map
<
String
,
Object
>>>
page
=
mcbWarningFeign
.
getQuestionRecordPage
(
map
);
return
page
.
getResult
();
}
public
List
<
RectificationUnitClassifyTreeDto
>
treeToList
(
List
<
RectificationUnitClassifyTreeDto
>
source
,
List
<
RectificationUnitClassifyTreeDto
>
object
)
{
source
.
stream
().
forEach
(
v
->
{
RectificationUnitClassifyTreeDto
t
=
new
RectificationUnitClassifyTreeDto
();
BeanUtils
.
copyProperties
(
v
,
t
);
t
.
setChildren
(
new
ArrayList
());
object
.
add
(
t
);
// 判断该对象的getChildren()是否为空
if
(!
CollectionUtils
.
isEmpty
(
v
.
getChildren
()))
{
treeToList
(
v
.
getChildren
(),
object
);
}
});
return
object
;
}
/**
* 任务详情、问题记录左侧树
*
*/
@Override
public
Object
getWarnTree
()
{
FeignClientResult
<
List
<
RectificationUnitClassifyTreeDto
>>
allUnitList
=
mcbWarningFeign
.
getWarnTree
();
List
<
RectificationUnitClassifyTreeDto
>
res
=
allUnitList
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
res
))
{
return
new
ArrayList
<>();
}
List
<
RectificationUnitClassifyTreeDto
>
targetList
=
new
ArrayList
<>();
List
<
RectificationUnitClassifyTreeDto
>
tempList
=
treeToList
(
res
,
targetList
);
List
<
String
>
codes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
targetList
=
tempList
.
stream
().
filter
(
x
->
{
if
(
CollectionUtil
.
isNotEmpty
(
codes
))
{
for
(
String
str
:
codes
)
{
if
(
x
.
getCode
().
startsWith
(
str
))
{
return
true
;
}
}
}
return
false
;
}).
collect
(
Collectors
.
toList
());
List
<
RectificationUnitClassifyTreeDto
>
listDate
=
new
ArrayList
<>();
if
(!
targetList
.
isEmpty
())
{
for
(
RectificationUnitClassifyTreeDto
t
:
targetList
)
{
if
(
StringUtils
.
isBlank
(
t
.
getParentId
())
||
"0"
.
equals
(
t
.
getParentId
())
||
codes
.
get
(
0
).
equals
(
t
.
getCode
()))
{
t
.
setChildren
(
getChild
(
t
,
targetList
));
listDate
.
add
(
t
);
break
;
}
}
}
return
listDate
;
}
private
List
<
RectificationUnitClassifyTreeDto
>
getChild
(
RectificationUnitClassifyTreeDto
dto
,
List
<
RectificationUnitClassifyTreeDto
>
listDto
)
{
return
(
List
<
RectificationUnitClassifyTreeDto
>)
listDto
.
stream
()
.
filter
(
t
->
t
.
getParentId
().
equals
(
dto
.
getSequenceNbr
().
toString
()))
.
peek
(
m
->
m
.
setChildren
(
getChild
(
m
,
listDto
))).
collect
(
Collectors
.
toList
());
}
/**
* 任务详情列表统计
*
*/
@Override
public
Object
getTaskDetailStatistic
(
Map
<
String
,
Object
>
map
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
map
.
put
(
"projectOrgCodes"
,
projectOrgCodes
);
FeignClientResult
result
=
mcbWarningFeign
.
getTaskDetailStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 问题记录列表统计
*
*/
@Override
public
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
)
{
List
<
String
>
projectOrgCodes
=
this
.
getProjectOrgCodes
();
map
.
put
(
"projectOrgCodes"
,
this
.
getProjectOrgCodes
());
FeignClientResult
result
=
mcbWarningFeign
.
getQuestionRecordStatistic
(
map
);
return
result
.
getResult
();
}
/**
* 问题记录列表统计
*
*/
@Override
public
Object
getMapRouteInfoByCodes
(
String
province
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getMapRouteInfoByCodes
(
province
,
projectOrgCodes
,
"like"
);
return
result
.
getResult
();
}
@Override
public
Object
getLampListPageByCodes
(
String
questionRectificationStatus
,
String
warningSourceType
,
String
objectName
,
Page
page
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getLampListPage
(
questionRectificationStatus
,
warningSourceType
,
objectName
,
projectOrgCodes
,
"like"
,
page
.
getCurrent
(),
page
.
getSize
());
return
result
.
getResult
();
}
@Override
public
Object
getLampListByCodes
(
String
questionRectificationStatus
,
String
warningSourceType
,
String
objectName
)
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserAmosOrgCodes
();
if
(
projectOrgCodes
.
isEmpty
())
{
projectOrgCodes
.
add
(
"NULL"
);
}
FeignClientResult
<
Object
>
result
=
mcbWarningFeign
.
getLampList
(
questionRectificationStatus
,
warningSourceType
,
objectName
,
projectOrgCodes
,
"like"
);
return
result
.
getResult
();
}
/**
* 获取用户权限(此处使用projectOrgCode)
*
* @return gatewayIds
*/
private
List
<
String
>
getProjectOrgCodes
()
{
List
<
String
>
projectOrgCodes
=
permissionService
.
getCurrentUserProjectOrgCodes
();
if
(
Objects
.
isNull
(
projectOrgCodes
))
{
projectOrgCodes
=
new
ArrayList
<>();
}
log
.
info
(
JSON
.
toJSONString
(
"当前用户转换获取的orgcode列表是 "
+
projectOrgCodes
));
return
projectOrgCodes
;
}
public
List
<
Map
<
String
,
Object
>>
stationOverNum
(
String
sourceAttribution
)
{
return
mcbWarningMapper
.
stationOverNum
(
sourceAttribution
);
}
public
Map
<
String
,
Object
>
stationOverTotal
(
String
province
,
String
sourceAttribution
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dayNum"
,
mcbWarningMapper
.
getDayTotal
(
province
,
sourceAttribution
));
map
.
put
(
"monNum"
,
mcbWarningMapper
.
getMonthTotal
(
province
,
sourceAttribution
));
map
.
put
(
"yearNum"
,
mcbWarningMapper
.
getYearTotal
(
province
,
sourceAttribution
));
return
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