Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6b1125db
authored
Oct 20, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
V1.3.0需求开发
1 parent
7fd5ab82
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
16 deletions
pom.xml
src/main/java/cn/com/glsx/admin/modules/controller/ElectricInStoreDriveController.java
src/main/java/cn/com/glsx/admin/modules/controller/TrialDriveReportController.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveReportSearch.java
src/main/java/cn/com/glsx/admin/modules/service/LogginApiService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorSevice.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
pom.xml
View file @
6b1125d
...
...
@@ -82,12 +82,21 @@
<scope>
compile
</scope>
</dependency>
<!-- alarm-api-->
<!-- loggincenter-api -->
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-loggincenter-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- alarmcenter-api-->
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-alarmcenter-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
ne-shield-publiccenter-api
</artifactId>
...
...
src/main/java/cn/com/glsx/admin/modules/controller/ElectricInStoreDriveController.java
View file @
6b1125d
...
...
@@ -37,7 +37,7 @@ public class ElectricInStoreDriveController {
private
HttpServletResponse
response
;
@GetMapping
(
"/search"
)
@SysLog
(
module
=
"无在店统计"
,
value
=
"查询无在店统计(日报)"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"无在店统计"
,
value
=
"查询无在店统计(日报)"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"无在店统计(日报)"
)
public
R
search
(
ElectricInStoreSearch
search
)
{
Page
<
Object
>
page
=
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
(),
true
);
...
...
@@ -49,10 +49,9 @@ public class ElectricInStoreDriveController {
}
@GetMapping
(
value
=
"/export"
)
@SysLog
(
module
=
"无在店统计"
,
value
=
"导出无在店统计(日报)"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"导出无在店统计(日报)"
)
public
void
exportTrialDriveReport
(
ElectricInStoreSearch
search
)
throws
Exception
{
log
.
info
(
"试驾报表导出===start
"
);
log
.
info
(
"试驾报表导出===start
,参数:{}"
,
search
.
toString
()
);
String
fileName
=
"无在店数据统计表"
+
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
// 统计 t_electric_instore_drive 在店数据
List
<
ElectricInStoreExport
>
inStoreExportList
=
inStoreDriveService
.
search
(
search
);
...
...
@@ -62,7 +61,7 @@ public class ElectricInStoreDriveController {
}
@GetMapping
(
value
=
"/years"
)
@SysLog
(
module
=
"无在店统计"
,
value
=
"获取在店有数据的年份"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"无在店统计"
,
value
=
"获取在店有数据的年份"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"获取在店有数据的年份"
)
public
R
getYearWithData
()
{
List
<
String
>
yearList
=
inStoreDriveService
.
getYearWithData
();
...
...
src/main/java/cn/com/glsx/admin/modules/controller/TrialDriveReportController.java
View file @
6b1125d
...
...
@@ -41,7 +41,7 @@ public class TrialDriveReportController {
private
HttpServletResponse
response
;
@GetMapping
(
"/search"
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"查询有效试驾(日报)"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"查询有效试驾(日报)"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"有效试驾(日报)"
)
public
R
search
(
TrialDriveReportSearch
search
)
{
Page
<
Object
>
page
=
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
(),
true
);
...
...
@@ -53,10 +53,9 @@ public class TrialDriveReportController {
}
@GetMapping
(
value
=
"/export"
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"导出有效试驾(日报)"
,
action
=
OperateType
.
QUERY
)
@ApiOperation
(
value
=
"导出有效试驾(日报)"
)
public
void
exportTrialDriveReport
(
TrialDriveReportSearch
search
)
throws
Exception
{
log
.
info
(
"试驾报表导出===start
"
);
log
.
info
(
"试驾报表导出===start
,参数:{}"
,
search
.
toString
()
);
String
fileName
=
"有效试驾次数统计(按日"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd"
)
+
")表"
;
// 优先查询试驾 d_electric_fence_drive 表获取分页页数
List
<
TrialDriveReportExport
>
testDrivePageList
=
trialDriveReportService
.
search
(
search
);
...
...
@@ -66,10 +65,23 @@ public class TrialDriveReportController {
}
@GetMapping
(
value
=
"/years"
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"获取有试驾数据的年份"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"获取有试驾数据的年份"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"获取有试驾数据的年份"
)
public
R
getYearWithData
()
{
List
<
String
>
yearList
=
trialDriveReportService
.
getYearWithData
();
return
R
.
ok
().
data
(
yearList
);
}
@GetMapping
(
"/details"
)
@SysLog
(
module
=
"有效试驾(日报)"
,
value
=
"查询有效试驾(日报)"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@ApiOperation
(
value
=
"有效试驾(日报)"
)
public
R
details
(
TrialDriveReportSearch
search
)
{
Page
<
Object
>
page
=
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
(),
true
);
// 优先查询试驾 d_electric_fence_drive 表获取分页页数
List
<
TrialDriveReportExport
>
testDrivePageList
=
trialDriveReportService
.
search
(
search
);
return
R
.
ok
().
putPageData
(
testDrivePageList
,
page
.
getTotal
());
}
}
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
View file @
6b1125d
...
...
@@ -76,7 +76,7 @@ public class VehicleController {
}
@ApiOperation
(
value
=
"查询该组织下没有绑定为试驾车辆的列表"
)
@SysLog
(
module
=
MODULE
,
value
=
"查询该组织下没有绑定为试驾车辆的列表"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
MODULE
,
value
=
"查询该组织下没有绑定为试驾车辆的列表"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@GetMapping
(
"/drivevehicle/listtestdrive"
)
public
R
listTestDriveVehicle
(
TestVehicleSearch
testVehicleVo
)
{
String
shopId
=
testVehicleVo
.
getShopId
();
...
...
@@ -111,7 +111,7 @@ public class VehicleController {
}
@ApiOperation
(
value
=
"根据id查询某条试驾车辆数据(数据回显)"
)
@SysLog
(
module
=
MODULE
,
value
=
"根据id查询某条试驾车辆数据(数据回显)"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
MODULE
,
value
=
"根据id查询某条试驾车辆数据(数据回显)"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@GetMapping
(
"/drivevehicle/findbyid"
)
public
R
findDriveVehicleById
(
@RequestParam
String
tempId
)
{
TrialDriveVehicleEditDTO
vehicleEditDTO
=
vehicleService
.
findDriveVehicleById
(
tempId
);
...
...
@@ -334,7 +334,7 @@ public class VehicleController {
}
@ApiOperation
(
value
=
"验证试驾设备"
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"验证试驾设备"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"验证试驾设备"
,
action
=
OperateType
.
QUERY
,
saveLog
=
false
)
@GetMapping
(
"/vehicleinfo/verifydevice"
)
public
R
verifydevice
(
@RequestParam
String
sn
)
{
// 校验设备号是否存在
...
...
@@ -408,7 +408,6 @@ public class VehicleController {
}
@ApiOperation
(
value
=
"根据id查询某条车辆信息(数据回显)"
)
@SysLog
(
value
=
"查询车辆信息"
,
action
=
OperateType
.
QUERY
)
@GetMapping
(
"/vehicleinfo/findone"
)
public
R
findVehicleInfoById
(
@RequestParam
Long
id
)
{
VehicleInfoVo
vehicleInfoVo
=
vehicleService
.
findVehicleInfoById
(
id
);
...
...
@@ -436,7 +435,7 @@ public class VehicleController {
* @return
*/
@ApiOperation
(
value
=
"一键调频"
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"一键调频"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"一键调频"
,
action
=
OperateType
.
EDIT
)
@PostMapping
(
value
=
"/adjFreq"
)
public
R
adjFreq
(
@RequestBody
DeviceWorkModel
model
)
{
if
(
StringUtils
.
isNullOrEmpty
(
model
.
getSn
()))
{
...
...
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveReportSearch.java
View file @
6b1125d
...
...
@@ -11,7 +11,7 @@ import lombok.experimental.Accessors;
public
class
TrialDriveReportSearch
extends
Page
{
/**
*
sn 号
*
车辆id
*/
private
Long
vehicleId
;
...
...
@@ -30,4 +30,8 @@ public class TrialDriveReportSearch extends Page {
*/
private
String
keywords
;
private
String
sn
;
private
String
sDate
;
private
String
eDate
;
}
src/main/java/cn/com/glsx/admin/modules/service/LogginApiService.java
0 → 100644
View file @
6b1125d
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.loggincenter.api.dto.request.CustomLogRequest
;
import
cn.com.glsx.loggincenter.api.feign.LogginService
;
import
com.glsx.plat.context.utils.PropertiesUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
@Service
public
class
LogginApiService
{
@Autowired
private
LogginService
logginService
;
@Async
public
void
addCustomLog
(
CustomLogRequest
log
)
{
if
(
log
==
null
)
{
return
;
}
log
.
setApplication
(
PropertiesUtils
.
getProperty
(
"spring.application.name"
));
log
.
setProcessed
(
Thread
.
currentThread
().
getStackTrace
()[
2
].
getMethodName
());
logginService
.
addLog
(
log
);
}
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorSevice.java
View file @
6b1125d
...
...
@@ -219,7 +219,7 @@ public class VehicleMonitorSevice {
List
<
VehicleLocationBo
>
retVehilceBoList
=
new
ArrayList
<>();
long
begin
=
System
.
currentTimeMillis
();
List
<
DeviceLocationBo
>
deviceLocationBos
=
monitorApiService
.
listDeviceMonitorInfo
(
sns
,
deviceCode
);
log
.
info
(
"
use
time:"
+
(
System
.
currentTimeMillis
()
-
begin
));
log
.
info
(
"
Used
time:"
+
(
System
.
currentTimeMillis
()
-
begin
));
if
(
deviceLocationBos
==
null
)
{
return
retVehilceBoList
;
}
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
6b1125d
...
...
@@ -23,6 +23,7 @@ import cn.com.glsx.auth.utils.ShieldContextHolder;
import
cn.com.glsx.devicemonitor.api.dto.response.DeviceSearchDTO
;
import
cn.com.glsx.devicemonitor.api.dto.response.DeviceStatusModel
;
import
cn.com.glsx.devicemonitor.api.feign.DeviceFeignService
;
import
cn.com.glsx.loggincenter.api.dto.request.CustomLogRequest
;
import
cn.com.glsx.publiccenter.api.dto.response.SysDictDataResponse
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
com.alibaba.fastjson.JSON
;
...
...
@@ -120,6 +121,9 @@ public class VehicleService {
@Autowired
private
DevicePowerFeignClient
devicePowerFeignClient
;
@Autowired
private
LogginApiService
logginApiService
;
private
static
CarInfoSelected
applyCarBrandConvert
(
TenantVehicleType
tvt
)
{
CarInfoSelected
selected
=
new
CarInfoSelected
();
selected
.
setId
(
Math
.
toIntExact
(
tvt
.
getBrandId
()));
...
...
@@ -467,6 +471,11 @@ public class VehicleService {
log
.
info
(
"同步设备给试驾围栏==="
+
vehicleDevice
.
getVehicleId
());
Vehicle
vehicle
=
vehicleMapper
.
selectById
(
vehicleDevice
.
getVehicleId
());
fenceService
.
syncUsersFencesSns
(
Lists
.
newArrayList
(
vehicle
.
getCreatedBy
()));
//自定义日志
CustomLogRequest
log
=
new
CustomLogRequest
();
log
.
setModule
(
"车辆管理"
).
setAction
(
"车辆解绑"
).
setRemark
(
"删除车辆试驾关系"
);
logginApiService
.
addCustomLog
(
log
);
}
/**
...
...
@@ -1285,6 +1294,7 @@ public class VehicleService {
vehicle
.
setCreatedDate
(
new
Date
());
vehicle
.
setRemark
(
vehicle
.
getRemark
());
vehicleMapper
.
insert
(
vehicle
);
List
<
DeviceInfoDto
>
deviceInfoDtos
=
vehicleInfoVo
.
getDeviceInfoDtos
();
for
(
DeviceInfoDto
deviceInfoDto
:
deviceInfoDtos
)
{
vehicleDeviceService
.
saveSnToVehicleId
(
deviceInfoDto
.
getSn
(),
vehicle
.
getId
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment