Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
3415b397
提交
3415b397
authored
5月 13, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
dc28a537
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
63 行增加
和
35 行删除
+63
-35
TaskController.java
...a/com/tykj/dev/device/task/controller/TaskController.java
+1
-0
MessageController.java
...kj/dev/device/user/read/controller/MessageController.java
+6
-0
MessageServiceImpl.java
...dev/device/user/read/service/impl/MessageServiceImpl.java
+30
-18
DeviceUseReportController.java
...evice/usereport/controller/DeviceUseReportController.java
+2
-1
DeviceUseReportService.java
.../dev/device/usereport/service/DeviceUseReportService.java
+21
-0
DeviceUseReportServiceImpl.java
...ce/usereport/service/impl/DeviceUseReportServiceImpl.java
+3
-16
没有找到文件。
dev-task/src/main/java/com/tykj/dev/device/task/controller/TaskController.java
浏览文件 @
3415b397
...
@@ -158,6 +158,7 @@ public class TaskController {
...
@@ -158,6 +158,7 @@ public class TaskController {
List
<
Integer
>
ids
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getCountryTaskIds
());
List
<
Integer
>
ids
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getCountryTaskIds
());
userRecord
.
setCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecord
.
setCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
taskIds
.
removeAll
(
ids
);
taskIds
.
removeAll
(
ids
);
userRecord
.
setNewCountryTaskIds
(
StringSplitUtil
.
idListToString
(
taskIds
));
userRecordService
.
save
(
userRecord
);
userRecordService
.
save
(
userRecord
);
}
}
}
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/controller/MessageController.java
浏览文件 @
3415b397
...
@@ -60,6 +60,7 @@ public class MessageController {
...
@@ -60,6 +60,7 @@ public class MessageController {
Boolean
hasContentDim
=
messageSelectVo
.
getContentDim
()!=
null
;
Boolean
hasContentDim
=
messageSelectVo
.
getContentDim
()!=
null
;
Boolean
hasOperatorDim
=
messageSelectVo
.
getOperatorDim
()!=
null
;
Boolean
hasOperatorDim
=
messageSelectVo
.
getOperatorDim
()!=
null
;
List
<
MessageUserVo
>
messageUserVos
=
messageService
.
getAllList
(
messageSelectVo
);
List
<
MessageUserVo
>
messageUserVos
=
messageService
.
getAllList
(
messageSelectVo
);
//模糊查询筛选
if
(
hasContentDim
||
hasOperatorDim
)
{
if
(
hasContentDim
||
hasOperatorDim
)
{
messageUserVos
=
messageUserVos
.
stream
().
filter
(
messageUserVo
->
{
messageUserVos
=
messageUserVos
.
stream
().
filter
(
messageUserVo
->
{
Boolean
containContentDim
=
!
hasContentDim
||
messageUserVo
.
getContent
().
contains
(
messageSelectVo
.
getContentDim
());
Boolean
containContentDim
=
!
hasContentDim
||
messageUserVo
.
getContent
().
contains
(
messageSelectVo
.
getContentDim
());
...
@@ -67,11 +68,16 @@ public class MessageController {
...
@@ -67,11 +68,16 @@ public class MessageController {
return
containContentDim
&&
containOperatorDim
;
return
containContentDim
&&
containOperatorDim
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
//分页
Page
<
MessageUserVo
>
taskUserVos1
=
PageUtil
.
getPerPage
(
messageSelectVo
.
getPage
(),
messageSelectVo
.
getSize
(),
messageUserVos
,
messageSelectVo
.
getPageable
());
Page
<
MessageUserVo
>
taskUserVos1
=
PageUtil
.
getPerPage
(
messageSelectVo
.
getPage
(),
messageSelectVo
.
getSize
(),
messageUserVos
,
messageSelectVo
.
getPageable
());
//返回对象map
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
Integer
,
String
>
businessMap
=
GlobalMap
.
getBusinessMap
();
Map
<
Integer
,
String
>
businessMap
=
GlobalMap
.
getBusinessMap
();
//存在的业务类型
Set
<
Integer
>
businessType
=
messageUserVos
.
stream
().
map
(
MessageUserVo:
:
getBusinessType
).
collect
(
Collectors
.
toSet
());
Set
<
Integer
>
businessType
=
messageUserVos
.
stream
().
map
(
MessageUserVo:
:
getBusinessType
).
collect
(
Collectors
.
toSet
());
//分页数据
map
.
put
(
"pages"
,
taskUserVos1
);
map
.
put
(
"pages"
,
taskUserVos1
);
//存在的业务类型
map
.
put
(
"businessTypes"
,
businessType
.
stream
().
map
(
integer
->
new
BusinessTypeVo
(
integer
,
businessMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
map
.
put
(
"businessTypes"
,
businessType
.
stream
().
map
(
integer
->
new
BusinessTypeVo
(
integer
,
businessMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
return
ResponseEntity
.
ok
(
map
);
return
ResponseEntity
.
ok
(
map
);
}
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/read/service/impl/MessageServiceImpl.java
浏览文件 @
3415b397
...
@@ -97,25 +97,35 @@ public class MessageServiceImpl implements MessageService {
...
@@ -97,25 +97,35 @@ public class MessageServiceImpl implements MessageService {
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
Integer
>
ids
=
messageUserVos
.
stream
().
map
(
MessageUserVo:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
ids
=
messageUserVos
.
stream
().
map
(
MessageUserVo:
:
getId
).
collect
(
Collectors
.
toList
());
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
//休眠100ms保证用户第一次登录不会创建二条userRecord
if
(
userRecord
==
null
){
try
{
UserRecord
userRecord2
=
new
UserRecord
();
Thread
.
sleep
(
100
);
userRecord2
.
setUserId
(
userId
);
}
catch
(
InterruptedException
e
)
{
userRecord2
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
e
.
printStackTrace
();
userRecord2
.
setNewReadIds
(
userRecord2
.
getReadIds
());
userRecordService
.
save
(
userRecord2
);
}
}
else
{
finally
{
if
(
userRecord
.
getReadIds
()
==
null
)
{
UserRecord
userRecord
=
userRecordDao
.
findByUserId
(
userId
);
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
if
(
userRecord
==
null
)
{
userRecord
.
setNewReadIds
(
userRecord
.
getReadIds
());
UserRecord
userRecord2
=
new
UserRecord
();
userRecordService
.
save
(
userRecord
);
userRecord2
.
setUserId
(
userId
);
userRecord2
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecord2
.
setNewReadIds
(
userRecord2
.
getReadIds
());
userRecordService
.
save
(
userRecord2
);
}
else
{
}
else
{
List
<
Integer
>
integerList
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getReadIds
());
if
(
userRecord
.
getReadIds
()
==
null
)
{
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
//更新阅知id
ids
.
removeAll
(
integerList
);
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecord
.
setNewReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecord
.
setNewReadIds
(
userRecord
.
getReadIds
());
userRecordService
.
save
(
userRecord
);
userRecordService
.
save
(
userRecord
);
}
else
{
List
<
Integer
>
integerList
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getReadIds
());
//更新阅知id
userRecord
.
setReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
//和上一次比新增的id
ids
.
removeAll
(
integerList
);
userRecord
.
setNewReadIds
(
StringSplitUtil
.
idListToString
(
ids
));
userRecordService
.
save
(
userRecord
);
}
}
}
}
}
return
messageUserVos
;
return
messageUserVos
;
...
@@ -131,9 +141,11 @@ public class MessageServiceImpl implements MessageService {
...
@@ -131,9 +141,11 @@ public class MessageServiceImpl implements MessageService {
}
}
else
{
else
{
List
<
Integer
>
newTaskIds
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getNewReadIds
());
List
<
Integer
>
newTaskIds
=
StringSplitUtil
.
userIdSplit
(
userRecord
.
getNewReadIds
());
//筛选出新id的阅知
messageUserVos
=
messageDao
.
findAll
().
stream
()
messageUserVos
=
messageDao
.
findAll
().
stream
()
.
map
(
Message:
:
parse2Bto
)
.
map
(
Message:
:
parse2Bto
)
.
filter
(
messageBto
->
messageBto
.
getInvolveUserIdList
().
contains
(
userId
)
&&
!
messageBto
.
getCompleteUserIdList
().
contains
(
userId
)
&&
newTaskIds
.
contains
(
messageBto
.
getId
()))
.
filter
(
messageBto
->
messageBto
.
getInvolveUserIdList
().
contains
(
userId
)
&&
!
messageBto
.
getCompleteUserIdList
().
contains
(
userId
)
&&
newTaskIds
.
contains
(
messageBto
.
getId
()))
.
map
(
MessageBto:
:
toVo
)
.
map
(
MessageBto:
:
toVo
)
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
sorted
(
Comparator
.
comparing
(
MessageUserVo:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/controller/DeviceUseReportController.java
浏览文件 @
3415b397
...
@@ -81,10 +81,11 @@ public class DeviceUseReportController {
...
@@ -81,10 +81,11 @@ public class DeviceUseReportController {
@ApiOperation
(
value
=
"装备使用报告下载"
,
notes
=
"装备使用报告下载"
)
@ApiOperation
(
value
=
"装备使用报告下载"
,
notes
=
"装备使用报告下载"
)
@GetMapping
(
"/download/{id}"
)
@GetMapping
(
"/download/{id}"
)
public
ResponseEntity
getDownloadUrl
(
@PathVariable
(
"id"
)
int
id
,
HttpServletResponse
response
,
HttpServletRequest
httpServletRequest
)
throws
IOException
{
public
ResponseEntity
getDownloadUrl
(
@PathVariable
(
"id"
)
int
id
,
HttpServletResponse
response
,
HttpServletRequest
httpServletRequest
)
throws
IOException
{
//获取详情
ResultObj
resultObj
=
(
ResultObj
)
selectDetail
(
id
).
getBody
();
ResultObj
resultObj
=
(
ResultObj
)
selectDetail
(
id
).
getBody
();
DeviceUseReportDetailVo
deviceUseReportDetailVo
=
(
DeviceUseReportDetailVo
)
resultObj
.
getData
();
DeviceUseReportDetailVo
deviceUseReportDetailVo
=
(
DeviceUseReportDetailVo
)
resultObj
.
getData
();
//新建word模板
WrodParameter
wrodParameter
=
new
WrodParameter
();
WrodParameter
wrodParameter
=
new
WrodParameter
();
Instant
instant
=
deviceUseReportDetailVo
.
getCreateTime
().
toInstant
();
Instant
instant
=
deviceUseReportDetailVo
.
getCreateTime
().
toInstant
();
ZoneId
zone
=
ZoneId
.
systemDefault
();
ZoneId
zone
=
ZoneId
.
systemDefault
();
LocalDateTime
localDateTime
=
LocalDateTime
.
ofInstant
(
instant
,
zone
);
LocalDateTime
localDateTime
=
LocalDateTime
.
ofInstant
(
instant
,
zone
);
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/service/DeviceUseReportService.java
浏览文件 @
3415b397
...
@@ -15,6 +15,10 @@ import java.util.List;
...
@@ -15,6 +15,10 @@ import java.util.List;
*/
*/
public
interface
DeviceUseReportService
{
public
interface
DeviceUseReportService
{
/**
* @param deviceUseReportEntity 实体
* 添加实体
*/
DeviceUseReport
addEntity
(
DeviceUseReport
deviceUseReportEntity
);
DeviceUseReport
addEntity
(
DeviceUseReport
deviceUseReportEntity
);
/**
/**
...
@@ -22,12 +26,29 @@ public interface DeviceUseReportService {
...
@@ -22,12 +26,29 @@ public interface DeviceUseReportService {
*/
*/
void
sendHash
(
List
<
DeviceUseReport
>
deviceUseReports
);
void
sendHash
(
List
<
DeviceUseReport
>
deviceUseReports
);
/**
* @param deviceUseReportSelectVo 查询vo
* @param pageable 分页
* 获取使用报告分页
*/
Page
<
DeviceUseReport
>
getPage
(
DeviceUseReportSelectVo
deviceUseReportSelectVo
,
Pageable
pageable
);
Page
<
DeviceUseReport
>
getPage
(
DeviceUseReportSelectVo
deviceUseReportSelectVo
,
Pageable
pageable
);
/**
* @param id 报告id
* 根据id获取使用报告
*/
DeviceUseReport
getOne
(
Integer
id
);
DeviceUseReport
getOne
(
Integer
id
);
/**
* @param deviceUseReportEntity 实体
* 更新实体
*/
DeviceUseReport
update
(
DeviceUseReport
deviceUseReportEntity
);
DeviceUseReport
update
(
DeviceUseReport
deviceUseReportEntity
);
/**
* @param deviceUseReportCreateVo 创建vo
* 生成装备使用报告
*/
DeviceUseReport
createReport
(
DeviceUseReportCreateVo
deviceUseReportCreateVo
);
DeviceUseReport
createReport
(
DeviceUseReportCreateVo
deviceUseReportCreateVo
);
/**
/**
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/service/impl/DeviceUseReportServiceImpl.java
浏览文件 @
3415b397
...
@@ -384,26 +384,13 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
...
@@ -384,26 +384,13 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
}
}
/**
/**
* 按型号
,名称,类型组合
* 按型号
组合统计
*/
*/
private
List
<
DeviceStatistics
>
getDeviceStatistics
(
List
<
DeviceLibrary
>
deviceLibraries
)
{
private
List
<
DeviceStatistics
>
getDeviceStatistics
(
List
<
DeviceLibrary
>
deviceLibraries
)
{
List
<
DeviceStatistics
>
deviceStatisticsList
=
new
ArrayList
<>();
List
<
DeviceStatistics
>
deviceStatisticsList
=
new
ArrayList
<>();
//按型号组合成map
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
deviceLibraries
.
stream
().
collect
(
groupingBy
(
DeviceLibrary:
:
getModel
));
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
deviceLibraries
.
stream
().
collect
(
groupingBy
(
DeviceLibrary:
:
getModel
));
// map.forEach((s, deviceLibraries1) -> {
//不同型号生成统计vo
// String[] strings = s.split("Ǵ");
// if (strings.length == 2) {
// DeviceStatistics deviceStatistics = new DeviceStatistics();
// deviceStatistics.setModel(strings[0]);
//// deviceStatistics.setName(strings[1]);
// deviceStatistics.setType(Integer.valueOf(strings[1]));
// deviceStatistics.setNum(deviceLibraries1.size());
// deviceStatisticsList.add(deviceStatistics);
// }
// DeviceStatistics deviceStatistics = new DeviceStatistics();
// deviceStatistics.setModel(s);
// deviceStatistics.setNum(deviceLibraries1.size());
// deviceStatisticsList.add(deviceStatistics);
// });
for
(
String
s:
map
.
keySet
())
{
for
(
String
s:
map
.
keySet
())
{
DeviceStatistics
deviceStatistics
=
new
DeviceStatistics
();
DeviceStatistics
deviceStatistics
=
new
DeviceStatistics
();
deviceStatistics
.
setModel
(
s
);
deviceStatistics
.
setModel
(
s
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论