Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
9f2a896d
Commit
9f2a896d
authored
Dec 07, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备列表接口更新
parent
e7c5102f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
BeanDtoVoUtils.java
...eejoin/amos/boot/module/tzs/biz/utils/BeanDtoVoUtils.java
+29
-0
EquipmentController.java
...ot/module/tzs/flc/biz/controller/EquipmentController.java
+4
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/utils/BeanDtoVoUtils.java
View file @
9f2a896d
...
@@ -6,8 +6,11 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
...
@@ -6,8 +6,11 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -274,4 +277,29 @@ public class BeanDtoVoUtils {
...
@@ -274,4 +277,29 @@ public class BeanDtoVoUtils {
}
}
});
});
}
}
/**
* 将设备实体类转换为Vo
*
* @param page 原分页对象
* @return 转换后的分页对象
*/
public
static
IPage
<
EquipmentDto
>
equipmentIPageDto
(
IPage
<
Equipment
>
page
)
{
return
page
.
convert
(
item
->
{
try
{
EquipmentDto
target
=
new
EquipmentDto
();
// 把原对象数据拷贝到新对象
BeanUtils
.
copyProperties
(
item
,
target
);
if
(
EquipmentStatusEnum
.
未安装
.
getCode
().
equals
(
item
.
getStatus
()))
{
target
.
setStatus
(
EquipmentStatusEnum
.
未安装
.
getName
());
}
else
if
(
EquipmentStatusEnum
.
已安装
.
getCode
().
equals
(
item
.
getStatus
()))
{
target
.
setStatus
(
EquipmentStatusEnum
.
已安装
.
getName
());
}
return
target
;
}
catch
(
Exception
e
)
{
return
null
;
}
});
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/EquipmentController.java
View file @
9f2a896d
...
@@ -132,7 +132,7 @@ public class EquipmentController extends BaseController {
...
@@ -132,7 +132,7 @@ public class EquipmentController extends BaseController {
page
=
equipmentServiceImpl
.
page
(
pageBean
,
equipmentQueryWrapper
);
page
=
equipmentServiceImpl
.
page
(
pageBean
,
equipmentQueryWrapper
);
int
num
=
equipmentServiceImpl
.
count
(
equipmentQueryWrapper
);
int
num
=
equipmentServiceImpl
.
count
(
equipmentQueryWrapper
);
pageBean
.
setTotal
(
num
);
pageBean
.
setTotal
(
num
);
IPage
<
EquipmentDto
>
equipmentDtoIPager
=
BeanDtoVoUtils
.
iPageVoStream
(
page
,
EquipmentDto
.
class
);
IPage
<
EquipmentDto
>
equipmentDtoIPager
=
BeanDtoVoUtils
.
equipmentIPageDto
(
page
);
return
ResponseHelper
.
buildResponse
(
equipmentDtoIPager
);
return
ResponseHelper
.
buildResponse
(
equipmentDtoIPager
);
}
}
...
@@ -163,12 +163,12 @@ public class EquipmentController extends BaseController {
...
@@ -163,12 +163,12 @@ public class EquipmentController extends BaseController {
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getName
()))
{
// 设备名称
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getName
()))
{
// 设备名称
queryWrapper
.
like
(
"name"
,
equipmentDto
.
getName
());
queryWrapper
.
like
(
"name"
,
equipmentDto
.
getName
());
}
}
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getTypeId
()))
{
// 设备种类
queryWrapper
.
eq
(
"type_id"
,
equipmentDto
.
getTypeId
());
}
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getCategoryId
()))
{
// 设备类别
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getCategoryId
()))
{
// 设备类别
queryWrapper
.
eq
(
"category_id"
,
equipmentDto
.
getCategoryId
());
queryWrapper
.
eq
(
"category_id"
,
equipmentDto
.
getCategoryId
());
}
}
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getTypeId
()))
{
// 设备种类
queryWrapper
.
eq
(
"type_id"
,
equipmentDto
.
getTypeId
());
}
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getVarietyId
()))
{
// 设备品种
if
(!
ValidationUtil
.
isEmpty
(
equipmentDto
.
getVarietyId
()))
{
// 设备品种
queryWrapper
.
eq
(
"variety_id"
,
equipmentDto
.
getVarietyId
());
queryWrapper
.
eq
(
"variety_id"
,
equipmentDto
.
getVarietyId
());
}
}
...
...
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