Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 47f4f5dd
authored
Mar 15, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化离线车辆表入库功能
1 parent
9bf93c79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
13 deletions
src/main/java/cn/com/glsx/stdinterface/modules/mapper/FakeOfflineVinMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/service/FakeOfficeService.java
src/main/resources/mapper/FakeOfflineVinMapper.xml
src/main/java/cn/com/glsx/stdinterface/modules/mapper/FakeOfflineVinMapper.java
View file @
47f4f5d
...
...
@@ -3,6 +3,7 @@ package cn.com.glsx.stdinterface.modules.mapper;
import
cn.com.glsx.stdinterface.modules.entity.FakeOfflineVin
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* mapper
...
...
@@ -13,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
public
interface
FakeOfflineVinMapper
extends
CommonBaseMapper
<
FakeOfflineVin
>
{
FakeOfflineVin
getFakeOfflineVinBy
(
@Param
(
"vin"
)
String
vin
);
}
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/service/FakeOfficeService.java
View file @
47f4f5d
...
...
@@ -87,18 +87,34 @@ public class FakeOfficeService {
}
// 有设备在线就说明不是假性离线 没有设备在线 并且在家庭围栏或者工作围栏内你就是假性离线
FakeOfflineVin
fakeOfflineVin
=
fakeOfflineVinMapper
.
getFakeOfflineVinBy
(
vehicle
.
getVin
());
if
(
fakeOfflineVin
==
null
)
{
fakeOfflineVin
=
new
FakeOfflineVin
();
}
if
(!
flag
&&
FakeOfficeStatusEnum
.
FAKE_OFFICE
.
getStatus
().
equals
(
fakeOfflineFenceSn
.
getStatus
()))
{
FakeOfflineVin
fakeOfflineVin
=
new
FakeOfflineVin
();
fakeOfflineVin
.
setVin
(
vehicle
.
getVin
());
fakeOfflineVin
.
setStatus
(
fakeOfflineFenceSn
.
getStatus
());
if
(
FakeOfficeTypeEnum
.
HOME_FENCE
.
getType
().
equals
(
fakeOfflineFenceSn
.
getMerchantType
()))
{
fakeOfflineVin
.
setHomeAddr
(
fakeOfflineFenceSn
.
getAddr
());
}
else
if
(
FakeOfficeTypeEnum
.
WORK_FENCE
.
getType
().
equals
(
fakeOfflineFenceSn
.
getMerchantType
()))
{
fakeOfflineVin
.
setWorkAddr
(
fakeOfflineFenceSn
.
getAddr
());
}
fakeOfflineVin
.
setCreatedBy
(
vehicle
.
getCreatedBy
());
fakeOfflineVin
.
setCreatedDate
(
new
Date
());
// 真假性离线
fakeOfflineVin
.
setStatus
(
FakeOfficeStatusEnum
.
FAKE_OFFICE
.
getStatus
());
}
else
{
// 非假性离线
fakeOfflineVin
.
setStatus
(
FakeOfficeStatusEnum
.
UN_FAKE_OFFICE
.
getStatus
());
}
fakeOfflineVin
.
setVin
(
vehicle
.
getVin
());
if
(
FakeOfficeTypeEnum
.
HOME_FENCE
.
getType
().
equals
(
fakeOfflineFenceSn
.
getMerchantType
()))
{
fakeOfflineVin
.
setHomeAddr
(
fakeOfflineFenceSn
.
getAddr
());
}
else
if
(
FakeOfficeTypeEnum
.
WORK_FENCE
.
getType
().
equals
(
fakeOfflineFenceSn
.
getMerchantType
()))
{
fakeOfflineVin
.
setWorkAddr
(
fakeOfflineFenceSn
.
getAddr
());
}
fakeOfflineVin
.
setCreatedBy
(
vehicle
.
getCreatedBy
());
fakeOfflineVin
.
setCreatedDate
(
new
Date
());
// id不存在表示为新的数据 则插入 存在则更新旧的数据
if
(
fakeOfflineVin
.
getId
()
==
null
)
{
fakeOfflineVinMapper
.
insert
(
fakeOfflineVin
);
}
else
{
fakeOfflineVinMapper
.
updateByPrimaryKeySelective
(
fakeOfflineVin
);
}
}
...
...
src/main/resources/mapper/FakeOfflineVinMapper.xml
View file @
47f4f5d
...
...
@@ -5,16 +5,23 @@
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"vin"
property=
"vin"
jdbcType=
"VARCHAR"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"TINYINT"
/>
<result
column=
"home_addr"
property=
"homeAddr"
jdbcType=
"VARCHAR"
/>
<result
column=
"work_addr"
property=
"workAddr"
jdbcType=
"VARCHAR"
/>
<result
column=
"del_flag"
property=
"delFlag"
jdbcType=
"TINYINT"
/>
<result
column=
"created_date"
property=
"createdDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"INTEGER"
/>
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"updated_by"
property=
"updatedBy"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"BaseColumns"
>
a.id, a.vin, a.status, a.del_flag, a.created_date, a.created_by, a.updated_date,
a.updated_by
id, vin, status, del_flag, created_date, created_by, updated_date, updated_by
</sql>
<select
id=
"getFakeOfflineVinBy"
resultMap=
"BaseMap"
>
select
<include
refid=
"BaseColumns"
/>
from t_fake_offline_vin
where vin = #{vin}
</select>
</mapper>
\ 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