Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
a0b8e009
提交
a0b8e009
authored
2月 23, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改返回值
上级
21dceed7
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
73 行增加
和
33 行删除
+73
-33
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+18
-8
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+2
-2
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+18
-11
DeviceLibrary.java
.../tykj/dev/device/library/subject/domin/DeviceLibrary.java
+21
-0
DeviceVo.java
...java/com/tykj/dev/device/library/subject/vo/DeviceVo.java
+1
-0
DeviceLifeStatus.java
...rc/main/java/com/tykj/dev/misc/base/DeviceLifeStatus.java
+3
-3
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+8
-8
TaskSelectVo.java
...ava/com/tykj/dev/device/task/subject/vo/TaskSelectVo.java
+2
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
a0b8e009
...
...
@@ -13,6 +13,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLog;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -24,10 +25,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.Min
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -126,8 +124,15 @@ public class DeviceLibraryController {
@ApiOperation
(
value
=
"模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/core/feature/summary"
)
public
ResponseEntity
selectCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
Page
<
DeviceVo
>
deviceLibraryEntities
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
()).
map
(
DeviceLibrary:
:
parseVo
);
return
ResultUtil
.
success
(
deviceLibraryEntities
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
());
Page
<
DeviceVo
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
resultList
,
deviceLibrarySelectVo
.
getPageable
()).
map
(
DeviceLibrary:
:
parseVo
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pages"
,
deviceLibraryEntities
);
map
.
put
(
"models"
,
resultList
.
stream
().
map
(
DeviceLibrary:
:
getModel
).
collect
(
Collectors
.
toSet
()));
map
.
put
(
"names"
,
resultList
.
stream
().
map
(
DeviceLibrary:
:
getName
).
collect
(
Collectors
.
toSet
()));
map
.
put
(
"ownUnits"
,
resultList
.
stream
().
map
(
DeviceLibrary:
:
getOwnUnit
).
collect
(
Collectors
.
toSet
()));
map
.
put
(
"locationUnits"
,
resultList
.
stream
().
map
(
DeviceLibrary:
:
getLocationUnit
).
collect
(
Collectors
.
toSet
()));
return
ResultUtil
.
success
(
map
);
}
@ApiOperation
(
value
=
"查询存在的装备名称"
,
notes
=
"可以通过这个接口查询存在的装备名称"
)
...
...
@@ -152,8 +157,13 @@ public class DeviceLibraryController {
@ApiOperation
(
value
=
"模糊查询核心装备统计分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/core/stat/summary"
)
public
ResponseEntity
getDeviceStatisticsPage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
Page
<
DeviceStatisticsVo
>
deviceStatisticsVos
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
());
return
ResultUtil
.
success
(
deviceStatisticsVos
);
List
<
DeviceStatisticsVo
>
deviceStatisticsVoList
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
());
Page
<
DeviceStatisticsVo
>
deviceStatisticsVos
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
deviceStatisticsVoList
,
deviceLibrarySelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pages"
,
deviceStatisticsVos
);
map
.
put
(
"models"
,
deviceStatisticsVoList
.
stream
().
map
(
DeviceStatisticsVo:
:
getModel
).
collect
(
Collectors
.
toSet
()));
map
.
put
(
"names"
,
deviceStatisticsVoList
.
stream
().
map
(
DeviceStatisticsVo:
:
getName
).
collect
(
Collectors
.
toSet
()));
return
ResultUtil
.
success
(
map
);
}
@ApiOperation
(
value
=
"查询核心装备详情的详情"
,
notes
=
"可以通过这个接口查询核心装备详情的详情"
)
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
a0b8e009
...
...
@@ -39,13 +39,13 @@ public interface DeviceLibraryService {
* @param deviceLibrarySelectVo 装备查询vo
* @param pageable 获取核心装备分页
*/
Page
<
DeviceLibrary
>
getCoreDevicePage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
);
List
<
DeviceLibrary
>
getCoreDevicePage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
);
/**
* @param deviceLibrarySelectVo 装备查询vo
* @param pageable 获取装备统计分页
*/
Page
<
DeviceStatisticsVo
>
getDeviceStatisticsPage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
);
List
<
DeviceStatisticsVo
>
getDeviceStatisticsPage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
);
/**
* 获取所有存在的装备名称
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
a0b8e009
...
...
@@ -15,11 +15,9 @@ import com.tykj.dev.device.user.util.UserUtils;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.GetTreeUtils
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -89,7 +87,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
}
@Override
public
Page
<
DeviceLibrary
>
getCoreDevicePage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
)
{
public
List
<
DeviceLibrary
>
getCoreDevicePage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
)
{
Integer
selectUnitId
=
deviceLibrarySelectVo
.
getUnitId
();
Integer
selectAreaId
=
deviceLibrarySelectVo
.
getAreaId
();
//areaId为null
...
...
@@ -112,7 +110,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
resultList
.
addAll
(
d
.
getChilds
());
}
}
return
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
resultList
,
pageable
);
if
(
deviceLibrarySelectVo
.
getContent
()!=
null
){
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getKeyWords
().
contains
(
deviceLibrarySelectVo
.
getContent
())).
collect
(
Collectors
.
toList
());
}
return
resultList
;
}
//areId不为空,查询某个区域下的所有单位的所有装备
else
{
...
...
@@ -133,7 +134,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
resultList
.
addAll
(
d
.
getChilds
());
}
}
return
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
resultList
,
pageable
);
if
(
deviceLibrarySelectVo
.
getContent
()!=
null
){
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getKeyWords
().
contains
(
deviceLibrarySelectVo
.
getContent
())).
collect
(
Collectors
.
toList
());
}
return
resultList
;
}
//省能看到所有装备
if
(
selectLevel
==
1
)
{
...
...
@@ -145,7 +149,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
resultList
.
addAll
(
d
.
getChilds
());
}
}
return
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
resultList
,
pageable
);
if
(
deviceLibrarySelectVo
.
getContent
()!=
null
){
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getKeyWords
().
contains
(
deviceLibrarySelectVo
.
getContent
())).
collect
(
Collectors
.
toList
());
}
return
resultList
;
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"区域等级只能为1,2,3"
));
}
...
...
@@ -153,7 +160,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
}
@Override
public
Page
<
DeviceStatisticsVo
>
getDeviceStatisticsPage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
)
{
public
List
<
DeviceStatisticsVo
>
getDeviceStatisticsPage
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
Pageable
pageable
)
{
//获取存在的所有装备型号
// List<String> list = new ArrayList<>();
// if (deviceLibrarySelectVo.getModel() != null) {
...
...
@@ -173,7 +180,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
d
.
setName
(
deviceLibrarySelectVo
.
getName
());
d
.
setContent
(
deviceLibrarySelectVo
.
getContent
());
//获取所有的核心装备
List
<
DeviceLibrary
>
libraryEntities
=
getCoreDevicePage
(
d
,
d
.
getPageable
())
.
getContent
()
;
List
<
DeviceLibrary
>
libraryEntities
=
getCoreDevicePage
(
d
,
d
.
getPageable
());
if
(
libraryEntities
.
size
()
>
0
)
{
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
libraryEntities
.
stream
().
collect
(
groupingBy
(
deviceLibrary
->
deviceLibrary
.
getModel
()+
"Ǵ"
+
deviceLibrary
.
getName
()));
//按型号遍历统计各种状态的装备数量
...
...
@@ -277,9 +284,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if
(
deviceLibrarySelectVo
.
getName
()
!=
null
)
{
deviceStatisticsVos
=
selectByName
(
deviceLibrarySelectVo
.
getName
(),
deviceStatisticsVos
);
}
return
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
deviceStatisticsVos
,
pageable
)
;
return
deviceStatisticsVos
;
}
return
new
PageImpl
<>(
deviceStatisticsVos
,
pageable
,
deviceStatisticsVos
.
size
())
;
return
deviceStatisticsVos
;
}
@Override
...
...
@@ -583,7 +590,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if
(
deviceLibrarySelectVo
.
getManageStatus
()
!=
null
)
{
predicateBuilder
.
eq
(
"manageStatus"
,
deviceLibrarySelectVo
.
getManageStatus
());
}
if
(
deviceLibrarySelectVo
.
getLifeStatus
()
!=
null
)
{
if
(
lifeStatus
!=
null
&&
lifeStatus
.
size
()>
0
)
{
predicateBuilder
.
in
(
"lifeStatus"
,
lifeStatus
.
toArray
(
new
Integer
[]{}));
}
if
(
deviceLibrarySelectVo
.
getType
()
!=
null
)
{
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceLibrary.java
浏览文件 @
a0b8e009
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
domin
;
import
com.tykj.dev.config.GlobalMap
;
import
com.tykj.dev.device.library.subject.vo.DeviceVo
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -233,4 +234,24 @@ public class DeviceLibrary {
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
return
mapper
.
map
(
this
,
DeviceVo
.
class
);
}
public
String
getKeyWords
(){
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
this
.
model
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
name
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
seqNumber
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
rfidSurfaceId
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
locationUnit
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
ownUnit
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
GlobalMap
.
getDeviceLifeStatusMap
().
get
(
this
.
lifeStatus
).
name
);
stringBuffer
.
append
(
"Ǒ"
);
stringBuffer
.
append
(
this
.
record
);
return
stringBuffer
.
toString
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceVo.java
浏览文件 @
a0b8e009
...
...
@@ -59,4 +59,5 @@ public class DeviceVo {
@ApiModelProperty
(
value
=
"备注"
)
private
String
record
;
}
dev-misc/src/main/java/com/tykj/dev/misc/base/DeviceLifeStatus.java
浏览文件 @
a0b8e009
...
...
@@ -24,7 +24,7 @@ public enum DeviceLifeStatus {
/**
* 配发中
*/
IN_TRANSIT
(
3
,
"配发
中
"
),
IN_TRANSIT
(
3
,
"配发"
),
/**
* 维修中
*/
...
...
@@ -32,7 +32,7 @@ public enum DeviceLifeStatus {
/**
* 报废在省库
*/
SCRAP_I
(
5
,
"
报废在省库
"
),
SCRAP_I
(
5
,
"
已报废
"
),
/**
* 清退
*/
...
...
@@ -64,7 +64,7 @@ public enum DeviceLifeStatus {
/**
* 报废不在省库
*/
SCRAP_II
(
13
,
"
报废不在省库
"
),
SCRAP_II
(
13
,
"
已报废
"
),
/**
* 使用
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
a0b8e009
...
...
@@ -611,7 +611,7 @@ public class TaskServiceImpl implements TaskService {
*/
private
List
<
TaskUserVo
>
getTaskUserVoList
(
TaskSelectVo
taskSelectVo
)
{
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
bussinessType
=
taskSelectVo
.
getBusinessType
();
List
<
Integer
>
bussinessType
=
taskSelectVo
.
getBusinessType
();
Integer
unitId
=
userUtils
.
getCurrentUnitId
();
//筛选出未完结和未封存业务,映射成bto
List
<
TaskBto
>
taskBtos
=
taskDao
.
findAll
().
stream
()
...
...
@@ -632,12 +632,12 @@ public class TaskServiceImpl implements TaskService {
})
.
collect
(
Collectors
.
toList
());
//查询所有的业务
if
(
bussinessType
==
null
)
{
if
(
bussinessType
==
null
||
bussinessType
.
isEmpty
()
)
{
List
<
TaskUserVo
>
taskUserVos
=
taskBtoList
.
stream
().
map
(
TaskBto:
:
toVo
).
collect
(
Collectors
.
toList
());
return
setTaskUserVo
(
taskUserVos
,
0
);
}
else
{
//查询工作台其它业务
if
(
bussinessType
==
0
)
{
if
(
bussinessType
.
contains
(
0
)
)
{
List
<
TaskUserVo
>
taskUserVos
=
taskBtoList
.
stream
()
.
filter
(
taskBto
->
!
new
ArrayList
<>(
Arrays
.
asList
(
3
,
4
,
5
,
6
)).
contains
(
taskBto
.
getBusinessType
()))
.
map
(
TaskBto:
:
toVo
)
...
...
@@ -647,7 +647,7 @@ public class TaskServiceImpl implements TaskService {
//查询某一业务
else
{
List
<
TaskUserVo
>
taskUserVos
=
taskBtoList
.
stream
()
.
filter
(
taskBto
->
taskBto
.
getBusinessType
().
equals
(
bussinessType
))
.
filter
(
taskBto
->
bussinessType
.
contains
(
taskBto
.
getBusinessType
()
))
.
map
(
TaskBto:
:
toVo
)
.
collect
(
Collectors
.
toList
());
return
setTaskUserVo
(
taskUserVos
,
0
);
...
...
@@ -686,7 +686,7 @@ public class TaskServiceImpl implements TaskService {
return
setTaskUserVo
(
taskUserVos
,
1
);
}
else
{
//查询工作台其它业务
if
(
bussinessType
==
0
)
{
if
(
bussinessType
.
contains
(
0
)
)
{
List
<
TaskUserVo
>
taskUserVos
=
taskBtoList
.
stream
()
.
filter
(
taskBto
->
!
new
ArrayList
<>(
Arrays
.
asList
(
3
,
4
,
5
,
6
)).
contains
(
taskBto
.
getBusinessType
()))
.
map
(
TaskBto:
:
toVo
)
...
...
@@ -696,7 +696,7 @@ public class TaskServiceImpl implements TaskService {
//查询某一业务
else
{
List
<
TaskUserVo
>
taskUserVos
=
taskBtoList
.
stream
()
.
filter
(
taskBto
->
taskBto
.
getBusinessType
().
equals
(
bussinessType
))
.
filter
(
taskBto
->
bussinessType
.
contains
(
taskBto
.
getBusinessType
()
))
.
map
(
TaskBto:
:
toVo
)
.
collect
(
Collectors
.
toList
());
return
setTaskUserVo
(
taskUserVos
,
1
);
...
...
@@ -799,8 +799,8 @@ public class TaskServiceImpl implements TaskService {
*/
private
Specification
<
Task
>
getSelectSpecification
(
TaskSelectVo
taskSelectVo
)
{
PredicateBuilder
<
Task
>
predicateBuilder
=
Specifications
.
and
();
if
(
taskSelectVo
.
getBusinessType
()
!=
null
)
{
predicateBuilder
.
eq
(
"businessType"
,
taskSelectVo
.
getBusinessType
(
));
if
(
taskSelectVo
.
getBusinessType
()
!=
null
&&
taskSelectVo
.
getBusinessType
().
size
()>
0
)
{
predicateBuilder
.
in
(
"businessType"
,
taskSelectVo
.
getBusinessType
().
toArray
(
new
Integer
[]{}
));
}
if
(
taskSelectVo
.
getContent
()
!=
null
)
{
Class
<
Task
>
taskEntityClass
=
Task
.
class
;
...
...
dev-task/src/main/java/com/tykj/dev/device/task/subject/vo/TaskSelectVo.java
浏览文件 @
a0b8e009
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author dengdiyi
...
...
@@ -23,6 +24,6 @@ public class TaskSelectVo extends CustomPage {
@ApiModelProperty
(
value
=
"查询方式(0:全部业务,1:我的发起,2:待办业务,3:业务跟踪,4:办结任务,5:封存业务)"
,
example
=
"0"
)
private
Integer
selectNum
;
@ApiModelProperty
(
value
=
"业务类型id"
,
example
=
"1"
)
private
Integer
businessType
;
private
List
<
Integer
>
businessType
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论