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 b059c607
authored
Mar 22, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化假性离线导出报表
1 parent
17fae11c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
11 deletions
src/main/java/cn/com/glsx/admin/modules/model/export/FakeOfficeExport.java
src/main/java/cn/com/glsx/admin/modules/model/imports/WhiteListSnImportListener.java
src/main/resources/mapper/FakeOfflineVinMapper.xml
src/main/java/cn/com/glsx/admin/modules/model/export/FakeOfficeExport.java
View file @
b059c60
...
@@ -23,10 +23,10 @@ public class FakeOfficeExport {
...
@@ -23,10 +23,10 @@ public class FakeOfficeExport {
private
String
ownerName
;
private
String
ownerName
;
/**
/**
*
设备
号
*
车架
号
*/
*/
@ExcelProperty
(
value
=
"
设备
号"
,
index
=
2
)
@ExcelProperty
(
value
=
"
车架
号"
,
index
=
2
)
private
String
sns
;
private
String
licensePlate
;
/**
/**
* 车架号
* 车架号
...
@@ -35,21 +35,27 @@ public class FakeOfficeExport {
...
@@ -35,21 +35,27 @@ public class FakeOfficeExport {
private
String
vin
;
private
String
vin
;
/**
/**
* 设备号
*/
@ExcelProperty
(
value
=
"设备号"
,
index
=
4
)
private
String
sns
;
/**
* 假性离线原因
* 假性离线原因
*/
*/
@ExcelProperty
(
value
=
"假性离线原因"
,
index
=
4
)
@ExcelProperty
(
value
=
"假性离线原因"
,
index
=
5
)
private
String
reason
;
private
String
reason
;
/**
/**
* 预测家庭地址
* 预测家庭地址
*/
*/
@ExcelProperty
(
value
=
"预测家庭地址"
,
index
=
5
)
@ExcelProperty
(
value
=
"预测家庭地址"
,
index
=
6
)
private
String
homeAddr
;
private
String
homeAddr
;
/**
/**
* 预测工作地址
* 预测工作地址
*/
*/
@ExcelProperty
(
value
=
"预测工作地址"
,
index
=
6
)
@ExcelProperty
(
value
=
"预测工作地址"
,
index
=
7
)
private
String
workAddr
;
private
String
workAddr
;
/**
/**
...
...
src/main/java/cn/com/glsx/admin/modules/model/imports/WhiteListSnImportListener.java
View file @
b059c60
...
@@ -123,9 +123,10 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
...
@@ -123,9 +123,10 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
list
.
add
(
whiteListSnImport
);
list
.
add
(
whiteListSnImport
);
// 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
// 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
if
(
list
.
size
()
>
BATCH_SUM_COUNT
)
{
if
(
list
.
size
()
>
BATCH_SUM_COUNT
)
{
saveData
();
list
.
clear
();
list
.
clear
();
throw
new
AdminException
(
ResultEnum
.
IMPORT_SIZE_TIP
.
getCode
(),
//
throw new AdminException(ResultEnum.IMPORT_SIZE_TIP.getCode(),
String
.
format
(
ResultEnum
.
IMPORT_SIZE_TIP
.
getMessage
(),
BATCH_SUM_COUNT
));
//
String.format(ResultEnum.IMPORT_SIZE_TIP.getMessage(), BATCH_SUM_COUNT));
}
}
}
}
...
@@ -137,6 +138,13 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
...
@@ -137,6 +138,13 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
*/
*/
@Override
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
analysisContext
)
{
public
void
doAfterAllAnalysed
(
AnalysisContext
analysisContext
)
{
saveData
();
}
/**
* 分批次保存数据
*/
public
void
saveData
()
{
// 保存数据
// 保存数据
baseImportInfo
.
setTotal
(
list
.
size
());
baseImportInfo
.
setTotal
(
list
.
size
());
log
.
info
(
"开始处理{}条数据"
,
list
.
size
());
log
.
info
(
"开始处理{}条数据"
,
list
.
size
());
...
@@ -183,7 +191,6 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
...
@@ -183,7 +191,6 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
list
.
clear
();
list
.
clear
();
}
}
/**
/**
* 分批次线程调用 执行导入
* 分批次线程调用 执行导入
*
*
...
...
src/main/resources/mapper/FakeOfflineVinMapper.xml
View file @
b059c60
...
@@ -53,7 +53,8 @@
...
@@ -53,7 +53,8 @@
select tv.id, tw.partner_order_no bizOrderNo,
select tv.id, tw.partner_order_no bizOrderNo,
tv.owner_name ownerName,
tv.owner_name ownerName,
tv.vin as vin,
tv.vin as vin,
group_concat(tvd.sn) sns
group_concat(tvd.sn) sns,
tv.license_plate licensePlate
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
left join t_workorder tw on tw.id = tv.workorder_id
left join t_workorder tw on tw.id = tv.workorder_id
...
@@ -71,7 +72,8 @@
...
@@ -71,7 +72,8 @@
tw.partner_order_no like '%${keywords}%'
tw.partner_order_no like '%${keywords}%'
or tv.vin like '%${keywords}%'
or tv.vin like '%${keywords}%'
or tv.owner_name like '%${keywords}%'
or tv.owner_name like '%${keywords}%'
or tv.id in (select vehicle_id from t_vehicle_device where del_flag = 0 and bind_status = 1 and sn like '%${keywords}%')
or tv.id in (select vehicle_id from t_vehicle_device where del_flag = 0 and bind_status = 1 and sn like
'%${keywords}%')
)
)
</if>
</if>
group by tv.id
group by 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