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 b647e62c
authored
Dec 30, 2021
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设备位置点数据落库单元测试
1 parent
83008498
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
src/test/java/cn/com/glsx/stdinterface/modules/service/ElectricInStoreServiceTest.java
src/test/java/cn/com/glsx/stdinterface/modules/service/ElectricInStoreServiceTest.java
View file @
b647e62
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.stdinterface.
modules.mapper.ElectricInStoreMapper
;
import
cn.com.glsx.stdinterface.
dto.DeviceLocationDto
;
import
cn.com.glsx.stdinterface.modules.entity.VehicleDevice
;
import
cn.com.glsx.stdinterface.modules.entity.VehicleDevice
;
import
cn.com.glsx.stdinterface.modules.mapper.DeviceLocationMapper
;
import
cn.com.glsx.stdinterface.modules.mapper.ElectricInStoreMapper
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.assertj.core.util.Lists
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.HashMap
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
@Slf4j
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
...
@@ -25,6 +27,9 @@ class ElectricInStoreServiceTest {
...
@@ -25,6 +27,9 @@ class ElectricInStoreServiceTest {
@Autowired
@Autowired
ElectricInStoreMapper
electricInStoreMapper
;
ElectricInStoreMapper
electricInStoreMapper
;
@Resource
private
DeviceLocationMapper
deviceLocationMapper
;
@Test
@Test
public
void
calculateInStoreDateEveryDay
()
{
public
void
calculateInStoreDateEveryDay
()
{
System
.
out
.
println
(
"electricInStoreService start=== "
);
System
.
out
.
println
(
"electricInStoreService start=== "
);
...
@@ -42,4 +47,22 @@ class ElectricInStoreServiceTest {
...
@@ -42,4 +47,22 @@ class ElectricInStoreServiceTest {
System
.
out
.
println
(
"allSnVdIdMap = "
+
JSON
.
toJSONString
(
snVdIdMap
));
System
.
out
.
println
(
"allSnVdIdMap = "
+
JSON
.
toJSONString
(
snVdIdMap
));
}
}
@Test
public
void
testBatchHandleDeviceLocation
()
{
Collection
<
DeviceLocationDto
>
list
=
Lists
.
newArrayList
();
DeviceLocationDto
locationDto
=
new
DeviceLocationDto
();
locationDto
.
setSn
(
"123456789"
);
locationDto
.
setSpeed
(
500
);
locationDto
.
setLastGpsTime
(
new
Date
());
DeviceLocationDto
locationDto2
=
new
DeviceLocationDto
();
locationDto2
.
setSn
(
"123456788"
);
locationDto2
.
setSpeed
(
1500
);
locationDto2
.
setLastGpsTime
(
new
Date
());
list
.
add
(
locationDto
);
list
.
add
(
locationDto2
);
deviceLocationMapper
.
batchInsertOrUpdate
(
list
);
}
}
}
\ 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