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
f00d9d73
Commit
f00d9d73
authored
Dec 21, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交权限过滤
parent
3a3584a7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
26 deletions
+38
-26
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+35
-23
ICarService.java
...ain/java/com/yeejoin/equipmanage/service/ICarService.java
+1
-1
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+2
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
f00d9d73
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
...
@@ -46,6 +47,7 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -167,7 +169,7 @@ public class CarController extends AbstractBaseController {
// Car carInstance = iCarService.saveCar(user, car, carInfo, carpList);
// saveFile(carInstance); 图片视频后期统一处理
//
如果默认有id值则认为是更新
//
如果默认有id值则认为是更新
if
(
car
.
getId
()
!=
null
)
{
Car
car1
=
this
.
iCarService
.
getById
(
car
.
getId
());
if
(
car
.
getOrgCode
()
!=
null
&&
!
car
.
getBizOrgCode
().
equals
(
car1
.
getBizOrgCode
()))
{
...
...
@@ -191,7 +193,8 @@ public class CarController extends AbstractBaseController {
if
(
ar
!=
null
)
{
throw
new
BadRequest
(
"物联编码重复"
);
}
if
(
StringUtils
.
isNotEmpty
(
haveUsedIotPrefix
)
&&
Arrays
.
stream
(
haveUsedIotPrefix
.
split
(
","
)).
anyMatch
(
iotCode:
:
startsWith
))
{
if
(
StringUtils
.
isNotEmpty
(
haveUsedIotPrefix
)
&&
Arrays
.
stream
(
haveUsedIotPrefix
.
split
(
","
)).
anyMatch
(
iotCode:
:
startsWith
))
{
throw
new
BadRequest
(
"物联编码航班已占用"
);
}
}
...
...
@@ -257,7 +260,6 @@ public class CarController extends AbstractBaseController {
// });
// }
@Async
(
"equipAsyncExecutor"
)
public
void
refreshAllCount
()
{
// 清空单位装备分类树缓存
...
...
@@ -275,7 +277,6 @@ public class CarController extends AbstractBaseController {
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
IOT
);
}
/**
* 根据iotCode查询
*
...
...
@@ -341,13 +342,13 @@ public class CarController extends AbstractBaseController {
if
(
ar
!=
null
)
{
throw
new
BadRequest
(
"物联编码重复"
);
}
if
(
StringUtils
.
isNotEmpty
(
haveUsedIotPrefix
)
&&
Arrays
.
stream
(
haveUsedIotPrefix
.
split
(
","
)).
anyMatch
(
iotCode:
:
startsWith
))
{
if
(
StringUtils
.
isNotEmpty
(
haveUsedIotPrefix
)
&&
Arrays
.
stream
(
haveUsedIotPrefix
.
split
(
","
)).
anyMatch
(
iotCode:
:
startsWith
))
{
throw
new
BadRequest
(
"物联编码航班已占用"
);
}
}
//用来解绑车辆
// 用来解绑车辆
if
(!
ObjectUtils
.
isEmpty
(
car
.
getTeamId
()))
{
jcsFeign
.
getUserCar
(
car
.
getId
(),
car
.
getTeamId
());
}
...
...
@@ -988,8 +989,7 @@ public class CarController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取九大类二级统计"
)
@RequestMapping
(
value
=
"/getCarList/{ercode}"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
public
IPage
<
Car
>
getCarList
(
@PathVariable
(
value
=
"ercode"
)
String
ercode
,
String
orgcode
,
Car
car
,
String
pageNum
,
public
IPage
<
Car
>
getCarList
(
@PathVariable
(
value
=
"ercode"
)
String
ercode
,
String
orgcode
,
Car
car
,
String
pageNum
,
String
pageSize
)
{
Page
<
Car
>
pageBean
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
...
...
@@ -1316,8 +1316,8 @@ public class CarController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取消防队伍的消防车辆"
,
notes
=
"获取消防队伍的消防车辆"
)
public
ResponseModel
getTeamCarList
(
@RequestParam
(
required
=
false
)
Long
id
,
@RequestParam
(
required
=
false
)
String
sequenceNbr
,
@RequestParam
(
required
=
false
)
Double
longitude
,
@RequestParam
(
required
=
false
)
Double
latitude
)
{
@RequestParam
(
required
=
false
)
String
sequenceNbr
,
@RequestParam
(
required
=
false
)
Double
longitude
,
@RequestParam
(
required
=
false
)
Double
latitude
)
{
return
CommonResponseUtil
.
success
(
iCarService
.
getTeamCarList
(
sequenceNbr
,
id
,
longitude
,
latitude
));
}
...
...
@@ -1367,7 +1367,6 @@ public class CarController extends AbstractBaseController {
return
ResponseHelper
.
buildResponse
(
menusList
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/iot/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司部门树"
,
notes
=
"根据登录人及类型获取公司部门树"
)
...
...
@@ -1387,9 +1386,15 @@ public class CarController extends AbstractBaseController {
@RequestMapping
(
value
=
"/location"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取二维码图片"
,
notes
=
"获取二维码图片"
)
public
ResponseModel
<
Object
>
location
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iCarService
.
location
());
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
orgCode
=
null
;
if
(
reginParams
!=
null
&&
reginParams
.
getCompany
()!=
null
&&!
ObjectUtils
.
isEmpty
(
reginParams
.
getCompany
().
getOrgCode
()))
{
orgCode
=
reginParams
.
getCompany
().
getOrgCode
();
}
return
ResponseHelper
.
buildResponse
(
iCarService
.
location
(
orgCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getCountOfCar"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -1422,7 +1427,8 @@ public class CarController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getCarEquipAlarmInfoDto"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-获取设备告警信息"
,
notes
=
"车辆统计-获取设备告警信息"
)
public
Page
<
CarEquipAlarmInfoDto
>
getCarEquipAlarmInfoDto
(
@RequestParam
(
required
=
false
)
String
keyWord
,
@RequestParam
String
flag
)
{
public
Page
<
CarEquipAlarmInfoDto
>
getCarEquipAlarmInfoDto
(
@RequestParam
(
required
=
false
)
String
keyWord
,
@RequestParam
String
flag
)
{
return
iCarService
.
getCarEquipAlarmInfoDto
(
keyWord
);
}
...
...
@@ -1443,15 +1449,17 @@ public class CarController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getCarMileageInfoByMoth"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-按照月份统计车辆里程"
,
notes
=
"车辆统计-按照月份统计车辆里程"
)
public
BasicTableDataDto
getCarMileageInfoByMoth
(
@RequestParam
(
required
=
false
)
String
date
,
@RequestParam
Integer
current
,
@RequestParam
Integer
size
,
@RequestParam
(
required
=
false
)
String
keyWord
)
{
public
BasicTableDataDto
getCarMileageInfoByMoth
(
@RequestParam
(
required
=
false
)
String
date
,
@RequestParam
Integer
current
,
@RequestParam
Integer
size
,
@RequestParam
(
required
=
false
)
String
keyWord
)
{
return
iCarService
.
getCarMileageInfoByMoth
(
date
,
current
,
size
,
keyWord
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/exportCarMileageInfoByMoth"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-按照月份统计导出车辆里程"
,
notes
=
"车辆统计-按照月份统计导出车辆里程"
)
public
void
exportCarMileageInfoByMoth
(
@RequestParam
(
required
=
false
)
String
date
,
@RequestParam
(
required
=
false
)
String
keyWord
,
HttpServletResponse
response
)
{
List
<
CarExportDto
>
list
=
this
.
iCarService
.
exportCarMileageInfoByMoth
(
date
,
keyWord
);
public
void
exportCarMileageInfoByMoth
(
@RequestParam
(
required
=
false
)
String
date
,
@RequestParam
(
required
=
false
)
String
keyWord
,
HttpServletResponse
response
)
{
List
<
CarExportDto
>
list
=
this
.
iCarService
.
exportCarMileageInfoByMoth
(
date
,
keyWord
);
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
date
))
{
date
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM"
);
}
...
...
@@ -1469,19 +1477,23 @@ public class CarController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getCarExcepitonTrack"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-按照日期范围获取异常车辆"
,
notes
=
"车辆统计-按照日期范围获取异常车辆"
)
public
Page
<
CarExceptionDto
>
getCarExcepitonTrack
(
@RequestParam
Integer
type
,
@RequestParam
(
required
=
false
)
String
keyWord
)
{
return
iCarService
.
getCarExcepitonTrack
(
type
,
keyWord
);
public
Page
<
CarExceptionDto
>
getCarExcepitonTrack
(
@RequestParam
Integer
type
,
@RequestParam
(
required
=
false
)
String
keyWord
)
{
return
iCarService
.
getCarExcepitonTrack
(
type
,
keyWord
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getCarWarningRecord"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-获取超速信息"
,
notes
=
"车辆统计-获取超速信息"
)
public
BasicTableDataDto
getCarWarningRecord
(
@RequestParam
(
required
=
false
)
String
keyWord
,
@RequestParam
Integer
current
,
@RequestParam
Integer
size
)
{
return
iCarService
.
getCarWarningRecord
(
keyWord
,
current
,
size
);
public
BasicTableDataDto
getCarWarningRecord
(
@RequestParam
(
required
=
false
)
String
keyWord
,
@RequestParam
Integer
current
,
@RequestParam
Integer
size
)
{
return
iCarService
.
getCarWarningRecord
(
keyWord
,
current
,
size
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getBizOrgName"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆统计-获取归属单位下拉框值"
,
notes
=
"车辆统计-获取归属单位下拉框值"
)
public
List
<
Map
<
String
,
String
>>
getBizOrgName
(
@RequestParam
(
required
=
false
)
String
keyWord
)
{
public
List
<
Map
<
String
,
String
>>
getBizOrgName
(
@RequestParam
(
required
=
false
)
String
keyWord
)
{
return
iCarService
.
getBizOrgName
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/ICarService.java
View file @
f00d9d73
...
...
@@ -187,7 +187,7 @@ public interface ICarService extends IService<Car> {
IPage
getQRCode
(
Long
id
);
List
<
Car
>
location
();
List
<
Car
>
location
(
String
orgCode
);
// 获取车辆总数
Map
<
String
,
Integer
>
getCountOfCar
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
f00d9d73
...
...
@@ -1442,8 +1442,8 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
}
@Override
public
List
<
Car
>
location
()
{
List
<
Car
>
list
=
this
.
list
();
public
List
<
Car
>
location
(
String
orgCode
)
{
List
<
Car
>
list
=
this
.
list
(
new
LambdaQueryWrapper
<
Car
>().
like
(
Car:
:
getBizOrgCode
,
orgCode
)
);
return
list
;
}
...
...
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