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 018e0b25
authored
Sep 22, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.24.0 开发批量查询定位接口
1 parent
50ad8788
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
645 additions
and
8 deletions
src/main/java/cn/com/glsx/stdinterface/common/enums/ResultEnum.java
src/main/java/cn/com/glsx/stdinterface/modules/api/DeviceLocationApiController.java
src/main/java/cn/com/glsx/stdinterface/modules/mapper/VehicleMapper.java
src/main/java/cn/com/glsx/stdinterface/modules/model/AddrVerifyBatchBo.java
src/main/java/cn/com/glsx/stdinterface/modules/model/AddrVerifyBatchDTO.java
src/main/java/cn/com/glsx/stdinterface/modules/remote/RemoteGpsBsService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/VehicleService.java
src/main/resources/mapper/VehicleMapper.xml
src/test/java/cn/com/glsx/stdinterface/modules/MainTest04.java
src/test/java/cn/com/glsx/stdinterface/modules/service/VehicleServiceTest.java
src/main/java/cn/com/glsx/stdinterface/common/enums/ResultEnum.java
View file @
018e0b2
...
@@ -11,7 +11,8 @@ public enum ResultEnum {
...
@@ -11,7 +11,8 @@ public enum ResultEnum {
PARAM_ERROR
(
"1001"
,
"参数错误"
),
PARAM_ERROR
(
"1001"
,
"参数错误"
),
DECRYPT_ENCRYPT_ERROR
(
"6021"
,
"加解密失败[Sm4]"
),
DECRYPT_ENCRYPT_ERROR
(
"6021"
,
"加解密失败[Sm4]"
),
DEVICE_NOT_EXIST
(
"10001"
,
"不存在该设备号"
);
DEVICE_NOT_EXIST
(
"10001"
,
"不存在该设备号"
),
DEVICE_ARR_NOT_EXIST
(
"10002"
,
"设备号不存在"
);
private
final
String
code
;
private
final
String
code
;
private
final
String
message
;
private
final
String
message
;
...
...
src/main/java/cn/com/glsx/stdinterface/modules/api/DeviceLocationApiController.java
View file @
018e0b2
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
api
;
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
api
;
import
cn.com.glsx.stdinterface.modules.model.CommonApiRequest
;
import
cn.com.glsx.stdinterface.modules.model.*
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.modules.service.VehicleService
;
import
cn.com.glsx.stdinterface.modules.service.VehicleService
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -16,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -16,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
/**
* 对外公用设备定位查询接口
* 对外公用设备定位查询接口
*
*
...
@@ -46,4 +46,22 @@ public class DeviceLocationApiController extends CommonController {
...
@@ -46,4 +46,22 @@ public class DeviceLocationApiController extends CommonController {
log
.
info
(
"verifyDTO==="
+
JSONUtil
.
toJsonStr
(
verifyDTO
));
log
.
info
(
"verifyDTO==="
+
JSONUtil
.
toJsonStr
(
verifyDTO
));
return
R
.
ok
().
data
(
verifyDTO
);
return
R
.
ok
().
data
(
verifyDTO
);
}
}
/**
* 通过批量查询设备GPS定位数据
*
* @param request 请求参数
* @return
*/
@PostMapping
(
value
=
"/checkLocationBatch"
)
@SysLog
(
module
=
"设备定位"
,
value
=
"获取设备定位数据"
,
action
=
OperateType
.
QUERY
)
public
R
checkLocationBatch
(
@RequestBody
CommonApiRequest
request
)
{
String
decryptData
=
decryptRequestData
(
request
.
getOrganization
(),
request
.
getData
());
AddrVerifyBatchBo
verifyBatchBo
=
JSON
.
parseObject
(
decryptData
,
AddrVerifyBatchBo
.
class
);
verifyBatchBo
.
setOrderSource
(
request
.
getOrganization
());
List
<
AddrVerifyBatchDTO
>
verifyBatchDTOList
=
vehicleService
.
addrVerifyBatch
(
verifyBatchBo
);
log
.
info
(
"verifyBatchDTOList==="
+
JSONUtil
.
toJsonStr
(
verifyBatchDTOList
));
return
R
.
ok
().
data
(
verifyBatchDTOList
);
}
}
}
src/main/java/cn/com/glsx/stdinterface/modules/mapper/VehicleMapper.java
View file @
018e0b2
...
@@ -57,4 +57,13 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
...
@@ -57,4 +57,13 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* @return
* @return
*/
*/
XBAddrVerifyDTO
getVehicleBySnAndTenantName
(
@Param
(
"sn"
)
String
sn
,
@Param
(
"orderSource"
)
String
orderSource
);
XBAddrVerifyDTO
getVehicleBySnAndTenantName
(
@Param
(
"sn"
)
String
sn
,
@Param
(
"orderSource"
)
String
orderSource
);
/**
* 通过组织名称和设备号校验设备号
*
* @param snList 设备号集合
* @param orderSource 组织名称
* @return
*/
List
<
String
>
checkSnBySnListAndTenantName
(
@Param
(
"snList"
)
List
<
String
>
snList
,
@Param
(
"orderSource"
)
String
orderSource
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/stdinterface/modules/model/AddrVerifyBatchBo.java
0 → 100644
View file @
018e0b2
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
model
;
import
lombok.Data
;
import
java.util.List
;
/**
* 通用请求定位参数实体类
*
* @author Yanglinlong
* @date 2023/4/3 17:33
*/
@Data
public
class
AddrVerifyBatchBo
{
/**
* 设备号
*/
private
List
<
String
>
snList
;
/**
* 工单来源 襄本默认为 湖北襄本网络
*/
private
String
orderSource
;
}
src/main/java/cn/com/glsx/stdinterface/modules/model/AddrVerifyBatchDTO.java
0 → 100644
View file @
018e0b2
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
model
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
AddrVerifyBatchDTO
{
/**
* 设备号
*/
private
String
sn
;
/**
* gps经度
*/
private
String
lat
;
/**
* gps纬度
*/
private
String
lng
;
/**
* GPS定位时间
*/
private
String
time
;
/**
* 经纬度类型 0:GPS 1:基站
*/
private
Integer
locationType
;
}
src/main/java/cn/com/glsx/stdinterface/modules/remote/RemoteGpsBsService.java
View file @
018e0b2
...
@@ -139,4 +139,23 @@ public class RemoteGpsBsService {
...
@@ -139,4 +139,23 @@ public class RemoteGpsBsService {
}
}
return
gpsBsDataMap
;
return
gpsBsDataMap
;
}
}
/**
* 将定位集合list 转换成map
*
* @param snList 设备集合
* @return
*/
public
Map
<
String
,
GpsBsData
>
getLastGpsBsSimpleBatchBySns
(
List
<
String
>
snList
)
{
R
<
List
<
GpsBsData
>>
lastGpsBsBatch
=
gpsBsFeignService
.
getLastGpsBsSimpleBatch
(
snList
);
List
<
GpsBsData
>
gpsBsDataList
=
lastGpsBsBatch
.
getDataList
(
new
TypeToken
<
List
<
GpsBsData
>>()
{
}.
getType
());
Map
<
String
,
GpsBsData
>
gpsBsDataMap
=
Maps
.
newHashMap
();
if
(
CollectionUtils
.
isNotEmpty
(
gpsBsDataList
))
{
gpsBsDataMap
=
gpsBsDataList
.
stream
().
collect
(
Collectors
.
toMap
(
GpsBsData:
:
getSn
,
Function
.
identity
(),
(
o
,
n
)
->
n
));
}
return
gpsBsDataMap
;
}
}
}
src/main/java/cn/com/glsx/stdinterface/modules/service/VehicleService.java
View file @
018e0b2
...
@@ -3,6 +3,7 @@ package cn.com.glsx.stdinterface.modules.service;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.stdinterface.modules.service;
import
cn.com.glsx.devicemonitor.api.dto.response.DeviceDTO
;
import
cn.com.glsx.devicemonitor.api.dto.response.DeviceDTO
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.com.glsx.devicemonitor.api.enums.GeoLocationEnum
;
import
cn.com.glsx.devicemonitor.api.feign.DeviceFeignService
;
import
cn.com.glsx.devicemonitor.api.feign.DeviceFeignService
;
import
cn.com.glsx.stdinterface.common.constants.Constants
;
import
cn.com.glsx.stdinterface.common.constants.Constants
;
import
cn.com.glsx.stdinterface.common.enums.ResultEnum
;
import
cn.com.glsx.stdinterface.common.enums.ResultEnum
;
...
@@ -15,11 +16,11 @@ import cn.com.glsx.stdinterface.modules.entity.VehicleDevice;
...
@@ -15,11 +16,11 @@ import cn.com.glsx.stdinterface.modules.entity.VehicleDevice;
import
cn.com.glsx.stdinterface.modules.entity.VehicleDeviceOperator
;
import
cn.com.glsx.stdinterface.modules.entity.VehicleDeviceOperator
;
import
cn.com.glsx.stdinterface.modules.mapper.VehicleDeviceMapper
;
import
cn.com.glsx.stdinterface.modules.mapper.VehicleDeviceMapper
;
import
cn.com.glsx.stdinterface.modules.mapper.VehicleMapper
;
import
cn.com.glsx.stdinterface.modules.mapper.VehicleMapper
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo
;
import
cn.com.glsx.stdinterface.modules.model.*
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.modules.model.XBDeviceAddressItem
;
import
cn.com.glsx.stdinterface.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.stdinterface.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.stdinterface.modules.util.DeviceLocationUtil
;
import
cn.com.glsx.stdinterface.modules.util.DeviceLocationUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.StopWatch
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -195,4 +196,64 @@ public class VehicleService {
...
@@ -195,4 +196,64 @@ public class VehicleService {
}
}
return
verifyDTO
;
return
verifyDTO
;
}
}
/**
* 批量查询设备GPS设备定位数据
*
* @param verifyBatchBo 查询gps设备参数
* @return
*/
public
List
<
AddrVerifyBatchDTO
>
addrVerifyBatch
(
AddrVerifyBatchBo
verifyBatchBo
)
{
StopWatch
sw
=
new
StopWatch
();
sw
.
start
(
"checkSnBySnListAndTenantName"
);
if
(
CollectionUtils
.
isEmpty
(
verifyBatchBo
.
getSnList
()))
{
throw
new
StdInterfaceException
(
ResultEnum
.
PARAM_ERROR
);
}
List
<
String
>
snList
=
vehicleMapper
.
checkSnBySnListAndTenantName
(
verifyBatchBo
.
getSnList
(),
verifyBatchBo
.
getOrderSource
());
if
(
CollectionUtils
.
isEmpty
(
snList
))
{
log
.
warn
(
"没有查询到该设备相关信息=="
+
JSONUtil
.
toJsonStr
(
verifyBatchBo
));
throw
new
StdInterfaceException
(
ResultEnum
.
DEVICE_ARR_NOT_EXIST
);
}
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
+
"ms"
);
List
<
AddrVerifyBatchDTO
>
list
=
Lists
.
newArrayList
();
//查位置点
sw
.
start
(
"getLastGpsBsSimpleBatchBySns"
);
Map
<
String
,
GpsBsData
>
gpsBsDataMap
=
remoteGpsBsService
.
getLastGpsBsSimpleBatchBySns
(
snList
);
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
+
"ms"
);
sw
.
start
(
"merge"
);
snList
.
forEach
(
sn
->
{
AddrVerifyBatchDTO
addressItem
=
new
AddrVerifyBatchDTO
();
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
sn
);
if
(
gpsBsData
!=
null
)
{
addressItem
.
setSn
(
sn
);
// 获取 Gps 定位数据
GpsLocation
gpsLocation
=
gpsBsData
.
getGpsLocation
();
if
(
gpsLocation
!=
null
)
{
addressItem
.
setLat
(
gpsLocation
.
getLat
());
addressItem
.
setLng
(
gpsLocation
.
getLng
());
addressItem
.
setTime
(
gpsLocation
.
getDateTime
());
addressItem
.
setLocationType
(
GeoLocationEnum
.
GPS
.
getLocationType
());
}
// 获取基站定位数据
GpsLocation
bsLocation
=
gpsBsData
.
getBsLocation
();
if
(
bsLocation
!=
null
)
{
addressItem
.
setLat
(
bsLocation
.
getBlat
());
addressItem
.
setLng
(
bsLocation
.
getBlng
());
addressItem
.
setTime
(
bsLocation
.
getDateTime
());
addressItem
.
setLocationType
(
GeoLocationEnum
.
BS
.
getLocationType
());
}
list
.
add
(
addressItem
);
}
});
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
+
"ms"
);
log
.
info
(
"addrVerifyBatch总耗时:"
+
sw
.
getTotalTimeSeconds
()
+
"s"
);
return
list
;
}
}
}
src/main/resources/mapper/VehicleMapper.xml
View file @
018e0b2
...
@@ -206,4 +206,23 @@
...
@@ -206,4 +206,23 @@
AND tu.del_flag = 0
AND tu.del_flag = 0
AND tt.del_flag = 0
AND tt.del_flag = 0
</select>
</select>
<select
id=
"checkSnBySnListAndTenantName"
resultType=
"java.lang.String"
>
SELECT tvd.sn
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 AND tw.del_flag = 0
LEFT JOIN t_user tu ON tu.id = tv.created_by
LEFT JOIN t_tenant tt ON tt.id = tu.tenant_id
WHERE tt.tenant_name = #{orderSource}
AND tvd.sn in
<foreach
collection=
"snList"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
AND tv.del_flag = 0
AND tvd.del_flag = 0
AND tvd.bind_status = 1
AND tu.del_flag = 0
AND tt.del_flag = 0
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/test/java/cn/com/glsx/stdinterface/modules/MainTest04.java
0 → 100644
View file @
018e0b2
package
cn
.
com
.
glsx
.
stdinterface
.
modules
;
import
cn.com.glsx.stdinterface.modules.model.AddrVerifyBatchBo
;
import
cn.com.glsx.stdinterface.modules.model.CommonApiRequest
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo
;
import
cn.com.glsx.stdinterface.modules.util.Sm4EncryptUtils
;
import
cn.hutool.json.JSONUtil
;
import
com.google.common.collect.Lists
;
/**
* @author Yanglinlong
* @date 2023/4/3 18:24
*/
public
class
MainTest04
{
public
static
void
main
(
String
[]
args
)
{
AddrVerifyBatchBo
addrVerifyBatchBo
=
new
AddrVerifyBatchBo
();
addrVerifyBatchBo
.
setOrderSource
(
"仲利国际"
);
addrVerifyBatchBo
.
setSnList
(
Lists
.
newArrayList
(
"2691212734"
,
"1570731232"
,
"1570921355"
,
"1570915965"
,
"1570921461"
,
"4711014006"
,
"4711014013"
,
"4711014037"
,
"4711014065"
,
"4711014057"
,
"4711014029"
,
"4711014096"
,
"4711014010"
,
"4711014008"
,
"4711014093"
,
"4711014036"
,
"4711014034"
,
"4711014022"
,
"4711014032"
,
"4711014094"
,
"4711014069"
,
"4711014012"
,
"4711014098"
,
"4711014081"
,
"4711014015"
,
"4711014024"
,
"4711014086"
,
"4711014062"
,
"4711014085"
,
"4711014025"
,
"4711014091"
,
"4711014020"
,
"4711014063"
,
"4711014033"
,
"4711014028"
,
"4711014071"
,
"4711014095"
,
"4711014001"
,
"4711014054"
,
"4711014044"
,
"4711014017"
,
"4711014049"
,
"4711014055"
,
"4711014002"
,
"4711014007"
,
"4711014064"
,
"4711014074"
,
"4711014027"
,
"4711014048"
,
"4711014087"
,
"4711014068"
,
"4711014076"
,
"4711014097"
,
"4711014004"
,
"4711014070"
,
"4711014100"
,
"4711014067"
,
"4711014058"
,
"4711014043"
,
"4711014038"
,
"4711014077"
,
"4711014014"
,
"4711014080"
,
"4711014040"
,
"4711014084"
,
"4711014011"
,
"4711014059"
,
"4711014053"
,
"4711014082"
,
"4711014009"
,
"4711014083"
,
"4711014005"
,
"4711014051"
,
"4711014092"
,
"4711014089"
,
"4711014021"
,
"4711014075"
,
"4711014042"
,
"4711014079"
,
"4711014066"
,
"4711014088"
,
"4711014072"
,
"4711014030"
,
"4711014052"
,
"4711014019"
,
"4711014031"
,
"4711014026"
,
"4711014016"
,
"4711014041"
,
"4711014045"
,
"4711014050"
,
"4711014060"
,
"4711014056"
,
"4711014035"
,
"4711014046"
,
"4711014047"
,
"1510927176"
,
"75111051090"
,
"1510928296"
,
"75111240208"
,
"1511012663"
,
"75111240862"
,
"75201050986"
,
"75111241929"
,
"45111120326"
,
"45111120452"
,
"45111120466"
,
"1511012660"
,
"75111240852"
,
"1510115677"
,
"75201160550"
,
"1510112585"
,
"75111051100"
,
"1510115673"
,
"75201160551"
,
"1510927166"
,
"75111051081"
,
"1510927189"
,
"75111051086"
,
"75111240204"
,
"75111241544"
,
"1511224181"
,
"1610520319"
,
"45203070553"
,
"1510927193"
,
"75111051097"
,
"15111090754"
,
"45203070935"
,
"15111090757"
,
"45203070942"
,
"93107720006"
,
"2192801101"
,
"1570921355"
,
"1570915965"
,
"2691212734"
,
"1570731232"
,
"3010006003"
,
"3010006004"
,
"3010006005"
,
"1591113211"
,
"2691113936"
,
"1510112899"
,
"1700000001"
,
"1610507001"
,
"3010005933 "
,
"75111051416"
,
"1610127312"
,
"1610127300"
,
"1610127297"
,
"1610127307"
,
"1610127299"
,
"1610127306"
,
"1610127303"
,
"1610127301"
,
"1610127298"
,
"75108032084"
,
"75108032085"
,
"75108032075"
,
"75111240322"
,
"75111241284"
,
"45111120391"
,
"1611012312"
,
"1611012313"
,
"2601204222"
,
"2601025417"
,
"2601204204"
,
"1610111616"
,
"1610111624"
,
"1610111618"
,
"1610111619"
,
"1610111615"
,
"2600628225"
,
"2600628223"
,
"2600628222"
,
"2600628228"
,
"2600628224"
,
"2600628221"
,
"1610525087"
,
"2601025374"
,
"2601025381"
,
"2601025400"
,
"1610113004"
,
"1610108136"
,
"1610113259"
,
"1610113270"
,
"1610113262"
,
"1610108146"
,
"1610108192"
,
"1610125392"
,
"1610125393"
,
"1610125403"
,
"1610125401"
,
"1610125388"
,
"1610125394"
,
"1610701065"
,
"1610701050"
,
"1610701225"
,
"1610701066"
,
"1610701220"
,
"1610701070"
,
"1610701223"
,
"75108030030"
,
"75111240485"
,
"75111240484"
,
"2601023676"
));
System
.
out
.
println
(
"addrVerifyBatchBo = "
+
JSONUtil
.
toJsonPrettyStr
(
addrVerifyBatchBo
));
CommonApiRequest
request
=
new
CommonApiRequest
();
request
.
setOrganization
(
"仲利国际"
);
request
.
setTimestamp
(
System
.
currentTimeMillis
());
request
.
setDataType
(
1
);
System
.
out
.
println
(
"request beforre= "
+
JSONUtil
.
toJsonPrettyStr
(
request
));
String
encryptData
=
Sm4EncryptUtils
.
encryptCbc
(
"E76F7D9A27F63E6BA5F4282D81BA9E50"
,
JSONUtil
.
toJsonStr
(
addrVerifyBatchBo
));
request
.
setData
(
encryptData
);
System
.
out
.
println
(
"request after==="
+
JSONUtil
.
toJsonPrettyStr
(
request
));
// String encryptDataTest = Sm4EncryptUtils.encryptCbc("E76F7D9A27F63E6BA5F4282D81BA9E50", "123456");
// System.out.println("encryptDataTest===" + encryptDataTest);
}
}
src/test/java/cn/com/glsx/stdinterface/modules/service/VehicleServiceTest.java
View file @
018e0b2
...
@@ -4,11 +4,14 @@ import cn.com.glsx.Application;
...
@@ -4,11 +4,14 @@ import cn.com.glsx.Application;
import
cn.com.glsx.stdinterface.dto.VehicleDto
;
import
cn.com.glsx.stdinterface.dto.VehicleDto
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.modules.entity.Vehicle
;
import
cn.com.glsx.stdinterface.modules.entity.Vehicle
;
import
cn.com.glsx.stdinterface.modules.model.AddrVerifyBatchBo
;
import
cn.com.glsx.stdinterface.modules.model.AddrVerifyBatchDTO
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyDTO
;
import
cn.com.glsx.stdinterface.modules.model.XBAddrVerifyDTO
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
...
@@ -16,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -16,6 +19,8 @@ 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.List
;
@Slf4j
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
...
@@ -47,11 +52,221 @@ public class VehicleServiceTest {
...
@@ -47,11 +52,221 @@ public class VehicleServiceTest {
}
}
@Test
@Test
public
void
test
(){
public
void
test
()
{
XBAddrVerifyBo
verifyBO
=
new
XBAddrVerifyBo
();
XBAddrVerifyBo
verifyBO
=
new
XBAddrVerifyBo
();
verifyBO
.
setSn
(
"93107720006"
);
verifyBO
.
setSn
(
"93107720006"
);
verifyBO
.
setOrderSource
(
"仲利国际"
);
verifyBO
.
setOrderSource
(
"仲利国际"
);
XBAddrVerifyDTO
verifyDTO
=
vehicleService
.
addrVerifyByXB
(
verifyBO
);
XBAddrVerifyDTO
verifyDTO
=
vehicleService
.
addrVerifyByXB
(
verifyBO
);
System
.
out
.
println
(
"verifyDTO = "
+
JSONUtil
.
toJsonStr
(
verifyDTO
));
System
.
out
.
println
(
"verifyDTO = "
+
JSONUtil
.
toJsonStr
(
verifyDTO
));
}
}
@Test
public
void
testAddrVerifyBatch
()
{
AddrVerifyBatchBo
addrVerifyBatchBo
=
new
AddrVerifyBatchBo
();
addrVerifyBatchBo
.
setSnList
(
Lists
.
newArrayList
(
"2691212734"
,
"1570731232"
,
"1570921355"
,
"1570915965"
,
"1570921461"
,
"4711014006"
,
"4711014013"
,
"4711014037"
,
"4711014065"
,
"4711014057"
,
"4711014029"
,
"4711014096"
,
"4711014010"
,
"4711014008"
,
"4711014093"
,
"4711014036"
,
"4711014034"
,
"4711014022"
,
"4711014032"
,
"4711014094"
,
"4711014069"
,
"4711014012"
,
"4711014098"
,
"4711014081"
,
"4711014015"
,
"4711014024"
,
"4711014086"
,
"4711014062"
,
"4711014085"
,
"4711014025"
,
"4711014091"
,
"4711014020"
,
"4711014063"
,
"4711014033"
,
"4711014028"
,
"4711014071"
,
"4711014095"
,
"4711014001"
,
"4711014054"
,
"4711014044"
,
"4711014017"
,
"4711014049"
,
"4711014055"
,
"4711014002"
,
"4711014007"
,
"4711014064"
,
"4711014074"
,
"4711014027"
,
"4711014048"
,
"4711014087"
,
"4711014068"
,
"4711014076"
,
"4711014097"
,
"4711014004"
,
"4711014070"
,
"4711014100"
,
"4711014067"
,
"4711014058"
,
"4711014043"
,
"4711014038"
,
"4711014077"
,
"4711014014"
,
"4711014080"
,
"4711014040"
,
"4711014084"
,
"4711014011"
,
"4711014059"
,
"4711014053"
,
"4711014082"
,
"4711014009"
,
"4711014083"
,
"4711014005"
,
"4711014051"
,
"4711014092"
,
"4711014089"
,
"4711014021"
,
"4711014075"
,
"4711014042"
,
"4711014079"
,
"4711014066"
,
"4711014088"
,
"4711014072"
,
"4711014030"
,
"4711014052"
,
"4711014019"
,
"4711014031"
,
"4711014026"
,
"4711014016"
,
"4711014041"
,
"4711014045"
,
"4711014050"
,
"4711014060"
,
"4711014056"
,
"4711014035"
,
"4711014046"
,
"4711014047"
,
"1510927176"
,
"75111051090"
,
"1510928296"
,
"75111240208"
,
"1511012663"
,
"75111240862"
,
"75201050986"
,
"75111241929"
,
"45111120326"
,
"45111120452"
,
"45111120466"
,
"1511012660"
,
"75111240852"
,
"1510115677"
,
"75201160550"
,
"1510112585"
,
"75111051100"
,
"1510115673"
,
"75201160551"
,
"1510927166"
,
"75111051081"
,
"1510927189"
,
"75111051086"
,
"75111240204"
,
"75111241544"
,
"1511224181"
,
"1610520319"
,
"45203070553"
,
"1510927193"
,
"75111051097"
,
"15111090754"
,
"45203070935"
,
"15111090757"
,
"45203070942"
,
"93107720006"
,
"2192801101"
,
"1570921355"
,
"1570915965"
,
"2691212734"
,
"1570731232"
,
"3010006003"
,
"3010006004"
,
"3010006005"
,
"1591113211"
,
"2691113936"
,
"1510112899"
,
"1700000001"
,
"1610507001"
,
"3010005933 "
,
"75111051416"
,
"1610127312"
,
"1610127300"
,
"1610127297"
,
"1610127307"
,
"1610127299"
,
"1610127306"
,
"1610127303"
,
"1610127301"
,
"1610127298"
,
"75108032084"
,
"75108032085"
,
"75108032075"
,
"75111240322"
,
"75111241284"
,
"45111120391"
,
"1611012312"
,
"1611012313"
,
"2601204222"
,
"2601025417"
,
"2601204204"
,
"1610111616"
,
"1610111624"
,
"1610111618"
,
"1610111619"
,
"1610111615"
,
"2600628225"
,
"2600628223"
,
"2600628222"
,
"2600628228"
,
"2600628224"
,
"2600628221"
,
"1610525087"
,
"2601025374"
,
"2601025381"
,
"2601025400"
,
"1610113004"
,
"1610108136"
,
"1610113259"
,
"1610113270"
,
"1610113262"
,
"1610108146"
,
"1610108192"
,
"1610125392"
,
"1610125393"
,
"1610125403"
,
"1610125401"
,
"1610125388"
,
"1610125394"
,
"1610701065"
,
"1610701050"
,
"1610701225"
,
"1610701066"
,
"1610701220"
,
"1610701070"
,
"1610701223"
,
"75108030030"
,
"75111240485"
,
"75111240484"
,
"2601023676"
));
addrVerifyBatchBo
.
setOrderSource
(
"仲利国际"
);
List
<
AddrVerifyBatchDTO
>
verifyBatchDTOList
=
vehicleService
.
addrVerifyBatch
(
addrVerifyBatchBo
);
System
.
out
.
println
(
"verifyBatchDTOList = "
+
JSONUtil
.
toJsonStr
(
verifyBatchDTOList
));
}
}
}
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