Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
fe30d6e5
提交
fe30d6e5
authored
9月 17, 2021
作者:
133
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:matrix/device-back into dev
上级
dc866e39
2b9b6f09
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
28 行增加
和
17 行删除
+28
-17
DeviceSelectIdsVo.java
...tykj/dev/device/library/subject/vo/DeviceSelectIdsVo.java
+2
-4
StatisticalController.java
...ykj/dev/statistical/controller/StatisticalController.java
+26
-13
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceSelectIdsVo.java
浏览文件 @
fe30d6e5
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
com.tykj.dev.misc.base.CustomPage
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -16,10 +17,7 @@ import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
DeviceSelectIdsVo
{
private
Integer
page
;
private
Integer
size
;
public
class
DeviceSelectIdsVo
extends
CustomPage
{
private
List
<
Integer
>
ids
;
}
dev-statistical/src/main/java/com/tykj/dev/statistical/controller/StatisticalController.java
浏览文件 @
fe30d6e5
...
...
@@ -8,10 +8,15 @@ package com.tykj.dev.statistical.controller;
* @createTime 2020年10月16日 14:53:00
*/
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.util.ArrayUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.DeviceModelSort
;
import
com.tykj.dev.misc.utils.PageUtil
;
...
...
@@ -22,9 +27,11 @@ import com.tykj.dev.statistical.vo.DeviceStatistics;
import
com.tykj.dev.statistical.vo.ScrappedDestroyedRetiredVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.hibernate.mapping.Array
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -51,6 +58,9 @@ public class StatisticalController {
@Autowired
private
DeviceLibraryService
deviceLibraryService
;
@Autowired
DeviceLibraryDao
deviceLibraryDao
;
// @Autowired
// private ConfigCache configCache;
...
...
@@ -248,19 +258,22 @@ public class StatisticalController {
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
@PostMapping
(
"/selectByIds2"
)
public
List
<
DeviceLibrary
>
selectByIds2
(
@RequestBody
DeviceSelectIdsVo
deviceSelectIdsVo
){
List
<
DeviceLibrary
>
byIds
=
deviceLibraryService
.
findByIds
(
deviceSelectIdsVo
.
getIds
());
byIds
.
forEach
(
DeviceLibrary:
:
setConfigName
);
// List<ScrappedVos> scrappedVosArrayList = new ArrayList<>();
ScrappedVos
scrappedVos
=
new
ScrappedVos
();
// byIds.forEach(
// deviceLibrary -> {
// BeanUtils.copyProperties(deviceLibrary,scrappedVos);
// scrappedVosArrayList.add(scrappedVos);
// }
// );
return
byIds
;
public
ResponseEntity
selectByIds2
(
@RequestBody
DeviceSelectIdsVo
deviceSelectIdsVo
){
Page
<
DeviceLibrary
>
byIds
=
deviceLibraryDao
.
findAll
(
getFindRetiredSpecification
(
deviceSelectIdsVo
),
deviceSelectIdsVo
.
getPageable
()).
map
(
DeviceLibrary:
:
setConfigName
);
return
ResponseEntity
.
ok
(
byIds
);
}
private
Specification
<
DeviceLibrary
>
getFindRetiredSpecification
(
DeviceSelectIdsVo
deviceSelectIdsVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
Specifications
.
and
();
// List<Integer> leftStatus=new ArrayList<>();
// leftStatus.add(com.tykj.dev.config.base.DeviceLifeStatus.RETIRED.id);
if
(
deviceSelectIdsVo
.
getIds
()!=
null
&&
deviceSelectIdsVo
.
getIds
().
size
()!=
0
)
{
predicateBuilder
.
in
(
"id"
,
deviceSelectIdsVo
.
getIds
().
toArray
());
}
return
predicateBuilder
.
build
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论