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
8e468a1c
Commit
8e468a1c
authored
Jul 25, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl_plan6_temp' of…
Merge branch 'develop_dl_plan6_temp' of
http://39.98.45.134:8090/moa/amos-boot-biz
into develop_dl_plan6_temp
parents
8f5c2103
00a18f66
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
228 additions
and
5 deletions
+228
-5
PointController.java
...join/amos/patrol/business/controller/PointController.java
+13
-0
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+153
-0
IRoutePointDao.java
...n/amos/patrol/business/dao/repository/IRoutePointDao.java
+7
-0
JcsFeignClient.java
...om/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
+1
-0
RoutePageParam.java
...om/yeejoin/amos/patrol/business/param/RoutePageParam.java
+39
-2
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+7
-0
IRouteService.java
...oin/amos/patrol/business/service/intfc/IRouteService.java
+3
-1
routeMapper.xml
...ystem-patrol/src/main/resources/db/mapper/routeMapper.xml
+5
-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/PointController.java
View file @
8e468a1c
...
...
@@ -133,6 +133,19 @@ public class PointController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"新*查询巡检点列表"
,
notes
=
"新*查询巡检点列表"
)
@GetMapping
(
value
=
"/routeListNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryPointListByRouteIdNew
(
@ApiParam
(
value
=
"线路ID"
)
@RequestParam
(
value
=
"routeId"
)
Long
routeId
)
{
Page
<
Map
<
String
,
Object
>>
pag
=
new
PageImpl
<
Map
<
String
,
Object
>>(
iPointService
.
queryPointListByRouteId
(
routeId
));
return
CommonResponseUtil
.
success
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"新增巡查对象"
,
notes
=
"新增巡查对象"
)
...
...
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 @
8e468a1c
...
...
@@ -9,10 +9,12 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.expression.spel.ast.NullLiteral
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
@@ -49,6 +51,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@RestController
@RequestMapping
(
value
=
"/api/route"
)
...
...
@@ -64,6 +67,156 @@ public class RouteController extends AbstractBaseController {
private
AsyncTask
asyncTask
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
/**
*
* 新增接口
* **/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询巡检路线信息"
,
notes
=
"查询巡检路线信息"
)
@PostMapping
(
value
=
"/listNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
listRouteNew
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
RoutePageParam
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
//获取所在公司code
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
queryRequests
.
setBizOrgCode
(
bizOrgCode
);
Page
<
HashMap
<
String
,
Object
>>
routeList
=
routeService
.
getRouteInfo
(
null
,
null
,
null
,
queryRequests
);
return
CommonResponseUtil
.
success
(
routeList
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"查询巡检路线信息失败"
);
}
}
/**
* 修改保存巡检路线
* @return IDs
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"新*保存巡检路线"
,
notes
=
"新*保存巡检路线"
)
@PutMapping
(
value
=
"/saveUpdateNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
saveRouteNew
(
@ApiParam
(
value
=
"巡检路线"
,
required
=
true
)
@RequestBody
Route
route
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
route
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
route
.
setBizOrgName
(
reginParams
.
getPersonIdentity
().
getCompanyName
());
if
(
route
.
getDeptId
()!=
null
){
//查询jcs
ResponseModel
<
Object
>
companyInfo
=
jcsFeignClient
.
getCompanyInfo
(
route
.
getDeptId
());
Object
obj
=
companyInfo
.
getResult
();
String
bizOrgName
=
((
Map
<
String
,
Object
>)
obj
).
get
(
"bizOrgName"
).
toString
();
route
.
setDeptName
(
bizOrgName
);
}
if
(
route
.
getBoss
()!=
null
){
//查询jcs
ResponseModel
<
Object
>
companyInfo
=
jcsFeignClient
.
getCompanyInfo
(
route
.
getBoss
());
Object
obj
=
companyInfo
.
getResult
();
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
.
setCreatorId
(
getUserId
());
return
CommonResponseUtil
.
success
(
routeService
.
addRouteNew
(
route
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"巡检路线新增失败"
);
}
}
/**
* 根据ID查询巡检路线信息
*
* @param point
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询巡检路线信息"
,
notes
=
"查询巡检路线信息"
)
@GetMapping
(
value
=
"/queryRouteByIdNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryRouteByIdNew
(
@ApiParam
(
value
=
"巡检路线id"
,
required
=
true
)
@RequestParam
(
name
=
"id"
)
long
id
)
{
try
{
Route
route
=
routeService
.
queryRouteById
(
id
);
return
CommonResponseUtil
.
success
(
route
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"查询巡检路线失败"
);
}
}
/**
* 删除巡检路线
*
* @param routeIds
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除巡检路线"
,
notes
=
"删除巡检路线"
)
@DeleteMapping
(
value
=
"/deleteRouteNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
deleteRouteNew
(
@ApiParam
(
value
=
"巡检路线ID"
,
required
=
false
)
@RequestParam
List
<
Long
>
routeIds
)
{
try
{
//校验1:线路上有点时返回删除失败
Map
<
Long
,
String
>
idNameMap
=
new
HashMap
<>();
for
(
long
id
:
routeIds
)
{
int
routePointCount
=
routeService
.
countRoutePoint
(
id
);
if
(
routePointCount
>
0
)
{
Route
route
=
routeService
.
queryRouteById
(
id
);
idNameMap
.
put
(
id
,
route
.
getName
());
}
}
if
(
idNameMap
.
size
()
>
0
)
{
return
CommonResponseUtil
.
failure
(
idNameMap
,
"删除路线失败:路线上已设置巡检点"
);
}
//校验2:计划在使用,删除失败
idNameMap
.
clear
();
for
(
long
id
:
routeIds
)
{
int
routePointCount
=
routeService
.
countRoutePoint
(
id
);
if
(
routePointCount
>
0
)
{
List
<
Plan
>
planList
=
routeService
.
queryPlanByRouteId
(
id
);
if
(
planList
!=
null
&&
planList
.
size
()
>
0
){
idNameMap
.
put
(
id
,
planList
.
get
(
0
).
getName
());
}
}
}
if
(
idNameMap
.
size
()
>
0
)
{
return
CommonResponseUtil
.
failure
(
idNameMap
,
"删除路线失败:计划在使用"
);
}
routeService
.
delRouteById
(
routeIds
.
toArray
(
new
Long
[
0
]));
return
CommonResponseUtil
.
success
();
}
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/dao/repository/IRoutePointDao.java
View file @
8e468a1c
...
...
@@ -34,6 +34,13 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query
(
value
=
"select * from p_route_point WHERE route_id = ?1 and point_id in (?2)"
,
nativeQuery
=
true
)
List
<
RoutePoint
>
queryRoutePoint
(
Long
routeId
,
Long
[]
pointIds
);
@Modifying
@Transactional
@Query
(
value
=
"select * from p_route_point WHERE route_id = ?1 "
,
nativeQuery
=
true
)
List
<
RoutePoint
>
queryRoutePointList
(
Long
routeId
);
@Modifying
@Query
(
value
=
"select point_id from p_route_point WHERE route_id = ?1"
,
nativeQuery
=
true
)
List
<
Long
>
findAllByRouteId
(
Long
routeId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/JcsFeignClient.java
View file @
8e468a1c
...
...
@@ -64,5 +64,6 @@ public interface JcsFeignClient {
@GetMapping
(
value
=
"/org-usr/getCompanyInfo"
)
ResponseModel
<
Object
>
getCompanyInfo
(
@RequestParam
(
value
=
"companyId"
)
String
companyId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/param/RoutePageParam.java
View file @
8e468a1c
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.patrol.business.param;
import
com.yeejoin.amos.patrol.core.common.request.CommonPageable
;
import
javax.persistence.Column
;
public
class
RoutePageParam
extends
CommonPageable
{
/**
...
...
@@ -27,7 +29,7 @@ public class RoutePageParam extends CommonPageable{
/**
* 责任部门
*/
private
String
deptName
;
//
private String deptName;
private
Long
deptId
;
...
...
@@ -50,7 +52,42 @@ public class RoutePageParam extends CommonPageable{
* 人员编号
*/
private
String
userId
;
private
String
bossName
;
//所属单位code
private
String
bizOrgCode
;
//所属单位名称
private
String
bizOrgName
;
//责任部门名称
private
String
deptName
;
public
String
getBossName
()
{
return
bossName
;
}
public
void
setBossName
(
String
bossName
)
{
this
.
bossName
=
bossName
;
}
public
String
getBizOrgCode
()
{
return
bizOrgCode
;
}
public
void
setBizOrgCode
(
String
bizOrgCode
)
{
this
.
bizOrgCode
=
bizOrgCode
;
}
public
String
getBizOrgName
()
{
return
bizOrgName
;
}
public
void
setBizOrgName
(
String
bizOrgName
)
{
this
.
bizOrgName
=
bizOrgName
;
}
public
Long
getId
()
{
return
id
;
}
...
...
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 @
8e468a1c
...
...
@@ -138,6 +138,13 @@ public class RouteServiceImpl implements IRouteService {
}
@Override
public
Route
addRouteNew
(
Route
route
)
{
return
iRouteDao
.
saveAndFlush
(
route
);
}
@Override
@Transactional
public
void
delRouteById
(
Long
[]
ids
)
{
//0.删除路线
...
...
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 @
8e468a1c
...
...
@@ -29,7 +29,9 @@ public interface IRouteService {
* @param route
*/
Route
addRoute
(
Route
route
);
Route
addRouteNew
(
Route
route
);
/**
* 删除路线
* @param routeIds
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/routeMapper.xml
View file @
8e468a1c
...
...
@@ -89,6 +89,8 @@
<if
test=
"name!=null"
>
AND r.`name` LIKE CONCAT('%', #{name}, '%')
</if>
<if
test=
"remark!=null"
>
AND r.remark LIKE CONCAT('%', #{remark}, '%')
</if>
<if
test=
"orgCode!=null"
>
AND r.org_Code = #{orgCode}
</if>
<if
test=
"bizOrgCode!=null"
>
AND r.biz_org_code = #{bizOrgCode}
</if>
<!-- <if test="deptId!=null">AND r.dept_id = #{deptId}</if> -->
<choose>
<when
test=
"deptId > 0 "
>
AND r.dept_id = #{deptId}
</when>
...
...
@@ -104,8 +106,8 @@
r.boss,
r.tel,
r.remark,
r.dept_
id
,
r.
user_id
r.dept_
name
,
r.
boss_name
FROM
`p_route` r
WHERE
...
...
@@ -113,6 +115,7 @@
<if
test=
"name!=null"
>
AND r.`name` LIKE CONCAT('%', #{name}, '%')
</if>
<if
test=
"remark!=null"
>
AND r.remark LIKE CONCAT('%', #{remark}, '%')
</if>
<if
test=
"orgCode!=null"
>
AND r.org_Code = #{orgCode}
</if>
<if
test=
"bizOrgCode!=null"
>
AND r.biz_org_code = #{bizOrgCode}
</if>
<choose>
<when
test=
"deptId > 0 "
>
AND r.dept_id = #{deptId}
</when>
<when
test=
"deptId == -1 "
>
AND r.dept_id in(0,-1)
</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