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
a7850ad4
Commit
a7850ad4
authored
Nov 01, 2023
by
H2T
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改巡检线路点的巡检项接口修改
parent
bd038335
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
+30
-13
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+4
-3
IPointInputItemDao.java
...os/patrol/business/dao/repository/IPointInputItemDao.java
+5
-0
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+20
-9
IRouteService.java
...oin/amos/patrol/business/service/intfc/IRouteService.java
+1
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/RouteController.java
View file @
a7850ad4
...
...
@@ -744,11 +744,12 @@ public class RouteController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"修改巡检线路点的巡检项新"
,
notes
=
"修改巡检线路点的巡检项新"
)
@PostMapping
(
value
=
"/updateRoutePointInputItemNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
updateRoutePointInputItemNew
(
@ApiParam
(
value
=
"巡检路线id"
,
required
=
true
)
@RequestParam
Long
routeId
,
@ApiParam
(
value
=
"巡检点id"
,
required
=
true
)
@RequestParam
Long
pointId
,
public
CommonResponse
updateRoutePointInputItemNew
(
@ApiParam
(
value
=
"巡检路线id"
,
required
=
true
)
@RequestParam
(
value
=
"routeId"
)
Long
routeId
,
@ApiParam
(
value
=
"巡检点id"
,
required
=
true
)
@RequestParam
(
value
=
"pointId"
)
Long
pointId
,
@ApiParam
(
value
=
"巡检点分类id"
,
required
=
true
)
@RequestParam
(
value
=
"classifyId"
)
Long
classifyId
,
@ApiParam
(
value
=
"巡检点巡检项id"
,
required
=
true
)
@RequestParam
List
<
Long
>
inputItemIds
)
{
try
{
routeService
.
updateRoutePointInputItemNew
(
routeId
,
pointId
,
inputItemIds
);
routeService
.
updateRoutePointInputItemNew
(
routeId
,
pointId
,
classifyId
,
inputItemIds
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/IPointInputItemDao.java
View file @
a7850ad4
...
...
@@ -56,4 +56,9 @@ public interface IPointInputItemDao extends BaseDao<PointInputItem, Long> {
@Query
(
value
=
"SELECT count(*) FROM p_point_inputitem WHERE input_item_id IN(?1) "
,
nativeQuery
=
true
)
int
selectByITemId
(
String
inputItemIds
);
@Modifying
@Transactional
@Query
(
value
=
"SELECT * FROM p_point_inputitem WHERE point_id = ?1 and classify_ids =?2"
,
nativeQuery
=
true
)
List
<
PointInputItem
>
getPointInputItemByPointIdAndClassifyId
(
Long
pointId
,
Long
classifyId
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RouteServiceImpl.java
View file @
a7850ad4
...
...
@@ -31,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
(
"routeService"
)
public
class
RouteServiceImpl
extends
ServiceImpl
<
RouteMapper
,
Route
>
implements
IRouteService
{
...
...
@@ -539,18 +541,27 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
iRoutePointItemDao
.
saveAll
(
routePointList
);
}
@Override
@Transactional
public
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
List
<
Long
>
inputItemIds
)
{
public
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
Long
classifyId
,
List
<
Long
>
inputItemIds
)
{
Long
[]
pointIds
=
{
pointId
};
List
<
RoutePoint
>
oldRoutePointList
=
iRoutePointDao
.
queryRoutePoint
(
routeId
,
pointIds
);
if
(
oldRoutePointList
!=
null
&&
oldRoutePointList
.
size
()>
0
){
RoutePoint
RoutePoint
=
oldRoutePointList
.
get
(
0
);
if
(
inputItemIds
!=
null
){
String
excludeItem
=
StringUtils
.
join
(
inputItemIds
.
toArray
(),
","
);
RoutePoint
.
setExcludeItems
(
excludeItem
);
}
else
{
RoutePoint
.
setExcludeItems
(
null
);
}
if
(
oldRoutePointList
!=
null
&&
oldRoutePointList
.
size
()
>
0
)
{
RoutePoint
RoutePoint
=
oldRoutePointList
.
get
(
0
);
List
<
Long
>
split
=
Arrays
.
asList
(
RoutePoint
.
getExcludeItems
().
split
(
","
)).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
Set
<
Long
>
allPointInputItemIdSet
=
iPointInputItemDao
.
getPointInputItemByPointIdAndClassifyId
(
pointId
,
classifyId
)
.
stream
().
map
(
PointInputItem:
:
getId
)
.
collect
(
Collectors
.
toSet
());
List
<
Long
>
otherClassify
=
new
ArrayList
<>();
split
.
forEach
(
x
->
{
if
(!
allPointInputItemIdSet
.
contains
(
x
))
{
otherClassify
.
add
(
x
);
}
});
List
<
Long
>
lastList
=
Stream
.
concat
(
otherClassify
.
stream
(),
inputItemIds
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
RoutePoint
.
setExcludeItems
(
StringUtils
.
join
(
lastList
.
toArray
(),
","
));
iRoutePointDao
.
saveAndFlush
(
RoutePoint
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IRouteService.java
View file @
a7850ad4
...
...
@@ -132,7 +132,7 @@ public interface IRouteService extends IService<Route> {
*/
void
updateRoutePointInputItem
(
Long
routeId
,
Long
pointId
,
Long
[]
inputItemIds
);
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
List
<
Long
>
inputItemIds
);
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
L
ong
classifyId
,
L
ist
<
Long
>
inputItemIds
);
/**
* 列出巡检点的巡检项及其分类
...
...
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