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
abf66589
Commit
abf66589
authored
Aug 03, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改检查项接口
parent
483690dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
37 deletions
+22
-37
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+1
-1
PointServiceImpl.java
...n/amos/patrol/business/service/impl/PointServiceImpl.java
+10
-7
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+10
-28
IRouteService.java
...oin/amos/patrol/business/service/intfc/IRouteService.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/RouteController.java
View file @
abf66589
...
...
@@ -704,7 +704,7 @@ public class RouteController extends AbstractBaseController {
@ApiParam
(
value
=
"巡检点id"
,
required
=
true
)
@RequestParam
Long
pointId
,
@ApiParam
(
value
=
"巡检点巡检项id"
,
required
=
true
)
@RequestParam
List
<
Long
>
inputItemIds
)
{
try
{
routeService
.
updateRoutePointInputItemNew
(
routeId
,
pointId
,
inputItemIds
.
toArray
(
new
Long
[
0
])
);
routeService
.
updateRoutePointInputItemNew
(
routeId
,
pointId
,
inputItemIds
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PointServiceImpl.java
View file @
abf66589
...
...
@@ -799,13 +799,16 @@ public class PointServiceImpl implements IPointService {
Long
[]
longs
=
new
Long
[]{
pointId
};
List
<
RoutePoint
>
list
=
iRoutePointDao
.
queryRoutePoint
(
routeId
,
longs
);
String
excludeItems
=
list
.
get
(
0
).
getExcludeItems
();
resList
.
forEach
(
e
->{
if
(
excludeItems
.
contains
(
e
.
get
(
"itemId"
).
toString
())){
e
.
put
(
"checked"
,
false
);
}
else
{
e
.
put
(
"checked"
,
true
);
}
});
if
(
excludeItems
!=
null
){
resList
.
forEach
(
e
->{
if
(
excludeItems
.
contains
(
e
.
get
(
"itemId"
).
toString
())){
e
.
put
(
"checked"
,
true
);
}
else
{
e
.
put
(
"checked"
,
false
);
}
});
}
return
resList
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RouteServiceImpl.java
View file @
abf66589
...
...
@@ -571,37 +571,19 @@ public class RouteServiceImpl implements IRouteService {
}
@Transactional
public
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
L
ong
[]
inputItemIds
)
{
public
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
L
ist
<
Long
>
inputItemIds
)
{
Long
[]
pointIds
=
{
pointId
};
String
creatorId
=
""
;
long
routePointId
=
0
;
RoutePoint
routePoint
=
null
;
// 1.先查找并删除表中已有的行(旧的项)
List
<
RoutePoint
>
oldRoutePointList
=
iRoutePointDao
.
queryRoutePoint
(
routeId
,
pointIds
);
if
(
oldRoutePointList
.
size
()
>
0
)
{
routePoint
=
oldRoutePointList
.
get
(
0
);
creatorId
=
routePoint
.
getCreatorId
();
routePointId
=
routePoint
.
getId
();
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
);
}
iRoutePointDao
.
save
(
RoutePoint
);
}
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
);
// 2.保存新的项到数据库
List
<
RoutePointItem
>
routePointList
=
new
ArrayList
<>();
int
orderNo
=
0
;
for
(
Long
inputItemId
:
inputItemIds
)
{
// PointInputItem pointInputItem = iPointInputItemDao.getPointInputItem(pointId, inputItemId);
RoutePointItem
routePointItem
=
new
RoutePointItem
();
routePointItem
.
setCreatorId
(
creatorId
);
routePointItem
.
setOrderNo
(
orderNo
++);
routePointItem
.
setPointInputItemId
(
inputItemId
);
routePointItem
.
setRoutePointId
(
routePointId
);
routePointItem
.
setRoutePoint
(
routePoint
);
PointInputItem
pointInputItem
=
iPointInputItemDao
.
getOne
(
inputItemId
);
routePointItem
.
setPointClassifyId
(
Long
.
valueOf
(
pointInputItem
.
getClassifyIds
()));
routePointList
.
add
(
routePointItem
);
}
iRoutePointItemDao
.
saveAll
(
routePointList
);
}
@Override
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IRouteService.java
View file @
abf66589
...
...
@@ -139,7 +139,7 @@ public interface IRouteService {
*/
void
updateRoutePointInputItem
(
Long
routeId
,
Long
pointId
,
Long
[]
inputItemIds
);
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
L
ong
[]
inputItemIds
);
void
updateRoutePointInputItemNew
(
Long
routeId
,
Long
pointId
,
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