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 50184692
authored
May 15, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
V1.7.0需求:运营报表完善
1 parent
5da06398
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
23 deletions
src/main/java/cn/com/glsx/admin/modules/model/ReportVehicleDTO.java
src/main/java/cn/com/glsx/admin/modules/model/export/ReportDeviceExport.java
src/main/java/cn/com/glsx/admin/modules/model/export/ReportVehicleExport.java
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
src/main/resources/mapper/VehicleMapper.xml
src/main/java/cn/com/glsx/admin/modules/model/ReportVehicleDTO.java
View file @
5018469
...
@@ -54,6 +54,16 @@ public class ReportVehicleDTO extends BaseOrgDto {
...
@@ -54,6 +54,16 @@ public class ReportVehicleDTO extends BaseOrgDto {
private
String
deviceCompose
;
private
String
deviceCompose
;
/**
/**
* 设备类型
*/
private
String
deviceTypes
;
/**
* 设备有线无线类型
*/
private
String
deviceSources
;
/**
* 工单创建时间
* 工单创建时间
*/
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
...
@@ -66,6 +76,11 @@ public class ReportVehicleDTO extends BaseOrgDto {
...
@@ -66,6 +76,11 @@ public class ReportVehicleDTO extends BaseOrgDto {
private
Date
activateTime
;
private
Date
activateTime
;
/**
/**
* 车型
*/
private
String
modelName
;
/**
* 激活人
* 激活人
*/
*/
private
String
activator
;
private
String
activator
;
...
...
src/main/java/cn/com/glsx/admin/modules/model/export/ReportDeviceExport.java
View file @
5018469
...
@@ -42,12 +42,6 @@ public class ReportDeviceExport extends BaseOrgDto {
...
@@ -42,12 +42,6 @@ public class ReportDeviceExport extends BaseOrgDto {
private
String
licensePlate
;
private
String
licensePlate
;
/**
/**
* 是否激活
*/
@ExcelProperty
(
"是否激活"
)
private
String
activateFlag
;
/**
* 车主姓名
* 车主姓名
*/
*/
@ExcelProperty
(
"姓名"
)
@ExcelProperty
(
"姓名"
)
...
@@ -88,13 +82,4 @@ public class ReportDeviceExport extends BaseOrgDto {
...
@@ -88,13 +82,4 @@ public class ReportDeviceExport extends BaseOrgDto {
@ExcelProperty
(
"工单激活时间"
)
@ExcelProperty
(
"工单激活时间"
)
private
Date
woActivateTime
;
private
Date
woActivateTime
;
@ExcelProperty
(
"租赁属性"
)
private
String
rentP
;
@ExcelProperty
(
"车辆说明"
)
private
String
vehicleRemark
;
@ExcelProperty
(
"备注"
)
private
String
remark
;
}
}
src/main/java/cn/com/glsx/admin/modules/model/export/ReportVehicleExport.java
View file @
5018469
...
@@ -54,6 +54,18 @@ public class ReportVehicleExport extends BaseOrgDto {
...
@@ -54,6 +54,18 @@ public class ReportVehicleExport extends BaseOrgDto {
private
String
deviceCompose
;
private
String
deviceCompose
;
/**
/**
* 设备类型
*/
@ExcelIgnore
private
String
deviceTypes
;
/**
* 设备有线无线类型
*/
@ExcelIgnore
private
String
deviceSources
;
/**
* 工单创建时间
* 工单创建时间
*/
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
...
@@ -79,6 +91,18 @@ public class ReportVehicleExport extends BaseOrgDto {
...
@@ -79,6 +91,18 @@ public class ReportVehicleExport extends BaseOrgDto {
@ExcelProperty
(
"车型"
)
@ExcelProperty
(
"车型"
)
private
String
modelName
;
private
String
modelName
;
@ExcelProperty
(
"租赁期限"
)
private
String
leaseTerm
;
@ExcelProperty
(
"安装地址"
)
private
String
serviceAddress
;
@ExcelProperty
(
"租赁方式"
)
private
String
leaseWay
;
@ExcelProperty
(
"是否自采"
)
private
String
purchaseWay
;
/**
/**
* 激活人
* 激活人
*/
*/
...
...
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
View file @
5018469
...
@@ -10,9 +10,12 @@ import cn.com.glsx.admin.modules.model.param.ReportDeviceSearch;
...
@@ -10,9 +10,12 @@ import cn.com.glsx.admin.modules.model.param.ReportDeviceSearch;
import
cn.com.glsx.admin.modules.model.param.ReportVehicleSearch
;
import
cn.com.glsx.admin.modules.model.param.ReportVehicleSearch
;
import
cn.com.glsx.admin.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.admin.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.enums.DeviceTypeRelationEnum
;
import
cn.com.glsx.stdinterface.enums.DeviceComposeEnum
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -58,17 +61,52 @@ public class OpereportService extends AbstractCommonService {
...
@@ -58,17 +61,52 @@ public class OpereportService extends AbstractCommonService {
List
<
ReportVehicleDTO
>
list
=
vehicleMapper
.
searchReportVehicle
(
search
);
List
<
ReportVehicleDTO
>
list
=
vehicleMapper
.
searchReportVehicle
(
search
);
list
.
forEach
(
rv
->
rv
.
setDeviceCompose
(
parseDeviceCompose
(
rv
.
getDeviceCompose
(),
rv
.
getDeviceTypes
(),
rv
.
getDeviceSources
())));
organizationApiService
.
drawAllLevel
(
list
);
organizationApiService
.
drawAllLevel
(
list
);
return
new
PageInfo
<>(
list
);
return
new
PageInfo
<>(
list
);
}
}
/**
* 解析设备组合
*
* @param deviceComposeCode
* @param deviceTypesCode
* @param deviceSourcesCode
* @return
*/
public
String
parseDeviceCompose
(
String
deviceComposeCode
,
String
deviceTypesCode
,
String
deviceSourcesCode
)
{
String
deviceCompose
=
DeviceComposeEnum
.
getNameByCode
(
deviceComposeCode
);
if
(
StringUtils
.
isNotEmpty
(
deviceCompose
))
{
return
deviceCompose
;
}
if
(
StringUtils
.
isNotEmpty
(
deviceTypesCode
))
{
List
<
String
>
deviceTypeNames
=
Lists
.
newArrayList
();
String
[]
deviceTypes
=
deviceTypesCode
.
split
(
","
);
String
[]
deviceSources
=
deviceSourcesCode
.
split
(
","
);
for
(
int
i
=
0
;
i
<
deviceTypes
.
length
;
i
++)
{
Integer
deviceType
=
Integer
.
valueOf
(
deviceTypes
[
i
]);
Integer
deviceSource
=
Integer
.
valueOf
(
deviceSources
[
i
]);
String
deviceTypeName
=
DeviceTypeRelationEnum
.
findByBizDeviceType
(
deviceType
,
deviceSource
);
deviceTypeNames
.
add
(
deviceTypeName
);
}
return
StringUtils
.
join
(
deviceTypeNames
,
"+"
);
}
return
"--"
;
}
public
List
<
ReportVehicleExport
>
vehicleExport
(
ReportVehicleSearch
search
)
{
public
List
<
ReportVehicleExport
>
vehicleExport
(
ReportVehicleSearch
search
)
{
injectOrgChecked
(
search
);
injectOrgChecked
(
search
);
List
<
ReportVehicleExport
>
list
=
vehicleMapper
.
exportReportVehicle
(
search
);
List
<
ReportVehicleExport
>
list
=
vehicleMapper
.
exportReportVehicle
(
search
);
list
.
forEach
(
rv
->
rv
.
setDeviceCompose
(
parseDeviceCompose
(
rv
.
getDeviceCompose
(),
rv
.
getDeviceTypes
(),
rv
.
getDeviceSources
())));
organizationApiService
.
drawAllLevel
(
list
);
organizationApiService
.
drawAllLevel
(
list
);
return
list
;
return
list
;
...
...
src/main/resources/mapper/VehicleMapper.xml
View file @
5018469
...
@@ -1265,13 +1265,14 @@
...
@@ -1265,13 +1265,14 @@
tv.owner_name ownerName,
tv.owner_name ownerName,
tv.vin,
tv.vin,
twv.device_compose deviceCompose,
twv.device_compose deviceCompose,
group_concat(t
vd.sn order by source desc
) sns,
group_concat(t
d.sn order by td.id
) sns,
group_concat(td.device_type order by
source desc
) deviceTypes,
group_concat(td.device_type order by
td.id
) deviceTypes,
group_concat(td.source order by
source desc
) deviceSources,
group_concat(td.source order by
td.id
) deviceSources,
tv.license_plate licensePlate,
tv.license_plate licensePlate,
case when tv.type_id is null then tv.model_name else concat(tv.sub_brand_name,'/',tv.series_name,'/',tv.type_name) end as modelName,
tv.created_date activateTime,
tv.created_date activateTime,
tw.created_date createdDate,
tw.created_date createdDate,
tw.mechanic_name
activator,
ifnull(tw.mechanic_name,tu.username)
activator,
tv.created_by createdBy
tv.created_by createdBy
from t_vehicle tv
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
...
@@ -1310,13 +1311,20 @@
...
@@ -1310,13 +1311,20 @@
tv.owner_name ownerName,
tv.owner_name ownerName,
tv.vin,
tv.vin,
twv.device_compose deviceCompose,
twv.device_compose deviceCompose,
group_concat(t
vd.sn order by source desc
) sns,
group_concat(t
d.sn order by td.id
) sns,
group_concat(td.device_type order by
source desc
) deviceTypes,
group_concat(td.device_type order by
td.id
) deviceTypes,
group_concat(td.source order by
source desc
) deviceSources,
group_concat(td.source order by
td.id
) deviceSources,
tv.license_plate licensePlate,
tv.license_plate licensePlate,
case when tv.type_id is null then tv.model_name else concat(tv.sub_brand_name,'/',tv.series_name,'/',tv.type_name) end as modelName,
tv.created_date activateTime,
tv.created_date activateTime,
tv.remark,
tw.shop_name shopName,
tw.service_address serviceAddress,
'--' as leaseTerm,
'--' as leaseWay,
'--' as purchaseWay,
tw.created_date createdDate,
tw.created_date createdDate,
tw.mechanic_name
activator,
ifnull(tw.mechanic_name,tu.username)
activator,
tv.created_by createdBy
tv.created_by createdBy
from t_vehicle tv
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
...
...
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