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
967bffd0
Commit
967bffd0
authored
Jul 25, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口 修改代码
parent
e600893c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
9 deletions
+91
-9
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+22
-7
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+66
-0
IRouteService.java
...oin/amos/patrol/business/service/intfc/IRouteService.java
+1
-0
dbTemplate_input_item.xml
...ol/src/main/resources/db/mapper/dbTemplate_input_item.xml
+2
-2
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 @
967bffd0
...
@@ -9,6 +9,7 @@ import java.util.Map;
...
@@ -9,6 +9,7 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -124,18 +125,13 @@ public class RouteController extends AbstractBaseController {
...
@@ -124,18 +125,13 @@ public class RouteController extends AbstractBaseController {
route
.
setDeptName
(
bizOrgName
);
route
.
setDeptName
(
bizOrgName
);
}
}
if
(
route
.
getBoss
()!=
null
){
if
(
route
.
getBoss
()!=
null
){
//查询jcs
//查询jcs
ResponseModel
<
Object
>
companyInfo
=
jcsFeignClient
.
getCompanyInfo
(
route
.
getBoss
());
FeignClientResult
result
=
jcsFeignClient
.
selectById
(
route
.
getBoss
());
Object
obj
=
result
.
getResult
();
Object
obj
=
companyInfo
.
getResult
();
String
bizOrgName
=
((
Map
<
String
,
Object
>)
obj
).
get
(
"bizOrgName"
).
toString
();
String
bizOrgName
=
((
Map
<
String
,
Object
>)
obj
).
get
(
"bizOrgName"
).
toString
();
String
amosOrgId
=
((
Map
<
String
,
Object
>)
obj
).
get
(
"amosOrgId"
).
toString
();
route
.
setBoss
(
amosOrgId
);
route
.
setBossName
(
bizOrgName
);
route
.
setBossName
(
bizOrgName
);
}
}
route
.
setCreatorId
(
getUserId
());
route
.
setCreatorId
(
getUserId
());
return
CommonResponseUtil
.
success
(
routeService
.
addRouteNew
(
route
));
return
CommonResponseUtil
.
success
(
routeService
.
addRouteNew
(
route
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -690,4 +686,23 @@ public class RouteController extends AbstractBaseController {
...
@@ -690,4 +686,23 @@ public class RouteController extends AbstractBaseController {
}
}
}
}
/**
* 修改保存巡检路线
* @return IDs
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"巡检路线关联巡检点"
,
notes
=
"巡检路线关联巡检点"
)
@PutMapping
(
value
=
"/relevancyPoint"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
relevancyPoint
(
@ApiParam
(
value
=
"巡检路线"
,
required
=
true
)
@RequestBody
Route
route
)
{
try
{
return
CommonResponseUtil
.
success
(
routeService
.
relevancyPoint
(
route
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"巡检路线更新失败"
);
}
}
}
}
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 @
967bffd0
...
@@ -267,6 +267,72 @@ public class RouteServiceImpl implements IRouteService {
...
@@ -267,6 +267,72 @@ public class RouteServiceImpl implements IRouteService {
}
}
@Override
@Override
@Transactional
public
Route
relevancyPoint
(
Route
route
)
{
List
<
RoutePoint
>
routePoints
=
route
.
getRoutePointList
();
Long
routeId
=
route
.
getId
();
String
orgCode
=
route
.
getOrgCode
();
String
CreatorId
=
route
.
getCreatorId
();
// 以下删除顺序不可更改
// 删除旧的项
routePointItemMapper
.
delRoutePointItemByRouteId
(
routeId
);
// 删除旧的点
iRoutePointDao
.
delRoutePointByRouteId
(
routeId
);
// 保存新的点
if
(
routePoints
!=
null
&&
!
routePoints
.
isEmpty
())
{
List
<
RoutePoint
>
points
=
new
ArrayList
<>();
List
<
RoutePointItem
>
items
=
new
ArrayList
<>();
List
<
Long
>
pointIds
=
new
ArrayList
<>();
routePoints
.
forEach
(
rp
->
{
rp
.
setOrgCode
(
orgCode
);
rp
.
setRouteId
(
routeId
);
rp
.
setCreatorId
(
CreatorId
);
points
.
add
(
rp
);
pointIds
.
add
(
rp
.
getPointId
());
});
List
<
RoutePoint
>
savedPoints
=
iRoutePointDao
.
saveAll
(
points
);
List
<
Map
<
String
,
Object
>>
pointRefItem
=
pointMapper
.
getPointRefItem
(
pointIds
);
if
(!
savedPoints
.
isEmpty
())
{
savedPoints
.
forEach
(
rp
->
{
String
excludeItems
=
rp
.
getExcludeItems
();
Set
<
Long
>
excludeItemIdSet
=
new
HashSet
<>();
if
(
excludeItems
!=
null
&&
!
excludeItems
.
isEmpty
())
{
String
[]
itemIds
=
excludeItems
.
split
(
","
);
for
(
String
itemId
:
itemIds
)
{
try
{
excludeItemIdSet
.
add
(
Long
.
valueOf
(
itemId
));
}
catch
(
Exception
e
)
{
}
}
}
final
int
[]
orderNum
=
{
1
};
pointRefItem
.
forEach
(
ref
->
{
Long
pointId
=
rp
.
getPointId
();
if
(
pointId
.
equals
(
ref
.
get
(
"pointId"
))){
if
(!
excludeItemIdSet
.
contains
(
ref
.
get
(
"itemId"
)))
{
RoutePointItem
item
=
new
RoutePointItem
();
item
.
setPointInputItemId
((
Long
)
ref
.
get
(
"id"
));
item
.
setRoutePointId
(
rp
.
getId
());
item
.
setPointClassifyId
(
Long
.
valueOf
(
ref
.
get
(
"classifyId"
).
toString
()));
item
.
setOrderNo
(
orderNum
[
0
]++);
item
.
setPointId
(
pointId
);
item
.
setIsDelete
(
false
);
items
.
add
(
item
);
}
}
});
});
if
(!
items
.
isEmpty
())
{
iRoutePointItemDao
.
saveAll
(
items
);
}
}
}
return
route
;
}
@Override
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
public
void
migrateRoutePoint
(
Long
sourceRouteId
,
Long
[]
pointIds
,
Long
targetRouteId
)
{
public
void
migrateRoutePoint
(
Long
sourceRouteId
,
Long
[]
pointIds
,
Long
targetRouteId
)
{
List
<
RoutePoint
>
routePointList
=
iRoutePointDao
.
queryRoutePoint
(
sourceRouteId
,
pointIds
);
List
<
RoutePoint
>
routePointList
=
iRoutePointDao
.
queryRoutePoint
(
sourceRouteId
,
pointIds
);
...
...
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 @
967bffd0
...
@@ -45,6 +45,7 @@ public interface IRouteService {
...
@@ -45,6 +45,7 @@ public interface IRouteService {
Route
updateRoute
(
Route
route
);
Route
updateRoute
(
Route
route
);
Route
updateRouteNew
(
Route
route
);
Route
updateRouteNew
(
Route
route
);
Route
relevancyPoint
(
Route
route
);
/**
/**
* 迁移路线巡检点
* 迁移路线巡检点
*
*
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_input_item.xml
View file @
967bffd0
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
</if>
</if>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
and a.biz_org_codeLIKE CONCAT (#{bizOrgCode} ,'%')
and a.biz_org_code
LIKE CONCAT (#{bizOrgCode} ,'%')
</if>
</if>
<choose>
<choose>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
...
@@ -293,7 +293,7 @@
...
@@ -293,7 +293,7 @@
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
</if>
</if>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
and a.biz_org_code
LIKE CONCAT (#{bizOrgCode}
,'%')
and a.biz_org_code
LIKE CONCAT (#{bizOrgCode}
,'%')
</if>
</if>
<choose>
<choose>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
...
...
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