Commit b059c607 by 杨林龙

优化假性离线导出报表

1 parent 17fae11c
......@@ -23,10 +23,10 @@ public class FakeOfficeExport {
private String ownerName;
/**
* 设备号
* 车架号
*/
@ExcelProperty(value = "设备号", index = 2)
private String sns;
@ExcelProperty(value = "车架号", index = 2)
private String licensePlate;
/**
* 车架号
......@@ -35,21 +35,27 @@ public class FakeOfficeExport {
private String vin;
/**
* 设备号
*/
@ExcelProperty(value = "设备号", index = 4)
private String sns;
/**
* 假性离线原因
*/
@ExcelProperty(value = "假性离线原因", index = 4)
@ExcelProperty(value = "假性离线原因", index = 5)
private String reason;
/**
* 预测家庭地址
*/
@ExcelProperty(value = "预测家庭地址", index = 5)
@ExcelProperty(value = "预测家庭地址", index = 6)
private String homeAddr;
/**
* 预测工作地址
*/
@ExcelProperty(value = "预测工作地址", index = 6)
@ExcelProperty(value = "预测工作地址", index = 7)
private String workAddr;
/**
......
......@@ -123,9 +123,10 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
list.add(whiteListSnImport);
// 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
if (list.size() > BATCH_SUM_COUNT) {
saveData();
list.clear();
throw new AdminException(ResultEnum.IMPORT_SIZE_TIP.getCode(),
String.format(ResultEnum.IMPORT_SIZE_TIP.getMessage(), BATCH_SUM_COUNT));
// throw new AdminException(ResultEnum.IMPORT_SIZE_TIP.getCode(),
// String.format(ResultEnum.IMPORT_SIZE_TIP.getMessage(), BATCH_SUM_COUNT));
}
}
......@@ -137,6 +138,13 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
*/
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
saveData();
}
/**
* 分批次保存数据
*/
public void saveData() {
// 保存数据
baseImportInfo.setTotal(list.size());
log.info("开始处理{}条数据", list.size());
......@@ -183,7 +191,6 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
list.clear();
}
/**
* 分批次线程调用 执行导入
*
......
......@@ -53,7 +53,8 @@
select tv.id, tw.partner_order_no bizOrderNo,
tv.owner_name ownerName,
tv.vin as vin,
group_concat(tvd.sn) sns
group_concat(tvd.sn) sns,
tv.license_plate licensePlate
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_workorder tw on tw.id = tv.workorder_id
......@@ -71,7 +72,8 @@
tw.partner_order_no like '%${keywords}%'
or tv.vin 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>
group by tv.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!