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 1e060a01
authored
Mar 15, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
假性离线需求开发--- 优化导入校验
1 parent
b93289ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
13 deletions
src/main/java/cn/com/glsx/admin/modules/model/imports/WhiteListSnImportListener.java
src/main/java/cn/com/glsx/admin/modules/service/FakeOfflineService.java
src/main/resources/mapper/FakeOfflineVinMapper.xml
src/main/resources/mapper/WhitelistSnMapper.xml
src/main/java/cn/com/glsx/admin/modules/model/imports/WhiteListSnImportListener.java
View file @
1e060a0
...
...
@@ -239,7 +239,7 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
// 校验车辆和设备的绑定关系
checkVinAndDevice
(
stringBuilder
,
vi
.
getVin
(),
vi
.
getSn
(),
importSnList
,
vehicleAndDeviceMap
);
importSnList
.
add
(
vi
.
getVin
(
).
concat
(
"-"
).
concat
(
vi
.
getSn
()));
importSnList
.
add
(
(
vi
.
getVin
()
==
null
?
""
:
vi
.
getVin
()
).
concat
(
"-"
).
concat
(
vi
.
getSn
()));
if
(
StringUtils
.
isNotEmpty
(
stringBuilder
))
{
WhiteListFailExport
failExport
=
new
WhiteListFailExport
();
...
...
@@ -281,8 +281,8 @@ public class WhiteListSnImportListener extends AnalysisEventListener<WhiteListSn
*/
private
void
checkVinAndDevice
(
StringBuilder
stringBuilder
,
String
vin
,
String
sn
,
List
<
String
>
importSnList
,
Map
<
String
,
String
>
vehicleAndDeviceMap
)
{
// 校验设备号是否重复
if
(
importSnList
.
contains
(
vin
.
concat
(
"-"
).
concat
(
sn
)))
{
stringBuilder
.
append
(
vin
.
concat
(
"-"
).
concat
(
sn
)).
append
(
"重复数据;"
);
if
(
importSnList
.
contains
(
(
vin
==
null
?
""
:
vin
)
.
concat
(
"-"
).
concat
(
sn
)))
{
stringBuilder
.
append
(
(
vin
==
null
?
""
:
vin
)
.
concat
(
"-"
).
concat
(
sn
)).
append
(
"重复数据;"
);
}
String
sns
=
vehicleAndDeviceMap
.
get
(
vin
);
...
...
src/main/java/cn/com/glsx/admin/modules/service/FakeOfflineService.java
View file @
1e060a0
...
...
@@ -70,6 +70,7 @@ public class FakeOfflineService extends AbstractCommonService {
Map
<
String
,
Integer
>
reasonMap
=
Maps
.
newHashMap
();
List
<
String
>
vinList
=
getFakeOfficeVinList
(
reasonMap
);
if
(
CollectionUtil
.
isEmpty
(
vinList
))
{
log
.
warn
(
"没有假性离线车辆==="
+
ShieldContextHolder
.
getUsername
());
return
new
PageInfo
();
}
...
...
@@ -111,10 +112,10 @@ public class FakeOfflineService extends AbstractCommonService {
}
}
}
//对于触碰围栏假性离线的设备 封装家庭地址和工作地址
buildPredictAddr
(
fakeOfficeExport
,
vin
);
builder
.
append
(
"】设备离线"
);
fakeOfficeExport
.
setReason
(
builder
.
toString
());
//对于触碰围栏假性离线的设备 封装家庭地址和工作地址
buildPredictAddr
(
fakeOfficeExport
,
vin
);
}
}
...
...
@@ -170,10 +171,10 @@ public class FakeOfflineService extends AbstractCommonService {
List
<
FakeOfficeMapDto
>
vehicleNumMapList
=
fakeOfflineVinMapper
.
getVehicleNumMap
();
log
.
info
(
"vehicleNumMapList==="
+
JSONUtil
.
toJsonStr
(
vehicleNumMapList
));
vehicleNumMapList
.
forEach
(
vehicleNum
->
vehicleNumMap
.
put
(
vehicleNum
.
getVin
(),
vehicleNum
.
getNum
()));
log
.
info
(
"vehicleNumMap==="
+
JSONUtil
.
toJsonStr
(
vehicleNumMap
));
Map
<
String
,
Integer
>
offlineVehicleNumMap
=
Maps
.
newHashMap
();
List
<
FakeOfficeMapDto
>
offlineVehicleNumMapList
=
fakeOfflineVinMapper
.
getOfflineVehicleNumMap
();
log
.
info
(
"offlineVehicleNumMapList==="
+
JSONUtil
.
toJsonStr
(
offlineVehicleNumMapList
));
offlineVehicleNumMapList
.
forEach
(
offlineVehicleNum
->
offlineVehicleNumMap
.
put
(
offlineVehicleNum
.
getVin
(),
offlineVehicleNum
.
getNum
()));
for
(
Map
.
Entry
<
String
,
Integer
>
stringIntegerEntry
:
offlineVehicleNumMap
.
entrySet
())
{
String
vin
=
stringIntegerEntry
.
getKey
();
...
...
src/main/resources/mapper/FakeOfflineVinMapper.xml
View file @
1e060a0
...
...
@@ -19,7 +19,7 @@
</sql>
<select
id=
"getFakeOfflineVinByFence"
resultType=
"String"
>
SELECT DISTINCT tfov.vin FROM t_fake_offline_vin tfov WHERE tfov.del_flag = 0 AND tfov.`status` = 1
;
SELECT DISTINCT tfov.vin FROM t_fake_offline_vin tfov WHERE tfov.del_flag = 0 AND tfov.`status` = 1
</select>
<select
id=
"getVehicleNumMap"
resultType=
"cn.com.glsx.admin.modules.model.FakeOfficeMapDto"
>
...
...
@@ -30,7 +30,7 @@
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
group by tv.vin
;
group by tv.vin
</select>
<select
id=
"getOfflineVehicleNumMap"
resultType=
"cn.com.glsx.admin.modules.model.FakeOfficeMapDto"
>
...
...
@@ -46,7 +46,7 @@
and ((timestampdiff(SECOND, tdl.last_gps_time, now()) > 259200 and
timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 1)
or (timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 0))
group by tv.vin
;
group by tv.vin
</select>
<select
id=
"searchFakeOfficeList"
resultType=
"cn.com.glsx.admin.modules.model.export.FakeOfficeExport"
>
...
...
@@ -65,7 +65,7 @@
and ((timestampdiff(SECOND, tdl.last_gps_time, now()) > 259200 and
timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 1)
or (timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 0))
<if
test=
"vinList != null and vinList.size
!=
0 "
>
<if
test=
"vinList != null and vinList.size
>
0 "
>
and tv.vin in
<foreach
collection=
"vinList"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
...
...
@@ -91,5 +91,6 @@
from t_fake_offline_vin
where vin = #{vin}
and status = 1
and del_flag = 0
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/WhitelistSnMapper.xml
View file @
1e060a0
...
...
@@ -28,9 +28,9 @@
</update>
<select
id=
"getWriteListVin"
resultType=
"String"
>
SELECT DISTINCT vin FROM t_whitelist_sn WHERE
1 = 1
<if
test=
"deptIds != null "
>
department_id IN
SELECT DISTINCT vin FROM t_whitelist_sn WHERE
del_flag = 0
<if
test=
"deptIds != null
and deptIds.size() > 0
"
>
and
department_id IN
<foreach
collection=
"deptIds"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
...
...
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