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
c7d2efcd
Commit
c7d2efcd
authored
Dec 13, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 tzs救援站根据id删除接口
parent
28668da3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
RescueStationController.java
...ot/module/tzs/biz/controller/RescueStationController.java
+18
-5
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RescueStationController.java
View file @
c7d2efcd
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation
;
...
...
@@ -19,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -76,18 +78,28 @@ public class RescueStationController extends BaseController {
/**
* 根据id删除
*
* @param id
id
* @param id
s id,id,id,...
* @return 返回结果
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id
s
}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
ResponseModel
<
Boolean
>
deleteById
(
@PathVariable
Long
id
)
{
RescueStation
rescueStation
=
iRescueStationService
.
getById
(
id
);
@Transactional
public
ResponseModel
<
Boolean
>
deleteById
(
@PathVariable
String
ids
)
{
String
[]
id
=
ids
.
split
(
","
);
boolean
remove
=
true
;
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++)
{
if
(
remove
)
{
RescueStation
rescueStation
=
iRescueStationService
.
getById
(
id
[
i
]);
rescueStation
.
setIsDelete
(
true
);
rescueStation
.
setRecUserId
(
RequestContext
.
getExeUserId
());
rescueStation
.
setRecDate
(
new
Date
());
boolean
remove
=
iRescueStationService
.
updateById
(
rescueStation
);
remove
=
iRescueStationService
.
updateById
(
rescueStation
);
if
(!
remove
)
{
return
CommonResponseUtil
.
failure
(
"应急救援机构名称:"
+
rescueStation
.
getName
()+
"删除失败!"
);
}
}
}
return
ResponseHelper
.
buildResponse
(
remove
);
}
...
...
@@ -193,6 +205,7 @@ public class RescueStationController extends BaseController {
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
Page
<
RescueStation
>
pageBean
;
QueryWrapper
<
RescueStation
>
rescueStationQueryWrapper
=
new
QueryWrapper
<>();
rescueStationQueryWrapper
.
eq
(
"is_delete"
,
false
);
Class
<?
extends
RescueStation
>
aClass
=
rescueStation
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
...
...
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