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
50825124
Commit
50825124
authored
Jun 11, 2021
by
付培阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
救援站信息业务接口修改
parent
c99c159f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
216 additions
and
40 deletions
+216
-40
RescueStationDto.java
...eejoin/amos/boot/module/tzs/api/dto/RescueStationDto.java
+3
-0
RescueStation.java
...eejoin/amos/boot/module/tzs/api/entity/RescueStation.java
+13
-1
MaintenanceUnitNameVo.java
...in/amos/boot/module/tzs/api/vo/MaintenanceUnitNameVo.java
+33
-0
RescueStationVo.java
.../yeejoin/amos/boot/module/tzs/api/vo/RescueStationVo.java
+3
-0
ElevatorController.java
...os/boot/module/tzs/biz/controller/ElevatorController.java
+1
-1
MaintenanceUnitController.java
.../module/tzs/biz/controller/MaintenanceUnitController.java
+24
-1
RescueStationController.java
...ot/module/tzs/biz/controller/RescueStationController.java
+115
-31
UseUnitController.java
...mos/boot/module/tzs/biz/controller/UseUnitController.java
+1
-1
BeanDtoVoUtils.java
...eejoin/amos/boot/module/tzs/biz/utils/BeanDtoVoUtils.java
+20
-5
application.properties
...boot-tzs-system/src/main/resources/application.properties
+3
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/RescueStationDto.java
View file @
50825124
...
...
@@ -63,4 +63,7 @@ public class RescueStationDto extends BaseEntity {
@ApiModelProperty
(
value
=
"所属单位id"
)
private
Long
affiliatedUnitId
;
@ApiModelProperty
(
value
=
"经纬度"
)
private
String
longitudeLatitude
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/RescueStation.java
View file @
50825124
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -7,6 +8,10 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* @author tb
...
...
@@ -21,22 +26,26 @@ public class RescueStation extends BaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"名称不能为空"
)
@ApiModelProperty
(
value
=
"应急救援机构名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"省份"
)
private
String
province
;
@NotNull
(
message
=
"地市不能为空"
)
@ApiModelProperty
(
value
=
"地市"
)
private
String
city
;
@NotNull
(
message
=
"区县不能为空"
)
@ApiModelProperty
(
value
=
"区县"
)
private
String
district
;
@NotNull
(
message
=
"区域代码不能为空"
)
@ApiModelProperty
(
value
=
"区域代码"
)
private
String
regionCode
;
@NotNull
(
message
=
"地址不能为空"
)
@ApiModelProperty
(
value
=
"地址(详细地址,包括道路、门牌号码)"
)
private
String
address
;
...
...
@@ -64,4 +73,7 @@ public class RescueStation extends BaseEntity {
@ApiModelProperty
(
value
=
"所属单位id"
)
private
Long
affiliatedUnitId
;
@ApiModelProperty
(
value
=
"经纬度"
)
private
String
longitudeLatitude
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/vo/MaintenanceUnitNameVo.java
0 → 100644
View file @
50825124
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* @title: RescueStationNameVo
* @Author fpy
* @Date: 2021/6/10 19:10
* @Version 1.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"cb_maintenance_unit"
)
@ApiModel
(
value
=
"MaintenanceUnitNameVo"
,
description
=
"MaintenanceUnitNameVo"
)
public
class
MaintenanceUnitNameVo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"维护保养单位id"
)
private
int
sequence_nbr
;
@ApiModelProperty
(
value
=
"维护保养单位名称"
)
private
String
unitName
;
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/vo/RescueStationVo.java
View file @
50825124
...
...
@@ -64,4 +64,7 @@ public class RescueStationVo extends BaseEntity {
@ApiModelProperty
(
value
=
"所属单位id"
)
private
Long
affiliatedUnitId
;
@ApiModelProperty
(
value
=
"经纬度"
)
private
String
longitudeLatitude
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/ElevatorController.java
View file @
50825124
...
...
@@ -101,7 +101,7 @@ public class ElevatorController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
ElevatorVo
>
selectById
(
@PathVariable
Long
id
)
{
Elevator
elevator
=
iElevatorService
.
getById
(
id
);
ElevatorVo
elevatorVo
=
BeanDtoVoUtils
.
convertElevatorToVo
(
elevator
);
ElevatorVo
elevatorVo
=
BeanDtoVoUtils
.
convertElevatorToVo
(
elevator
,
false
);
return
ResponseHelper
.
buildResponse
(
elevatorVo
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/MaintenanceUnitController.java
View file @
50825124
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.MaintenanceUnitNameVo
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.MaintenanceUnitVo
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
io.swagger.annotations.Api
;
...
...
@@ -22,6 +23,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Arrays
;
import
java.util.Map
;
/**
...
...
@@ -94,7 +96,7 @@ public class MaintenanceUnitController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
MaintenanceUnitVo
>
selectById
(
@PathVariable
Long
id
)
{
MaintenanceUnit
maintenanceUnit
=
iMaintenanceUnitService
.
getById
(
id
);
MaintenanceUnitVo
maintenanceUnitVo
=
BeanDtoVoUtils
.
convertMaintenanceUnitToVo
(
maintenanceUnit
);
MaintenanceUnitVo
maintenanceUnitVo
=
BeanDtoVoUtils
.
convertMaintenanceUnitToVo
(
maintenanceUnit
,
false
);
return
ResponseHelper
.
buildResponse
(
maintenanceUnitVo
);
}
...
...
@@ -199,5 +201,26 @@ public class MaintenanceUnitController extends BaseController {
IPage
<
MaintenanceUnitVo
>
maintenanceUnitVoIPage
=
BeanDtoVoUtils
.
maintenanceUnitIPageVo
(
page
);
return
ResponseHelper
.
buildResponse
(
maintenanceUnitVoIPage
);
}
/**
* 根据名称查询维保单位列表
*
* @param unitName 维保单位名称
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/query_maintenance_unit_name_list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称查询维保单位列表"
,
notes
=
"根据名称查询维保单位列表"
)
public
ResponseModel
<
IPage
<
MaintenanceUnitNameVo
>>
queryMaintenanceUnitListWithName
(
@PathVariable
(
required
=
false
)
String
unitName
)
{
QueryWrapper
<
MaintenanceUnit
>
maintenanceUnitQueryWrapper
=
new
QueryWrapper
<>();
maintenanceUnitQueryWrapper
.
select
(
"distinct sequence_nbr,unit_name"
).
like
(
StringUtils
.
isNotEmpty
(
unitName
),
"unit_name"
,
unitName
);
Page
<
MaintenanceUnit
>
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
IPage
<
MaintenanceUnit
>
page
=
iMaintenanceUnitService
.
page
(
pageBean
,
maintenanceUnitQueryWrapper
);
IPage
<
MaintenanceUnitNameVo
>
maintenanceUnitVoIPage
=
BeanDtoVoUtils
.
iPageVoStream
(
page
,
MaintenanceUnitNameVo
.
class
);
return
ResponseHelper
.
buildResponse
(
maintenanceUnitVoIPage
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RescueStationController.java
View file @
50825124
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto
;
import
com.yeejoin.amos.boot.module.tzs.api.vo.RescueStationVo
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -10,7 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -18,85 +24,111 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Arrays
;
import
java.util.Date
;
/**
* 救援站
*
* @author tb
* @date 2021-06-01
*/
* 救援站
*
* @author tb
* @date 2021-06-01
*/
@RestController
@Api
(
tags
=
"救援站Api"
)
@RequestMapping
(
value
=
"/tzs/rescue-station"
)
public
class
RescueStationController
extends
BaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RescueStationController
.
class
);
@Autowired
IRescueStationService
iRescueStationService
;
/**
* 新增救援站
* @return
*
* @param rescueStationDto 救援站
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增救援站"
,
notes
=
"新增救援站"
)
public
boolean
saveRescueStation
(
HttpServletRequest
request
,
@RequestBody
RescueStation
rescueStation
){
return
iRescueStationService
.
save
(
rescueStation
);
public
ResponseModel
<
Boolean
>
saveRescueStation
(
@RequestBody
RescueStationDto
rescueStationDto
)
{
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
rescueStation
.
setRecUserId
(
getUserId
());
rescueStation
.
setRecDate
(
new
Date
());
boolean
save
=
iRescueStationService
.
save
(
rescueStation
);
return
ResponseHelper
.
buildResponse
(
save
);
}
/**
* 根据id删除
* @param id
* @return
*
* @param id id
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iRescueStationService
.
removeById
(
id
);
public
ResponseModel
<
Boolean
>
deleteById
(
@PathVariable
Long
id
)
{
RescueStation
rescueStation
=
iRescueStationService
.
getById
(
id
);
rescueStation
.
setDelete
(
true
);
rescueStation
.
setRecUserId
(
getUserId
());
rescueStation
.
setRecDate
(
new
Date
());
boolean
remove
=
iRescueStationService
.
updateById
(
rescueStation
);
return
ResponseHelper
.
buildResponse
(
remove
);
}
/**
* 修改救援站
* @return
*
* @param rescueStationDto 救援站
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改救援站"
,
notes
=
"修改救援站"
)
public
boolean
updateByIdRescueStation
(
HttpServletRequest
request
,
@RequestBody
RescueStation
rescueStation
){
return
iRescueStationService
.
updateById
(
rescueStation
);
}
public
ResponseModel
<
Boolean
>
updateByIdRescueStation
(
@RequestBody
RescueStationDto
rescueStationDto
)
{
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
rescueStation
.
setRecUserId
(
getUserId
());
rescueStation
.
setRecDate
(
new
Date
());
boolean
update
=
iRescueStationService
.
updateById
(
rescueStation
);
return
ResponseHelper
.
buildResponse
(
update
);
}
/**
* 根据id查询
* @param id
* @return
*
* @param id id
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
RescueStation
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iRescueStationService
.
getById
(
id
);
public
ResponseModel
<
RescueStationVo
>
selectById
(
@PathVariable
Long
id
)
{
RescueStation
rescueStation
=
iRescueStationService
.
getById
(
id
);
RescueStationVo
rescueStationVo
=
BeanDtoVoUtils
.
convert
(
rescueStation
,
RescueStationVo
.
class
);
return
ResponseHelper
.
buildResponse
(
rescueStationVo
);
}
/**
* 列表分页查询
* @return
*
* @param pageNum 页码
* @param pageSize 每页大小
* @param rescueStationDto 查询参数
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
RescueStation
>
listPage
(
String
pageNum
,
String
pageSize
,
RescueStation
rescueStation
){
public
ResponseModel
<
IPage
<
RescueStationVo
>>
listPage
(
String
pageNum
,
String
pageSize
,
RescueStationDto
rescueStationDto
)
{
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
Page
<
RescueStation
>
pageBean
;
QueryWrapper
<
RescueStation
>
rescueStationQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
RescueStation
>
aClass
=
rescueStation
.
getClass
();
...
...
@@ -122,6 +154,7 @@ public class RescueStationController extends BaseController {
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
});
IPage
<
RescueStation
>
page
;
...
...
@@ -131,7 +164,58 @@ public class RescueStationController extends BaseController {
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iRescueStationService
.
page
(
pageBean
,
rescueStationQueryWrapper
);
return
page
;
IPage
<
RescueStationVo
>
rescueStationVoIPage
=
BeanDtoVoUtils
.
iPageVoStream
(
page
,
RescueStationVo
.
class
);
return
ResponseHelper
.
buildResponse
(
rescueStationVoIPage
);
}
/**
* 分页查询救援站信息
*
* @param pageNum 页码
* @param pageSize 每页大小
* @param rescueStationDto 查询参数
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/query_rescue_station_list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询救援站信息"
,
notes
=
"分页查询救援站信息"
)
public
ResponseModel
<
IPage
<
RescueStationVo
>>
queryRescueStationList
(
String
pageNum
,
String
pageSize
,
RescueStationDto
rescueStationDto
)
{
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
Page
<
RescueStation
>
pageBean
;
QueryWrapper
<
RescueStation
>
rescueStationQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
RescueStation
>
aClass
=
rescueStation
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
rescueStation
);
if
(
o
!=
null
)
{
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
"name"
.
equalsIgnoreCase
(
name
)
||
"address"
.
equalsIgnoreCase
(
name
)
||
"principal"
.
equalsIgnoreCase
(
name
)
||
"rescue_leader"
.
equalsIgnoreCase
(
name
)
||
"rescue_leader_phone"
.
equalsIgnoreCase
(
name
))
{
String
fileValue
=
(
String
)
o
;
rescueStationQueryWrapper
.
like
(
name
,
fileValue
);
}
else
if
(
"city"
.
equalsIgnoreCase
(
name
)
||
"district"
.
equalsIgnoreCase
(
name
)
||
"affiliated_unit"
.
equalsIgnoreCase
(
name
))
{
String
fileValue
=
(
String
)
o
;
rescueStationQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
o
;
rescueStationQueryWrapper
.
like
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
});
IPage
<
RescueStation
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iRescueStationService
.
page
(
pageBean
,
rescueStationQueryWrapper
);
IPage
<
RescueStationVo
>
rescueStationVoIPage
=
BeanDtoVoUtils
.
iPageVoStream
(
page
,
RescueStationVo
.
class
);
return
ResponseHelper
.
buildResponse
(
rescueStationVoIPage
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/UseUnitController.java
View file @
50825124
...
...
@@ -40,7 +40,7 @@ import java.util.Arrays;
@Api
(
tags
=
"使用单位Api"
)
@RequestMapping
(
value
=
"/tzs/use-unit"
)
public
class
UseUnitController
extends
BaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Elevator
Controller
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UseUnit
Controller
.
class
);
@Autowired
IUseUnitService
iUseUnitService
;
...
...
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 @
50825124
...
...
@@ -120,9 +120,10 @@ public class BeanDtoVoUtils {
* 将电梯实体类转换为Vo
*
* @param source 实体类
* @param isBatch 是否批量
* @return Vo类
*/
public
static
ElevatorVo
convertElevatorToVo
(
Elevator
source
)
{
public
static
ElevatorVo
convertElevatorToVo
(
Elevator
source
,
boolean
isBatch
)
{
// 判断source是否为空
if
(
source
==
null
)
{
return
null
;
...
...
@@ -138,8 +139,9 @@ public class BeanDtoVoUtils {
String
[]
photoList
=
photos
.
split
(
","
);
target
.
setImg
(
Arrays
.
stream
(
photoList
).
map
(
ElevatorVo
.
Img
::
new
).
collect
(
Collectors
.
toList
()));
}
// 根据数据字典设置值
if
(!
isBatch
)
{
getElevatorDictionaryByDictCode
();
}
List
<
DictionarieValueModel
>
categoryValue
=
elevatorCategory
.
stream
().
filter
(
e
->
e
.
getDictDataKey
().
equals
(
source
.
getCategory
())).
collect
(
Collectors
.
toList
());
target
.
setCategory
(
categoryValue
.
isEmpty
()
?
""
:
categoryValue
.
get
(
0
).
getDictDataValue
());
...
...
@@ -172,9 +174,14 @@ public class BeanDtoVoUtils {
* @return 转换后的Vo
*/
public
static
IPage
<
ElevatorVo
>
elevatorIPageVo
(
IPage
<
Elevator
>
page
)
{
try
{
getElevatorDictionaryByDictCode
();
}
catch
(
Exception
e
)
{
return
null
;
}
return
page
.
convert
(
item
->
{
try
{
return
convertElevatorToVo
(
item
);
return
convertElevatorToVo
(
item
,
true
);
}
catch
(
Exception
e
)
{
return
null
;
}
...
...
@@ -185,9 +192,10 @@ public class BeanDtoVoUtils {
* 将MaintenanceUnit转换为Vo
*
* @param source 源对象
* @param isBatch 是否批量
* @return 转换后的Vo
*/
public
static
MaintenanceUnitVo
convertMaintenanceUnitToVo
(
MaintenanceUnit
source
)
{
public
static
MaintenanceUnitVo
convertMaintenanceUnitToVo
(
MaintenanceUnit
source
,
boolean
isBatch
)
{
// 判断source是否为空
if
(
source
==
null
)
{
return
null
;
...
...
@@ -199,7 +207,9 @@ public class BeanDtoVoUtils {
BeanUtils
.
copyProperties
(
source
,
target
);
// 返回新对象
// 根据数据字典设置值
if
(!
isBatch
)
{
getMaintenanceUnitDictionaryByDictCode
();
}
List
<
DictionarieValueModel
>
qualificationLevelValue
=
qualificationLevel
.
stream
().
filter
(
e
->
e
.
getDictDataKey
().
equals
(
source
.
getQualificationLevel
())).
collect
(
Collectors
.
toList
());
target
.
setQualificationLevel
(
qualificationLevelValue
.
isEmpty
()
?
""
:
...
...
@@ -217,9 +227,14 @@ public class BeanDtoVoUtils {
* @return 转换后的分页对象
*/
public
static
IPage
<
MaintenanceUnitVo
>
maintenanceUnitIPageVo
(
IPage
<
MaintenanceUnit
>
page
)
{
try
{
getMaintenanceUnitDictionaryByDictCode
();
}
catch
(
Exception
e
)
{
return
null
;
}
return
page
.
convert
(
item
->
{
try
{
return
convertMaintenanceUnitToVo
(
item
);
return
convertMaintenanceUnitToVo
(
item
,
true
);
}
catch
(
Exception
e
)
{
return
null
;
}
...
...
amos-boot-tzs-system/src/main/resources/application.properties
View file @
50825124
...
...
@@ -2,3 +2,5 @@ spring.application.name=SPECIAL-EQUIPMENT
server.port
=
10000
spring.profiles.active
=
dev
server.servlet.context-path
=
/specialEquipment
spring.jackson.date-format
=
YYYY-MM-DD HH:mm:ss
\ No newline at end of file
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