Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
2c924d95
提交
2c924d95
authored
10月 26, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[统计分析]修改了业务统计,新增了各市告警统计
上级
8db0b79f
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
107 行增加
和
33 行删除
+107
-33
StatisticalController.java
...ykj/dev/statistical/controller/StatisticalController.java
+2
-3
StatisticalService.java
.../com/tykj/dev/statistical/service/StatisticalService.java
+6
-1
StatisticalServiceImpl.java
.../dev/statistical/service/impl/StatisticalServiceImpl.java
+97
-21
BusinessSituation.java
...n/java/com/tykj/dev/statistical/vo/BusinessSituation.java
+0
-5
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+2
-2
DeviceUseReportController.java
...evice/usereport/controller/DeviceUseReportController.java
+0
-1
没有找到文件。
dev-statistical/src/main/java/com/tykj/dev/statistical/controller/StatisticalController.java
浏览文件 @
2c924d95
...
@@ -116,13 +116,12 @@ public class StatisticalController {
...
@@ -116,13 +116,12 @@ public class StatisticalController {
/**
/**
* 查询各市告警情况
* 查询各市告警情况
* @return 各市告警
情况
对象集合
* @return 各市告警
统计
对象集合
*/
*/
@ApiOperation
(
value
=
"查询各市告警情况"
)
@ApiOperation
(
value
=
"查询各市告警情况"
)
@GetMapping
(
"/alarmSituation/detail"
)
@GetMapping
(
"/alarmSituation/detail"
)
public
ResponseEntity
selectAlarmSituationDetail
(){
public
ResponseEntity
selectAlarmSituationDetail
(){
List
<
AlarmSituation
>
alarmSituations
=
new
ArrayList
<>();
return
ResponseEntity
.
ok
(
statisticalService
.
getRfidWarningDetail
());
return
ResponseEntity
.
ok
(
alarmSituations
);
}
}
/**
/**
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/service/StatisticalService.java
浏览文件 @
2c924d95
...
@@ -40,5 +40,10 @@ public interface StatisticalService {
...
@@ -40,5 +40,10 @@ public interface StatisticalService {
* @param type 类型(1:上半年,2:下半年)
* @param type 类型(1:上半年,2:下半年)
* 获取业务统计信息
* 获取业务统计信息
*/
*/
BusinessSituation
getBusinessNum
(
Integer
type
)
throws
ParseException
;
List
<
BusinessSituation
>
getBusinessNum
(
Integer
type
)
throws
ParseException
;
/**
* 获取本季度各市告警统计信息
*/
List
<
AlarmSituation
>
getRfidWarningDetail
();
}
}
dev-statistical/src/main/java/com/tykj/dev/statistical/service/impl/StatisticalServiceImpl.java
浏览文件 @
2c924d95
...
@@ -8,7 +8,11 @@ import com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask;
...
@@ -8,7 +8,11 @@ import com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.task.subject.vo.TaskSelectVo
;
import
com.tykj.dev.device.task.subject.vo.TaskUserVo
;
import
com.tykj.dev.device.user.subject.dao.AreaDao
;
import
com.tykj.dev.device.user.subject.dao.AreaDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
com.tykj.dev.device.user.subject.entity.Area
;
...
@@ -53,10 +57,7 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -53,10 +57,7 @@ public class StatisticalServiceImpl implements StatisticalService {
private
LibraryWarningLogDao
libraryWarningLogDao
;
private
LibraryWarningLogDao
libraryWarningLogDao
;
@Autowired
@Autowired
private
TaskDao
taskDao
;
private
TaskService
taskService
;
@Autowired
private
FinalReportDao
finalReportDao
;
/**
/**
* 获取装备统计信息
* 获取装备统计信息
...
@@ -264,35 +265,95 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -264,35 +265,95 @@ public class StatisticalServiceImpl implements StatisticalService {
* 获取业务统计信息
* 获取业务统计信息
*/
*/
@Override
@Override
public
BusinessSituation
getBusinessNum
(
Integer
type
)
throws
ParseException
{
public
List
<
BusinessSituation
>
getBusinessNum
(
Integer
type
)
throws
ParseException
{
List
<
Task
>
tasks
;
List
<
BusinessSituation
>
businessSituations
=
new
ArrayList
<>();
List
<
FinalReport
>
finalReports
;
TaskSelectVo
taskSelectVo
=
new
TaskSelectVo
();
taskSelectVo
.
setSelectNum
(
3
);
TaskSelectVo
taskSelectVo2
=
new
TaskSelectVo
();
taskSelectVo2
.
setSelectNum
(
2
);
//跟踪
List
<
TaskUserVo
>
trackings
=
taskService
.
getList
(
taskSelectVo
);
//待办
List
<
TaskUserVo
>
belongings
=
taskService
.
getList
(
taskSelectVo2
);
//筛选出来的上半年或下半年待办
List
<
TaskUserVo
>
tasks
;
//筛选出来的上半年或下半年跟踪
List
<
TaskUserVo
>
tasks2
;
//上半年
//上半年
if
(
type
==
1
){
if
(
type
==
1
){
List
<
Date
>
dates
=
getFirstHalfYear
();
List
<
Date
>
dates
=
getFirstHalfYear
();
tasks
=
taskDao
.
findAll
().
stream
()
//筛选出上半年待办
.
filter
(
task
->
task
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
task
.
getCreateTime
().
before
(
dates
.
get
(
1
))&&(
task
.
getParentTaskId
()==
null
||
task
.
getParentTaskId
()==
0
))
tasks
=
belongings
.
stream
()
.
filter
(
taskUserVo
->
taskUserVo
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
taskUserVo
.
getCreateTime
().
before
(
dates
.
get
(
1
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
finalReports
=
finalReportDao
.
findAll
().
stream
()
//筛选出上半年跟踪
.
filter
(
finalReport
->
Date
.
from
(
finalReport
.
getCreateTime
().
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()).
after
(
dates
.
get
(
0
))&&
Date
.
from
(
finalReport
.
getCreateTime
().
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()).
before
(
dates
.
get
(
1
)))
tasks2
=
trackings
.
stream
()
.
filter
(
taskUserVo
->
taskUserVo
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
taskUserVo
.
getCreateTime
().
before
(
dates
.
get
(
1
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
return
countBusiness
(
tasks
,
finalReports
);
businessSituations
.
add
(
countBusiness
(
tasks
));
businessSituations
.
add
(
countBusiness
(
tasks2
));
return
businessSituations
;
}
}
else
if
(
type
==
2
){
else
if
(
type
==
2
){
List
<
Date
>
dates
=
getLastHalfYear
();
List
<
Date
>
dates
=
getLastHalfYear
();
tasks
=
taskDao
.
findAll
().
stream
()
//筛选出下半年待办
.
filter
(
task
->
task
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
task
.
getCreateTime
().
before
(
dates
.
get
(
1
))&&(
task
.
getParentTaskId
()==
null
||
task
.
getParentTaskId
()==
0
))
tasks
=
belongings
.
stream
()
.
filter
(
taskUserVo
->
taskUserVo
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
taskUserVo
.
getCreateTime
().
before
(
dates
.
get
(
1
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
finalReports
=
finalReportDao
.
findAll
().
stream
()
//筛选出下半年跟踪
.
filter
(
finalReport
->
Date
.
from
(
finalReport
.
getCreateTime
().
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()).
after
(
dates
.
get
(
0
))&&
Date
.
from
(
finalReport
.
getCreateTime
().
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()).
before
(
dates
.
get
(
1
)))
tasks2
=
trackings
.
stream
()
.
filter
(
taskUserVo
->
taskUserVo
.
getCreateTime
().
after
(
dates
.
get
(
0
))&&
taskUserVo
.
getCreateTime
().
before
(
dates
.
get
(
1
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
return
countBusiness
(
tasks
,
finalReports
);
businessSituations
.
add
(
countBusiness
(
tasks
));
businessSituations
.
add
(
countBusiness
(
tasks2
));
return
businessSituations
;
}
}
else
{
else
{
throw
new
ApiException
(
"type只能为1或2"
);
throw
new
ApiException
(
"type只能为1或2"
);
}
}
}
}
/**
* 获取本季度各市告警统计信息
*/
@Override
public
List
<
AlarmSituation
>
getRfidWarningDetail
()
{
List
<
AlarmSituation
>
alarmSituations
=
new
ArrayList
<>();
List
<
Area
>
areas
=
areaDao
.
findAreasByType
(
2
);
//每个市进行统计
for
(
Area
area:
areas
)
{
AlarmSituation
alarmSituation
=
new
AlarmSituation
();
alarmSituation
.
setArea
(
area
.
getName
());
//获取市以及子区县所有区域
List
<
Area
>
areas1
=
areaDao
.
findAllByFatherId
(
area
.
getId
());
areas1
.
add
(
area
);
//获取所有单位名称
List
<
String
>
unitNames
=
new
ArrayList
<>();
areas1
.
forEach
(
area1
->
{
List
<
Units
>
units
=
unitsDao
.
findAllByAreaId
(
area1
.
getId
());
if
(
units
.
size
()
==
1
)
{
unitNames
.
add
(
units
.
get
(
0
).
getName
());
}
});
//获取当前季度
Integer
quarter
=
getQuarter
(
new
Date
());
//获取当前季度该区域所有告警记录
List
<
LibraryWarningLog
>
libraryWarningLogs
=
libraryWarningLogDao
.
findAll
().
stream
()
.
filter
(
libraryWarningLog
->
getQuarter
(
libraryWarningLog
.
getCreateTime
()).
equals
(
quarter
)&&
unitNames
.
contains
(
libraryWarningLog
.
getUnit
()))
.
collect
(
Collectors
.
toList
());
alarmSituation
.
setAlarmCount
(
libraryWarningLogs
.
size
());
//获取盘库异常数量
int
inventoryNum
=
(
int
)
libraryWarningLogs
.
stream
().
filter
(
libraryWarningLog
->
libraryWarningLog
.
getWarningType
()==
2
).
count
();
//获取未处理数量
int
unHandleNum
=
(
int
)
libraryWarningLogs
.
stream
().
filter
(
libraryWarningLog
->
libraryWarningLog
.
getWarningHandle
()==
0
).
count
();
alarmSituation
.
setInventoryCount
(
inventoryNum
);
alarmSituation
.
setInOutCount
(
libraryWarningLogs
.
size
()-
inventoryNum
);
alarmSituation
.
setUntreatedCount
(
unHandleNum
);
alarmSituations
.
add
(
alarmSituation
);
}
return
alarmSituations
;
}
/**
/**
* @param devLifeSector 装备生命状态添统计
* @param devLifeSector 装备生命状态添统计
* @param deviceLibraries 统计装备
* @param deviceLibraries 统计装备
...
@@ -422,20 +483,19 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -422,20 +483,19 @@ public class StatisticalServiceImpl implements StatisticalService {
return
dates
;
return
dates
;
}
}
private
BusinessSituation
countBusiness
(
List
<
Task
>
tasks
,
List
<
FinalReport
>
finalReport
s
){
private
BusinessSituation
countBusiness
(
List
<
Task
UserVo
>
task
s
){
int
withCount
=
0
;
int
withCount
=
0
;
int
sendRepelCount
=
0
;
int
sendRepelCount
=
0
;
int
selfInspection
=
0
;
int
selfInspection
=
0
;
int
verification
=
0
;
int
verification
=
0
;
int
train
=
0
;
int
train
=
0
;
int
finalAccounts
=
finalReports
.
size
();
int
putStorage
=
0
;
int
putStorage
=
0
;
int
apply
=
0
;
int
apply
=
0
;
int
fielding
=
0
;
int
fielding
=
0
;
int
backPack
=
0
;
int
backPack
=
0
;
int
destruction
=
0
;
int
destruction
=
0
;
int
maintenance
=
0
;
int
maintenance
=
0
;
for
(
Task
task:
tasks
)
{
for
(
Task
UserVo
task:
tasks
)
{
switch
(
task
.
getBusinessType
()){
switch
(
task
.
getBusinessType
()){
case
1
:
case
1
:
fielding
++;
fielding
++;
...
@@ -473,6 +533,22 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -473,6 +533,22 @@ public class StatisticalServiceImpl implements StatisticalService {
default
:
break
;
default
:
break
;
}
}
}
}
return
new
BusinessSituation
(
withCount
,
sendRepelCount
,
selfInspection
,
verification
,
train
,
finalAccounts
,
putStorage
,
apply
,
fielding
,
backPack
,
destruction
,
maintenance
);
return
new
BusinessSituation
(
withCount
,
sendRepelCount
,
selfInspection
,
verification
,
train
,
putStorage
,
apply
,
fielding
,
backPack
,
destruction
,
maintenance
);
}
/**
* 当前date属于本年第几个季度
*/
private
Integer
getQuarter
(
Date
date
)
{
int
month
=
date
.
getMonth
()+
1
;
if
(
month
<=
3
)
{
return
1
;
}
else
if
(
month
<=
6
)
{
return
2
;
}
else
if
(
month
<=
9
)
{
return
3
;
}
else
{
return
4
;
}
}
}
}
}
dev-statistical/src/main/java/com/tykj/dev/statistical/vo/BusinessSituation.java
浏览文件 @
2c924d95
...
@@ -39,11 +39,6 @@ public class BusinessSituation {
...
@@ -39,11 +39,6 @@ public class BusinessSituation {
*/
*/
private
Integer
train
;
private
Integer
train
;
/**
* 决算
*/
private
Integer
finalAccounts
;
/**
/**
* 入库
* 入库
*/
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
2c924d95
...
@@ -293,7 +293,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -293,7 +293,7 @@ public class TaskServiceImpl implements TaskService {
@Override
@Override
public
List
<
TaskUserVo
>
getList
(
TaskSelectVo
taskSelectVo
)
{
public
List
<
TaskUserVo
>
getList
(
TaskSelectVo
taskSelectVo
)
{
List
<
TaskUserVo
>
taskEntities
=
getTaskUserVoList
(
taskSelectVo
);
List
<
TaskUserVo
>
taskEntities
=
getTaskUserVoList
(
taskSelectVo
);
if
(
taskSelectVo
.
getOrders
()
!=
null
)
{
if
(
taskSelectVo
.
getOrders
()
.
size
()>
0
)
{
//根据vo待办和跟踪时间的查询顺序按顺序或降序排序输出
//根据vo待办和跟踪时间的查询顺序按顺序或降序排序输出
if
(
taskSelectVo
.
getSelectNum
()
==
2
&&
"trackingTime"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getCoulmn
()))
{
if
(
taskSelectVo
.
getSelectNum
()
==
2
&&
"trackingTime"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getCoulmn
()))
{
if
(
"ASC"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getDirection
().
toString
()))
{
if
(
"ASC"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getDirection
().
toString
()))
{
...
@@ -334,7 +334,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -334,7 +334,7 @@ public class TaskServiceImpl implements TaskService {
.
filter
(
taskUserVo
->
find
(
taskUserVo
.
getId
(),
list
)
>
-
1
)
.
filter
(
taskUserVo
->
find
(
taskUserVo
.
getId
(),
list
)
>
-
1
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
//判断是否需要按发起时间排序
//判断是否需要按发起时间排序
if
(
taskSelectVo
.
getOrders
()
!=
null
)
{
if
(
taskSelectVo
.
getOrders
()
.
size
()>
0
)
{
if
(
"createTime"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getCoulmn
()))
{
if
(
"createTime"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getCoulmn
()))
{
if
(
"ASC"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getDirection
().
toString
()))
{
if
(
"ASC"
.
equals
(
taskSelectVo
.
getOrders
().
get
(
0
).
getDirection
().
toString
()))
{
return
taskUtils
.
orderByCreateTimeAsc2
(
taskUserVos
);
return
taskUtils
.
orderByCreateTimeAsc2
(
taskUserVos
);
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/controller/DeviceUseReportController.java
浏览文件 @
2c924d95
...
@@ -42,7 +42,6 @@ public class DeviceUseReportController {
...
@@ -42,7 +42,6 @@ public class DeviceUseReportController {
@Autowired
@Autowired
private
UseReportFIleService
useReportFIleService
;
private
UseReportFIleService
useReportFIleService
;
@ApiOperation
(
value
=
"模糊查询装备使用报告分页"
,
notes
=
"可以通过这个接口模糊查询装备使用报告分页"
)
@ApiOperation
(
value
=
"模糊查询装备使用报告分页"
,
notes
=
"可以通过这个接口模糊查询装备使用报告分页"
)
@PostMapping
(
"/summary"
)
@PostMapping
(
"/summary"
)
public
ResponseEntity
selectDeviceUseReport
(
@RequestBody
DeviceUseReportSelectVo
deviceUseReportSelectVo
)
{
public
ResponseEntity
selectDeviceUseReport
(
@RequestBody
DeviceUseReportSelectVo
deviceUseReportSelectVo
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论