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 c94171c3
authored
Sep 15, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
假性离线查询
1 parent
d4f48a06
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
17 deletions
src/main/java/cn/com/glsx/admin/modules/entity/FakeOfflineChangeFrequently.java
src/main/java/cn/com/glsx/admin/modules/service/FakeOfflineService.java
src/main/resources/mapper/FakeOfflineChangeFrequentlyMapper.xml
src/main/java/cn/com/glsx/admin/modules/entity/FakeOfflineChangeFrequently.java
View file @
c94171c
...
@@ -3,15 +3,14 @@ package cn.com.glsx.admin.modules.entity;
...
@@ -3,15 +3,14 @@ package cn.com.glsx.admin.modules.entity;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.*
;
@Data
@Data
@Table
(
name
=
"t_fake_offline_change_frequently"
)
@Table
(
name
=
"t_fake_offline_change_frequently"
)
public
class
FakeOfflineChangeFrequently
extends
BaseEntity
{
public
class
FakeOfflineChangeFrequently
extends
BaseEntity
{
/**
/**
* 设备号
* 设备号
*/
*/
...
@@ -22,5 +21,15 @@ public class FakeOfflineChangeFrequently extends BaseEntity {
...
@@ -22,5 +21,15 @@ public class FakeOfflineChangeFrequently extends BaseEntity {
*/
*/
private
String
vin
;
private
String
vin
;
/**
* 假性离线时间
*/
@Column
(
name
=
"fake_offline_time"
)
private
Date
fakeOfflineTime
;
/**
* 1生效,0失效
*/
private
Integer
status
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/admin/modules/service/FakeOfflineService.java
View file @
c94171c
...
@@ -239,6 +239,19 @@ public class FakeOfflineService extends AbstractCommonService {
...
@@ -239,6 +239,19 @@ public class FakeOfflineService extends AbstractCommonService {
vinList
.
addAll
(
fakeOfflineVinByFenceList
);
vinList
.
addAll
(
fakeOfflineVinByFenceList
);
}
}
//十日内状态反复变化 假性离线
List
<
String
>
changeFrequentlyList
=
fakeOfflineChangeFrequentlyMapper
.
listAllVin
();
if
(
CollectionUtil
.
isEmpty
(
changeFrequentlyList
))
{
return
vinList
;
}
List
<
String
>
fakeOfflineChangeFrequentlyList
=
offlineVehicleNumMapList
.
stream
()
.
map
(
FakeOfficeMapDto:
:
getVin
)
.
filter
(
changeFrequentlyList:
:
contains
)
.
collect
(
Collectors
.
toList
());
fakeOfflineChangeFrequentlyList
.
forEach
(
vin
->
reasonMap
.
put
(
vin
,
FakeOfficeReasonEnum
.
CHANGE_FREQUENTLY
.
getCode
()));
log
.
info
(
"假性离线十日内状态反复变化车架号 size:"
+
fakeOfflineChangeFrequentlyList
.
size
());
vinList
.
addAll
(
fakeOfflineChangeFrequentlyList
);
// 三 获取本部门以及下级部门
// 三 获取本部门以及下级部门
Set
<
Long
>
deptIds
=
organizationApiService
.
getAllSubOrgIds
();
Set
<
Long
>
deptIds
=
organizationApiService
.
getAllSubOrgIds
();
log
.
info
(
"userId:"
+
ShieldContextHolder
.
getUserId
()
+
";deptIds:"
+
JSONUtil
.
toJsonStr
(
deptIds
));
log
.
info
(
"userId:"
+
ShieldContextHolder
.
getUserId
()
+
";deptIds:"
+
JSONUtil
.
toJsonStr
(
deptIds
));
...
@@ -249,18 +262,6 @@ public class FakeOfflineService extends AbstractCommonService {
...
@@ -249,18 +262,6 @@ public class FakeOfflineService extends AbstractCommonService {
log
.
info
(
"假性离线白名单车架号 size:"
+
collectList
.
size
());
log
.
info
(
"假性离线白名单车架号 size:"
+
collectList
.
size
());
vinList
.
addAll
(
collectList
);
vinList
.
addAll
(
collectList
);
//十日内状态反复变化 假性离线 todo 1vin交集处理 2数据库有效性判断
List
<
String
>
changeFrequentlyList
=
fakeOfflineChangeFrequentlyMapper
.
listAllVin
();
if
(
CollectionUtil
.
isEmpty
(
changeFrequentlyList
))
{
return
vinList
;
}
List
<
String
>
fakeOfflinChangeFrequentlyList
=
offlineVehicleNumMapList
.
stream
()
.
map
(
FakeOfficeMapDto:
:
getVin
)
.
filter
(
changeFrequentlyList:
:
contains
)
.
collect
(
Collectors
.
toList
());
fakeOfflinChangeFrequentlyList
.
forEach
(
vin
->
reasonMap
.
put
(
vin
,
FakeOfficeReasonEnum
.
CHANGE_FREQUENTLY
.
getCode
()));
log
.
info
(
"假性离线十日内状态反复变化车架号 size:"
+
fakeOfflinChangeFrequentlyList
.
size
());
vinList
.
addAll
(
collectList
);
log
.
info
(
"假性离线车架号集合大小size:"
+
vinList
.
size
());
log
.
info
(
"假性离线车架号集合大小size:"
+
vinList
.
size
());
return
vinList
;
return
vinList
;
}
}
...
...
src/main/resources/mapper/FakeOfflineChangeFrequentlyMapper.xml
View file @
c94171c
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"fake_offline_time"
jdbcType=
"TIMESTAMP"
property=
"fakeOfflineTime"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
...
@@ -18,14 +20,16 @@
...
@@ -18,14 +20,16 @@
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, sn, vin, del_flag, created_date, created_by, updated_date, updated_by
id, sn, vin, fake_offline_time, `status`, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
</sql>
<select
id=
"listAllVin"
resultType=
"java.lang.String"
>
<select
id=
"listAllVin"
resultType=
"java.lang.String"
>
select vin
select vin
from t_fake_offline_change_frequently tfocf
from t_fake_offline_change_frequently tfocf
<where>
<where>
del_flag = 0
and del_flag = 0
and status = 1
</where>
</where>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
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