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
1ab38660
Commit
1ab38660
authored
Oct 19, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检路线相关接口适配调整,添加设备类型,企业类型字段
parent
9f6f9a88
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
192 additions
and
33 deletions
+192
-33
Route.java
...c/main/java/com/yeejoin/amos/patrol/dao/entity/Route.java
+21
-0
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+98
-29
PointMapper.java
.../yeejoin/amos/patrol/business/dao/mapper/PointMapper.java
+5
-0
RouteMapper.java
.../yeejoin/amos/patrol/business/dao/mapper/RouteMapper.java
+7
-0
TzsFeign.java
...java/com/yeejoin/amos/patrol/business/feign/TzsFeign.java
+7
-0
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+5
-2
pointMapper.xml
...ystem-patrol/src/main/resources/db/mapper/pointMapper.xml
+31
-0
routeMapper.xml
...ystem-patrol/src/main/resources/db/mapper/routeMapper.xml
+18
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/dao/entity/Route.java
View file @
1ab38660
...
...
@@ -108,6 +108,27 @@ public class Route extends BasicEntity {
@Column
(
name
=
"dept_name"
)
private
String
deptName
;
// 排查企业类型
@Column
(
name
=
"enterprise_type"
)
private
String
enterpriseType
;
// 排查设备类型
@Column
(
name
=
"equip_type"
)
private
String
equipType
;
public
String
getEquipType
()
{
return
equipType
;
}
public
void
setEquipType
(
String
equipType
)
{
this
.
equipType
=
equipType
;
}
public
String
getEnterpriseType
()
{
return
enterpriseType
;
}
public
void
setEnterpriseType
(
String
enterpriseType
)
{
this
.
enterpriseType
=
enterpriseType
;
}
public
String
getBossName
()
{
return
bossName
;
...
...
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 @
1ab38660
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRouteDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.TzsFeign
;
import
com.yeejoin.amos.patrol.business.param.RoutePageParam
;
import
com.yeejoin.amos.patrol.business.service.impl.RouteServiceImpl
;
import
com.yeejoin.amos.patrol.business.service.intfc.IRouteService
;
...
...
@@ -20,10 +24,7 @@ import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import
com.yeejoin.amos.patrol.core.common.request.RoutePointInputItemRequest
;
import
com.yeejoin.amos.patrol.core.common.request.ToJson
;
import
com.yeejoin.amos.patrol.core.common.response.RoutePointRespone
;
import
com.yeejoin.amos.patrol.dao.entity.InputItem
;
import
com.yeejoin.amos.patrol.dao.entity.Plan
;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePoint
;
import
com.yeejoin.amos.patrol.dao.entity.*
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -73,6 +74,16 @@ public class RouteController extends AbstractBaseController {
@Autowired
private
IRouteDao
iRouteDao
;
@Autowired
private
TzsFeign
tzsFeign
;
@Resource
private
RouteMapper
routeMapper
;
@Autowired
PointMapper
pointMapper
;
/**
*
* 新增接口
...
...
@@ -86,6 +97,8 @@ public class RouteController extends AbstractBaseController {
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
RoutePageParam
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
try
{
List
<
Map
<
String
,
Object
>>
result
=
tzsFeign
.
getEnterpriseType
().
getResult
();
List
<
Map
<
String
,
Object
>>
getEquipType
=
tzsFeign
.
getEquipType
().
getResult
();
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
queryRequests
.
getBizOrgCode
()))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
//获取所在公司code
...
...
@@ -97,6 +110,16 @@ public class RouteController extends AbstractBaseController {
queryRequests
.
setPageSize
(
commonPageable
.
getPageSize
());
}
Page
<
HashMap
<
String
,
Object
>>
routeList
=
routeService
.
getRouteInfo
(
null
,
null
,
null
,
queryRequests
);
routeList
.
stream
().
forEach
(
item
->
{
List
<
Map
<
String
,
Object
>>
enterpriseTypeList
=
result
.
stream
().
filter
(
enterpriseType
->
enterpriseType
.
get
(
"code"
).
toString
().
equals
(
item
.
get
(
"enterpriseType"
).
toString
())).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
equipTypeList
=
getEquipType
.
stream
().
filter
(
equipType
->
equipType
.
get
(
"code"
).
toString
().
equals
(
item
.
get
(
"equipType"
).
toString
())).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
enterpriseTypeList
)){
item
.
put
(
"enterpriseType"
,
enterpriseTypeList
.
get
(
0
).
get
(
"name"
));
}
if
(!
ObjectUtils
.
isEmpty
(
equipTypeList
)){
item
.
put
(
"equipType"
,
equipTypeList
.
get
(
0
).
get
(
"name"
));
}
});
return
CommonResponseUtil
.
success
(
routeList
);
}
catch
(
Exception
e
)
{
...
...
@@ -165,32 +188,38 @@ public class RouteController extends AbstractBaseController {
route
.
setOrgCode
(
loginOrgCode
);
if
(!
StringUtils
.
isEmpty
(
route
.
getName
())){
List
<
Route
>
list
=
null
;
list
=
route
.
getId
()>
0
?
iRouteDao
.
getListByNameUpdate
(
route
.
getId
(),
route
.
getName
()):
iRouteDao
.
getListByName
(
route
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
list
)
||
list
.
size
()>
0
){
throw
new
BadRequest
(
"该名称路线已存在"
);
}
}
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
);
route
.
setBizOrgCode
(((
Map
<
String
,
Object
>)
obj
).
get
(
"bizOrgCode"
).
toString
());
route
.
setBizOrgName
(
bizOrgName
);
}
if
(
route
.
getBoss
()!=
null
){
//查询jcs
FeignClientResult
result
=
jcsFeignClient
.
selectById
(
route
.
getBoss
());
Object
obj
=
result
.
getResult
();
String
bizOrgName
=
((
Map
<
String
,
Object
>)
obj
).
get
(
"personName"
).
toString
();
route
.
setBossName
(
bizOrgName
);
// if(!StringUtils.isEmpty(route.getName())){
// List<Route> list =null;
//
// list = route.getId()>0?iRouteDao.getListByNameUpdate(route.getId(),route.getName()):iRouteDao.getListByName(route.getName());
//
// if (!ObjectUtils.isEmpty(list) || list.size()>0){
// throw new BadRequest("该名称路线已存在");
// }
// }
// 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);
// route.setBizOrgCode(((Map<String, Object>) obj).get("bizOrgCode").toString());
// route.setBizOrgName(bizOrgName);
// }
// if(route.getBoss()!=null){
// //查询jcs
// FeignClientResult result = jcsFeignClient.selectById(route.getBoss());
// Object obj = result.getResult();
// String bizOrgName = ((Map<String, Object>) obj).get("personName").toString();
// route.setBossName(bizOrgName);
// }
Integer
integer
=
routeMapper
.
checkData
(
route
.
getId
(),
route
.
getName
());
if
(
integer
>
0
){
throw
new
BadRequest
(
"该名称路线已存在"
);
}
route
.
setCreatorId
(
getUserId
());
route
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
route
.
setBizOrgName
(
reginParams
.
getCompany
().
getCompanyName
());
return
CommonResponseUtil
.
success
(
routeService
.
addRouteNew
(
route
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -773,7 +802,20 @@ public class RouteController extends AbstractBaseController {
@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
)
{
public
CommonResponse
relevancyPoint
(
@ApiParam
(
value
=
"巡检路线"
,
required
=
true
)
@RequestBody
JSONObject
map
)
{
Route
route
=
new
Route
();
List
<
Long
>
ids
=
(
List
<
Long
>)
map
.
get
(
"ids"
);
List
<
RoutePoint
>
routePoint
=
pointMapper
.
getRoutePoint
(
ids
);
// if (!ObjectUtils.isEmpty(ids)){
// ids.forEach(item ->{
// RoutePoint routePoint = new RoutePoint();
// routePoint.setId(Long.valueOf(item.intValue()));
// routePoints.add(routePoint);
// });
// }
route
.
setId
(
Long
.
parseLong
(
map
.
get
(
"routeId"
).
toString
()));
route
.
setRoutePointList
(
routePoint
);
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
getOrgCode
(
reginParams
);
...
...
@@ -813,4 +855,31 @@ public class RouteController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询企业类型"
,
notes
=
"查询企业类型"
)
@GetMapping
(
value
=
"/getEnterpriseType"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getEnterpriseType
()
{
return
CommonResponseUtil
.
success
(
tzsFeign
.
getEnterpriseType
().
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询设备类型"
,
notes
=
"查询设备类型"
)
@GetMapping
(
value
=
"/getEquipType"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getEquipType
()
{
return
CommonResponseUtil
.
success
(
tzsFeign
.
getEquipType
().
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"路线绑定点列表"
,
notes
=
"路线绑定点列表"
)
@GetMapping
(
value
=
"/selectRoutePointList"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
selectRoutePointList
(
@RequestParam
(
"size"
)
Long
size
,
@RequestParam
(
"number"
)
Long
number
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"pointNo"
,
required
=
false
)
String
pointNo
){
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
Point
>
pointPage
=
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<>();
number
=
(
number
-
1
)
*
size
;
pointPage
.
setTotal
(
pointMapper
.
countRoutePointList
(
name
,
pointNo
));
pointPage
.
setRecords
(
pointMapper
.
selectRoutePointList
(
number
,
size
,
name
,
pointNo
));
return
CommonResponseUtil
.
success
(
pointPage
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/PointMapper.java
View file @
1ab38660
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.patrol.business.vo.*;
import
com.yeejoin.amos.patrol.core.common.response.PointResponse
;
import
com.yeejoin.amos.patrol.dao.entity.Point
;
import
com.yeejoin.amos.patrol.dao.entity.PointPhoto
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePoint
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
...
...
@@ -154,4 +155,8 @@ public interface PointMapper extends BaseMapper {
* @param list 点ID列表
*/
List
<
Map
<
String
,
Object
>>
getPointRefItem
(
List
<
Long
>
list
);
List
<
Point
>
selectRoutePointList
(
Long
number
,
Long
size
,
String
name
,
String
pointNo
);
Integer
countRoutePointList
(
String
name
,
String
pointNo
);
List
<
RoutePoint
>
getRoutePoint
(
@Param
(
"ids"
)
List
<
Long
>
ids
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/RouteMapper.java
View file @
1ab38660
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dao
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.patrol.business.param.RoutePageParam
;
import
com.yeejoin.amos.patrol.business.vo.PointInputItemVo
;
import
com.yeejoin.amos.patrol.core.common.request.RoutePointInputItemRequest
;
import
com.yeejoin.amos.patrol.core.common.response.RoutePointRespone
;
import
com.yeejoin.amos.patrol.dao.entity.Point
;
import
com.yeejoin.amos.patrol.dao.entity.PointInputItem
;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePointItem
;
...
...
@@ -104,4 +106,9 @@ public interface RouteMapper extends BaseMapper, com.baomidou.mybatisplus.core.m
List
<
Route
>
queryRoutesByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
);
List
<
Route
>
queryRoutesByOrgCodeNew
(
@Param
(
"orgCode"
)
String
orgCode
);
Integer
countRoutePoint
(
@Param
(
"routeId"
)
Long
routeId
);
Integer
checkData
(
@Param
(
"id"
)
Long
id
,
@Param
(
"name"
)
String
name
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/feign/TzsFeign.java
View file @
1ab38660
...
...
@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author DELL
...
...
@@ -23,4 +24,10 @@ public interface TzsFeign {
*/
@RequestMapping
(
value
=
"/userInfo/getGroupAndPersonInfo"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
UserDetailsDto
>>
getGroupAndPersonInfo
(
@RequestParam
(
value
=
"groupId"
,
required
=
false
)
Long
groupId
);
@RequestMapping
(
value
=
"/baseEnterprise/getEnterpriseType"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getEnterpriseType
();
@RequestMapping
(
value
=
"/baseEnterprise/getEquipType"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getEquipType
();
}
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 @
1ab38660
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper
;
...
...
@@ -366,8 +368,9 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
@Override
public
int
countRoutePoint
(
Long
routeId
)
{
int
routePointCount
=
iRoutePointDao
.
countRoutePoint
(
routeId
);
return
routePointCount
;
Integer
integer
=
routeMapper
.
countRoutePoint
(
routeId
);
// int routePointCount = iRoutePointDao.countRoutePoint(routeId);
return
integer
;
}
@Override
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/pointMapper.xml
View file @
1ab38660
...
...
@@ -1436,4 +1436,34 @@
#{pointId}
</foreach>
</select>
<select
id=
"selectRoutePointList"
resultType=
"com.yeejoin.amos.patrol.dao.entity.Point"
>
SELECT * from p_point
WHERE route_id is null
<if
test=
"name != null and name != ''"
>
AND name like concat('%', #{name}, '%')
</if>
<if
test=
"name != null and name != ''"
>
AND point_no like concat('%', #{pointNo}, '%')
</if>
LIMIT #{number}, #{size}
</select>
<select
id=
"countRoutePointList"
resultType=
"java.lang.Integer"
>
SELECT count(1) from p_point
WHERE route_id is null
<if
test=
"name != null and name != ''"
>
AND name like concat('%', #{name}, '%')
</if>
<if
test=
"name != null and name != ''"
>
AND point_no like concat('%', #{pointNo}, '%')
</if>
</select>
<select
id=
"getRoutePoint"
resultType=
"com.yeejoin.amos.patrol.dao.entity.RoutePoint"
>
select * from p_route_point
<if
test=
"ids != null "
>
where id in
<foreach
item=
"item"
collection=
"ids"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
amos-boot-system-patrol/src/main/resources/db/mapper/routeMapper.xml
View file @
1ab38660
...
...
@@ -110,7 +110,9 @@
r.remark,
r.dept_name deptName,
r.boss_name bossName,
ifnull(r.biz_org_code, "") as bizOrgCode
ifnull(r.biz_org_code, '') as bizOrgCode,
ifnull(r.enterprise_type, '') as enterpriseType,
ifnull(r.equip_type, '') as equipType
FROM
p_route r
WHERE
...
...
@@ -462,7 +464,21 @@
GROUP BY r.id
order by r.create_date DESC
</select>
<select
id=
"countRoutePoint"
resultType=
"java.lang.Integer"
>
SELECT COUNT( point_id ) FROM p_route_point where route_id = #{routeId}
</select>
<select
id=
"checkData"
resultType=
"java.lang.Integer"
>
select count(1) from p_route
<where>
is_delete =0
<if
test=
"id != null and id != ''"
>
and id != #{id}
</if>
<if
test=
"name != null and name != ''"
>
and name = #{name}
</if>
</where>
</select>
...
...
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